modm-io / modm-devices

Curated device data for all AVR and ARM Cortex-M devices
https://blog.salkinium.com/modm-devices
Mozilla Public License 2.0
50 stars 28 forks source link

Fix STM32H7 dual-core device files #83

Open chris-durand opened 2 years ago

chris-durand commented 2 years ago
chris-durand commented 2 years ago

I am trying to compile a blink example for a Nucleo H755ZI-Q. Compilation fails without the fix because the Peripheral enum has the entry OpenampCortex-m4 which is not a valid identifier.

chris-durand commented 2 years ago

Please don't merge yet. I have found another issue. There is no Cortex-M4 with a double-precision FPU but the device file has cortex-m4fd.

chris-durand commented 2 years ago

The memory layout is not correct for size g devices. The flash address space is not contiguous on those devices. Flash bank 0 ends at 0x807F FFFF whereas bank 1 starts at 0x8100 0000. The reason for this design choice is to have the same boot address for the M4 core at 0x8100 0000 on both 1MB and 2MB flash devices. It is intended to use one bank for each core. The boot addresses are configurable by writing option bytes, though.

salkinium commented 2 years ago

Then the flash memories should be separated and given to each core separately, the merging will then tag it per core.

chris-durand commented 2 years ago

Then the flash memories should be separated and given to each core separately, the merging will then tag it per core.

You mean we should assign a core to each half in the device file? Also for size i devices?

This would hard-code the default usage in the device file. There is nothing that prevents you from reconfiguring the core boot addresses in the option bytes or only using a part of a bank for one core. It's a user choice and not a property of the hardware.

I am fine with that limitation for modm but a potential external user of the device files might not. (Is there actually someone using modm-devices for another purpose that is not modm?).

salkinium commented 2 years ago

Good points. Then we need to split the Flash into two areas, not sure what will break in modm if anything.