This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Moving project from Keil to Eclipse : Make fails

Hey there!

I am trying to switch from Keil to Eclipse.

I have followed several tutorials on this website (like this one) and I can easily create new eclipse project, import SDK examples, then build, flash & debug...

That was easy because "examples" are provided with a gcc section that contains a makefile.

So, I have rewritten a new makefile based on example makefiles, like this question.

All seems to work until the linking:

"C:\Program Files\GNU ARM Eclipse\Build Tools\2.8-201611221915\bin\make.exe"
rm -rf _build
echo  Makefile
 Makefile
mkdir _build
Compiling file: ble_common.c
[ ... ]
Compiling file: app_fifo.c
Compiling file: fds.c
Compiling file: fstorage.c
Compiling file: nrf_assert.c
Compiling file: sdk_mapped_flags.c
Compiling file: softdevice_handler.c
Assembly file: gcc_startup_nrf51.s
Linking target: nrf51422_xxac_s130.out
_build/gcc_startup_nrf51.o: In function `Reset_Handler':
(.text+0x34): undefined reference to `SystemInit'
_build/gcc_startup_nrf51.o: In function `Reset_Handler':
(.text+0x38): undefined reference to `__START'
collect2.exe: error: ld returned 1 exit status
Makefile:224: recipe for target 'nrf51422_xxac_s130' failed
make: *** [nrf51422_xxac_s130] Error 1

I do not clearly understand what is happening because it is a file provided in the SDK... I have not modified it. I am using the SDK v12.1.0.

To be sure that the problem was not my SDK, my example makefile or even the builder, I have done the same test on blinky:

C:\Users\***\Desktop\SDK-Test\examples\peripheral\blinky\pca10028\s130\armgcc>
"C:\Program Files\GNU ARM Eclipse\Build Tools\2.8-201611221915\bin\make.exe"
rm -rf _build
echo  Makefile
 Makefile
mkdir _build
Compiling file: system_nrf51.c
Compiling file: main.c
Compiling file: nrf_delay.c
Assembly file: gcc_startup_nrf51.s
Linking target: nrf51422_xxac_s130.out
make[1]: Entering directory 'C:/Users/***/Desktop/SDK-Test/examples/peripheral/blinky/pca10028/s130/armgcc'
Preparing: nrf51422_xxac_s130.bin
Preparing: nrf51422_xxac_s130.hex
''
   text    data     bss     dec     hex filename
   1452     108      28    1588     634 _build/nrf51422_xxac_s130.out
''
make[1]: Leaving directory 'C:/Users/***/Desktop/SDK-Test/examples/peripheral/blinky/pca10028/s130/armgcc'

On it there is no problem.

Does anyone has an idea of what I have done wrong ?

Thanks for your help!

Parents
  • Hmm I have SDK 12_2 but it doesn't have a seperate ASM files section, they are all under SRC_FILES. My guess is whatever example Makefile you are using is from an older SDK before they changed things.

    What I did was copied the ble_app_hrs Makefile into my project, got it to build. Then added whatever extra source files needed.

  • I have not found what was wrong. However, I have followed your advice and used last SDK 12 release. I have done exactly the same thing for this make file and this time it works! Maybe my SDK was outdated ... Thanks a lot for your help !

Reply
  • I have not found what was wrong. However, I have followed your advice and used last SDK 12 release. I have done exactly the same thing for this make file and this time it works! Maybe my SDK was outdated ... Thanks a lot for your help !

Children
No Data
Related