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

How to generate a hex file from a sample app - Segger embedded studio for ARM (Nordic version)

Hi,

I have setup the Segger Embedded Studio for ARM (Nordic Edition) V5.10d, and managed to compile a sample app from ,

V1.4.2 -> nrf -> samples -> bluetooth -> peripheral uart

I used my NRF52-DK, hooked up the board to my PC and managed to program the app with "Build and Run" option. I quickly verified that the app is working, by installing the "nrf-tool box" on my phone, and run the app, connect to the device named "Nordic-UART_service". Then did setup the terminal emulator (inbuilt on the segger) with 115200/8/N/1 and managed to communicate with the phone's app, both directions, rx and tx.

Apart from the NRF52-DK, I have designed and built our own NRF52832 based board, which was initially tested with a custom serial/UART bootloader. For this, earlier I used Arduino IDE and managed to program the custom board and run the apps.

Now, I need to migrate to the official NRF SDK studio (Segger which I already setup and tested) and use this SDK to compile and build, but then I need a means to program the custom boards.

My custom boards have the following options (hardware wise)

1. Serial RX/TX exposed

2. SWDIO / SWDCLK pins exposed

With these options, how do I compile an app on the NRF-SDK, and download the Hex file (??) on to the custom board?

I have previously managed to program the bootloader + SoftAPI on to my custom board through the SWDIO/SWDCLK interface, provided from the NRF52-DK board.

I would like to know, 

1. Similar to the way I program the bootloader + SoftAPI on to the custom board through the SWD interface, can I program the app on to the custom board?

2. If I want to use a Serial/UART bootloader, where by pressing a button, the custom board goes on to Serial bootloader mode, does the NRF-SDK support to flash/program the app through a serial cable (with a USB 2 serial cable).

Looking forward to hearing from you soon.

Thanks.

regards,

Dinesh.

  • Hi Dinesh,

    It is not clear to me which SDK you want to use. Based on what you write initially it looks like you use / want to use the nRF Connect SDK. But you also mention "SoftAPI", which makes me think of the SoftDevice, which is used together with the nRF5 SDK (though the Nordic BLE controller for NCS is also called SoftDevice controller. Please clarify that first. In any case the getting started guides  has linked to are good places to start.

    1. Similar to the way I program the bootloader + SoftAPI on to the custom board through the SWD interface, can I program the app on to the custom board?

    Programming via SWD is exactlyt he same on the DK as on the custom board. The only thing you need to remember is that the DK has an onboard debugger, which you will not have on your custom board. So you need to hook the SWD lines of your custom board to a debugger (could be the DK) in order to program it.

    2. If I want to use a Serial/UART bootloader, where by pressing a button, the custom board goes on to Serial bootloader mode, does the NRF-SDK support to flash/program the app through a serial cable (with a USB 2 serial cable).

    Yes, you can upgrade via serial DFU. If you use the nRF5 SDK then you should look at the example bootloader. If you are using the nRF Connect SDK you should look at the Zephyr documentationf or that. You sould typically need MCUboot as a bootloader and MCUmgr in order to handle the transport. See Device Management.

    Einar

  • Hello Einar,

    For some reason, I am unable to reply to your message. So I am replying to my own message.

    I think the best way to go ahead would be to use nRF5 SDK with SES, mainly because we are using NRF52832 chip at the moment. In that case, i believe the SoftAPI is required.

    So, I am of the view that, if I hook up the SWD pins on the nRF52-DK on to my custom board's NRF52832 chips SWDIO/SWDCLK pins, I should be able to program the custom board from the NRF52 SDK. This means, when ever an external device is connected to the SWD port on the NRF52-DK, the channel will be routed to the external device, instead of the on board debugger on the DK board. Please advise. 

    Also, could you advise me from where I can download the latest softAPIs for NRF52832, along with their capabilities description.

    And, also, I would like to know, how I can generate/compile my own bootloader and the related settings. I will be interested in compiling the bootloader with options such as (a). Serial bootloader with a button defined to put the device in serial bootloading mode upon reset (b). Over the air bootloader etc.

    regards,

    Dinesh.

  • Hi Dinesh,

    DineshB said:
    I think the best way to go ahead would be to use nRF5 SDK with SES, mainly because we are using NRF52832 chip at the moment. In that case, i believe the SoftAPI is required.

    The SoftDevice is only for the nRF5 SDK, that is correct. But the Zephyr BLE stack (which can be combined with the SoftDevice controller) is available with the NCS. That said, I agree using the nRF5 SDK for a nRF52 product makes sense unless you have a good reason for going with NCS.

    DineshB said:
    So, I am of the view that, if I hook up the SWD pins on the nRF52-DK on to my custom board's NRF52832 chips SWDIO/SWDCLK pins, I should be able to program the custom board from the NRF52 SDK. This means, when ever an external device is connected to the SWD port on the NRF52-DK, the channel will be routed to the external device, instead of the on board debugger on the DK board. Please advise. 

    Yes, that is correct. It is because the debug out port of the DK has a GND DETECT pin, which is used to indicate if the onboard debugger should debug the onboard nRF or the external one.

    DineshB said:
    Also, could you advise me from where I can download the latest softAPIs for NRF52832, along with their capabilities description.

    You can download the S132 SoftDevices here, which is the most commonly used with the nRF52832. However, you typically want to download the nRF5 SDK instead, as that includes the SoftDevice and a lot of supporting libraries and examples etc. You can find SoftDevice documentation here and SDK documentation here.

    DineshB said:
    And, also, I would like to know, how I can generate/compile my own bootloader and the related settings. I will be interested in compiling the bootloader with options such as (a). Serial bootloader with a button defined to put the device in serial bootloading mode upon reset (b). Over the air bootloader etc.

    I recommend you refer to the example bootloader projects, and also the bootloader modules documentation.

    Einar

  • For some reason, I am unable to reply to your message

    Is that because the 'Reply' button is missing - like this:

    (also the vote up/down are missing - blue highlight)

    They should be at the bottom of each post - like this:

    I see this as a frequent problem with the Nordic forum: often, refreshing the page will not help; sometimes, switching the sort order (Oldest / Votes / Newest) will help.

    EDIT

    We're not the only ones seeing this:

    devzone.nordicsemi.com/.../ability-to-reply-missing

Related