ADC and DAC not working

Viewing 2 reply threads
  • Author
    Posts
    • #13351
      Julius SalamonJulius Salamon
      Participant

      Hello,

      I made a custom image for the brk board like described in the CubeMX tutorial.
      The image is running normaly on the brk board and i can also launch M4 programs.
      The problem is that the ADC and DAC are not working even though I enabled them in cube MX.
      When the boot process is finished linux prints: vdda: disabling. I think thats the reason for the problem.
      I try to fix this by setting ldo5 to regulator-always-on manualy in the device tree. But it ignores that.

      I also tried the following device tree https://github.com/octavosystems/OSD32MP1-BRK-device-tree/tree/master/linux-v5.10-r0.
      Here the regulator-always-on works and also the adc is running as expected. But the DAC is not working, probally because it is not enabled in the devicetree. I dont want to learn how to define the peripherals by hand in the devicetree so I did not test if the DAC would work in this case.

      Is there a solution for this problem?
      How can I prevent vdda from disabling or how can I reanable it?

      I also attached my devicetree file.
      I would be very gratefull for any help.

      Best Regards
      Julius Salamon

    • #13359
      Neeraj Dantu
      Moderator

      Hey Julius,

      Using the device tree is the recommended way to control power rails of the PMIC. See example here for EV1 board: https://github.com/STMicroelectronics/linux/blob/v5.15-stm32mp/arch/arm/boot/dts/stm32mp15xx-edx.dtsi#L175.

      Please also take a look at the EV1 implementation of ADC and DAC here: https://github.com/STMicroelectronics/linux/blob/v5.15-stm32mp/arch/arm/boot/dts/stm32mp15xx-edx.dtsi#L108 and https://github.com/STMicroelectronics/linux/blob/v5.15-stm32mp/arch/arm/boot/dts/stm32mp15xx-edx.dtsi#L146

      Best,

      Neeraj

    • #13384
      coloradocarlos
      Participant

      (I tried to post this response last week, but it didn’t seem to go through.)

      By default, regulators are disabled if there are no consumers. The idea is if a regulator is not supplying power to anything (consumers), it can be safely turned off.  This is what you are seeing in dmesg. Once a consumer is enabled, the regulator is also re-enabled.

      If you have debugfs enabled, then you may be able to see where vdda is being used in the regulator tree:

      # less /sys/kernel/debug/regulator/regulator_summary

      I suspect that vdda is not configured as a supply or the device tree node is not status=okay. Can you post your adc and dac nodes in your device tree?

      Carlos

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