1
Microcontrollers / Re: Looking for help to debug 32F4 ethernet
« Last post by peter-h on Today at 03:24:02 pm »I've fixed it, by stepping back through previous versions. Can anyone see a problem with this linkfile syntax? The purpose is to first collect DATA from the 1st module (main.o) and then collect DATA from the remaining modules. There is no particular reason for doing that other than it is neater in the .map file
Previously it was done all in one go and that works fine
Obviously it would be good to know what the problem is in the first one, but the linkfile syntax is horrible and there is no useful error reporting; you just get a line # because real men don't need anything else
I did always suspect the issue was with DATA not getting initialised correctly in RAM from its FLASH image.
Code: [Select]
/* Initialized data sections for non boot block code. These go into RAM. LMA copy is loaded after code. */
/* This stuff is copied from FLASH to RAM by C code in the main stub */
/* This is stuff like int fred = 1; which is copied flash -> ram (not const) */
. = ALIGN(4);
/* main.c DATA */
.main_data :
{
. = ALIGN(4);
_s_nonboot_data = .; /* create a global symbol at data start */
*main.o (.data .data*) /* .data sections */
. = ALIGN(4);
} >RAM AT >FLASH_APP
/* Remaining DATA */
._other_data :
{
. = ALIGN(4);
*(.data .data*) /* .data sections */
. = ALIGN(4);
_e_nonboot_data = .; /* define a global symbol at data end */
} >RAM AT >FLASH_APP
/* used by the main stub C code to initialize data */
_si_nonboot_data = LOADADDR(.KDE_main_data);
Previously it was done all in one go and that works fine
Code: [Select]
.all_nonboot_data :
{
. = ALIGN(4);
_s_nonboot_data = .; /* create a global symbol at data start */
*(.data .data*) /* .data sections */
. = ALIGN(4);
_e_nonboot_data = .; /* define a global symbol at data end */
} >RAM AT >FLASH_APP
/* used by the main stub C code to initialize data */
_si_nonboot_data = LOADADDR(.all_nonboot_data);
Obviously it would be good to know what the problem is in the first one, but the linkfile syntax is horrible and there is no useful error reporting; you just get a line # because real men don't need anything else
I did always suspect the issue was with DATA not getting initialised correctly in RAM from its FLASH image.