Pin confuguration STM32F429

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.
Post Reply
User avatar
Posts: 5
Joined: Tue Jul 29, 2014 1:55 pm

Pin confuguration STM32F429

Post by Pikachu » Thu Dec 11, 2014 2:37 pm


i want to change the pin configuration of micropython. Micropython is running on the STM32F429i board and i want to see some led blinking.
I made some new folder in /micro-python/stmhal/boards and named it STM32F429. I put in this folder the same files as in the STM32f4DISC folder.

in the mpconfigboard.h file i changed:

Code: Select all

#define MICROPY HW_LED3                          (pin_G13) // red
#define MICROPY HW_LED4                          (pin_G14) //blue
in the stm32f4xx_hal_conf.h i changed:

Code: Select all

#define STM32F429xx
in the pins.csv file i changed:

BOARD ?= STM32F429

and i put some python code in the file (main.c):

Code: Select all

"# -- put your code here!\r\n"
"import pyb\n"
"def blink():\n"
"	pyb.LED(3).on()\n"
"	pyb.LED(4).on()\n"
"	pyb.delay(300)\n"
"	pyb.LED(3).off()\n"
"	pyb.LED(4).off()\n"
"	pyb.delay(300)\n"
"for i in range(20):\n"
"	blink()\n"
if(reset_mode ==1 || res  == FR_NO_FILESYSTEM){
However i cant see any led blinking :(
What am i doing wrong?

thanks for your help

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

Re: Pin confuguration STM32F429

Post by dhylands » Thu Dec 11, 2014 8:06 pm

I suspect that the clocks for PORTG will need to be enabled. See this code for Ports A-D ... #L191-L194

I'd probably do something like:

Code: Select all

#if defined(__GPIOG_CLK_ENABLE)
The actual define for the G port is in amongst a bunch of other ports as well: ... _ex.h#L333

Posts: 1
Joined: Thu Apr 16, 2015 6:45 pm

Re: Pin confuguration STM32F429

Post by jaroslav » Fri Apr 17, 2015 10:59 am

Does it mean, that on ... 2/PF259090 micropython works? I read that there is a problem with usb connection from linux. ( ... -STM32F429)

The prototyping board seems powerful and relatively cheap. With micropython it could be suitable for my students at highschool. What do you think? I'm a little experienced with micropython on pyboard and teensy.



Posts: 53
Joined: Thu Mar 05, 2015 1:12 pm
Location: Germany

Re: Pin confuguration STM32F429

Post by Tetraeder » Tue Apr 21, 2015 6:07 am

At the time you can flash micropython on the STM32F429i with the build-enviroment of the "STM32F4DISCO". Problem is that the USB_OTG connector "CN6" is currently not working, so you have no access to micropython over USB. But you can set in the main.c a UART-instance for the REPL prompt. Further you have to edit pins.csv to get access to all pins.....And there are not tested all functions, for example PWM is working at the moment.

summed it is still much to do.

Its a great board, specifically because of the touch display. Would be great if the REPL prompt running on the display and you can interact with micropython with a connected keyboard on the USB_OTG connector.

But i think the pyboard would be the best choice for your students...

Post Reply