I want to know why MCU falls into a trap after performing Lbist.

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

cross mob
DownyK
Level 5
Level 5
100 replies posted 10 solutions authored 250 sign-ins

Hi everyone,

After MCU performs Lbist at App SW level, it jumps to the start address after SW reset (system reset).

After that, before going to the actual application address, several registers are checked, one of which is CPU0 KRST0 RSTSTAT. But when I check this register, the trap is occurring.

Have any of you ever experienced this situation?

 

 

0 Likes
1 Solution
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored

The register can't be read with ld.b or ld.h. It must be accessed always with 32 bit width:

MoD_1-1651154640189.png

 

 

View solution in original post

7 Replies
Nambi
Moderator
Moderator
Moderator
50 likes received 5 likes given 100 solutions authored

Hi,

1. "when I check this register,." Are you just reading this register or also writing to this register?

2. Can you comment the access to this register in your code and confirm that the system is working fine?

Best Regards.

DownyK
Level 5
Level 5
100 replies posted 10 solutions authored 250 sign-ins

Hi Nambi

I tried to read the CPU0 KRST0 register and trap 2 occurs.

Yes, if I comment this code to access this register,  the system works fine.

DownyK_0-1651129310973.jpegDownyK_1-1651129322194.jpeg

CPU0 KRST0 : 0xF880D000

DownyK_2-1651129339705.png

 

0 Likes
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored

You get a Trap Class 4 -> DSE - Data Access Synchronous Error (TIN 2)

Set a breakpoint on address 0xA000C5BE and analyze the instruction and the content of used register with this instruction. I expect that there is a wrong value use which result to a read access to an invalid address.

DownyK
Level 5
Level 5
100 replies posted 10 solutions authored 250 sign-ins

Hi MoD

Thank you for your reply.

Our team noticed something odd in the compiled code.

DownyK_0-1651135328609.png

 

DownyK_1-1651135336762.png

A trap occurs when reading CPU0_KRST0 in byte units [ld.bu] and no trap occurs when reading in word units [ld.w].

Does the register have to be read in word units only?

If you know anything about this, please share.

 

 

0 Likes
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored

The register can't be read with ld.b or ld.h. It must be accessed always with 32 bit width:

MoD_1-1651154640189.png

 

 

DownyK
Level 5
Level 5
100 replies posted 10 solutions authored 250 sign-ins

oh thanks, I didn't check it 

0 Likes
Prudhvi_E
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 25 likes received

Hello DownyK,

Please find the Access modes for Read/Write below:

Prudhvi_0-1651154787040.png

As mentioned here, the Register is to be read/written in 32 bits.

Regards,

Prudhvi.