cancel
Showing results for 
Search instead for 
Did you mean: 

Cosmic compiler problem

Maddi.Mike
Associate II
Posted on October 18, 2013 at 16:42

I'm using the Cosmic 32k compiler version 4.3.6 and STVD Version 4.3.1 for a project with an ST8S208C chip. The problem seems to be the compiler. Whenever I do 32 bit math while interrupts are on, I occasionally see corruption in the results. The compiler switch @svlreg is supposed to address this problem but it apparently does not. When I contacted Cosmic about this, they said to see the ST forums because we don't have a paid support agreement with them. So here I am. I searched these forums for anything concerning this problem but have come up short. I was wondering if anyone else has encountered this problem.

#cosmic-svlreg
1 REPLY 1
luca239955_stm1_st
Senior II
Posted on October 21, 2013 at 18:32

Hello,

@svlreg would be the first answer: make sure you use it on all your interrupt functions.

Another possibility is that you don't protect your 32 bit variable accesses (that are non atomic on the stm8) from interrupt.

Regards,

Luca