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

BLE with FREERTOS - nrf_drv_gpiote_out_set/clear triggers Assertion failed

Hi, 

We are working with integrating LoRa to our nRF52840 with BLE and FreeRTOS. To be sure that LoRa worked as expected, we configured and tested LoRa on nRF52840 dk and observed it was functioning. Now, when we are moving the LoRa code to BLE and FreeRTOS code on nRF52840 dk, we get assertion failed error on nrf_drv_gpiote_out_set and sometimes on clear. I'm wondering if its the softdevice for BLE that can effect the GPIO configuration? 

This is the error on terminal: 

 app: ASSERTION FAILED at /****/***/***SDK/external/freertos/portable/CMSIS/nrf52/port_cmsis.c:273


Would appreciate any guidelines on how to solve the problem! 

Best Regards,
Hamza

  • Hi

    Just to clarify one thing. Are you talking about Coded PHY, the Long Range option that came with BLE v5.0 or are you referring to the LoRa LPWAN protocol developed by Semtech? Because there are no Nordic products supporting the LoRa protocol, as the nRF52840 only has a 2.4GHz radio, while the LoRa protocol runs at sub-GHz frequencies.

    What SDK version are you using, and what example project are you basing your project off of? I need some more information on what exactly you're trying to do in order to help you out.

    Best regards,

    Simon

  • Dear Simon, 

    I have connected LoRa LPWAN Transceiver which I communicate with through SPI and has its own protocol and modem. I am using SDK version 17 and built the project from example ble_app_hrs_freertos. I get this error when I want to communicate with the LoRa Transceiver through SPI or Gpio set/clear. This error occurs when I start the FreeRTOS scheduler, but works without the RTOS. 

    Regards,
    Hamza

  • Thank you for explaining. Can you upload a snippet of code showing me how you are initializing SPI communication, and how the task you're using to control the SPI process is set up? Also, what pins are you using for communication with the LoRa transceiver?

    Best regards,

    Simon

  • Hey Simon, 

    I managed to solve the issue as it was more related to freertos. Now I have another issue that only occurs when I switch from bare metal to Freertos based on the same example. It's difficult to describe the error but It triggers when I try to execute a callback function on LoRaMac functions. I get the following error: 

    The processor has made an unaligned memory access.

    I am developing the software upon the same example I stated before. 

    Regards,
    Hamza

  • Hamza_HK said:
    It triggers when I try to execute a callback function on LoRaMac functions.

     This occurs in the nRF application, correct? Is it when trying to communicate with the LoRa module over SPI you see this error? Are you able to upload a debug log so we can get a better picture of the entirety of this application maybe?

    Best regards,

    Simon

Related