17.1 User Actions

This section explains the code modifications required after generating code using MCC.

Developers must call the app_idle_task() API within vApplicationIdleHook() to enable periodic Persistent Data Storage and RF calibration. Persistent Data Storage stores data in non-volatile memory (Flash), ensuring that application and stack parameters, such as peer connection information, are saved. The Idle Task executes at the lowest priority level in FreeRTOS

  1. During project compilation or build, a compile-time error prompts developers to call app_idle_task() and app_idle_updateRtcCnt(RTC_Timer32CounterGet()).
    Figure 17-1. Compile-time Error
    Figure 17-2. User Action Required
  2. Users are required to open freertos_hooks.c file and add #include "definitions.h"

  3. Users are required to open freertos_hooks.c file and add API app_idle_task()

    Figure 17-3. freertos_hooks.c
  4. Users are required to comment out “#error” in app_user_edits.c file

    Figure 17-4. app_user_edits.c
  5. Initiate build and user will be able to build successfully

    Figure 17-5. Build Successful
Note: User action is required only the first time the code is generated.

Additional User Action when Low Power is Enabled

Developers are required to call app_idle_updateRtcCnt(RTC_Timer32CounterGet()) in vApplicationTickHook(). This API call is used to compensate for FreeRTOS Timer when in Sleep mode.
Figure 17-6. app_user_edits.c
  1. Users are required to open freertos_hooks.c file and add API app_idle_updateRtcCnt(RTC_Timer32CounterGet())

    Figure 17-7. freertos_hooks.c