This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Firmware crashes running standalone but not under debugger

Hello,
I'm working on EZ-USB 8051 firmware. If I load the firmware under debugger then firmware works as expected but when I load it standalone then it crashes. I have been able to find a corelation between a ring buffer declaration and crash. Following is the ring buffer declarion

#define  RING_BUFFER_SIZE 900
#define  RING_BUFFER_THRESHOLD 100
//
// Define a Ring Buffer
//
struct RingBuffer
{
   byte buffer[RING_BUFFER_SIZE];           //pointer to a character buffer
   unsigned short count;                              //count of characters in buffer
   unsigned short  nextSlotOut;                        //pointer to next input slot
   unsigned short  nextSlotIn;                         //pointer to last character read
};

The firmware works when debug engine runs but downloading standalone crashes. But if I reduce RING_BUFFER_SIZE to 250 then firmware works standlaone. Reducing the size to 250 makes the structure total size 256 bytes. I have examined the map file and found no overlap between spaces. I'm just confused what to look for. Any idea\hints?

Thanks,
Hasan

0