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

cross mob
zelemar
Level 1
Level 1
First reply posted First like given First question asked

Hi,

This is first my project with XMC and Dave and I  have an issue with interrupts on 1404 release configuration.

The project has 3 interrupts: SysTick, IRQ5 and IRQ7 used as RX interrupts for CAN node0 and CAN node1.

Debug version works as supposed to, when messages received on CAN interrupts are working. When I compile the release version of the same code, only SysTick works (LED blinking), but CAN interrupts don't work anymore.

Can somebody help me out with this issue?

0 Likes
1 Solution
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi @zelemar ,

Do you have any interrupt-service-routines?
Any global variables that are modified out-of-sequence e.g. from within an interrupt-service-routine must be declared volatile otherwise the optimizer (used for release builds but not debug builds) might assume that the value has not changed and therefore not bother to re-read the variable.

Regards,

Alakananda

View solution in original post

2 Replies
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi @zelemar ,

Do you have any interrupt-service-routines?
Any global variables that are modified out-of-sequence e.g. from within an interrupt-service-routine must be declared volatile otherwise the optimizer (used for release builds but not debug builds) might assume that the value has not changed and therefore not bother to re-read the variable.

Regards,

Alakananda

I have a global variable. ISR routine modifies it and in the main loop depending on its value actions are taken.

I  have declared it as volatile and now it works.

Thank You.

0 Likes