nviennot / stm32-emulator

GNU General Public License v3.0
345 stars 35 forks source link

Register blocks can overlap on STM32 #2

Open Ristovski opened 1 year ago

Ristovski commented 1 year ago

With STM32L0x1, the SYSCFG and COMP register blocks do overlap which produces the following error: Overlapping register blocks between SYSCFG and COMP.

https://www.st.com/resource/en/reference_manual/rm0377-ultralowpower-stm32l0x1-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

image

In another document, I saw even more register blocks overlapping. Difference table between STM32F303xB and STM32L4 series image

I have no idea how this overlapping is supposed to work, as I have not looked into it much.

nviennot commented 1 year ago

Ah, indeed. Can you do some research on how this is supposed to work? So we can implement something correct

jpboucher commented 1 year ago

The registers do not actually overlap. SYSCFG and COMP are simply inside the same memory block. If you look at their respective addresses you can see that they have different memory offsets which do not overlap. In that document if you go to the SYSCFG register map section you can see that the offset is 0x00 to 0x0C while for COMP the offset is 0x18 to 0x1C.