[STM32F427] Beginner interested in porting to F427

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
plunk
Posts: 4
Joined: Thu Oct 05, 2017 1:54 pm

[STM32F427] Beginner interested in porting to F427

Postby plunk » Tue Oct 10, 2017 7:11 pm

Hello,

I have a STM32F427 that I would like to get micropython running on. I am not sure how exactly to go about this - my idea is to take all of the files marked as *F429 in the /ports/stm32/boards/ directory and use those as a template, along with the datasheet for the F427, to add new files that would hopefully just work when I try to build it.

The files I've found (in /master/ports/stm32/boards/) are:

STM32F429_af.csv -> STM32F427_af.csv
STM32F429.ld -> STM32F427.ld
STM32F429DISC/mpconfigboard.h -> STM32F427/mpconfigboard.h
STM32F429DISC/mpconfigboard.mk -> STM32F427/mpconfigboard.mk
STM32F429DISC/pins.csv -> STM32F427/pins.csv

Should this work, or is porting to the F427 more complicated than that? Also, does anybody know of any existing work done to port to the F427 that I am not aware of?

User avatar
dhylands
Posts: 2474
Joined: Mon Jan 06, 2014 6:08 pm
Location: Shuswap, BC, Canada
Contact:

Re: [STM32F427] Beginner interested in porting to F427

Postby dhylands » Tue Oct 10, 2017 7:22 pm

I'd check the _af.csv files. Its quite possible that you'll be able to use the same file for both MCUs.

It's also highly unlikely that you'll need a different .ld file.

Note that STM32F427 would be a poor choice for a board name. You really want a particular board, and not the generic MCU. The pins.csv is intended to be very board specific.

I know of a few '427 boards that I'd eventually like to add support for.

plunk
Posts: 4
Joined: Thu Oct 05, 2017 1:54 pm

Re: [STM32F427] Beginner interested in porting to F427

Postby plunk » Tue Oct 10, 2017 9:36 pm

Thanks for responding. This would actually be for a non-commercial, custom board. Does that make a difference in what would need to be altered from the F429 Discovery files?

User avatar
dhylands
Posts: 2474
Joined: Mon Jan 06, 2014 6:08 pm
Location: Shuswap, BC, Canada
Contact:

Re: [STM32F427] Beginner interested in porting to F427

Postby dhylands » Wed Oct 11, 2017 12:34 am

Not really. I've done a bunch of board definitions for various board which you can fine over here:
https://github.com/dhylands/wiki/wiki/M ... oard-files
Your pins.csv file will be entirely dependent on your custom board. The BIOLOID_POWER board is a example of a custom board that I did. It was based on the STM32F401

The biggest thing to get right will be the crystal frequency in the stm32f4xx_hal_conf.h file.
This will be HSE_VALUE and the corresponding MICROPY_HW_CLK_PLLM, MICROPY_HW_CLK_PLLN, MICROPY_HW_CLK_PLLP and MICROPY_HW_CLK_PLLQ values from mpconfigboard.h

I normally find another board with the same MCU that has the same HSE_VALUE and use that as my starting point. For a different MCU, I'd recommend checking the data sheet and seeing if the formulas for the M, N, P, and Q values are the same. If so you can steal value from a different MCU, or calculate them using the formulas in the datasheet.

Most of the remaining differences will be pin mappings and which peripherals are enabled.

chrismas9
Posts: 42
Joined: Wed Jun 25, 2014 10:07 am

Re: [STM32F427] Beginner interested in porting to F427

Postby chrismas9 » Sun Oct 15, 2017 12:44 am

I use the STM32cube software to setup the clocks. It has a GUI editor that lets you change all the clock sources, multiplexers, multipliers and dividers and see the affect on the core, USB and peripheral clocks.


Who is online

Users browsing this forum: fpp and 2 guests