cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U585OIY6QTR ADC reading garbage values

Francis_Fu
Associate II

I am planning to do an aging test which need capture the voltage of a net, but i found STM32U585OIY6QTR report a value about 40 while the actual voltage of ADC channel is close to VREF.

Then i write a simple ADC demo to verify ADC configuration, and run my code on B-U585I-IOT02A board(based on STM32U585AII6Q), it report a correct value, but the same code report a wrong value on my board.I use ADC1  CHANNEL2(GPIOC GPIO_PIN_1) on both board.

The only difference between B-U585I-IOT02A and my hardware is the different VREF i think(B-U585I-IOT02A use 3.3V, but my board use 2.5V).

Is there any difference on ADC usage between STM32U585AII6Q and STM32U585OIY6QTR?

You can find my ioc file and code in attachment, can anyone help me check my configuration?

Image20260316112201.pngImage20260316112207.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks you for the reminder.

Finally, i found the root cause. I use the "erase full chip memory" function of Cube programmer to restore all option byte, and didn't check the actual value of TZEN, so TZEN is opened when i did the test. The correct method to close the TrustZone is set RDP first and close TZEN.

View solution in original post

20 REPLIES 20
jiangfan
ST Employee

Frankly speaking, your descriptions and your results can't match.

As your code did not work on your board, you may do simple test on your board - to measure 0V and Vref first to see if OK or not - to ensure your board (hardware) is OK first.

TDK
Super User

Is your board designed correctly? Is there a cap on VDDA/VREF+ and is the voltage buffer enabled? Show schematic if you can.

If you feel a post has answered your question, please click "Accept as Solution".

Thanks for your reply!

Sure, I fogot to add these message. This ADC channel return a value about 40 when connected to 0V and VDDA, it doesn't change according to channel voltage.

Actually, i have a project with trustzone enabled shows that hardware have no issue, but i don't have the source code.

Thanks for your reply!

Actually, i have a project with trustzone enabled shows that hardware have no issue, but i don't have the source code.

So, this issue more likely to caused by configuration.

According to your explanation, you use same code on B-U585I-IOT02A board (based on STM32U585AII6Q) and your board (STM32U585OIY6QTR), you need to ensure that the ADC channel and GPIO pin (you did not share such information) are the same between 2 boards. So, you may check and ensure same the ADC channel and GPIO pin.

I use ADC_CHANNEL_2 on both STM32U585AII6Q and STM32U585OIY6QTR board.

It is possible that same ADC channel may be mapped to different GPIO pin.

So, it is important to ensure that both ADC channel and GPIO pin (GPIO pin information is unkown) are the same between 2 boards.

Yes, both board use ADC_CHANNEL_2 and GPIOC GPIO_PIN_1.

OK. PC1 can be ADC1_IN2 and/or ADC4_IN2 for both STM32U585AII6Q and STM32U585OIY6Q.

2 tests can be done.

1) if possible, try to toggle PC1 to see if you can see expected signal on you board with STM32U585OIY6Q.

2) test other ADC channel(s) - internal/external to see if the ADC (ADC1 or ADC4) is OK on you board.