EVADC configuration triggering TRAP

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

cross mob
nazeem
Level 1
Level 1
10 sign-ins 5 sign-ins First like given

Hi ,

I am working Bootloader for TC377 series , Bootloader code using EVADC Group10 (Pin P33.7) for sensing voltage levels

this is working as expected .But after jumping to Application code from bootloader, Application code has it own EVADC Initialization its Triggering TRAP.  If Application runs independently (no bootloader code preset in flash) application EVADC

initialization is working as expected.  Let me know if anything need to do with EVADC     in bootloader code  before jumping to Application? 

 

Thank you in Advance.

Regards

Mahammad Nazeem S

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

Hello,

The reason could be that the Init function/thread is lacking sufficient privileges to modify the critical registers of ADC.  Please check the CPU mode or if the ENDINIT mechanism is properly unlocked in such scenario.

Regards,

Prudhvi.

View solution in original post

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

Hello Mahammad Nazeem,

Could you please share the details of the TRAP like Trap Class & TIN in the above scenario. Also, how are you jumping from Bootloader to Application ? Is it via a RESET ?

 

Regards,

Prudhvi.

0 Likes

Hi Prudhi,

Thanks  for your replay,

1. Below find the TRAP details that you are asking for,

trapWatch = (
tAddr = 0x8002E1BE,
tId = 3,
tClass = 0x4,
tCpu = 0)
tin = 0x3

2. from Bootloader to Application, not via RESET. below code snippet that used in bootloader code to jump to Application  and let me know if you need more information

JumptoApplication.gif

Regards

Mahammad Nazeem S

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

Hello Mahammad Nazeem,

The Trap is set under following conditions:

Prudhvi_0-1649429693650.png

Could you check which instruction in the ADC Init function of the Application is causing this Trap ? That should probably be a Register update instruction. Please check the ADC De-Init sequence executed in the Bootloader before jumping to the Application as shown in your image. The issue seems to be a Bus Error caused due to (Re-)initialization of certain critical registers related to ADC peripheral in the Application.

You may also refer to the examples of ADC Init in the Aurix code examples given below:

https://github.com/Infineon/AURIX_code_examples/tree/master/code_examples

Regards,

Prudhvi.

 

0 Likes

Hi Prudhvi,

while returning the API "IfxEvadc_Adc_setGlobalConfigurations"  triggering TRAP, and not sure which instruction its triggering. I am attaching the De-initialization code that I used in bootloader.

And In Tricore examples I could not find any De-init of EVADC code , please suggest me if my De-initialization code is not correct. 

nazeem_1-1649747147922.png

 

 

 

 

nazeem_0-1649746760958.png

Thanks and regards

Mahammad Nazeem S

 

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

Hello,

The reason could be that the Init function/thread is lacking sufficient privileges to modify the critical registers of ADC.  Please check the CPU mode or if the ENDINIT mechanism is properly unlocked in such scenario.

Regards,

Prudhvi.

0 Likes
mmfix
Level 1
Level 1
5 sign-ins First like given First solution authored

Hello 

Would you able to tell me which programmer you using to read and write bootloader ?