Using sensor shell with the internal die temp sensor

I am using SDK 3.1.1.  I am trying to use the "sensor get" command with the internal die temp sensor.

In theory, this is all off the shelf software.  I didn't write anything.

The sensor is enabled in the device tree.  It shows up in the 'device list' command.

It does not work with the 'sensor get' command.

I have tried several combinations of settings for some k config values:

 CONFIG_TEMP_NRF5=y

CONFIG_TEMP_NRF5_MPSL=n

CONFIG_NRFX_TEMP=y

Nothing seems to work.  If I comment out the error checking in the sensor_shell.c, it will report the temperature correctly. I fell like the wrong driver API is being accessed.

What kconfig values should I be using or maybe not using?

  

Parents Reply Children
  • Rob, we still need to get the serial logs. We need to understand why enabling MPSL 

    The details that you gave is not enough to narrow down hundreds of possibilities. If possible share your code or code snippets aswell. 

    If you cannot share, then start your application in debugger and let it run until you use 'sensor get' and then let your program hang. At that moment, pause your debugger and let us know function call stack to get more context on what is happening. 

  • I have not written any code.  I am using the die_temp driver supplied with the sdk.  And I am using the sensor shell supplied with the sdk.

    Is there an example of how to use the die temp with the sensor shell anywhere?  It should be possible.  I don't think I am doing anything unusual.

    When the program hangs, it is waiting the the sensor read operation to complete, but it never does. I almost think the the wrong driver is being loaded.  Has anyone every confirmed that this driver works?

  • I think the temp_nrf5 driver waits for a TEMP interrupt, but MPSL owns that peripheral, so the interrupt never fires and the read hangs. That is why it might work if you bypass the error checking.

    For a reference sample, check zephyr/samples/sensor/die_temp_polling.  it uses the same die‑temp sensor path. I have not used this sensor sample myself, but trying to suggest here based on the Kconfig docs

  • I feel like its a catch-22. 

    If MPSL is enabled, the mpls driver for the temp_die is loaded, NOT the sensor API driver. The sensor shell never sees the temp_die sensor, since when it searches the sensor API segment it is not found.

    If MPLS is disabled, the sensor API driver for the temp_die is correctly loaded. The sensor shell sees the temp_die sensor, but calls to it (using "sensor get") hang. (because mpsl is disabled?)

    Maybe this sensor API driver has never worked for the temp_die sensor?

Related