Re-flashing HSM firmware

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

cross mob
User21596
Level 1
Level 1
Hello,

We are using TC366 MCU, is it possible to re-flash HSM firmware through debugger(specifically iSystem WinIDEA) or another way when HSM is enabled?
0 Likes
6 Replies
Darren_Galpin
Employee
Employee
First solution authored First like received
The HSM can program via the DMU, and can write to the PFlash0 sectors which are set exclusively for the HSM. It should do this by writing the correct programming sequences to the DMU using the SF versions of the registers. The debugger can also do this if Debug is enabled for the HSM.
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
It's possible as long as you haven't blocked access from the TriCore or debugger to those sectors (see PROCONHSMCOTP and SP_PROCONHSMCX0/1).

Keep in mind that if you erase HSM code and then reset the AURIX, the device is not recoverable. You can follow these steps to be safe:
- Disable the HSM via PROCONHSMCCFG.HSMBOOTEN=0
- Reprogram the HSM sectors
- Enable the HSM via PROCONHSMCCFG.HSMBOOTEN=1
0 Likes

Hello NeMa

I know this is kind of old but I am running into some issue during the update of the HSM and I wonder if you could maybe help me .

I brick my CPU when I disable the HSM using PROCONHSMCOTP.HSMBOOTEN=0 and do a power reset.

The unit keep on resetting and cannot be connected to the jtag debugger anymore. The confirmed state is unconfirmed for both set of this UCB and for both configuration HSMBOOTEN=0 and HSMBOOTEN=1. 

Do you have any clue why?

Any help would be appreciated

thank you

0 Likes
User21596
Level 1
Level 1
UC_wrangler wrote:
It's possible as long as you haven't blocked access from the TriCore or debugger to those sectors (see PROCONHSMCOTP and SP_PROCONHSMCX0/1).

Keep in mind that if you erase HSM code and then reset the AURIX, the device is not recoverable. You can follow these steps to be safe:
- Disable the HSM via PROCONHSMCCFG.HSMBOOTEN=0
- Reprogram the HSM sectors
- Enable the HSM via PROCONHSMCCFG.HSMBOOTEN=1


Thanks for your reply. We have another question related to your answer.

1) Is it enough to reprogramming HSM firmware just the steps you mentioned. Are there any steps that we should be aware of? Because programming the HSM is prone to brick the MCU. Also, there are chip(MCU) distribution problems in the world.

2) When we reference documents for first flashing HSM firmware it says disabling the debugging HSM Core, then it says enabling it in WinIDEA.When reprogramming HSM firmware should we change this option in WinIDEA?

3) How we can change PROCONHSMCCFG.HSMBOOTEN via WinIDEA?
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
For all three questions, the same answer applies: make a separate hex file for each UCB, or perhaps just one set of UCB data for HSM enabled and another for HSM disabled. If you save the data as a hex file, it's easy in winIDEA to modify the hex file and load it back in by checking "IgnoreChecksum" in the Advanced properties dialog.

Also keep in mind that UCBs are limited to 100 program/erase cycles per the datasheet, so make sure you don't include UCB programming each time you update the PFLASH of a development ECU.

Newer versions of iSYSTEM's winIDEA can issue a warning if you're about to brick the device, which has saved at least a few developers from shooting themselves in the foot. winIDEA makes it easy to exclude UCB updates by disabling the UCB area in Hardware / Options.
0 Likes
User21596
Level 1
Level 1
UC_wrangler wrote:
For all three questions, the same answer applies: make a separate hex file for each UCB, or perhaps just one set of UCB data for HSM enabled and another for HSM disabled. If you save the data as a hex file, it's easy in winIDEA to modify the hex file and load it back in by checking "IgnoreChecksum" in the Advanced properties dialog.

Also keep in mind that UCBs are limited to 100 program/erase cycles per the datasheet, so make sure you don't include UCB programming each time you update the PFLASH of a development ECU.

Newer versions of iSYSTEM's winIDEA can issue a warning if you're about to brick the device, which has saved at least a few developers from shooting themselves in the foot. winIDEA makes it easy to exclude UCB updates by disabling the UCB area in Hardware / Options.


Thanks for your reply. We will try what you have mentioned.
0 Likes