This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
reject programs with invalid memory layout #142
Labels
difficulty: medium
Somewhat difficult to solve
priority: medium
Medium priority for the Knurling team
status: needs PR
Issue just needs a Pull Request implementing the changes
type: enhancement
Enhancement or feature request
Projects
it's not uncommon to get the
memory.x
file (which describes the memory layout of the device) wrong when you have to write it manually (e.g. the HAL doesn't provide one). The file looks like this:If you get
FLASH
wrong then probe-rs will error with a reasonable error message so that's covered.If you get
RAM
wrong, however, probe-rs will say nothing (probably because it doesn't write to RAM when loading the program).What can go wrong there is: you specify a LENGTH greater than what the amount of RAM the device has. The result is: your stack pointer (whose initial value is stored in the vector table) starts outside physical RAM so your program won't even start.
If LENGTH is smaller than the amount of RAM the device has then nothing bad happens but you end up under-using the device resources.
What we should do:
The text was updated successfully, but these errors were encountered: