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

sd_mutex_acquire executed twice

Hello,

in my test I executed sd_mutex_acquire twice in sequence without releasing it. However, I did not get a "NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN" on the second time. What went wrong ?

I am using SoftDevice S132 v4.0.2 on nRF52832.

Best regards,

Parents
  • Hi,

    I tried to reproduce this, but I got NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN(=8192) the second time. Could you post some code that shows how you are testing this?

    Code snippet:

    nrf_mutex_t my_mutex;
    uint32_t return_code;
    
    return_code = sd_mutex_new(&my_mutex);
    NRF_LOG_INFO("sd_mutex_new() return code = %d \r\n",return_code);
    
    return_code = sd_mutex_acquire(&my_mutex);
    NRF_LOG_INFO("sd_mutex_acquire() return code = %d \r\n",return_code);
    
    return_code = sd_mutex_acquire(&my_mutex);
    NRF_LOG_INFO("sd_mutex_acquire() return code = %d \r\n",return_code);
    
Reply
  • Hi,

    I tried to reproduce this, but I got NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN(=8192) the second time. Could you post some code that shows how you are testing this?

    Code snippet:

    nrf_mutex_t my_mutex;
    uint32_t return_code;
    
    return_code = sd_mutex_new(&my_mutex);
    NRF_LOG_INFO("sd_mutex_new() return code = %d \r\n",return_code);
    
    return_code = sd_mutex_acquire(&my_mutex);
    NRF_LOG_INFO("sd_mutex_acquire() return code = %d \r\n",return_code);
    
    return_code = sd_mutex_acquire(&my_mutex);
    NRF_LOG_INFO("sd_mutex_acquire() return code = %d \r\n",return_code);
    
Children
No Data
Related