# Problems with understanding memory map STM32F446RE

I have a problem with the understanding of the memory map of the STM32F446RE.

In the Datasheet is the system memory (0x1FFF0000 - 0x1FFF7A0F) 30,51kb big.

But in the AN2606 the system memory is only 29kb big. But why?

I calculated this way: (kibibyte refers to the answer from Elliot Anderson)
Datasheet:

AN2606:

Difference:

So if my calculation is correct, what is in the other 1,51kbyte or 2,247 kbyte?

Update: For those who are interested, I got an answer from ST.

The whole caluclation is in kB --> 1024Byte

The flash memory has an information block, which contains the option bytes, so the calculation doesn't add up.

• You are probably the first person in the world to complain about this discrepancy. I think it's a simple mistake, perhaps an earlier version of the bootloader was of different length, and someone has forgot to update one of the documents. Does it make a difference in any conceivable use scenario? – berendi - protesting Jun 19 '19 at 12:21
• I don't think it makes any difference. I was just wondering. I mean those 30kb are reserved for the STM-bootloader and you can't modify this "area" of memory . I tried or try to understand "everything" about the bootloader and just saw this. – Melissa123 Jun 19 '19 at 12:33
• @berendi I didn't see anything in this question that made it sound like a complaint. The OP asked a simple, straight-forward question without making any judgement about the authors of the two documents. If you are somehow affiliated with ST, we mean no offense. – Elliot Alderson Jun 19 '19 at 17:41
• Ok, perhaps I should have said the first person to notice it at all. – berendi - protesting Jun 19 '19 at 18:40

## 3 Answers

The actual size of the bootloader is completely meaningless. You should never have to worry about it, and I doubt that STM will ever commit to guarantee any definitive size. It may well be different for each chip revision. The fact that the memory just above the bootloader is declared "reserved" indicates that STM reserves the right and space to change/extend the bootloader in the future. Again, you shouldn't be concerned with that; just treat the bootloader like every other section of "reserved" memory: Don't touch it, and don't rely on anything being readable from it.

• Thanks for your answer. :) I was just wondering because I calculated this memory size in 2 different ways and it doesn't match the informations from ST. – Melissa123 Jun 24 '19 at 9:05
• @MelissaWetter Yeah, I know. As others have commented: The real size is likely handled sloppily throughout documents because a) it may change repeatedly with new chip revisions and b) it makes no difference to the customer/user/developer. – JimmyB Jun 24 '19 at 9:21

For those who are interested, I got an answer from ST.

The whole caluclation is in kB --> 1024Byte

The flash memory has an information block, which contains the option bytes, so the calculation doesn't add up.

I think there is a subtle difference in meaning of the words here. I think the memory mapped is telling you that approximately 30 KiB is reserved for the bootloader while the application note is saying that the bootloader actually uses 29 KiB of memory. The "other kbyte" is memory that has been reserved for the bootloader but does not contain code.

By the way, you should be careful with the unit "kbyte" here. Published standards in the U.S. state that the prefix "kilo" should never be used to mean $$\2^{10} = 1024\$$. The standard prefix for $$\2^{10}\$$ is kibi. So, 1000 bytes is 1 kbyte (1 kB) but 1024 bytes is one kibibyte (1 KiB).

• Thank you! I wasn't able to "see the forest for the trees" :) The US standards are new to me. Thank you very much. – Melissa123 Jun 19 '19 at 11:46
• TIL about the kibibyte. Never heard of that before. – efox29 Jun 19 '19 at 12:01
• ... and we can all probably thank the marketing departments of hard-drive manufacturers for the 'kibibyte'. – brhans Jun 19 '19 at 12:09
• @brhans Yes, a big motivation was a series class-action lawsuits starting back in '03. The difference between a gigabyte and a gibibyte is significant and there were many angry consumers. – Elliot Alderson Jun 19 '19 at 12:16