Rubén Pérez de Aranda Alonso <rperez@sidsa.es> writes:
Hello,
I am working with the at91 eb40 porting of eCOS to develop another
port for a prototype based on the same microcontroller. I now use
the EmbeddedIce pod to debug the eCOS and execute the tests of the
different parts and layers, but I would like use the Redboot and its
GDB stub because it allows me write the falsh chips and the
comunication with the host is faster. I have installed a redboot
image in flash. With the load command in GDB I upload the
application in the RAM memory that has been compiled to be executed
in RAM and with a ROM monitor. The problem is when the eCOS startup
code calls to the cyg_hal_invoke_constructors() function. This
function uses the symbols allocated by the linker, __CTOR_LIST__ and
__CTOR_END__, to know the address of the constructors belonging to
*.ctors binary sections of the different object files. The function
calls to these constructors without verify if the function pointer
points to NULL, so the pc register branch to the 0x0 address and
execute the reset vector.
There should not be NULL pointers in the constructor table. So the
thing to do is find out why they are there. Make sure you have not
corrupted the linker script in some way. Also, add the option
"-Wl,-Map,map" to the linker options, take a look at the map file
produced and see where the sections being added to the constructor
table are coming from.