Dev
Dev

Reputation: 493

STM32F103RB and STM32F4 with STM32 Arm Programming for Embedded Systems

I want to buy the book STM32 Arm Programming for Embedded Systems

The examples of this book are done with STM32F4 (ARM)

But I have a board which is STM32F103RB (ARM)

Does the code done for STM32F4 compile and execute as well as if I copy them for my STM32F103RB ?

Thank you for your help

Upvotes: 3

Views: 1985

Answers (1)

Morten Jensen
Morten Jensen

Reputation: 5936

There are subtle differences between the STM32F4 and your STM32F1, and some code will not work 1:1 on both processors.

You should be able to find a cheap development board for the STM32F4 however, if you want to buy and follow the book.

This paper from ST describes migration from STM32F1 to STM32F4 and you should be able to learn the specific differences from that: https://www.st.com/content/ccc/resource/technical/document/application_note/group0/e9/c4/6b/99/4e/d3/4e/a0/DM00325582/files/DM00325582.pdf/jcr:content/translations/en.DM00325582.pdf

EDIT:

All platform independent C code should work the same on both platforms. I don't know the book, but if it is using some of the more advanced HW-features on the STM32F4, you may find that they are not present on the STM32F1 or work with other configurations.

Talking with sensors via I2C / SPI etc. should be pretty straight forward on both MCUs (microprocessors) though and I would expect the instructions in the book to be transferable from STM32F4 to STM32F1.

There are HW features that are only present on STM32F4, but for the most part, it's just the C support library that has a slightly different API. E.g. enum's are called something slightly different, or there are only one XXX-peripheral instead of two etc.

But since a development board for the STM32F4 costs ~10 dollars on eBay, I would advise you to just buy that one instead, if you want to feel more sure that you can follow the book 1:1.

Upvotes: 1

Related Questions