cortex-m-quickstart icon indicating copy to clipboard operation
cortex-m-quickstart copied to clipboard

Using probe-rs to initialise memory.x

Open romixlab opened this issue 4 years ago • 5 comments

Wouldn't it be great to automatically create a proper linker configuration based on the selected chip? It seems that this information can be easily pulled from yaml files in probe-rs/targets/. Probably someone is already thought about it, in that case just close this right away.

romixlab avatar Jun 30 '21 12:06 romixlab

I’m fairly certain there would need to be changes to cargo generate to make something like this work.

https://github.com/cargo-generate/cargo-generate/issues/17

rubberduck203 avatar Jun 30 '21 14:06 rubberduck203

Some way of getting values out of yaml files will also be required, maybe it's easier to create a cargo tool tailored specifically for that task...

romixlab avatar Jun 30 '21 15:06 romixlab

Oh! Hey! Some of the required functionality landed in cargo-generate v0.6.0!

https://github.com/cargo-generate/cargo-generate#template-defined-placeholders

rubberduck203 avatar Jun 30 '21 16:06 rubberduck203

Great! That can be used for improvements.

As for the memory size part, probably some scripting functionality from cargo-generate will be required. I wonder what would be better, add scripting to cargo-generate or create a special tool specifically for creating embedded projects.

romixlab avatar Jul 02 '21 09:07 romixlab

I don’t know much about probe-rs. Couldn’t we use the same user provided value for memory.x and the probe-rs config?

Of course, that assumes adding probe-rs support to the quickstart.

rubberduck203 avatar Jul 02 '21 12:07 rubberduck203