TRAP 4 generated after Reading CAN0_IR

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

cross mob
Krishnay10
Level 2
Level 2
10 replies posted 10 sign-ins 5 questions asked

HI,

Most of the times trap 4 is being generated after CAN0_IR is being read in CanInterruptTx.

The processor is TC375. Please let me know what causes this.

0 Likes
1 Solution

Hi, Thanks for your help. This issue have been resolved now.

Many thanks

Krishna

View solution in original post

15 Replies
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored

Which trap you get (TIN)?

0 Likes
Krishnay10
Level 2
Level 2
10 replies posted 10 sign-ins 5 questions asked
Data Access Synchronous Error Trap occurred is the trap that is being generated
0 Likes
Krishnay10
Level 2
Level 2
10 replies posted 10 sign-ins 5 questions asked

DSTR register shows the below error LBE

Krishnay10_0-1674825536249.png

 

0 Likes
µC_Wrangler
Employee
Employee
50 solutions authored 100 sign-ins 25 likes received

Since DEADD=0x00000004, it sounds like you've got a null pointer somewhere.

0 Likes

Hi, Thanks for your reply. What would cause a read from CAN0_IR0 to be interpreted as a read from 0x0000004 address? Are there registers to check to explain it

0 Likes
µC_Wrangler
Employee
Employee
50 solutions authored 100 sign-ins 25 likes received

Can you share a screenshot of the disassembly where the error occurred (probably pointed to by A11)?  Also include the core registers (D0...D15 and A0...A15).

0 Likes

Thanks for your reply.Here is the screenshot:

Krishnay10_0-1674837393898.png

 

0 Likes

Thanks for your reply. A11 content is shown in the above screenshot when the trap occurs. Unfortunately can't add cn to watch window

Thanks

Krishna

0 Likes

Sure looks like Cn is null.  If you need more help as to why, you'll have to show the code where Cn is set.

0 Likes
µC_Wrangler
Employee
Employee
50 solutions authored 100 sign-ins 25 likes received

Can you add Cn to a watch window?  I have a sneaking suspicion it's null.

When the trap occurs, what's in A11?

0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Please check TIN number, i.e. a Temporal Asynchronous Error trap (TAE - Class-4, Tin-7)

When a trap occurs identification is possible via trap class and trap identification number (TIN).
TIN is written into the core register D15

0 Likes
µC_Wrangler
Employee
Employee
50 solutions authored 100 sign-ins 25 likes received

D15=2, which means it's a Data Synchronous Exception / DSE (see Table 8 Supported Traps in TriCore_TC162P_core_architecture_volume_1_of_2.pdf).  That makes sense because reading from a NULL pointer is not defined in the AURIX memory map, so it results in a bus error.

0 Likes

Thanks for your reply.How did you gather the info of Null Pointer reading?

Thanks

Krishna

0 Likes

Might not be 100% correct because I don't know how Cn is declared, but this is the important bit:

if( (Cn->IR & Cn->IE & kCanIR_TC) != 0UL)

movh.a a15,#0x7000
lea a15,[a15]0x2618 ; probably Cn address 0x70002618 (check map file)
ld16.a a15,[a15] ; what Cn points to (this is probably 0)
ld16.a a15,[a15]0x04 ; Cn->IR is 4 bytes after that (0+4=4, still bus error)
0 Likes

Hi, Thanks for your help. This issue have been resolved now.

Many thanks

Krishna