stm32-data icon indicating copy to clipboard operation
stm32-data copied to clipboard

Incorrect memory sizes tracking issue

Open Dirbaio opened this issue 2 years ago • 11 comments

If you've got a chip where the stm32-metapac/memory.x feature generates a wrong memory.x please post here.

Identified cases:

  • STM32G030K8 flash generates 32kb but has 64kb
  • STM32WL55JC ram generates 12kb but has 64kb

Dirbaio avatar Nov 01 '23 21:11 Dirbaio

STM32WB55VG ram generates 128kb but has 192kb.

TaylorCarpenter avatar Jan 27 '24 04:01 TaylorCarpenter

STM32G030C8 flash generates 32kb but has 64kb

phycrax avatar Jan 29 '24 16:01 phycrax

stm32g491re memory.x shows 32kb RAM, chip should have 112kb (3 blocks of 80, 16, 16)

trepidacious avatar Feb 03 '24 17:02 trepidacious

STM32F303ZE says it has 64k but only has 48kb https://github.com/embassy-rs/stm32-data-generated/issues/1 nope, it's indeed 64k? stm32u5a5zj says it has 32k but it has 2.5mb or something

Dirbaio avatar Feb 05 '24 18:02 Dirbaio

Chip Type memory.x DS Tab.2 Note
STM32F411RE RAM 64K 128 KB

markdown if need

|     Chip    |  Type  | memory.x | DS Tab.2  |        Note        |
| :---------: | :----: | :------: | :-------: | :----------------: |
| STM32XDDDXX |  RAM   |  ddd K   |  ddd KB   |                    |
|             | FLASH  |  ddd K   |  ddd KB   |                    |

eZioPan avatar Feb 07 '24 15:02 eZioPan

Chip Type memory.x DS Tab.2 Note
STM32H5[67]xx[IG] RAM 256 K 640 (256+64+320) KB

eZioPan avatar Mar 05 '24 07:03 eZioPan

Chip Type memory.x actual Note
STM32F051R8T6 RAM 7 K 8 KB #437

Dirbaio avatar Mar 12 '24 12:03 Dirbaio

Chip Type memory.x actual Note
STM32F756ZG RAM 320K 256K

64 K less since DTCM starting at 0x20000000 is not used, and RAM starts at 0x20010000.

LorenzoCucchi avatar Mar 15 '24 20:03 LorenzoCucchi

Chip Type memory.x DS Tab.2 Note
STM32L4A6ZG RAM 320K 256K

Opposite issue to the one above: SRAM correctly starts at 0x2000_0000 up through 0x2004_0000, but the last 64K aren't available. According to the doc, there's a second SRAM2 memory device with 64K size, mapped both to 0x1000_0000 (which is present in the generated STM32L4A6ZG.json, although it has size 0), and to 0x2004_0000

adri326 avatar Mar 22 '24 14:03 adri326

STM32F746ZG variant presents the same issue as the STM32F756 variant described before in this thread.

Chip Type memory.x Actual Note
STM32F746ZG RAM 320K 256K

64K less because DTCM should not be counted. RAM starts at 0x20010000 not at 0x20000000.

Consider separating SRAM1 (240K) and SRAM2 (16K).

spcan avatar Mar 25 '24 17:03 spcan

As mentioned in the Matrix chat, seeing some incorrect sizes for the STM32U5 Family.

From the reference manual (RM0456):

Flash configuration: RM0456, 7.3.1, Table 51., 52., 53.: image image image

SRAM configuration: RM0456, 6.3.1, Table 45 image

Also, from the product page: image image image image image image

I haven't studied other STM32 MCUs this closely, but is it unusual to have so many SRAM devices?

Up to seven SRAMs are embedded in the devices

I'm working on a fix, but thought I'd post this before getting ahead of myself.

wagcampbell avatar Apr 11 '24 19:04 wagcampbell

https://github.com/embassy-rs/stm32-data/commit/3eab5e1161312efc394d2a238ba8b93e174846a1 fixes all issues reported here and more. I believe all stm32 memory maps are correct now.

If you find a new mistake, please open a new issue.

Dirbaio avatar Jun 08 '24 01:06 Dirbaio