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

nrf51822 development using SES, S110 SoftDevice on a Mac

Total noob here using SES on a Mac to build BLE peripheral (S110) firmware for an nRF51822-based device with SDK v15.

So far I've been able to get the generic portions of the application working. I can read button state changes. I can blink LEDs. I'm using the nRF5 DK board as my programmer. It connects to the target board using the debug out port and a "plug of nails" connector. The Segger debugger in SES is working. I can compile, flash, erase, debug, etc. all from SES.

But... My next challenge is to get the BLE peripheral functionality working. I'm a bit lost on how to tell SES to flash the S110 SoftDevice along with my code. I've found several messages that seem to indicate that the nRF51 line more-or-less stopped with SDK 12.x and that there is no native support for the 51 line in SES and / or in SDK v15.

Does anyone have a recipe, or any suggestions? Would I be better off abandoning SES and trying to set up a different tool chain or use a different IDE on this Mac?

Thanks in advance,

-S

Parents
  • Hrm... Looks like my assumption of the SoftDevice is wrong - based on old information.

    What is the appropriate BLE peripheral SoftDevice for use the the nRF51822 and the v15 SDK? Or is there no such thing?

  • There is no support for the nRF51 device on sdk 15. The last sdk that supported the nRF51 device was SDK 12.3. You should take a look at the S130 softdevice located under components/softdevice/s130 in SDK 12.3. SES automatically loads the softdevice onto the board when you download the application to the nRF52 device. You can check this by opening a SES project, right clicking on your Project in the top left corner of SES, clicking "Edit Options..." & going down to the Loader tab. Clicking on Additional Load File[0] will show you the path to the softdevice hex file that is loaded to your device.

    Do you have an nRF51 or nRF52 dev kit? If I were you, I would either get another nRF52 dev kit, use the latest SDK 15 & use SES or try using GCC to compile SDK 12.3 examples on your 51 board. You will most likely have less difficulties if you choose the first option.

    We also have getting started tutorial videos with SES that could be helpful. Be sure to take a look at our Infocenter documentation here too.

Reply
  • There is no support for the nRF51 device on sdk 15. The last sdk that supported the nRF51 device was SDK 12.3. You should take a look at the S130 softdevice located under components/softdevice/s130 in SDK 12.3. SES automatically loads the softdevice onto the board when you download the application to the nRF52 device. You can check this by opening a SES project, right clicking on your Project in the top left corner of SES, clicking "Edit Options..." & going down to the Loader tab. Clicking on Additional Load File[0] will show you the path to the softdevice hex file that is loaded to your device.

    Do you have an nRF51 or nRF52 dev kit? If I were you, I would either get another nRF52 dev kit, use the latest SDK 15 & use SES or try using GCC to compile SDK 12.3 examples on your 51 board. You will most likely have less difficulties if you choose the first option.

    We also have getting started tutorial videos with SES that could be helpful. Be sure to take a look at our Infocenter documentation here too.

Children
  • Hi Bjorn,

    I now have SDK 12.3 and arm-none-eabi-gcc installed on the Mac. I've been able to compile the very simply program that I originally had working in SES. (I copied the "blinky" project and replaced the code in main.c with my own.) The project compiles cleanly and the "make flash" command appears to load it to my board. However, it does not appear to work - the lone LED on my board does not blink.

    The same code worked as expected when compiled and installed using SES. LED blinked. Button clicks were detected.

    The makefile I am using is in the pca10028 directory, and it appears to be expecting to work with a nRF51422 rather than a nRF51822. Is this possibly the problem? If so, what do I need to do to fix this?

    How do I access the "printf" output from JLink (or some other tool)? The data appeared in the debug console in SES so I know that it's available somehow. I just don't know how to get to it from the shell (CLI). Any suggestions?

    ---

    Now, a small rant with some constructive criticism:

    The documentation for the nRF5 SDK indicates that it works with both the 51 and 52 variants of your products. See: https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF5-SDK

    The web site also makes it appear the SES is the preferred way to develop for nRF51. See:

    Note the last item in the table: SEGGER Embedded Studio IDE. If SES only works with SDK versions 14 and later, and nRF51 support stopped with 12.3, then this is wrong and misleading.

    When you go to the "Downloads" tab, that page shows two options, 12 and 15. The text describing these options discusses various SoftDevices, but it makes no reference to the actual hardware that is supported by them. This is incredibly confusing to someone who is not deeply versed in Nordic's products. It would make a great deal more sense if the downloads were segmented by hardware, THEN by preferred SoftDevice image.

    I have the nRF51 DK and the production units I am working to program are using the nRF51822, so there is no option to switch over to the nRF52 DK. Full stop. I'm stuck with nRF51 and I'm a Mac user.

    In your response, you say, "If I were you, I would either get another nRF52 dev kit, use the latest SDK 15 & use SES" but in the previous paragraph you say, "The last sdk that supported the nRF51 device was SDK 12.3."  I take your response to mean something like:

    "If you have the option of switching over to the nRF52 chip, then I would recommend that you re-design your hardware to use that chip, then get another nRF52 dev kit, use the latest SDK 15 & use SES. If not, then you're stuck with SDR 12.3 and you will need to use GCC, makefiles and all that stuff from 1997."

    Is that about the size of it? Sounds like I'm going to have to go the GCC / makefile route.

    If so, then it would be useful to have something in the documentation that explains how to install or build a full tool chain for each hardware platform (nRF51 and nRF52) on each development platform (Windows, Mac OS X, and Linux). Your site has some of some of these, but much of the documentation is outdated, referring to older versions of the SDKs, older IDEs that have been deprecated, and older versions of the core tool-chain components (GCC, etc.).

    How about you guys put something together like:

    • Tutorial: Getting Started With nRF51 Development On Windows 10
    • Tutorial: Getting Started With nRF52 Development On Windows 10
    • Tutorial: Getting Started With nRF51 Development On Mac OS X
    • Tutorial: Getting Started With nRF52 Development On Mac OS X
    • Tutorial: Getting Started With nRF51 Development On Linux
    • Tutorial: Getting Started With nRF52 Development On Linux

    Have the tutorials start from a blank system and walk the user through everything: installing the SDK; installing the IDE or command line tools; modifying the environment as necessary; installing the Segger tools used to program and debug; compiling the samples; and flashing the compiled, working application onto the DK board.

    Doing this, and keeping it up to date, would be a HUGE benefit to your developer community.

    End of rant.

  • After beating my head against GCC and Makefiles for a while, I went back and did some additional searching. I finally ran across this post, which seems to indicate that it is (or was) possible to use SES with 12.3 to build for the nRF51 family.

    I followed the tutorial in that post and have been able to compile the "ble_app_uart" example and flash it and the associated s130 SoftDevice. However, something appears to go wrong during the initialization of the application (or the SoftDevice) as the debugger never attaches. Here's the output from the console:

    Preparing target for download
    Executing script TargetInterface.resetAndStop()
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Downloading ?s130_nrf51_2.0.1_softdevice.hex? to J-Link
    Programming 1.9 KB of addresses 00000000 ? 000007bf
    Programming 103.9 KB of addresses 00001000 ? 0001afdf
    J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (2048 bytes)
    J-Link: Flash download: Total time needed: 0.392s (Prepare: 0.045s, Compare: 0.281s, Erase: 0.043s, Program: 0.013s, Verify: 0.000s, Restore: 0.007s)
    Download successful
    Downloading ?ble_app_uart_pca10028_s130.elf? to J-Link
    Programming 30.3 KB of addresses 0001f000 ? 0002696b
    Programming 0.0 KB of addresses 0002696c ? 0002698f
    J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
    Download successful

    And here's what I see on the screen:

    Any idea what I may have done wrong? Apparently others have managed to use the (somewhat outdated) recipe to make make (an older version of) SES work with 12.x.

  • I don't have it working, but I think I know at least part of the problem. The tutorial requires that set a Section Placement Macros value.

    If you don't do this (and you don't try to add the soft device binary) the application will load and try to run - it just fails (silently - freezes) when it attempts to initialize the BLE stack. But the debugger attaches as it should.

    If you do set the Section Placement Macros values, the application code is shifted down (you can see by looking at the Memory Usage display) and apparently the boot loader doesn't find it. (Or something like that - I'm out of my element here.)

    I am using the latest version of SES, and the v12.3 SDK. The tutorial was written for an older version of SES and so probably includes steps that are now unnecessary or omits steps that are necessary.

    For whatever its worth: the Memory Usage display doesn't appear to indicate that the soft device has been loaded - the first block of memory is clear.

    Anyone have a guess what's going on?

  • Still going. I initially had some problem with the thumb_crt0.o output, presumably generated by the changes to the thumb_crt0.s file. I assume that was due to changes since the tutorial was written and simply removed the changes. Not sure if that's the issue, but the changes are still causing errors:

    1> Linking ble_app_uart_pca10028_s130.elf
    1> Output/ble_app_uart_pca10028_s130 nrf51422_xxac/Obj/thumb_crt0.o: In function `memory_set':
    1> /Applications/SEGGER Embedded Studio for ARM 3.40/source/thumb_crt0.s:172: undefined reference to `__fs_data_load_start__'
    1> /Applications/SEGGER Embedded Studio for ARM 3.40/source/thumb_crt0.s:173: undefined reference to `__fs_data_start__'
    1> /Applications/SEGGER Embedded Studio for ARM 3.40/source/thumb_crt0.s:174: undefined reference to `__fs_data_end__'
    Build failed

    Nordic - please take the time to add full and proper support for SDK 12.3 to SES or at least publish an updated tutorial. This is becoming aggravating.

  • Hi ssokol,
     
    Sorry for the delayed response. If you take a look at the nRF51422 51822 product pages, you notice that the main difference is that the 51422 supports ANT in addition to BLE, while the 51822 supports BLE & 2.4 GHz proprietary communication.
     
    You can either use a UART or RTT based logging tool. For Windows I prefer tera term, but since you are using a Mac, something recommended here should work fine. For RTT based logging, you can either do this directly via the Segger Embedded Studio (SES) debug terminal or via a RTT viewer application (see link for more info). 
    I would definitely recommend taking a look at our SES youtube tutorial, especially the CMSIS Configuration wizard. With the CMSIS configuration wizard installed, open it up, open the nRF_Log folder, make sure that either NRF_LOG_BACKEND_SERIAL_USES_RTT is true or NRF_LOG_BACKEND_SERIAL_USES_UART is set true. Also make sure that NRF_LOG_ENABLED is set true.
     
    Regarding your constructive criticism:
     
    I agree that the downloads tab should be updated to make it simpler to use. I will mention this internally. For us in tech support, it is quite intuitive, but that is only because we have worked with Nordic products for a long, long time. I fully understand that for a beginner, it would be very helpful to simplify the documentation even further. We do have a compatibility matrix here in our Infocenter for each of our devices that could be useful.
     
    Sorry that I did not notice that you included the Development filter when you made the question. I was wrong about using "GCC, makefiles and all that stuff from 1997." Take a look at this link for importing Keil projects into SES. I would not recommend using gcc & eclipse for example, as many developers have had issues with this. I noticed that you have already found a blog post related to importing SES projects, which is a very good idea in my opinion.
     
    I fully agree that it would be very useful to make some more development tutorials & keep them updated. We have already discussed this internally, but I will mention it again. Thank you very much for the constructive criticism!
Related