Segger Embedded Debugger version 3 and how I got it to compiling

Hi I followed this Blog post on how to use Segger embedded studio(SES) to compile nrf5 examples and got into some truble with the newest version of SES v3.10c. And this blog post will tell how I solved the problem. I have not tried flashing the compiled code to the nrf52 dev kit, and I will opdate this turotial when I have figured out how to do this (help is appriciated). I have now managed to flash the device.

I followed the blog post up to the point where a project template should be choosen (this was not an option in SES V3.10). When importing the project I was instead asked if I wanted to create build configuration for external or internal toolchain, or if i wanted both. Here I chose both. Se attached screen shot.

Build configuration

After the import, the project looked like this

After import

Then I tried building the code, this is what happend.

First Try on compilation

I tried building using the internal toolchain(after some trial and error), this can be changed using ctrl + chift + b shortcut.

Second try with internal build configuration

By right clicking on the solution i found some options for the solution (it is important to be in the in the correct build configuration), especially the preprosessor options is interesting.

I inserted the location for these files into the user include directories (files found from the output of the faild compilation tries) under preprosessor.

compiler_abstraction.h nrf.h

both of these should be located in the components\device folder of the SDK.

Preprosessor configuration

This resulted in some other errors: "Storrage size of '__stdout' isn't known" and "Storrage size of '__stdout' isn't known"

Both of these are solved by comenting out two lines (# 29 and 30) in the retarget file described in the blogpost by nordic.

Rebuilding the application now result in a compilation witout errors. I am not shure if this is the recomended way of doing things in SES or if there is a better way. If you know a better way or have recomandations please coment below.

We now have to select the softdevice we want to upload to our device this is done under "Procject properties -> debugging -> Loader -> Additional load file type[0]" and point it to your softdevice hex file.

To load the prject to a devkit you also have to set the correct memmory location for the softdevice. This is done in the project properties under linker -> section placement macros. In my chase s132 the flash starts at 0x1c000 and the sram starts at 0x20002080 therfore these two macros where added: FLASH_START=0x1c000 SRAM_START=0x20002080

I am not shure where thees numbers shuld be found in the documentation so please coment if you know where it is documented (I found them trough using keil uVision which is not an ideal solution)

Parents
  • Thanks for the post. I got that far alone, though. Now I'm trying to get the ble_uart_app to run. It compiles and loads fine now. Advertising works but when I want to connect, the service discovering doesn't seem to be working. It's a bit strange because interaction with the softdevice seems to be ok since advertising works. Will keep working on it. Using SES v3.10a, s132 3.0.0, sdk 12.0.0, pca10040

Comment
  • Thanks for the post. I got that far alone, though. Now I'm trying to get the ble_uart_app to run. It compiles and loads fine now. Advertising works but when I want to connect, the service discovering doesn't seem to be working. It's a bit strange because interaction with the softdevice seems to be ok since advertising works. Will keep working on it. Using SES v3.10a, s132 3.0.0, sdk 12.0.0, pca10040

Children
No Data