How to read OSD32MP1-RED CPU/SiP Temperature in Debian Image

Forums Reference, Evaluation, and Development Boards OSD32MP1-RED How to read OSD32MP1-RED CPU/SiP Temperature in Debian Image

Viewing 2 reply threads
  • Author
    Posts
    • #11894
      Farid AzharFarid Azhar
      Participant

        As per data sheet, the STM32MP157C devices embed a temperature sensor that is internally connected to ADC2_INP12.
        The OSD32MP1-RED device tree also shows “temperature sensor” at adc2 and jadc2 channels 12.
        I don’t see any kernel attribute to read current temperature value from this sesnor.

        debian@osd1rmk3:~$ ls -al /sys/firmware/devicetree/base/soc/adc@48003000/adc@100
        -r–r–r– 1 root root 4 Oct 22 19:13 ‘#io-channel-cells’
        -r–r–r– 1 root root 16 Oct 22 19:13 compatible
        -r–r–r– 1 root root 3 Oct 22 19:13 dma-names
        -r–r–r– 1 root root 16 Oct 22 19:13 dmas
        -r–r–r– 1 root root 4 Oct 22 19:13 interrupt-parent
        -r–r–r– 1 root root 4 Oct 22 19:13 interrupts
        -r–r–r– 1 root root 4 Oct 22 19:13 name
        -r–r–r– 1 root root 4 Oct 22 19:13 phandle
        -r–r–r– 1 root root 4 Oct 22 19:13 reg
        -r–r–r– 1 root root 4 Oct 22 19:13 st,adc-channels
        -r–r–r– 1 root root 4 Oct 22 19:13 st,min-sample-time-nsecs
        -r–r–r– 1 root root 5 Oct 22 19:13 status
        debian@osd1rmk3:~$

        debian@osd1rmk3:~$ ls -al /sys/firmware/devicetree/base/soc/adc@48003000/jadc@100
        -r–r–r– 1 root root 4 Oct 22 19:13 ‘#io-channel-cells’
        -r–r–r– 1 root root 16 Oct 22 19:13 compatible
        -r–r–r– 1 root root 4 Oct 22 19:13 interrupt-parent
        -r–r–r– 1 root root 4 Oct 22 19:13 interrupts
        -r–r–r– 1 root root 5 Oct 22 19:13 name
        -r–r–r– 1 root root 4 Oct 22 19:13 reg
        -r–r–r– 1 root root 4 Oct 22 19:13 st,adc-channels
        -r–r–r– 1 root root 0 Oct 22 19:13 st,injected
        -r–r–r– 1 root root 4 Oct 22 19:13 st,min-sample-time-nsecs
        -r–r–r– 1 root root 9 Oct 22 19:13 status
        debian@osd1rmk3:~$

        How do I enable and read this internal temperature sensor using echo/cat command?

        Any help much appricated.

      • #11900
        coloradocarlos
        Participant

          Here is a script that works on the BRK to display the ADC temperatures. I found that the temperature device driver is disabled on the RED so you will need to enable it in the device tree for this to work.

          EDIT: I am not sure why stray HTML tags are getting injected in the code block below. You will need to fix this before running the script.

           

          • This reply was modified 3 years ago by coloradocarlos. Reason: weird html chars in code block
          • This reply was modified 3 years ago by coloradocarlos. Reason: Note the odd HTML tags in the post
        • #11906
          Neeraj Dantu
          Moderator

            In addition to inputs from Carlos, please take a look at the temp sensor device tree entries for OSD32MP1-BRK here: https://github.com/octavosystems/OSD32MP1-BRK-device-tree/blob/master/linux-v5.4/stm32mp157c-osd32mp1-brk.dts#L993

             

            Best,

            Neeraj

        Viewing 2 reply threads
        • You must be logged in to reply to this topic.