2
\$\begingroup\$

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:

formular
formular

AN2606:

formular formular

Difference:

formular formular

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.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ 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? \$\endgroup\$ Commented Jun 19, 2019 at 12:21
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – Melissa123
    Commented Jun 19, 2019 at 12:33
  • \$\begingroup\$ @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. \$\endgroup\$ Commented Jun 19, 2019 at 17:41
  • \$\begingroup\$ Ok, perhaps I should have said the first person to notice it at all. \$\endgroup\$ Commented Jun 19, 2019 at 18:40

3 Answers 3

0
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ 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. \$\endgroup\$
    – Melissa123
    Commented Jun 24, 2019 at 9:05
  • \$\begingroup\$ @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. \$\endgroup\$
    – JimmyB
    Commented Jun 24, 2019 at 9:21
0
\$\begingroup\$

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.

\$\endgroup\$
-2
\$\begingroup\$

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).

\$\endgroup\$
4
  • \$\begingroup\$ Thank you! I wasn't able to "see the forest for the trees" :) The US standards are new to me. Thank you very much. \$\endgroup\$
    – Melissa123
    Commented Jun 19, 2019 at 11:46
  • \$\begingroup\$ TIL about the kibibyte. Never heard of that before. \$\endgroup\$
    – efox29
    Commented Jun 19, 2019 at 12:01
  • 1
    \$\begingroup\$ ... and we can all probably thank the marketing departments of hard-drive manufacturers for the 'kibibyte'. \$\endgroup\$
    – brhans
    Commented Jun 19, 2019 at 12:09
  • \$\begingroup\$ @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. \$\endgroup\$ Commented Jun 19, 2019 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.