Differences between ORIG and COPY UCBs

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User21596
Level 1
Level 1
Hello,

We want to write UCB via Aurix/UCB plugin in iSystem's winIDEA. In case of HSM, there are UCB_HSMCOTP0_ORIG, UCB_HSMCOTP1_ORIG, UCB_HSMCOTP0_COPY, UCB_HSMCOTP1_COPY. But the layout of these UCBs are all the same.
There are exactly same registers in these UCBs. For example if we want to write to the PROCONHSMCBS register, in which UCB should we write? ORIG or COPY? If it is ORIG, ORIG0 or ORIG1? Which one?
0 Likes
6 Replies
Darren_Galpin
Employee
Employee
First solution authored First like received
You should write to both. There is a programming model detailed in the manual where you invalidate one of the UCBs, write in the data, check it is ok, invalidate the second, write in the data, check it is ok. The idea is that there are two copies so that if one gets a soft error, you still have an image to work from, and by having both and programming one at a time, if the programming fails for some reason, you still have a valid image.
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
The COPY UCBs are only used if the corresponding ORIG UCB is in an ERRORED confirmation state (i.e., invalid confirmation word).

HSMCOTP0 and HSMCOTP1 are not copies - pay special attention to the sector numbers in each one. HSMCOTP0 is for sectors 0-31, while HSMCOTP1 is for sectors 32 through 39.
0 Likes
User21596
Level 1
Level 1
UC_wrangler wrote:
The COPY UCBs are only used if the corresponding ORIG UCB is in an ERRORED confirmation state (i.e., invalid confirmation word).

HSMCOTP0 and HSMCOTP1 are not copies - pay special attention to the sector numbers in each one. HSMCOTP0 is for sectors 0-31, while HSMCOTP1 is for sectors 32 through 39.


1) How can a UCB go in ERRORED confirmation state?

2) When we look UCB_HSMCOTP0_ORIG and UCB_HSMCOTP1_ORIG in WinIDEA Aurix/UCB plugin. The contents(registers) of these UCBs are exactly the same. For example, there is PROCONHSMCFG register in UCB_HSMCOTP0_ORIG and also in the UCB_HSMCOTP1_ORIG.If my HSM code is in sector 0-31 do we need write the same value of PROCONHSMCFG(HSMBOOTEN, SSWAIT etc.) to the UCB_HSMCOTP1_ORIG.

3) Our HSM code is in sector 8 and sector 22. In this case, there is no need to program UCB_HSMCOTP1_ORIG? Is it true?

4) Just a scenario, if our HSM code is in sector 8 and sector 34, do we need write to any registers(for BOOTSEL, HSMBOOTEN, SSWWAIT etc.) in UCB_HSMCOTP1_ORIG for this scenario.
0 Likes
Darren_Galpin
Employee
Employee
First solution authored First like received
1) You can write it to an errored state, or the flash could encounter a soft error which flips it into an errored state.
2) If your code is only in sectors 0-31, then you write to UCB_HSMCOTP0. Your write to UCB_HSMCOTP1 if using the other sectors.
3) Correct
4) You should generally keep them the same apart from the sectors enabled.
0 Likes
User21596
Level 1
Level 1
Darren Galpin wrote:
1) You can write it to an errored state, or the flash could encounter a soft error which flips it into an errored state.
2) If your code is only in sectors 0-31, then you write to UCB_HSMCOTP0. Your write to UCB_HSMCOTP1 if using the other sectors.
3) Correct
4) You should generally keep them the same apart from the sectors enabled.


1) Do we understand right, if my HSM code is in sector 8 and sector 34. The BOOTSEL, HSMBOOTEN settings etc. which we have written for UCB_HSMCOTP0_ORIG, we have to write same BOOTSEL, HSMBOOTEN configurations to the UCB_HSMCOTP1_ORIG?

1.1) If my code is in sector 8 and sector 22. I don't have to write the same BOOTSEL, HSMBOOTEN to the UCB_HSMCOTP1_ORIG? Just leaving UCB_HSMCOTP1_ORIG as it is. Is it true? Sorry maybe I am asking the same questions again and again. But I need some clarifications, to don't make our MCU bricked.

2) We assumed that we can reprogram HSMBOOTEN and other configurations. But can we also change BOOTSEL in UCB when we needed?
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
These application notes should help:

AP32349 - HSM+ Startup V2.0 - Describes UCB configuration for starting HSM work
AP32399 - TC3xx Debug Protection with HSM - Describes UCB configuration for production ECUs
0 Likes