This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Migrating from Silabs EFR32 to nRF52840. FreeRTOS or Zephyr?

I have a BLE central application (a form of BLE to LTE bridge) which I have no choice but to redesign due to the dismal state of the supply chain. The original device which has completed both FCC and carrier certifications is based on Silabs BGM13P32 module which is EFR32 (Cortex M4) architecture, running Micrium RTOS. Our only viable BLE module right now is nRF52840 based.

The application must support multiple BLE peripherals concurrently, buffer data into NVM, then transmit it to the cloud via AT command control of the cellular modem. It also needs secure bootloader with FW update over cellular, BLE or USB. All of this has been implemented already, but now needs to be ported.

As a bonus, the new design now needs to act as a Peripheral as well, at least on occasion.

So far, I haven't seen much support from Nordic for Multirole BLE with FreeRTOS. It almost feels like they really don't want us to go there. That said, the existing application architecture demands an RTOS and has a nice abstraction layer for it as well. I could easily port that layer from Micrium to FreeRTOS, but I suspect that I'm going to get in trouble with the SoftDevice.

Are there any good examples around? I've already seen everything in the SDK and on this forum which is why I'm posting (hint: the examples are inadequate).

Should I forget about the nRF SDK and go with Zephyr instead? Do you think it's a better path?

TIA

P.S. In terms of hardware, there is an external I2C RTC w/ battery, and possibly an I2C or SPI OLED display (think SSD1306). No touch panel though.

Parents
  • I would generally pick the nRF5 SDK for the nRF52 series and in your case use FreeRTOS and evaluate the performance since that is the fastest path. The FreeRTOS works reasonably well on the nRF52, the isses that the softdevice has with the FreeRTOS have already been addressed. Zephyr is best for the nRF53. 

    The FreeRTOS integration should work ok with the central+peripheral role. I would start with the central role and validate it and then add the peripheral role for valiation. 

    You are correct that the examples are a bit scattered, so the first step would be to move the freeRTOS ble_peripheral\ble_app_hrs_freertos example for S140/nRF52840 and move it to the ble_app_multilink_central and do the first level of validation, then add the peripheral role in addition for the second level of validation. (Note: The number of folks using mult role is quite low so the examples of the SDK focus on the more common usecases)

    Hope this helps.

  • I started with ble_app_blinky and brought FreeRTOS in to migrate the Central. This is where I'm stuck:

    /usr/local/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: _build/nrf52840_xxaa/nrf_sdh_freertos.c.o: in function `SWI2_EGU2_IRQHandler':
    nrf_sdh_freertos.c:(.text.SWI2_EGU2_IRQHandler+0x0): multiple definition of `SWI2_EGU2_IRQHandler'; _build/nrf52840_xxaa/nrf_sdh.c.o:nrf_sdh.c:(.text.SWI2_EGU2_IRQHandler+0x0): first defined here

    It all seems to hinge on this:

    // <i> This setting configures how Stack events are dispatched to the application.
    //==========================================================
    // <o> NRF_SDH_DISPATCH_MODEL
     

    // <i> NRF_SDH_DISPATCH_MODEL_INTERRUPT: SoftDevice events are passed to the application from the interrupt context.
    // <i> NRF_SDH_DISPATCH_MODEL_APPSH: SoftDevice events are scheduled using @ref app_scheduler.
    // <i> NRF_SDH_DISPATCH_MODEL_POLLING: SoftDevice events are to be fetched manually.
    // <0=> NRF_SDH_DISPATCH_MODEL_INTERRUPT
    // <1=> NRF_SDH_DISPATCH_MODEL_APPSH
    // <2=> NRF_SDH_DISPATCH_MODEL_POLLING

    What is the correct model for FreeRTOS based dispatch?

Reply
  • I started with ble_app_blinky and brought FreeRTOS in to migrate the Central. This is where I'm stuck:

    /usr/local/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: _build/nrf52840_xxaa/nrf_sdh_freertos.c.o: in function `SWI2_EGU2_IRQHandler':
    nrf_sdh_freertos.c:(.text.SWI2_EGU2_IRQHandler+0x0): multiple definition of `SWI2_EGU2_IRQHandler'; _build/nrf52840_xxaa/nrf_sdh.c.o:nrf_sdh.c:(.text.SWI2_EGU2_IRQHandler+0x0): first defined here

    It all seems to hinge on this:

    // <i> This setting configures how Stack events are dispatched to the application.
    //==========================================================
    // <o> NRF_SDH_DISPATCH_MODEL
     

    // <i> NRF_SDH_DISPATCH_MODEL_INTERRUPT: SoftDevice events are passed to the application from the interrupt context.
    // <i> NRF_SDH_DISPATCH_MODEL_APPSH: SoftDevice events are scheduled using @ref app_scheduler.
    // <i> NRF_SDH_DISPATCH_MODEL_POLLING: SoftDevice events are to be fetched manually.
    // <0=> NRF_SDH_DISPATCH_MODEL_INTERRUPT
    // <1=> NRF_SDH_DISPATCH_MODEL_APPSH
    // <2=> NRF_SDH_DISPATCH_MODEL_POLLING

    What is the correct model for FreeRTOS based dispatch?

Children
Related