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

nrf_temp_read() or sd_temp_get(&t) fault with S132

Hello,

I try to read temperature with embedded sensor. Works well with example but crash when using SoftDevice 3.0.0 on nRF52328. Was working with SoftDevice 2.0.0.7.alpha.

Difficult do find information about this functions in the online documentation.

Thanks.

Parents
  • Hi,

    The softdevice function sd_temp_get() is documented in the infocenter.

    I tested it using the ble_app_uart example in SDK 12.2 with S132 v3.0.0 softdevice, and it works fine. How do you use it in your application? Did you get any error codes in return when calling the function?

    Best regards,

    Jørgen

  • No just replace nrf_temp_read() by sd_temp_get().

    Remove also other stuff NRF_TEMP-> ...

    //Without S132
    float temp;
    
    //   NRF_TEMP->TASKS_START = 1; /** Start the temperature measurement. */
    //  NRF_TEMP->EVENTS_DATARDY = 0;
    //  temp = nrf_temp_read()/4.0;
    //  NRF_TEMP->TASKS_STOP = 1; /** Stop the temperature measurement. */
      
    //With S132
     
    int32_t  t;
    sd_temp_get(&t);
    temp = t/4.0;
    
Reply
  • No just replace nrf_temp_read() by sd_temp_get().

    Remove also other stuff NRF_TEMP-> ...

    //Without S132
    float temp;
    
    //   NRF_TEMP->TASKS_START = 1; /** Start the temperature measurement. */
    //  NRF_TEMP->EVENTS_DATARDY = 0;
    //  temp = nrf_temp_read()/4.0;
    //  NRF_TEMP->TASKS_STOP = 1; /** Stop the temperature measurement. */
      
    //With S132
     
    int32_t  t;
    sd_temp_get(&t);
    temp = t/4.0;
    
Children
No Data