STM32F446ZCT6 MCU not in Arduino IDE

Post Reply
Gravedigger_ZA
Posts: 1
Joined: Sun Aug 13, 2023 6:15 pm

STM32F446ZCT6 MCU not in Arduino IDE

Post by Gravedigger_ZA »

Good day.

I have a custom designed board that utilises a STM32F446ZCT6 chip. There are only 3 completed boards, I have two of the three, which the third one will be obtained shortly. (Flopped project, did not make it past the prototype stage) :shock:
I'd like to repurpose those boards, connecting them over USB/Serial, and run my code on it.
It has both 8M and the 32.768kHz crystal connected to it.

How can I write some Arduino code for this chip, or simply put, enable the option to be selected in the Arduino IDE?
I am running the latest Arduino IDE, with the STM32 Arduino Core 2.6.0.
When I select the STM32F4 "board", the board part number only goes to STM32F446VETx.

I did notice that the MCU is in the variants list, as seen here: https://github.com/stm32duino/Arduino_C ... _entry.txt

Bit confused at this stage.
Is the MCU not supported yet, or do I have to generate a "board" file with my MCU, defining the crystals, etc?
I had run Arduino code on a STM32 bluepill clone long ago, so I am familiar with the basics.

If anyone could leave a comment on what I should do, it will be greatly appreciated.
Thanks.

EDIT:
I have dug further on this, apologies on my part, if I misunderstood the whole thing, did not properly read through the Wiki around the variants.
It appears that I need to generate a linker file using STM32CubeMX, and define the generic_clock definition as per wiki, which can also be generated with STM32CubeMX.

It appears that the linker script has not been added to the repo, which tells me that someone did not use this MCU for a board, yet.

Need to go add this stuff to my Arduino downloaded assets, and then I will be able to compile code for this, correct? Not forgetting to update the boards.txt file with my MCU.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32F446ZCT6 MCU not in Arduino IDE

Post by fpiSTM »

Correct ;)
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: STM32F446ZCT6 MCU not in Arduino IDE

Post by ag123 »

A suggestion would be to look at other boards in the F446 families
https://github.com/stm32duino/Arduino_C ... 446V(C-E)T
and make a new variant
https://github.com/stm32duino/Arduino_C ... 28board%29

one of the key things would be

Code: Select all

void SystemClock_Config(void)
if you want to properly make use of the external crystal HSE, i.e. the codes need to be done to setup the PLL multipliers correctly if you want to use an external crystal.
this little python script could help with exploring the possible MNPQ multipliers for the PLL.
viewtopic.php?t=78

other things would be like the ld script that needs to follow that for the F446ZC, in particular the memory layout definitions.
then maybe the pin definitions etc.

and lastly update boards.txt so that you can select that from the menu.
Post Reply

Return to “STM32F4 based boards”