Skip to content

Register address of ADC12_COMMON is incorrect for STM32U5xx #624

@mrlahe

Description

@mrlahe

In the resulting generated pac at build/stm32-metapac/src/chips/stm32u535xx/pac.rs the register address of ADC12_COMMON is set to 0x4204_8308, but according to the reference manual (RM0456), page 146, and the fact that it should be master ADC base address + 0x300 according to page 1368, chapter 33.7.1 and 33.7.2. this should be 0x4204_8300. This value seems to stem from the downloaded sources at sources/headers/stm32u5XXxx.h

I couldn't understand why I was unable to enable vref/vbat/tempsensor in the ADC1 peripheral until I noticed this error. Manually setting the ADC12_COMMON address to the correct value fixed my issue.

This issue affects the main branch of embassy, effectively rendering the embassy-stm32::adc driver useless for the entire U5 family of chips until fixed.

I'm not sure how to make a pull request that would manually override this value as they come from fetched sources, so it would have to be a pull request directly to stm32-data-generated? But then again, that would be overwritten and forgotten the next time a new tag is generated. Please let me know what to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions