mjdietz2 gravatar image

Posted 2016-02-04 12:51:53 +0100

blogs->nordicers

Segger Embedded Studio blog post rev2 DEPRECATED

Depreceted

see new blog post for new version of embedded studio here:

https://devzone.nordicsemi.com/blogs/1032/segger-embedded-studio-a-cross-platform-ide-w-no-c/

Introduction

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:

  • Target -> Erase All enabled
  • Properties -> Debugger -> J-Link Options -> Erase All added to erase the chip prior to download
  • Properties -> Debugger -> Debugger Options -> Start From Entry Point Symbol added to disable setting the PC after reset
  • Fixed project property dialog forgetting previously modified properties on cancel.
  • Imported projects from uvproj(x) files now use the TargetName.
  • Fixed reading of XML files with a UTF-8 byte order mark.

Required Software

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.

image description

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.

image description

Importing a Keil uVision Project

Embedded Studio allows you to import Keil and IAR projects. In this tutorial we will import the bleapp_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 '\nRF5_SDK...\examples\ble_peripheral\ble_app_hrs\pca10040\s132\arm5_no_packs\ ble_app_hrs_s132_pca10040.uvprojx.' Make sure you select nRF_EXE as the template for this project.

image description

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.

Adjustments

At this point we are almost done! But we need to make some minor adjustments to compile our project.

  1. In the "Project Explorer" notice that two Projects have been imported. This is because in Keil, Nordic SDK examples that use the SoftDevice include a dummy project specifically for flashing the SoftDevice directly from Keil. Since we can automatically flash the SoftDevice with our application in Embedded Studio we can delete this project. Remove the project 'flash_s130_nrf51_2.0.0-7.alpha_softdevice' or similar from Embedded Studio so you are left with only the real project. WARNING: it looks like Embedded Studio imports this dummy SoftDevice flash project as the default project. After importing a project from Keil it is likely this is the active (bolded) project.

image description

  1. Remove the "Source Files -> nRF_Segger_RTT" folder. Embedded Studio automatically includes RTT files as you can see and we want to use these (they are more up to date and correct for Embedded Studio).
  2. Open "retarget.c" and comment out lines 28 and 29 (// FILE stdout; // FILE stdin;). If you don't you will get a compiler error saying 'storage size of '__stdout' isn't known.' You can even remove "retarget.c" entirely from the project as it is not needed. For more information on why see: https://devzone.nordicsemi.com/question/29200/retargeting/.

image description

At this point your project should compile with no errors or warnings (but it won't run correctly)! Build it and make sure!

The Softdevice

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.

image description

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[0]" to the full path of your softdevice.

image description

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!

image description

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().

image description

However you will hard fault. We have a few more fixes to do...

Important Fixes

  1. Increase the stack size. The stack should be at least 1024 bytes but lets make it 2048 for this project. By default the SDK does not use heap but lets just leave the heap at 256 bytes. Do this by right clicking the project and changing "Main stack size" as seen in the screenshot below.
  2. Add NO_VTOR_CONFIG to the "Preprocessor Definitions."
  3. In Properties -> Debugger -> Debugger Options -> Start From Entry Point Symbol, set to 'No.' This is because we should enter our SoftDevice's ResetHandler(), not our applications. For more information, see RK's comment below.

image description

Rebuild and run the application. Everything should work!

Notes

  • It seems that Embedded Studio can lose project settings (and this includes the memory map and flash placement section). We are working with them to fix this bug. It seems to happen occasional when cleaning the project. Just beware of this and if you start to have weird problems you shouldn't take a look at the project settings to see they are as expected (preprocessor definitions, stack size, softdevice in file loader, memory map modifications, flash placement modifications).
  • You may need to change "Target Connection" from "Simulator" to "J-Link." This is done in project properties. If you get weird error messages when trying to run/debug your program check this.

Future

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!

54 comments

luposlip gravatar image

Posted Feb. 4, 2016, 1:54 p.m.

Hi Michael!

Thanks for the great tutorial. Newcomers (that haven't read your earlier tutorial) may initially miss how to import the flash_placement.xml, since there is no reference to the menu item until later ;-)

I got it to work (I think), the advertisement-indication LED1 blinks. I couldn't get this working following the old tutorial.

For now I've only tried with the PCA10040.

[EDIT:] I got it working, my Android Wear version of the nRF Toolbox found the Nordic HRM (!!). On my Android device I had to bond with the HRM in the normal Bluetooth settings. After that I could find it in the nRF Toolbox app. w00t! :)

Best, Henrik

mjdietz2 gravatar image

Posted Feb. 4, 2016, 2:07 p.m.

Henrik: that was fast, great to hear you got everything working! Thanks for the input, made it more clear. Good luck with Embedded Studio!

mjdietz2 gravatar image

Posted Feb. 4, 2016, 2:12 p.m.

Note: Blog post was just updated with new nRF device package from SEGGER with some bug fixes. (No need for changing any interrupts in the vector table).

Adrian gravatar image

Posted Feb. 4, 2016, 4:38 p.m.

Hi Michael I tried your tutorial and it worked so far for the SDK project. When I try to import my uVision project (also based on the SDK 11 alpha2) the SES just does nothing (no error message / no warning). Is there somewhere a log file I can check what happend? BR, Adrian

SOLUTION: Found the problem! Our project file had some spaces in it. After removing the spaces the import worked as expected.

bht890811 gravatar image

Posted Feb. 5, 2016, 2:56 a.m.

Nice post! But I still don't know why the "Target-->Erase all" is always gray. Can I use SES to erase the flash? If so, how can I make it work, not gray?

mjdietz2 gravatar image

Posted Feb. 5, 2016, 8:53 a.m.

Bee: Currently this feature isn't implemented for nRF5x devices. It is on SEGGER's TODO list. I expect that in their next release this command will be available.

Currently when Embedded Studio loads a file to your board, it erases the addresses that this file has data in. So if you program the softdevice it will erase addresses 0x0-0x1B000 and then write the softdevice. And then when you program your application it will erase 0x1B000-END_ADDRESS (for example).

My recommendation is to erase all with nrfjprog, JLink.exe or the tool of your choice until this feature is available. But note that you don't need to be doing this every time you re-flash your board (unless you are writing to flash in your application) but I would recommend doing this every once in a while or when you run into a bug.

luposlip gravatar image

Posted Feb. 5, 2016, 3 p.m.

Bee: if you're on OSX I can warmly recommend RKNRFGO: http://sourceforge.net/projects/rknrfgo/

msmayling gravatar image

Posted Feb. 5, 2016, 7:26 p.m.

Hi, Michael, this is great progress since the first blog on using SES. I tried the blinky project and had no problem to run it, needing absolutely no changes after the SES import; this is very good so far. However, when I tried the blinky_rtx example, it still did not like the difference in rtx (M3 vs M4F?) (The example runs fine with Keil.) I then tried the blinky_freertos -- it was compiling until it hit "port.c" and then started complaining about syntax. (Again, this ran fine in Keil.) So, it looks like good progress but still some work to do. Thanks to you and the Segger team for getting this tool ready for general use.

rols gravatar image

Posted Feb. 6, 2016, 7:44 a.m.

Great tutorial update.

You don't need to import and modify the flash_placement.xml file if you don't want to, the default one has macros in it which can be replaced with the actual values

To do that you set the Section Placement Macros property with

FLASH_START=0x1b000
RAM_START=0x20001f00

and it will substitute them into the default file and 'just work'.

I see when running that the Registers window shows only generic Cortex M4 registers. That seems to be because the default XML definition file doesn't have much in it. I pointed it to the SVD file in the SDK and changed the type to SVD but that didn't work. I have my own nRF52 register file I made for Crossworks, I pointed it to that, that does work. With that you get all the registers, all the bitfields, everything, so you might want to talk to Segger about including a full XML file in the released support package.

Apart from that .. it's working pretty well.

mjdietz2 gravatar image

Posted Feb. 6, 2016, 4:29 p.m.

Mike: Thanks! I will look into these problems this week and get back to you. Have you ever tried compiling/running these projects with GCC? If that works OK we shouldn't have a problem getting it working with Embedded Studio.

RK: Thanks for the great feedback! I updated the blog post to use this method as it is much simpler. Ok I will relay this to SEGGER, I was wondering about this myself and tried the SVD file with no luck as well.

rols gravatar image

Posted Feb. 7, 2016, 2:44 a.m.

I figured out what the SVD problem is, it's something I reported to Crossworks a while ago. If there's a Byte Order Mark at the start of the file the SVD reader can't read it. They had another bug too to do with register clusters but that's been fixed I see, even though the issue is still open.

If you trim the first 3 bytes off the SVD file (EF BB BF) with a hex editor, it should work, does for me. That instantly enables all the register information and is very useful.

The nrf51.svd file doesn't have the byte order mark so that one works out of the box. Possibly the simplest solution is for Nordic to start distributing that file without the BOM, it's not really needed, that file's UTF-8 anyway.

Posted Feb. 10, 2016, 1:49 a.m.

Michael: Doing what you described resulted in success for me. In fact, I found that I didn't even need to do a 'build and run'. If I just did 'build and debug', stop the debug session, hit the reset button on the board, and then 'build and debug' again, it worked.

RK: Trying what you suggested also resulted in success for me on the first 'build and debug' try. No reset button necessary!

I made sure to erase everything in nRFGo Studio between iterations so I knew I was working with a clean slate. I was also able to switch between working and not working by either not using the reset button in Michael's case or setting the 'Entry Point Symbol' field back to blank in RK's case, so these both appear to be 100% repeatable (erasing between attempts of course).

Once I got the debug session to work with the beacon app properly, pausing the debug session and restarting was still resulting in a fault being generated, and me having to stop the session and restart. But, I think I read in one of these posts that BLE and debug don't play well together on the nRF51 anyway due to loss of a clock or context, so that's probably what's going on. I think that post mentioned that was one of the advantages of the nRF52, was that you could keep the BLE stack satisfied even when pausing a debug session, correct?

Thanks for the help!

mjdietz2 gravatar image

Posted Feb. 10, 2016, 10:16 a.m.

Hey Edward,

I actually just saw this issue yesterday when I was debugging an application on an nRF51. I need to talk to SEGGER about it, but what I found was similar to what you have said. The thing is if I do 'build and run' and then hit the reset button on the board the application runs as expected. Then from there if I go 'build and debug' the application debugs as expected (doesn't hang at the SVCALL). Can you try this out and let me know what you see? (note: I haven't tried this in Release mode yet).

I will bring this issue up with SEGGER - I think it may have to do with the non standard SWD interface on the nRF51 but really not sure, its a weird one..

rols gravatar image

Posted Feb. 10, 2016, 2 p.m.

That sounds as if the softdevice init code isn't being run, ie you're not starting from the real reset handler down at 0x00000004 but starting right at the reset handler in your application code. When you hit the reset button it starts at the right place and initialises the SD correctly.

Do you want to try testing that by setting the property 'Entry Point Symbol' which is most likely empty to 'nonexistent' (yes really the string with the word nonexistent in it, or any load of garbage which doesn't actually exist). I don't know if that will help, but it's worth trying. If it does help, I'll explain why, if it doesn't, there's no point explaining why :)

... since Edward tried it and says it works .. Crossworks, from which SES is derived, when it runs your code, doesn't just reset the chip and let it go, well it can, but it doesn't always. It pulls the address of a start symbol out of the ELF binary, stops the chip, sets the PC to the address of it and then lets it run again. Certainly in Crossworks' case the default for that symbol if not specified is reset_handler, but it's reset_handler in the binary it just built, your binary, not reset_handler in the softdevice, so the softdevice doesn't get to run its short setup code and the first call into it crashes. Setting the symbol to something which really doesn't exist forces a start from reset.

I suspect it works in a release binary because it's probably stripped off enough symbols that reset_handler can't be found and it works if you hit the reset button because .. well that's obvious right.

My home grown nrf package for Crossworks sets that symbol to nonexistent automatically because I fell over this one quite a few times.

Posted Feb. 10, 2016, 8:30 p.m.

Not sure how, but I ended up editing (thus overwriting) my first post containing my original question. Sorry about that.

SvenKBach gravatar image

Posted Feb. 12, 2016, 5:12 p.m.

I suggest to change the project settings directly to "Release" and "Debug" configurations, seems like the lost settings atleast for me happened when I did them as "Common". Of course one should ignore the warning when saving properties.

mjdietz2 gravatar image

Posted Feb. 16, 2016, 3:58 p.m.

Guys, please see the edit in the blog post. SEGGER has added pretty much all features that have been requested and fixed all bugs that have been reported in their new release of Embedded Studio. I'd recommend updating it!

msmayling gravatar image

Posted Feb. 18, 2016, 5:12 a.m.

Hi, Michael,

I've installed 2.16, thanks for getting things moving and updated so quickly.

I'm trying the IOT SDK 0.9.0 with the coap_server_observe_pca10040 example. It runs fine with Keil. However, with SES, I'm getting a linker error:

C:/Program Files (x86)/SEGGER/SEGGER Embedded Studio 2.16/gcc/arm-none-eabi/bin/ld: Output/Debug/Exe/iot_ipv6_coap_server_observe_pca10040.elf section i.ble_6lowpan_init' will not fit in regionUNPLACED_SECTIONS'

C:/Program Files (x86)/SEGGER/SEGGER Embedded Studio 2.16/gcc/arm-none-eabi/bin/ld: region `UNPLACED_SECTIONS' overflowed by 4449 bytes

In the SES forums there is mention of this, but I couldn't find a solution. Have you seen this problem?

Thanks, Mike

Update1:

I added ble_6lowpan.a to linker options and now it build and runs ok. This will be very useful going forward, since my IOT programs were severely limited by the 32K size in the Keil eval version.

Update 2: I just downloaded and installed SES 2.16a. I ran it on the original example and it worked perfectly the first time, no manual tweaking. Very nice job by the Segger team.

wtbn gravatar image

Posted Feb. 18, 2016, 2:32 p.m.

This is great post, thanks!

I am wondering if is there anything like keil packs planned in SES? I am using packs with keil and they make things much easier - something similar for SES would definitely convince me to move to SES with all my projects (right now I am using keil and eclipse for bigger ones. Eclipse also lacks of pack functionality which is a bit painful comparing to keil). But very nice IDE anyway :)

mjdietz2 gravatar image

Posted Feb. 22, 2016, 11:42 a.m.

Note: With the 2.16 update of Embedded Studio there are some changes when importing Keil projects. Important: See the Adjustments section above which has been modified. This has to do with two Keil projects being imported into Embedded Studio. It explains that this is because of the dummy SoftDevice flash project in Keil that comes with our examples. If you are using Embedded Studio since 2.14 you need to read this update.

Also updated the Important Fixes section above. Mention Properties -> Debugger -> Debugger Options -> Start From Entry Point Symbol added to disable setting the PC after reset. You need to set this to 'No' when debugging applications using the softdevice. See RK's comment above for more info...

luposlip gravatar image

Posted Feb. 23, 2016, 2:56 p.m.

Hi Michael,

I've upgraded to SEM 2.16a. I need to use both Central and Peripheral, and I'm using the nRF52 DK (not preview).

I've followed the updated guidelines above in every detail, and imported project:

nRF5_SDK_11.0.0-2.alpha_bc3f6a0/examples/ble_central_and_peripheral/experimental/ble_app_hrs_rscs_relay/pca10040/s132/arm5_no_packs/ble_app_hrs_rscs_relay_pca10040.uvprojx

But when I build the project I get the following error:

Linking nrf52832_xxaa_s132.elf Output/Debug/Exe/nrf52832_xxaa_s132.elf section `fs_data' will not fit in region `UNPLACED_SECTIONS' region `UNPLACED_SECTIONS' overflowed by 17 bytes

Any ideas?

Best, Henrik

mjdietz2 gravatar image

Posted Feb. 23, 2016, 3:42 p.m.

Henrik: See this post https://devzone.nordicsemi.com/question/68722/segger-embedded-studio-unplaced_sections-problem/. I haven't looked into this problem yet but seems like its the same as your having so maybe it will help.

luposlip gravatar image

Posted Feb. 23, 2016, 5:10 p.m.

Cool, thanks Michael. After adding the following to the imported flash_placement.xml as the last element inside the <MemorySegment name="$(FLASH_NAME:FLASH)"> element, it builds perfectly! :)

<ProgramSection alignment="4" load="Yes" name="fs_data" address_symbol="__start_fs_data"  end_symbol="__stop_fs_data" />
rph8 gravatar image

Posted Feb. 27, 2016, 9:08 p.m.

I tried this tutorial but with the PCA10028 and of course S130, otherwise I used all the same settings. Whenever I try to Build and Debug the program is immediately stopped and "Stopped by vector catch" since device_manager_peripheral.c:2544 catches an exception in the function dm_ble_evt_handler. Seems like something is missing in the settings somehow?

When building the same with plain GCC and GNU make from the command line while flashing it with JLinkExe I do not get this error.

rph8 gravatar image

Posted Feb. 27, 2016, 9:28 p.m.

Found a solution for the "Stopped by vector catch" problem. Apparently I was using the wrong flash and RAM starts

Setting the Section Placement Macros to FLASH_START=0x1b000 RAM_START=0x20001f00 based on the linker file included in the armgcc directory worked for me.

Note that I was using S130 with PCA10028 and SDK v11-alpha2. I did not change the flash_placement.xml. I believe the start values for flash and RAM there should remain what they are and not be the same as the section placement macros, i.e. not factor in the SoftDevice. Correct me if I am wrong, but that is what I used and it worked for me.

Posted Feb. 29, 2016, 6:40 a.m.

Visit for great iOS android source code . you can also sell your app templates or code here " mobile app development and keep working on freedom251

mjdietz2 gravatar image

Posted Feb. 29, 2016, 9:30 a.m.

Raphael: I agree with you, flash_placement.xml should not be changed and the section placement macros should be set as you did. I thought this was how i described it in the tutorial - this is important so any suggestions on how I can clarify this in the tutorial?

Taeyeop Kim gravatar image

Posted March 2, 2016, 5:56 a.m.

Hi, Thank you for your greate tutorial.

I have a problem.

I followed your tutorial,

on the Adjustments section, I imported ble_app_hrs_s130_with_dfu_pca10028 in SDK10.0.0 example.

and remove one project, comment out stdout and stdin from retarget.c

Then I clicked build command I got the error like attachment.

How do I solve it?

I tested ble_app_hrs_s130_pca10028 example and the error never happened.

image description

mjdietz2 gravatar image

Posted March 2, 2016, 11:26 a.m.

I've seen this problem as well, I think it is common to GCC?

In Project Properties -> C/C++ -> Compiler Options -> Additional C Compiler Only Options you need to specifiy the flag '-fomit-frame-pointer'

This is only needed when you have an application with DFU service as you have.

Taeyeop Kim gravatar image

Posted March 3, 2016, 2:15 a.m.

@Michael Dietz

Hi, I ve got a question,

I did import keil project and compile, then set address and other attribute.

Finally, I would download flash to DK board but never connected.

Embedded studio haven't found DK board, Which part should I check to connect to DK board?

mjdietz2 gravatar image

Posted March 3, 2016, 9:33 a.m.

Just connect the DK as you normally would (usb cable). When you plug in your board to your computer (JLINK (E:)) should come up as a USB storage device. (Note: our boards are shipped with JLink firmware but did you put a different firmware on the board such as mbed or CMSIS DAP?) You will have to use JLink firmware on the on board debugger if you want to use SEGGER Embedded Studio.

Select Target->Connect JLink.

dave75 gravatar image

Posted March 4, 2016, 1:39 a.m.

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 did install the CMSIS-DSP support pack and went back to verify that it is really installed: image description

The same project builds with no problems in MDK. I also tried copying the preprocessor defines over (which didn't seem to come through in the project import) and that didn't fix it either.

help?

mjdietz2 gravatar image

Posted March 4, 2016, 9:22 a.m.

Hey, if the preprocessor defines didn't come through in the project import then you are using the wrong projects (2 are imported because of Keil's dummy softdevice flasher project). Please ready 'Adjustments' section above and follow those steps.

As for your problem I'm not sure. Try fixing above and see if that helps. It is just compiling with GCC so if this works with GCC it should work with Embedded Studio

dave75 gravatar image

Posted March 4, 2016, 10:37 p.m.

I'm not using a softdevice though, I have a project that just implements a proprietary point-point protocol so I didn't think that stuff applied in that case.

When I comment out all the calls to the arm_math library then the project builds fine.

Taeyeop Kim gravatar image

Posted March 9, 2016, 3:41 a.m.

Have you seen the error like below? image description

Taeyeop Kim gravatar image

Posted March 9, 2016, 3:52 a.m.

Have you seen the error like below? image description

wtbn gravatar image

Posted March 16, 2016, 3:56 p.m.

Is there possibility in SES to use newlib-nano instead of standard library? While developing in Keil i used microlib, in Eclipse with GCC i used newlib-nano (--specs=nano.specs). I am not very experienced at this linker and compiler settings and I have no idea how to make it work in SES.

gcrisler gravatar image

Posted March 28, 2016, 9:07 p.m.

I have followed the tutorial, everything is working fine except when I try to connect to the 10028 board I get a "Can not connect to J-Link via USB." Error. I can connect fine using Keil, so I know is not the board. I am running a Linux Ubuntu system. I plug in the board and it shows up as the file system, so I know that I am connecting. Is there some project option or something I am missing?? Garret

waynek gravatar image

Posted April 20, 2016, 7:50 p.m.

Great article, thank you!

I had to make a minor tweak to get the HRS example working for my touch test env, which was:

  • board: nrf52 PCA10040 (not preview DK)
  • SDK: nRF5_SDK_11.0.0_89a8197
  • SoftDevice s132
  • SES V2.16a
  • macOS 10.11

Go to "Project Properties -> Linker -> Linker Options" and in "Section Placement Macros" set

FLASH_START=0x1C000 RAM_START=0x20002080

These values came from the armgcc build settings of the same HRS project, namely

examples/ble_peripheral/ble_app_hrs/pca10040/s132/armgcc/ble_app_hrs_gcc_nrf52.ld

This is anecdotal, but, I had better success seeing the debugger stop in main() and the project advertise after starting from scratch a second time and using: 'MenuBar' -> Target -> Connect J-Link before doing a rebuild and run or debug. I only mention it because that was something I didn't do first time around, so just in case that did some magic; it may of course have been my fat fingers the first time that were another problem. :)

All the best Wayne

GeneralMayo gravatar image

Posted April 23, 2016, 1:22 a.m.

Thank you for the tutorial!

I wasn't able to get this to work on using the following

My error is this... Programming failed @ address 0x00000000 (block verification error) Verification failed @ address 0x00000000 Failed to download application. Error during verification phase. Please check J-Link and target connection.

My target connection is J-Link...

Any assistance would be much appreciated!!

bobr-rigado gravatar image

Posted May 16, 2016, 8:12 p.m.

Thanks for the info on this development option. Do you know what kind of restrictions there are with respect to the free license? Eval only? Non-profit? etc.?

kan gravatar image

Posted May 17, 2016, 9:08 a.m.

After installation and import the SDK sample, cannot find the linker when open project option page. any idea?

Kan.

borut gravatar image

Posted May 20, 2016, 5:24 p.m.

Hi and thanks for a great article!

I am trying to run hrs example on PCA100028 with s130 softdevice and was able to perform all the steps without errors, and the board seems to be successfully programmed. But while the debugger shows program running, the nRF51 status LEDs stay always on, and I can't connect to the board - nRF Toolbox doesn't find any device. I double-checked all the steps in the tutorial, and even started from a vanilla SDK11.0.0, with same result.

I'd be grateful for any ideas what might be wrong.

Borut

borut gravatar image

Posted May 23, 2016, 3:47 p.m.

EDIT: Solved by changing ram start in linker options to 0x20002080.

DK999 gravatar image

Posted June 15, 2016, 12:43 p.m.

No luck, just getting four always-on LEDs on my nRF52 DK :( I've set FLASH_START=0x1C000 and RAM_START=0x20001f00 to the values shown in the s13x_nrf5x_2.0.0_migration_document.pdf. Heap/Stack is set to 256/2048 Bytes and the memory map says FLASH start="0x00000000" size="0x00080000" and RAM start="0x20000000" size="0x8000". Memory usage looks like this: image description

There must've been something I've missed >_>

borut gravatar image

Posted June 15, 2016, 9:58 p.m.

Hi, I've been trying to run proximity example without success. The example runs on PCA100028, but hard-faults immediately after connect. Double-checked everything. Unfortunately I can't run the same example through Keil as the code exceeds 32k limit.

Any help much appreciated.

Borut

alhay49 gravatar image

Posted June 16, 2016, 12:14 a.m.

Hi, I followed along with the directions with the ble_app_hrs but for some reason I get a "Cannot download multiple load files because they overlap" The only additional load file is the softdevice. Anyone else have this problem? Thanks

smicas gravatar image

Posted July 6, 2016, 1:20 p.m.

I am having the same issue as alhay49. After following the directions meticulously, the ble_app_hrs project builds fine but when trying to debug - I get the "Cannot download multiple load files because they overlap" error.

  • board: nrf52 PCA10040 (not preview DK)
  • SDK: nRF5_SDK_11.0.0_89a8197
  • SoftDevice s132
  • SES V2.20
  • Windows 10

UPDATE: I managed to solve this issue by following Wayne's suggestion:

"Go to "Project Properties -> Linker -> Linker Options" and in "Section Placement Macros" set FLASH_START=0x1C000 RAM_START=0x20002080 These values came from the armgcc build settings of the same HRS project, namely examples/ble_peripheral/ble_app_hrs/pca10040/s132/armgcc/ble_app_hrs_gcc_nrf52.ld "

Thanks Wayne!

shtsht gravatar image

Posted Aug. 18, 2016, 8:32 a.m.

I have Keil project and want to migrate it to SEGGER Embedded Studio.

I followed instructions shown above.

However, when I tried to "Build" -> "Build and Run", an error occured. error says

image description

my momery settings are,

<!DOCTYPE Board_Memory_Definition_File>
 <root name="nRF51822_xxAC">
  <MemorySegment name="FLASH" start="0x18000" size="0x28000" access="ReadOnly" />
  <MemorySegment name="RAM" start="0x20002000" size="0x6000" access="Read/Write" />
</root>

image description

these are the same as in Keil project setting shown below.

image description

Could you please give me any clue to solve this issue? Thanks in advance.

Posted Sept. 8, 2016, 3:21 p.m.

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.

noebrun gravatar image

Posted Sept. 15, 2016, 5:28 p.m.

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.

Tentom gravatar image

Posted Sept. 24, 2016, 2:30 p.m.

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 https://devzone.nordicsemi.com/blogs/1020/

bopamo gravatar image

Posted Oct. 12, 2016, 8:55 p.m.

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!

gmamba gravatar image

Posted May 27, 2017, 1:31 a.m.

@dave75

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: Include: $(PackagesDir)/CMSIS_4/CMSIS/Lib/GCC/libarm_cortexXXlf_math.a

Hope you already had this figured out by now.

Sign in to comment.

Related posts by tag