This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Zephyr API to read the nRF5340 die temperature

Hello,

I am looking for some some nRF5340 example code that reads the nRF5340 die temperature using zephyr APIs.

I've looked at previous posts but I could only find this one https://devzone.nordicsemi.com/f/nordic-q-a/56171/how-to-get-die-temperature-on-nrf52832-using-zephyr from 10 months ago that stated none existed. I am hoping someone, somewhere musty have done something similar.

Thank you.

Kind regards

  • Hi, 

     

    Learner said:
    Yes, I confirm my overlay file nrf5340pdk_nrf5340_cpuapp.overlay does contain  the "temp", because your blinky example appcore overlay file also contains it. The only difference I called my overlay file *_cpuapp.overlay while you called yours *_cpunet.overlay. Why and what is the significance of the naming convention?

    the project will only pick up the overlay file if it matches the board you've selected.

    You can have several other .overlay files, but they will not be picked up unless you either specify them explicitly or that they match the same board as you configure for.

     

    Example: If you configure the project for board nrf52840dk_nrf52840, it will look for "nrf52840dk_nrf52840.overlay".

     

    Learner said:
    But in the example you sent me, in the blinky_appcore project you have an overlay file called nrf5340pdk_nrf5340_cpunet.overlay and contains "temp" which suggests that board nrf5340pdk does have a temp component. In fact your example ran, read and printed temperature values.

    I should have deleted that file from that specific folder to avoid confusion, my apologies. That file was not included when you configured for nrf5340pdk_nrf5340_cpuapp, as it does not match the current board you were selecting. If you look at the product specification, the application core does not have access to the temp peripheral.

     

    Kind regards,

    Håkon 

  • Hi Hakon,

    First, can you please get someone to look at why I cannot reply to your latest response because there is no "Reply" button to click on.

    I should have deleted that file from that specific folder to avoid confusion, my apologies.

    I think this is the root cause of my problems. DisappointedUnamused

    That file was not included when you configured for nrf5340pdk_nrf5340_cpuapp, as it does not match the current board you were selecting.

    My overlay file is nrf5340pdk_nrf5340_cpuapp.overlay and contains "temp" and my board is nrf5340pdk_nrf5340_cpuapp, so in my case my overlay file was included hence the error I am seeing.

    So, the solution to the problem I am seeing is NOT to have "temp" in my overlay file in the _appcore project. I will delete any reference to "temp" in my overlay file I have in my *_appcore project and see if this solves the problem. I will update you shortly.

    Kind regards

    Mohamed

  • I tested this code and found that after opening the net core RTT log, the app core serial terminal can output the temp value. If close the RTT window and reset 5340 DK, the log in the serial terminal stops at the "App core" and no temp value is output, why is this?

    Best regards,
    Devin

  • Hi,

     

    Learner said:
    First, can you please get someone to look at why I cannot reply to your latest response because there is no "Reply" button to click on.

    Try refreshing the window (F5) and see if it pops up then. We have seen this with some browsers, and we are investigating this issue.

     

    Kind regards,

    Håkon

  • Hi Hakon,

    The F5 refresh trick used to work for me but not anymore.

    The "Reply", "Verify Answer" and "More" buttons do appear after some responses but not other. For instance, I can reply to this latest response of yours but not recent previous ones. It is bizarre.

    By the way I managed to get the MCU die temperature to work but with some anomalies similar to What I reported three days ago when I ran your example. In fact someone else Devin Li reported similar problems. Was I  meant to receive his response?

    Could you please answer these four questions that I asked 3 days ago.

    Q1/ Why is it that the App core does not start getting temperature readings until the Segger J-Link RTT viewer is connected?

    Q2/ What is this line doing? It seems to kick start the communication between App and Net Cores. 

           uint32_t ret = ipm_send(ipm_tx_handle, 1, 0, NULL, 0);

    Q3/ I expected to see both the message "TX ID <id>" and "RX ID <id>" but I don't, I only this "RX ID 0"

    Q3/ Please explain the chronological sequence of events that is taking place between the App Core and the Net core.

    Thank you.

    Kind regards

    Mohamed

Related