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

Integrate SoftDevice Stack into IAR Workbench 7.10.1 for ARM

Hi, I am trying to evaluate the NRF51822 with S110 softdevice stack. My IDE is the IAR Workbench 7.10.1 for ARM. I downloaded the most recent s110 version (s110_nrf51822_6.0.0) which contains a folder of include files and the s110_nrf51822_6.0.0_softdevice.hex file. My question is what am I supposed to do with the .hex file? How do I integrate that into my overall application?

thank you.

  • If you install the SDK making sure to select "Custom installation location", or use the zip of the SDK, you should find an example IAR project in C:\Nordic Semiconductor\nRF51 SDK_v5.1.0.36092\nrf51822\Board\nrf6310\s110\ble_app_hrs\iar. This shows a full example of how the softdevice can be used from an IAR project.

    I'd also recommend you to take a look at the User Guide for the kit you're using, for instance this document for the Development Kit. This explains some of the concepts involved, for instance that flashing a softdevice to the chip is completely independent of flashing the actual application.

  • I need an understanding of why the SoftDevice requires independent flashing from the application using it? We would like to be able to do a one time programming on these devices for our product once they go out the door, but this adds a step. I will dig deeper, but if I can get an answer here quicker would be nice. We are also an IAR shop, not Keil, so for the examples in the DEMO kit, I'll be building those in IAR since that will be my target development environment.

    Thanks

  • This should possibly work:

    A. Download srecord from: srecord.sourceforge.net/download.html

    B. Convert the Intel HEX file to binary.

    srec_info.exe s110_nrf51822_7.1.0_softdevice.hex --intel
    
    Format: Intel Hexadecimal (MCS-86)
    Data:   000000 - 0007BF
            001000 - 01520B
    

    ...

    srec_cat.exe s110_nrf51822_7.1.0_softdevice.hex --intel -offset -0 -o s110.bin --binary
    Output file: s110.bin
    

    C. In IAR EW for ARM, include the binary in the linked output:

    Linker > Input:
      Keep symbols: _s110_image
      Binary image: $PROJ_DIR$\s110.bin
      Symbol: _s110_image
      Section: .s110_section
      Align: 4
    

    In the linker configuration file (to place the binary image):

        define region S110_region  = mem:[from 0x00000000 to 0x00015FFF];
    
        "S110_Firmware":
        place in S110_region { section .s110_section };
    

    D. Make sure that C-SPY runs the BLE-stack init:

    • Debugger > Extra options: --drv_vector_table_base=0x0

    See devzone.nordicsemi.com/.../

  • Thanks, this worked for me using IAR 7.50.3, s132 and SDK11 with a small modification:

    The size of the s132 softdevice binary overlaped with the ROM region defined in the linker file for the example that I used (ble peripheral hrs example with FreeRTOS). The ROM start in the example was defined to 0x1c000, but the converted .bin file had an additional region from 0x1c000 to 0x21ed3. Not sure what this region contains, but it would have been overwritten during download from IAR anyway and I therefore removed it from the .bin file.

    Linker region: define region S132_region = mem:[from 0x00000000 to 0x0001BFFF];

  • This is what I did. Doesnt really integrate the softdevice into your application, but flashes it as part of a build event.

    • Using SDK v13.0.0 and IAR EWARM v8.10.1

    • Write a batch file that will flash your softdevice with the hex image provided from within the SDK

    • Run that batch file as a post build action from within IAR. Options... -> Build Actions -> Post-build command line

    The batch file contents are: softdeviceHexFlashfromIAR.png

    NOTE: You need to have nRF command line tools installed. See www.nordicsemi.com/.../33444

Related