Good morning,
I am seeing a strange exception in my SYS/BIOS project that I have been unable to remedy how ever can easily turn it on and off but would like to understand why it is happening.
The setup is a beaglebone black based board (AM3358, 512MB DDR3 etc) and the versions of various bits are as follows:
- CCS v6.1.1.00022
- Compiler GNU v4.8.4 (Linaro)
- XDCtools version 3.31.0.24
- SYS/BIOS 6.42.3.35
I have been getting this exception is strange places for a few days and depending on how its built it does or doesn't happen so I need to get to the bottom of it so it doesn't keep coming back to haunt us.
The exception occurs in code running in the programs idle loop and I think I have tracked it down to always happening either in or soon after a memset() and at the moment this piece of code causes it:
{ #define MAX_FILE_SIZE (1024*60) unsigned char file_counter = 0; unsigned char pkt_counter = 0; unsigned char buffer[MAX_FILE_SIZE + 512] = {0,0}; WORD br; FIL mobile_file; FRESULT res; buffer[0] = 0; buffer[1] = 0; oxts_stdout("SCom cfg req received.", "");
In this case I can see when stepping through the assembly that the initialization of the array 'buffer' triggers a memset() which causes the exception. If i don't initialize it and just zero the first two bytes below (this code is in above from my testing) it works fine and doesn't crash.
After this piece of code it reads a series of files into &buffer[3] and sends them over a serial link to another processor this is using the FatFs library which also uses memset(). A couple of days ago it was crashing in the FatFs library at a memset() but after a lot of playing around it stopped and now it runs that code fine but not this bit?
With either build the buffer is at address 0x800e9dfc which is perfectly valid and I have tryed playing around with the stack which is currently at ~10MB with no joy.
I am running the code with a XDS100v2 debugger, hardware the same as the BBB.
Any help or suggestions would be appreciated and if someone could suggest a good source for getting any information about an exception in this processor/kernel that would be useful
Many thanks