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

Can i use sd_ble_gatts_hvx function in freertos custom thread?

the priority of my custom thread is lowest priority. but it's not possible to call hvx function.

in ble_app_hrs_freertos example,

a sd_ble_gatts_hvx function is called in timer service routine context.

that's ok. because interrupt service routine.

i know that a interupt servie routine context same to main in freertos.

So, is it possible to only call a sd_ble_gatts_hvx function in main context or interrupt context????

if it is not, please show me example.

  • I just tested it and it seems to work:

    main.c

    Is there something different with your setup?

  • Thanks for reply. I tested your example code. and it's good.

    but in my project, the hardfault is occured.

    So, i checked again my code. before calling hvx function, my code use a floating point operation.

    my project base is nRF5_SDK_11.0.0-2.alpha_bc3f6a0.

    I chaned a base sdk to nRF5_SDK_11.0.0_89a8197.

    then hardfault disappeared.

    i don't know the cause.

    in nRF5_SDK_11.0.0-2.alpha_bc3f6a0 , do you have a FPU problem in freertos?

    i would like to know the cause.

  • We have seen problems with FPU and FreeRTOS with SDK 0.9.2 and SoftDevice S132 v1, but not with SDK 11.0.0-2.alpha and S132 v2.0.0-7.alpha. I am not able to reproduce the error here.