Help migrating from NRF5 SDK to NRF Connect SDK

Hi, I have a fully functional software running on a NRF module. The application is built on a nrf5 sdk. I would like to migrate the entire application to NRF Connect SDK. Is there a document or anything from where i can get help to understand how this is done ? Can someone help me ?

Parents Reply Children
  • Not all of your current application based on nRF5SDK needs to be discarded. BLE API is different, but you will be able to find a close cousin API in nRF Connect SDK BLE API to the one in the Softdevice API. 

    There is no fstorage or fds in nRF Connect SDK, so you need to port that to settings. You need to change the way you initiated the peripherals and use Zephyr device drivers instead.

    • All you application logic and state machine can still be re-used.
    • All the logic inside the device driver callbacks can be reused. 
    • The way you communicate to the sensors connected to your product, pre and post processiing of data logic can still be re-used.
  • How do i flash the program to my custom board ? I have a custom board with nrf52840. I have been using nrf5 sdk based application and flashing it with the segger studio. I flash my board using the nrf52DK.
    I recently migrated my application to NCS.I have made a dts file and couple of other board related files. When i try to flash using 'west flash' , it says flashing is successful. But it does not really work. Am I doing something wrong ?Can you please guide me through the steps to flash the device successfully ?

  • you can use nrfjprog, nrf Programmer or any other debugger that supports SWD and Nordic device to be able to flash to the custom device. Changing from nRF5SDK to NCS only changes the firmware but it does not change the method of the debugger connecting to the device and flashing it. Since NCS does not support SES natively, you can still use nRF52DK connected to your custom board and flash using any programming tool.

    Midhunjac said:
    When i try to flash using 'west flash' , it says flashing is successful. But it does not really work. Am I doing something wrong ?

    You can try comparing the the memory of your custom board (use nrfjprog --readcode" to see if your program is flashed correctly. The nRF programmer and "nrfjprog  --program --verify" can also be used to verify your firmware being successfully flashed to the device.

    Midhunjac said:
    it says flashing is successful. But it does not really work.

    Maybe the program is flashed successfully and the firmware is not able to start correctly or faults quite early? Did you enable logs or see any logs to check if your application starts? How can you check if there are faults in the early stage of the application?

  • I am using nrfjprog. But that one didnt work. So, i tried overriding the default with jlink and it seems to work fine.I wonder what i am doing wrong with nrfjprog. Am i missing some arguments ?

    Did you enable logs or see any logs to check if your application starts

    can you please tell me how to do this ? If i enable logging. where will i be able to see the logs? How can i see the logs ? Sorry if my questions are too dumb. I am new to this. Thanks for your patience.

  • There are number of ways you can have your serial logs streamed out of your device. Please check the Logging module in the system that you can use to configure using UART or RTT and listen through a serial terminal on the computer. 

    When you have enabled the logs correctly then just after reset, Zephyr will log some system information pretty early in the boot phase and you can know that atleast the firmware started running. If you expected more logs than what you see, then most likely there is some other unexpected behavior in your new firmware that you need to debug using a debugger.

Related