Can I get the temperature of the nrf5340 SOC via sd_temp_get just like nrf52 ?
Can I get the temperature of the nrf5340 SOC via sd_temp_get just like nrf52 ?
It does not seem like this is supported through the Zephyr API, but you can use the NRFX API: https://github.com/nrfconnect/sdk-hal_nordic/blob/v1.5.1/nrfx/drivers/include/nrfx_temp.h.
I created a temperature sample using this API, check it out here: https://github.com/simon-iversen/sdk-nrf/tree/temperature/samples/peripheral/temperature
Best regards,
Simon
thanks,i solve it. by the way, can i call nrfx_temp_measure() function directly from appCore?
I got some more insight into this.
In NCS v1.5.0, there was added an HCI command for reading the temperature:
You can also use the function mpsl_temperature_get() (this was replaced by the function ble_controller_temp_get())
hello,simon
After I have tested nrfx_temp_measure, I can normally read the temperature data, but some of the devices in my hand will have the phenomenon that the read temperature is 0. After I reset it by NVIC_SystemReset function, the read value of nrfx_temp_measure function is still 0.Unable to recover. Do you have any directions?In addition, ask whether the NVIC_SystemReset function can reset netcore?
Hi, I have taken over this case while Simon is on leave. Sorry for the long delay.
The '0' you read could perhaps be because the measurement is not yet ready. Have you tried using nrfx_temp_result_get()? Or have you tried nrfx_temp_measure() in blocking mode?
Simon said:You can also use the function mpsl_temperature_get()
Have you tried this suggestion? From the documentation: "This function will block until the temperature measurement is done."
Please also feel free to share your code. We could try to reproduce this behavior.