What is status of newer hardware definition API?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

What is status of newer hardware definition API?

Post by jgriessen » Fri Dec 01, 2017 5:40 pm

I noticed a Hardware API being discussed: viewtopic.php?f=3&t=2545&hilit=api&start=50

Is that ready to use on a STM32F401 new platform with a QFN chip that has need to delete some pins compared to G30TH?
Another question: "Is the micropython/ports/stm32 dir full of .c files what acts on a board definiton, and where should board definitions go now?",
since "stmhal" port is renamed to "stm32" to better reflect the MCU that it targets."


meanwhile, I am making a new stm32 board definition based on the G30_TH as a guide -- as done for pyb versions in the past.
Are there any gotcha's I need to know?

I am using v1.9.3 release.
John Griessen blog.kitmatic.com

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

Re: What is status of newer hardware definition API?

Post by dhylands » Fri Dec 01, 2017 6:26 pm

The board definition files that come with Micropython can be found in ports/stm32/boards/BOARD_NAME. I have several others over here: https://github.com/dhylands/wiki/wiki/M ... oard-files (including G30TH).

Some of the hardware API stuff can be found in the machine module for stm32.

The biggest thing to look out for when creating a new board definition is to make sure that you get the crystal frequency correct (HSE_VALUE from stm32f4xx_hal_conf.h) and then that the MCIROPY_HW_CLK_PLLx constants are setup properly for that crystal frequency.

Most of the work is going through the board configuration files and making sure that everything is setup properly for your particular board.

User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

Re: What is status of newer hardware definition API?

Post by jgriessen » Fri Dec 01, 2017 7:35 pm

The biggest thing to look out for when creating a new board definition is to make sure that you get the crystal frequency correct (HSE_VALUE from stm32f4xx_hal_conf.h) and then that the MICROPY_HW_CLK_PLLx constants are setup properly for that crystal frequency.
Thanks. I used stm32cube program to check and set constants, so now to translate that into mpconfigboard.h lines in micropython/ports/stm32/boards/PYFLEX_F401.
John Griessen blog.kitmatic.com

Post Reply