How exactly to compile a new variant?

Post here first, or if you can't find a relevant section!
Post Reply
AidanofVT
Posts: 1
Joined: Sun May 29, 2022 2:16 pm

How exactly to compile a new variant?

Post by AidanofVT »

My board is the STM32F722ZET6. I can see this model, minus the trailing '6', in Arduino_Core_STM32/variants/STM32F7xx. However, in the Arduino IDE, no F722 boards are offered to me at all. I'm guessing that this is because the point of those 'generic' variants is to be adapted into more specific variants, and nobody has gotten around to making any F722 boards yet.

I have looked at the instructions for making new variants (https://github.com/stm32duino/wiki/wiki ... nt-(board)), and I found them unclear. I gather that I'm supposed to take the six files in the generic variant folder, make a couple alterations, add the ldscript.ld file, and compile. But compile them into what? And put the result where? If someone has an example of the exact GCC command used, or, better yet, a video of the entire process, that would be fantastic.

On a somewhat related note: how cross-compatible are boards from the same family? I've been trying to upload a blink example using random F7 boards, and they aren't working at all. If that sort of thing normally does work, that might mean that my problem doesn't stem from now having the exact board variant in the IDE, and it colud save me some trouble.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: How exactly to compile a new variant?

Post by ag123 »

you could start with a 'generic' variant.

the art of making a variant is, make a copy of the structure all the files in the variant. e.g. use generic as example
then make something similiar and update boards.txt similarly.

then one of the more important things is if you want to use HSE - your external crystal.
you need to make a working SystemClock_Config(void) that is part of the variant.
copy from an existing variant as a start, then configure the PLL multipliers so that your board will run at the correct system clock speed for your crystal frequency.

a python script that can be used to explore clock configs can be found here
viewtopic.php?f=41&t=78

as an example, you can take a look at how i've done it
https://github.com/stm32duino/Arduino_C ... /pull/1552
https://github.com/stm32duino/Arduino_C ... /pull/1585
^ this is for this board
https://github.com/WeActTC/MiniSTM32H7xx
it is already part of the core if you are using version 2.1 and above.
I think weact still sell that board today
https://www.aliexpress.com/item/1005001475058305.html
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: How exactly to compile a new variant?

Post by fpiSTM »

Post Reply

Return to “General discussion”