Running HSM core without debugger

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

cross mob
User21596
Level 1
Level 1
Hello,

We use TC332L as an MCU. And we use Tricore and HSM core together. Our project works fine with debugger. But it doesn't work without debugger.
Are there any settings or configurations in HSM core to work without debugger?
0 Likes
8 Replies
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored
What is not working without debugger?
State of ESR0 (reset)?
Common errors in such cases are:
Invalid or no BMHD programmed (ESR0 is always high)
Problems with any watchdog (ESR0 goes 2 times to high for short time hen stays always on low)
0 Likes
User21596
Level 1
Level 1
MoD wrote:
What is not working without debugger?
State of ESR0 (reset)?
Common errors in such cases are:
Invalid or no BMHD programmed (ESR0 is always high)
Problems with any watchdog (ESR0 goes 2 times to high for short time hen stays always on low)


When we detached debugger from iSystem's winIDEA,(to simulate the without debugger scenario) our HSM code is working properly. In our code, we apply Tricore Core0 application reset, again HSM is working.
But when debugger is detached, we apply power off/on, the HSM code is not working. In this scenario it seems HSM core not started yet. After power off/on, it seems HSM core stucks at some hardware breakpoint.
We have two winIDEA workspaces one for Tricore and one for HSM core. To be able to start the HSM core, we click Start button(green arrow button) in winIDEA HSM workspace. And in status window of winIDEA it says STOP-BKPT with green line.
So we came to the idea that when we apply the power off/on, it seems that HSM core stucks at this STOP-BKPT and do not pass this, so our code is not working.

Also we learned that there is onchip breakpoint set by the boot ROM which blocks the execution of HSM core. Maybe this is the problem but we don't know how to solve this issue.
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
omerkayten wrote:
Also we learned that there is onchip breakpoint set by the boot ROM which blocks the execution of HSM core. Maybe this is the problem but we don't know how to solve this issue.

Exactly right. Try a winIDEA initialization script like this:
// Start the HSM from the TriCore side without opening HSM instance
A 0xF0041010 L 0xE0000000 // set HSM DBGBASE register to E000
A 0xF0052008 L 0x00000000 // for deleting the onchip breakpoint set by the boot ROM. Without deleting the onchip breakpoint, the HSM won't start.
0 Likes

I tried this cript with TC275 but it still not working, I guess because it is for TC3xx only.

Could you provide me which script for TC275?

0 Likes
User21596
Level 1
Level 1
UC_wrangler wrote:
Exactly right. Try a winIDEA initialization script like this:

Thanks for reply.

Where should we place these configurations in our project. We can't put these configurations in Core0 user code because SSW, waits for acknowledge (if SSWWAIT is enabled in HSM) from HSM to start the application cores. Therefore, HSM must run first before application cores.
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
That's a winIDEA initialization script. Save it to an ini file and put it in CPU Setup / Initialization before Debug session / Initialize.
0 Likes
User21596
Level 1
Level 1
UC_wrangler wrote:
That's a winIDEA initialization script. Save it to an ini file and put it in CPU Setup / Initialization before Debug session / Initialize.


But our problem is not with debugger. The problem is our code doesn't work without debugger. As I said before, it seems HSM core does not start when we work without debugger.
Where we can put these configurations in our source codes, to delete onchip breakpoint which starts the HSM core when debugger is not attached. I mean our board is running standalone, so there is no debugger attached.
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Sorry - that initialization script is such a common problem when debugging that I misunderstood your problem.

There is no HSM breakpoint set when there's no debugger.

Could it be that your HSM software has some dependency on the TriCore doing something first? Without the debugger connected, both cores will start at the same time, unless you have PROCONHSMCFG.SSWWAIT set.

Could it be that PROCONHSMCFG.SSWWAIT is set, and the HSM is not eventually setting HSM2HTF=1? If the HSM waits too long, a watchdog will occur, causing the system to reset.
0 Likes