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

LESC and FreeRTOS

Does LESC is supported in FreeRTOS?

I init BLE modules in FreeRTOS tasks. After LESC is enabled, system returns error in nrf_crypto_rng_init(). Looks like nrf_stack_info_overflowed() isn't for FreeRTOS. I thought this API check the main stack, not the stack of task. 

I am wondering if there is any example of FreeRTOS with LESC enabled?

Parents
  • You need to try the non interrupt variant of cypto library to make it work with FreeRTOS. There are issues to make crypto interrupt variant work with RTOS environment.

  • Hello -

    I am also trying to get LESC working on FreeRTOS. Based on suggestions here, I am now linking the hard-float/no-interrupts variant of the libnrf_cc310_0.9.12.a library. In my application I am setting the same crypto sdk_config.h options as the ble_app_multirole_lesc app. We are using more RAM than the typical example app, but otherwise I don't believe our compiler/linker settings are different:

    arm_architecture="v7EM"
    arm_core_type="Cortex-M4"
    arm_endian="Little"
    arm_fp_abi="Hard"
    arm_fpu_type="FPv4-SP-D16"
    arm_linker_heap_size="61440"
    arm_linker_process_stack_size="0"
    arm_linker_stack_size="8192"

    With these options I am also getting the stack overflow in nrf_stack_info_overflowed(). We are initializing the BLE modules in our application based on the ble_app_hrs_freertos example.I have tried increasing our linker stack size to 16384, but that doesn't seem to make any difference.

    When I run the ble_app_hrs_freertos app, which also works as expected, I looked at the values being compared here in nrf_stack_info_overflowed:

    if (NRF_STACK_INFO_GET_SP() < NRF_STACK_INFO_BASE)
    

    The values are:

    0x2003e000 < 0x2003fed8
    
    In my app (which fails) the values are:

    0x2003e000 < 0x20009d38
    

    I am using a 20 KB stack size in the FreeRTOS task that initializes BLE. What do I need to change in my configuration/code to get past the stack overflow check successfully?

    Regards,

    Brian

Reply
  • Hello -

    I am also trying to get LESC working on FreeRTOS. Based on suggestions here, I am now linking the hard-float/no-interrupts variant of the libnrf_cc310_0.9.12.a library. In my application I am setting the same crypto sdk_config.h options as the ble_app_multirole_lesc app. We are using more RAM than the typical example app, but otherwise I don't believe our compiler/linker settings are different:

    arm_architecture="v7EM"
    arm_core_type="Cortex-M4"
    arm_endian="Little"
    arm_fp_abi="Hard"
    arm_fpu_type="FPv4-SP-D16"
    arm_linker_heap_size="61440"
    arm_linker_process_stack_size="0"
    arm_linker_stack_size="8192"

    With these options I am also getting the stack overflow in nrf_stack_info_overflowed(). We are initializing the BLE modules in our application based on the ble_app_hrs_freertos example.I have tried increasing our linker stack size to 16384, but that doesn't seem to make any difference.

    When I run the ble_app_hrs_freertos app, which also works as expected, I looked at the values being compared here in nrf_stack_info_overflowed:

    if (NRF_STACK_INFO_GET_SP() < NRF_STACK_INFO_BASE)
    

    The values are:

    0x2003e000 < 0x2003fed8
    
    In my app (which fails) the values are:

    0x2003e000 < 0x20009d38
    

    I am using a 20 KB stack size in the FreeRTOS task that initializes BLE. What do I need to change in my configuration/code to get past the stack overflow check successfully?

    Regards,

    Brian

Children
Related