I build a cross compile toolchain on OSX with: binutils-2.23.52 gcc-4.6.4 gcc-core-4.6.4 gcc-g++-4.6.4 gdb-7.6.1 gmp-4.3.2 mpc-1.0.1 mpfr-2.4.2 newlib-2.0.0 for the target EFM32 wich is a ARM Cortex-m3, so the gcc target is arm-none-eabi. All compiled fine. But making programs with this toolchain like blink.c don't actually run on the EFM32 board. I checked the blink.bin I did with a binary created with a IAR commercial toolchain delivered in the demos from energymicro, also gcc based and the they look very different internally (as expected :). So has my toolchain wrong libs/versions or is it simply a matter of gcc/ld/ar switches wrong and what would be the steps to systematicly analyse this?
Asked
Active
Viewed 591 times
0
-
Did it flash correctly? Does the generated code look reasonable? – Carl Norum Sep 24 '13 at 21:00
-
I flashed demo binaries that work and then changed the filename of the binary to the one I compiled. So all good there. But the top few houndred bytes of the binaries have mostly zeros, where in the working one are a few instructions. Then the rest of the binary files both are pretty much packed with instructions. – Gerald Witichis Sep 24 '13 at 21:07
-
So what does it look like when you break in at the first instruction and start stepping? – Carl Norum Sep 24 '13 at 21:08
-
Well flashing got done with the demo loader not with gdb - Eclipse says this after some debug commands get send: An internal error occurred during: "Label Job". java.lang.NullPointerException And the is not source available and on stepping further : can not find bounds of current function – Gerald Witichis Sep 24 '13 at 21:15
-
ok now - the first gdb step is in the startup file: /* Set up the stack pointer */ asm("ldr sp,=_estack\n\t"); – Gerald Witichis Sep 24 '13 at 21:38
-
it is a cortex-m4, the first word of the binary is the stack address there is no need for a ldr sp instruction. I suspect your issue is bootstrap/startup code which all the items you listed dont really matter, are you in control of the bootstrap code and the linker script? If not you should take control and/or understand who is in control of that, otherwise your c programs may not run at all... – old_timer Oct 04 '13 at 13:52
-
All cool now after sorting out linker script and startup code. Thanks for the help. – Gerald Witichis Oct 10 '13 at 12:50