This post is an introductory tutorial to SEGGER Embedded Studio. If you haven't already please skim through this post https://devzone.nordicsemi.com/blogs/825/segger-embedded-studio-cross-platform-ide-w-no-cod/ but don't follow along with it. This is the new and improved tutorial using the nRF device pack and assumes no prior knowledge on Embedded Studio.
After following this tutorial you will be able to build, debug and run a BLE project on nRF5x devices! You will also be able to load a softdevice (and any other file of your choice, i.e. a bootloader) to your board upon loading your application.
#Edit - New Release!
We just released V2.16 of Embedded Studio, which includes some improvements based on your / blog readers' feedback:
To follow along with this post download and install each of the following:
#Setting up Embedded Studio
Open SEGGER Embedded Studio V2.14. If this is the first time you will see the Dashboard Welcome Screen. If you've already been using Embedded Studio make sure you close all open solutions. The first thing we need to do is install the CMSIS and nRF Device packages. Go to "Tools -> Packages -> Manually Install Packages" and select nRF.emPackage.
Now in "Tools -> Package Manager..." update the packages by clicking the "Refresh package list" button in the upper right hand corner. Select the "CMSIS-Core Support Package" by clicking it and then click "next" (right lower corner) and follow the instructions to download and install this package. Now make sure the CMSIS-Core Support Package and the Nordic Semiconductor nRF CPU Support Package are both installed.
#Importing a Keil uVision Project
Embedded Studio allows you to import Keil and IAR projects. In this tutorial we will import the ble_app_hrs_s132_pca10040 example (if you are using an nRF51 Series device or the nRF52 Preview DK import the corresponding uVision project file and follow along - minor differences will be highlighted along the way). This feature makes Embedded Studio plug & play with our SDK. Go to "File -> Open IAR EWARM / Keil MDK Project" and select
ble_app_hrs_s132_pca10040.uvprojx.' Make sure you select nRF_EXE as the template for this project.
Our project will get its structure from the Keil uVision project we imported. All the source files, preprocessor definitions, user include directories and many project settings will be carried over from Keil. The nRF_EXE template (from our nRF device package) configures the rest of our project settings (memory map, flash section placement, etc...) and adds the system/startup files to our project.
At this point we are almost done! But we need to make some minor adjustments to compile our project.
At this point your project should compile with no errors or warnings (but it won't run correctly)! Build it and make sure!
As with every BLE project we will need to reserve some FLASH and RAM for the softdevice. To do this we need to set the Section Placement Macros used by "flash_placement.xml". This file tells our linker where to put the different parts of our application in FLASH and RAM. Go to "Project Properties -> Linker -> Linker Options" and in "Section Placement Macros" set FLASH_START=0x1b000 RAM_START=0x20001f00 (see screenshot below) or whatever these addresses should be for your specific softdevice.
Now we may need to edit the memory map for our device (most likely if you are using the nRF52 Preview DK). Go to "Edit Memory Map" (right above Import Section Placement) and double check that this is correct for your device. If you are using the nRF52 Preview DK change the size of RAM to 0x8000.
Now we want Embedded Studio to automatically program the softdevice to our board along with our application whenever we run/debug. To do this go to "Project Properties -> Debugger -> Loader Options" and set "Additional Load File" to the full path of your softdevice.
Now rebuild your project. Everything should compile without warnings or errors and you should notice that your application is leaving some space for the softdevice!
At this point you should be able to run and debug this application. Embedded Studio will program the softdevice and then the application. Your program should run until the first instruction in main().
However you will hard fault. We have a few more fixes to do...
Rebuild and run the application. Everything should work!
Thanks to all the great feedback on the last post about SEGGER Embedded Studio we decided to make this post! Note that there are still little workarounds we have to do that will be fixed very shortly. We are working with SEGGER to make Embedded Studio even easier to use with nRF5x devices. Please continue to give us feedback so we can keep improving! Nordic customers using OS X/Linux are no longer second class citizens and your feedback is driving this initiative!
Please experiment around with Embedded Studio. Tell us what you like, what you don't like, what you want to see and why you need this to be fully supported in the future!
I imported a project that I've been working on in Keil MDK into Segger, followed the steps and all seems to go well except that the linker barfs on the arm_math library (CMSIS-DSP).
I get this:
undefined reference to arm_negate_q31' undefined reference toarm_float_to_q31' undefined reference to `arm_fir_interpolate_init_q31'
I went through similar trouble as you did with the Linker. But you basically need to state the corresponding math library file explicitly, as far as I know, so the linker knows it exists.
Goto Project->Edit Options...->Linker(under Code)->Additional Input Files:
Hope you already had this figured out by now.
I was curious to know if there is a guide/tutorial available yet for creating a brand new nRF5x project with SES without exporting an existing project from Keil or IAR. I work primarily on Mac and Linux and I am interested in learning how to create SES projects from scratch and adding the necessary libraries as needed, as opposed to working from a converted example. Thanks!
It seems to be some new changes in v3 of the Segger embedded studio so that this walk-through is no longer valid for the most resent version of SES. I am experiencing the same problem as embedded-creations.
The problem seems to be the that SES does not set some include paths for the prepsosessor. I am including them manually now and keep you posted about the progress.
EDIT: got it compiling see my blogpost devzone.nordicsemi.com/.../
Did anyone get it to work with the Preview DK, SDK12.0.0, and SES 3.10a? I'm close but I get no memory errors when initializing the stack and softdevice.
Has anyone tried using SES V3 to compile NRF5 SDK Examples? I tried using this tutorial with SES V3.10a and there's no "Project Template Chooser" window during import. The imported project is missing CMSIS files and build fails because it can't find "nrf_gpio.h" (and probably other files past that).
I posted about this on the Segger forum.