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
  • We have a statement that we made comparing nRF5SDK and nRF Connect SDK. This gives a bird eye view of the difference you can see in these two SDKs. It is not possible to give you a 1-1 mapping of API of all functionalities as these SDK work on different fundamental concepts of one being baremetal and the other being RTOS based. You still have the nrfxlib in nRF Connect SDK which is comparable to what we had in the nRF5SDK apart from that most of the API is completely different and the amount of time you need to invest in it varies a lot on application to application and the experience of the team you have.

  • Okay. I understand. But is there any chance that any  of the old APIs or examples that was available in nrf5 was removed completely in NCS ?
    I used a the buttonless dfu in nrf5 (ble_app_buttonless_dfu )but I cannot find a similar example in NCS. Can you tell me is it stll available in a different name or if it is completely removed ? If it is available in NCS, could you tell me where I can get the code ?

  • Some of the examples we had in nRF5SDK are also supported in NCS inside ncs\vx.x.x\nrf\samples. Not all the examples are ported and I am not sure if it is in the roadmap even to port all available examples in nRF5SDK to NCS.

    Midhunjac said:
    But is there any chance that any  of the old APIs or examples that was available in nrf5 was removed completely in NCS ?

    A lot of libraries all of drivers (except nrfxlib) and many examples from nRF5 SDK are not available in the NCS. the buttonless_dfu example does not exist in NCS since Zephyr works with MCUBoot and it has its own native support of DFU and samples that are provided around it.

Reply
  • Some of the examples we had in nRF5SDK are also supported in NCS inside ncs\vx.x.x\nrf\samples. Not all the examples are ported and I am not sure if it is in the roadmap even to port all available examples in nRF5SDK to NCS.

    Midhunjac said:
    But is there any chance that any  of the old APIs or examples that was available in nrf5 was removed completely in NCS ?

    A lot of libraries all of drivers (except nrfxlib) and many examples from nRF5 SDK are not available in the NCS. the buttonless_dfu example does not exist in NCS since Zephyr works with MCUBoot and it has its own native support of DFU and samples that are provided around it.

Children
  • So, in a nutshell, I might have to destroy my existing code developed around nrf5 SDK and develop it all from scratch if I am migrating to NCS to achieve the same functionality. Right ?


  • 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.

Related