Closed gl-sergei closed 6 years ago
@xobs
There is one more bug in the DOC or in the code.... But probably in both places. DOC is saying:
Set SS to the starting page number to load your program at. .....
Page sizes are 1024 bytes. To maintain compatibility with earlier programs, you may want to set this value to 0x00046fb0, which will explicitly cause programs to be loaded at offset 0x4000.
Which is wrong because 4 * 1024 is 4096 or 0x1000 instead of 0x4000. So, I should put 0x106fb0 instead of 0x00046fb0 to my program to be loaded at offset 0x4000.
But then the bug in toboot chiming in. It actually doesn't multiply that value by 1024, but rather it multiplies it by 4096 (0x1000). Which makes DOC example work :)
All very good points. And you're right, my math was very much off.
API v2.0 should correct the issue with the documentation.
Fixed in 71110977be89c42694b948c6a05a8ada2bd772f5
I'll post an issue so that someone better than me at english could fix it.
I think it might be more correct to replace "The EFM32HG has 21 interrupt vectors" with "The EFM32HG has 21 external interrupt vectors".
Referring external interrupt handlers by labels (like VectorN) looks confusing as neither EFM32HG manual nor ARM manual 1 doesn't do that. After some googling I found that it probably comes from ChibiOS where corresponding code was copy-pasted from. Maybe replace labels with offsets or IRQ line numbers?
It would be great to add that in order to implement toboot configuration in Gecko SDK, one must hack on
startup_efm32hg.c
file and append something like this to the vectors array: