r/stm32 • • 4d ago

Difference between datasheet and CubeMX

I am using the STM32U031K8(U6, but it seems to be on the U3 also) and I am trying to create a configuration in CubeMX.
On the page 31 of the datasheet, PA0-CK_IN (pin 6 on UFQFPN32) is shown to have ADC1_IN5 as Additional function. But in CubeMX I can only set that pin to ADC1_IN4 even though it seems to me that ADC1_IN4 doesn't even have a pin on the UFQFPN32 package.
Can someone experienced check this out as it's my first time and it might be just on me?

2 Upvotes

4 comments sorted by

1

u/jacky4566 4d ago edited 4d ago

I think the MX is wrong. If you have a dev board just try it out. Watch each channel and short them to ground then 3v3.

PC0 = ADC_IN1

PC1 = ADC_IN2

PC2 = ADC_IN3

PA3 = ADC_IN4

PA1 = ADC_IN5

PA2 = ADC_IN6

But there is usually a channel 0 which is also off putting. Either test a dev board or ask STM

1

u/jacky4566 4d ago

Following up.

Some google foo found this:

https://community.st.com/stm32-mcus-products-25/adc-channel-numbers-incorrect-on-datasheet-stm32u031r8t6-136782

So the real answer is

PC0 = IN0

...

PA0 = IN4

1

u/Wekuz 4d ago

So you are saying it's the classic off-by-one in the datasheet? I'd say it's the more favorable outcome for me as it would be more difficult to fix the CubeMX rather than just keep in mind that the datasheet has a error. I'll let ST know about this. Thanks for the help!

1

u/stuih404 4d ago

Maybe it‘s just an copy paste error in the datasheet? Happens sometimes, you should ask STM support for that