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

freertos priority confusion

Setting interrupt priority according to FreeRTOS documentation is an inverted priority sequencing, i.e. lower number is high priority. However in the freeRTOS example provided, Logging is set to priority 1, and BLE 2. This would then set BLE is a lower priority then logging?

I am trying to design a 5 thread system. 1) BLE 2) Logging 3) LEDs 4) SAADC 5) SPI (external Flash). Confused as to how I should prioritize these.

Also in the SDK 14 FreeRTOS example, BLE is no longer in isn't own task? What was the architecture reasoning behind this?

p.s. Note I'm using SDK 12.3 and cannot migrate over to SDK 14 quite now.

Thanks guys,

Parents
  • Hi Dave, In FreeRTOS low priority number means low priority (inverse to what we have on ARM core, where exception priority is higher with lower number).

    You can read more about FreeRTOS priority here. Please note the line below mentioned on that page.

    Low priority numbers denote low priority tasks. The idle task has priority zero (tskIDLE_PRIORITY)
    

    I haven't tried the example in SDK14 myself but quick look shows that the function nrf_sdh_freertos_init creates a task for BLE.

Reply
  • Hi Dave, In FreeRTOS low priority number means low priority (inverse to what we have on ARM core, where exception priority is higher with lower number).

    You can read more about FreeRTOS priority here. Please note the line below mentioned on that page.

    Low priority numbers denote low priority tasks. The idle task has priority zero (tskIDLE_PRIORITY)
    

    I haven't tried the example in SDK14 myself but quick look shows that the function nrf_sdh_freertos_init creates a task for BLE.

Children
Related