AnsweredAssumed Answered

hazardous behaviour with HCS12 MC9S12GC64

Question asked by David CHEZE on Dec 7, 2006
Latest reply on Dec 8, 2006 by Daniel Lundin

i'm getting crazy with debugging a very "simple" application: reading 5 sensors and controling max 4 outputs and a display with icons :
I use a bootloader to load my application

- with a "empty" periodic loop (every 30s), no problem since application do nearly nothing it's difficult to see if there's a trouble
- when i add: acquisition routines , tests routines to see if the inputs are in correct range , simple control routine which activate an output if inputs are in incorrect range
, the application become to do hazardous things: global variables that are not accessed for write (just read) by the current loop are modified.

Inside the loop, i use mostly byte variable, accessing with bit mask for reading and sometimes for writing, but only global varaible from the "applicative" file (not the "kernel")
I attached the applicative file, the main fonction with the loop is the "CESI" fonction, called by the kernel after boot.

I hope somebody can help me