|
|
|
|
|
by matheusmoreira
1284 days ago
|
|
This is an awesome guide, thank you! I do have one question though. > Our firmware will be copied to the flash region at offset 0x8000000, but our data section should reside in RAM > therefore our _reset() function should copy the contents of the .data section to RAM. > Also it has to write zeroes to the whole .bss section. I'm confused by this. The linker places these sections on flash memory. How does the compiler know to use section we copied to RAM for the variables in the code? |
|
But the firmware image (that resides on flash), which has .text and .data concatenated, has that .data section in Flash region, obviously. So we have .data section residing in Flash region, but all its addresses in the RAM memory range. That's why it is necessary to copy it over manually.
Hope this is clear... Let me know if not!