zephyr stm32u5g9j-dk2 adc not function
-
I used the zephyr\samples\drivers\adc\adc_sequence example from Zephyr 4.2.0.
-
I created a new app.overlay file in the root Vmakelists.txt directory with the following content:
/ { aliases { adc0 = &adc1; }; }; &vbat1 { status = "okay"; io-channels = < &adc1 5 >; }; -
I compiled using this command:west build -p always -b stm32u5g9j_dk2 --sysbuild .
-
Then I supplied 1V to the PA0 pin (silkscreen labeled PWM/D6), and the log is as follows:
-
2684 = 2162mV
1788 = 1440mV
1571 = 1265mV
1532 = 1234mV
1492 = 1202mV
adc@42028000, channel 12, 5 sequence samples:
2092 = 1685mV
1660 = 1337mV
1571 = 1265mV
1532 = 1234mV
1532 = 1234mV
-
Subsequently, I changed the supply voltage to 2V, and the log is as follows:[16:27:39.509] RX←◆- adc@42028000, channel 5, 5 sequence samples:
0 = 0mV
1068 = 860mV
1404 = 1131mV
1492 = 1202mV
1492 = 1202mV
adc@42028000, channel 12, 5 sequence samples:
636 = 512mV
1315 = 1059mV
1492 = 1202mV
1492 = 1202mV
1532 = 1234mV
