This blog post will get you started with SEGGER Embedded Studio (SES) in less than 15 minutes!
Nordic's development kits come shipped with SEGGER J-Link firmware. Many of our tools used to program and debug our devices rely on SEGGER software & benefit from SEGGER's unparalleled feature set and performance. It would make sense to use SEGGER's IDE as well to provide a smoother development and debugging experience.
To follow along with this post download and install each of the following:
Open SES. You should see the Dashboard home page. Here you will see the package manager, software updates & your projects. Under Packages click "Manage Packages" and then double click on the "CMSIS Core Support Package." Then click "Next" and this package will be installed. There isn't a Nordic package currently but no worries, its not needed. You should see something like this: SES_Home_Dashboard.png.
Now lets compile and run the blinky example found in Nordic's SDK. Select "File->Open IAR EWARM / Keil MDK Project" and then navigate to blinky_blank_pca100XX.uvprojx in your SDK directory. Be sure to select the correct project for the board you are using. For me the full path is "nRF5_SDK_11.0.0-2.alpha_bc3f6a0\examples\peripheral\blinky\pca10040\blank\arm5_no_packs\blinky_blank_pac10040.uvprojx" as I am using the nRF52 Development Kit.
Now we just need to do a few things to compile & run this project!
All source files are added to the project now. SES looks at all files in the project and knows to compile these files just like Keil. The different folders like "Application," "nRF_Drivers," "System Files" help you keep your source files organized. Your project should look like this now.
The last thing to do now is to configure the project settings. This is very similar to how it is done in Keil. In GCC these are configured with compiler and linker flags. SES imports Keil project settings so almost all of this is done for us. All we need to do is add some include paths for header files that are no longer contained in a Keil software pack and set up the connection with the device so we can program/debug.
Now we are ready to go! Simply right click the project and click "Build." Or under the "Build" tab you can click "Build and Run" or "Build and Debug." Make sure your nRF5x Development Kit is connected to your computer and turned on. Then run the program and see that the LEDs blink.
Now lets debug the application. Under the "Debug" tab click "Go." When you start debugging an application SES will automatically build (if any source files have been changed), erase flash sectors and program the application. It will open the debug window with the program counter at the start of main(). You should see this.
There are a lot of debugging features I won't go over in this blog post. There are some amazing debug features and it is very easy to use. Experiment a bit here and you should get the hang of it very quickly!
There's your quick intro to SES. This IDE is a great option for any developers working with Nordic chips. You should easily be able to import a more complex Keil or IAR project like a BLE example from our SDK or one of your own projects from here. Explore the Project Settings and debug features more - this IDE is very easy to learn. If you are coming from GCC you will notice that there is no linker script. In project settings all you need to do is add some flags and it will be automatically generated properly. The main thing to do is specify the start of FLASH and RAM for an application using a softdevice.
Please comment and let us know what you think about this IDE. If we get good feedback there will be more to come with SES!
Running a BLE example requires the exact same steps as above with just a few extra ones. (Note: for now don't use any nRF device pack, import the project and just select the standard c/c++ executable template. if you haven't already installed the Nordic device package this doesn't apply to you).
rperkins: I came across the same issue with a few of our boards (a mix of PCA10040's & PCA10036's). The solution would be to set the following in Project->Edit Properties->Build->Memory Map Macros...
FLASH_START=0x00000000 FLASH_SIZE=0x00080000 SRAM_START=0x20000000 SRAM_SIZE=0x00008000 SRAM1_START=0x08000000 SRAM1_SIZE=0x00008000
This should give you 2 x 32KB memory regions should you need the 2nd 32KB of memory. Alternatively, simply removing the SRAM1_xxx macros will give a single 32KB region if your project doesn't need the additional memory.
--This is leonwj's comment below and will be helpful for anyone using this board.
Evaluating this software is free and there are no limitations on the features of the IDE. However when developing production firmware for commercial products a licence is required. More information about licensing SES here: https://www.segger.com/ses-licensing.html. Your SES licence can be stored on your J-Link debug probe, https://www.segger.com/jlink-debug-probes.html, so that you can use SES on any of your computers.
SEGGER has released a pack for Nordic devices. Official release is coming soon. Please save the package attached nRF.emPackage. It can be manually installed in Embedded Studio via Tools -> Packages -> Manually Install Packages... Once this is installed in Embedded Studio, import a Keil project as above. No need to add user include directories, the startup file i attached, and many of the other things you had to do. Works more out of the box. Will be updating this post when i get some time.