rust-embedded / book

Documentation on how to use the Rust Programming Language to develop firmware for bare metal (microcontroller) devices
https://docs.rust-embedded.org/book/
Apache License 2.0
1.08k stars 173 forks source link

Improved hardware.md chapter. #361

Closed armaxri closed 10 months ago

armaxri commented 10 months ago

If you follow the documentation blindly, you will end up in a trap with strange compiler warnings. This fix adds a warning about that.

armaxri commented 10 months ago

Actually it uses a different target, which makes everything a little bit confusing. The book talks about the STM32F3 and you have to install the Cortex M3 (the correct) dependencies and in this chapter it jumps to the Cortex M4F... I'm checking everything right now as an after midnight project, so it will take a few days but maybe there will be a bigger PR later.

adamgreig commented 10 months ago

The STM32F3 has a Cortex-M4F CPU core, so thumbv7em-none-eabihf is the right target, which is what this page means when it says

For the STM32F3DISCOVERY board used for the examples in this book, use the thumbv7em-none-eabihf target.

It is a bit confusing that the "STM32F3" has a Cortex-M4F, but it's just how it is - the STM32F4 is also Cortex-M4F, the STM32F1 is Cortex-M3, the STM32H7 is Cortex-M7, but the STM32H5 is Cortex-M33 and so forth.

armaxri commented 10 months ago

Thanks a lot! That got me really confused but now I'm back on track! Thanks!