CAN not working after running bootloader

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

cross mob
User18295
Level 1
Level 1
Hello,

I'm running on a TC233 and am seeing some odd CAN behavior in certain cases. If I run my application on its own it works just fine, but if our bootloader runs first then jumps to the application CAN is not working as expected. The bootloader uses interrupt based CAN whereas the app uses polling. Both the bootloader and application do a kernel reset (KRST0/KRST1) of the CAN peripheral before the app configures the CAN module and it looks like the register settings are correct. I see CAN traffic from TX pin but the data looks bad and our scope sees it transmitting at 480k baud instead of 500k. Since the CAN registers seem to be set correctly my question is what other registers could affect the CAN behavior?
Thanks
Steve
0 Likes
3 Replies
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Hi seckhart. Are you sure there's no change in the overall clock system when the bootloader jumps to the application?

Make sure your PLL settings are the same (especially SCU_PLLCON0).

Also check SCU_CCUCON0.CLKSEL to make sure you're not running off the PLL (CLKSEL=1) and not the internal 100 MHz oscillator (CLKSEL=0).
0 Likes
User18295
Level 1
Level 1
Thanks for the reply. You are correct, it ended up being a problem with the overall clock system. Our bootloader had to clean up the clock configuration registers before jumping to the application. It turns out there is an excerpt from an Infineon application note that I cannot seem to find online (AP32201) that states the "Especially it should be taken care that the clock register state does not cause issues when clock is re-initialized by the application instance." Even though our MCAL was resetting the clock registers, the re-initialization was not good enough to get the settings right apparently.

Thanks,
Steve
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Hi Steve. Glad you got it straightened out. If you have a MyICP account with AURIX access, here's a direct link to AP32201:

https://myicp-dmz.extra.infineon.com/sites/microcontrollers-aurix_customer_doc/Lists/MyICP%20Custome...
0 Likes