This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I've been having a problem recently with the lwip_static.lib of am335x_sysbios_ind_sdk_1.0.0.8. I'm running Code Composer Version: 5.4.0.00091 using the Ti v5.0.5 compiler for the lwip_static library. The problem is that in the file src/core/raw.c, there is a static structure pointer "static struct raw_pcb *raw_pcbs;" that ends up compiling to the same memory address as a global variable.From the debugger window you can see that &raw_pcbs is 0x8269C17C, but in the .map file shows that:
8269c0ac g_stFilterParams
8269c180 LastError
So when the g_stFilterParams gets filled in, it wipes out what ever was in raw_pcbs. The other strange thing is that the .map file does not even show a raw_pcbs structure pointer.
Am I missing some linker setting? How could the code link properly without having raw_pcbs?
Thanks,
John C.
It appears that static variables from the lwip_static.lib do not end up in the memory map file. I could see that once I used the Memory Browser the raw_pcbs static variable just after the global filter parameter.
The filter parameter was overwriting raw_pcbs. When the first IP packets came in, raw_pcbs was no longer a null and took the incorrect pathway in the code causing SYS/BIOS to fatal error.
Is there some file that holds the memory location of raw_pcbs ?
Thanks,
JC
raw_pcbs does not appear in the map file because it is a file level static. Only global variables appear in the map file listing.
Based on what I see so far, nothing appears to be wrong. You seem convinced that when g_stFilterParams is initialized, that is when raw_pcbs is mistakenly overwritten. How do you know that?
Thanks and regards,
-George
Hi George,
If you look at the screen capture you will see a value of 0xFFFFFFFF for raw_pcbs. During initialization raw_pcbs is set to zero and should either be a zero or a valid address(I assume this as the code in the raw_input() function is using its value to compare against a NULL.) When our application code is reading from flash it incorrectly pulls out a few more bytes of data than it should for the g_stFilterParams(this is our data structure). Because blank flash is all one's, hence the extra bytes are 0xFF and end up clobbering the raw_pcbs value setting it to 0xFFFFFFFF.
The problem I was having with this is that associating where I should look when the error occurred. Because it was happening when the first IP packets came in my train of thought was toward having messed up some part of lwip or it's interface with SYS/BIOS. When I came across the raw_pcbs value it definitely seemed wrong and the only way I found of locating it's "offical address" was via the debugger's disassembly window. It seems that I should be able to get all the final resolved addresses of any global/file level variable in the system(as they are fixed in the system.)
So if file statics are not in the map file where can I find their resolved location? Or can I turn on a linker option to spit this info out somewhere?
Thanks,
John C.