This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf51 SDK 5.2.0, S120 examples and gcc

I downloaded nRF51 SDK 5.2.0 and I am studying the examples for S120.

I notices that there's no gcc directory, thus only Keil compiler can be used. Is there a way to use gcc?

  • Most example projects in the SDK were not built under gcc, hence you will see there are no gcc subdirectory/makefile/....

    But it is very much possible. To start, you can follow the general instructions in AN-29.

    I am just in the process of setting up a S120-based project running under Windows/GCC/Eclipse.

    I am "porting" [nrf51822\Board\nrf6310\s120\experimental\ble_app_multilink_central] application to pca10001 device (nRF51822 Evaluation Kit). It runs right now, but I have not yet gotten to a step where I can connect to a peripheral. Still trying to understand the sample code better ...

    Few things to note:

    • you will have to create your own gcc Makefile to get started. I copied another example, and edited it from there.
    • Setup information in AN-29 is a bit light/incomplete. But if you are proficient in setting up software tool environments, you can work your way through it
    • I recommend putting nRF51 SDK 5.2.0 into a directory path that has no spaces in it. By default, the SDK .msi installer puts spaces in it.
    • "experimental" S120 projects have their own "common" subfolder, which I believe you are to use the files in there, versus files found in the SDK's "sd_common" subfolder.
    • with existing Makefile.common file setup, it appears to not handle being able to compile C files in a subfolder such as "common". (Could be limitations in my own knowledge). I had to copy those "common" files and place them directly into my projects source folder (right below gcc subfolder)
    • various things in S120 examples and SDK prevented compiling right away. (SDK function prototype errors, missing #define #include statements, ...)
    • copy gcc_startup_nrf51.s file into your project directory, and edit for your needs. For my sample project, the build linker indicated I was out of RAM. Had to edit this file to reduce default Heap_Size.

    Thx, Martin

  • Do you have nRF51 SDK 5.2.O and s120 softdevice? Could you send them to my email?I also want to studying the examples for S120 .My email is [email protected]

Related