What is the status of MicroPython on STM32F407 Discovery board?

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
arqeco
Posts: 2
Joined: Mon May 18, 2015 12:05 pm

What is the status of MicroPython on STM32F407 Discovery board?

Post by arqeco » Mon May 18, 2015 12:42 pm

Hello,

It´s my first post in this forum. MycroPython seems an amazing project. But to get one pyBoard here in Brazil it may take from a few days to 5 months due to the customs sometimes opens the parcels one by one. It´s a risk when time matters.

I would like to try MicroPython as soon as possible and STM32F407 Discovery boards are available now here in Brazil. http://www.farnellnewark.com.br/ferrame ... 276,0.aspx

Whats is the currente status of MicroPython on the STM32F407 Discovery board? Is it ready to run, or does it need some porting? How hard can it take to do this porting? My background is a bit of C programming on PIC16F (and a smaller bit of MC68HC11 assembler many years ago). I have better experience with Python, and this is the reason I am looking for MicroPython.

Thank you all,
Greetings,
Marcio

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

Re: What is the status of MicroPython on STM32F407 Discovery board?

Post by dhylands » Wed May 20, 2015 11:51 pm

Hey Marco,

The STM32F407 discovery board should be supported.

See this page for more complete directions: https://github.com/micropython/micropyt ... -Discovery

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: What is the status of MicroPython on STM32F407 Discovery board?

Post by SpotlightKid » Thu May 21, 2015 12:58 am

I use MicroPython on the STM32F4DISCOVERY board and it works very well. The biggest problem is finding out the exact steps to get the MicroPython firmware unto it and to figure out which pin is which. I can help you with the first problem: I wrote a few slides as an IPython notebook on how to install MicroPython on a discovery board for a small presentation I gave last week at our local Python user group:

https://github.com/SpotlightKid/micropython-stm

(Slides are in German but I think Google translate will have no problem with them.)

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

Re: What is the status of MicroPython on STM32F407 Discovery board?

Post by dhylands » Thu May 21, 2015 1:36 am

The board pins on the discovery board have the same name as the silkscreen printed on the board itself.

So PA13 would be either pyb.Pin.board.PA13 or pyb.cpu.A13

I often use the dir command to discover whats available:

Code: Select all

>>> dir(pyb.Pin.board)
['PC0', 'PC1', 'PC2', 'PC3', 'PA0', 'PA1', 'PA2', 'PA3', 'PA4', 'PA5', 'PA6', 'PA7', 'PC4', 'PC5', 'PB0', 'PB1', 'PB2', 'PE7', 'PE8', 'PE9', 'PE10', 'PE11', 'PE12', 'PE13', 'PE14', 'PE15', 'PB10', 'PB11', 'PB12', 'PB13', 'PB14', 'PB15', 'PD8', 'PD9', 'PD10', 'PD11', 'PD12', 'PD13', 'PD14', 'PD15', 'PC6', 'PC7', 'PC8', 'PC9', 'PA8', 'PA9', 'PA10', 'PA13', 'PA14', 'PA15', 'PC10', 'PC11', 'PC12', 'PD0', 'PD1', 'PD2', 'PD3', 'PD4', 'PD5', 'PD6', 'PD7', 'PB4', 'PB5', 'PB6', 'PB7', 'PB8', 'PB9', 'PE0', 'PE1', 'PE2', 'PE3', 'PE4', 'PE5', 'PE6', 'PC13', 'PC14', 'PC15', 'PH0', 'PH1', 'LED_GREEN', 'LED_ORANGE', 'LED_RED', 'LED_BLUE', 'SW']
>>> dir(pyb.Pin.cpu)
['A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10', 'A13', 'A14', 'A15', 'B0', 'B1', 'B2', 'B4', 'B5', 'B6', 'B7', 'B8', 'B9', 'B10', 'B11', 'B12', 'B13', 'B14', 'B15', 'C0', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9', 'C10', 'C11', 'C12', 'C13', 'C14', 'C15', 'D0', 'D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8', 'D9', 'D10', 'D11', 'D12', 'D13', 'D14', 'D15', 'E0', 'E1', 'E2', 'E3', 'E4', 'E5', 'E6', 'E7', 'E8', 'E9', 'E10', 'E11', 'E12', 'E13', 'E14', 'E15', 'H0', 'H1']
To figure out which pins have which functions, like UART/SPI, etc. there is a pins_af.py file which is generated for each board. You'll find it by looking in the build-STM32F4DISC directory. It contains a python data structure which describes the alternate functions available for the pins on that particular board.

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: What is the status of MicroPython on STM32F407 Discovery board?

Post by SpotlightKid » Thu May 21, 2015 12:00 pm

I've also found the Excel sheet with the pinouts and alternate functions presented in this blog article to be helpful:

http://kornakprotoblog.blogspot.de/2012 ... m32f4.html

arqeco
Posts: 2
Joined: Mon May 18, 2015 12:05 pm

Re: What is the status of MicroPython on STM32F407 Discovery board?

Post by arqeco » Thu May 21, 2015 12:24 pm

Hey friends,

Thank you for your answers. At first I thought I hade made some dumb question because I got no answer :oops: . Only after some time I noticed that the need for approval of new users was due to the spambots, and not about the question itself :D

Your answers were very helpful and I decided to order the DISCOVERY.

Greetings,
Marcio

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

Re: What is the status of MicroPython on STM32F407 Discovery board?

Post by dhylands » Thu May 21, 2015 2:51 pm

SpotlightKid wrote:I've also found the Excel sheet with the pinouts and alternate functions presented in this blog article to be helpful:

http://kornakprotoblog.blogspot.de/2012 ... m32f4.html
We have essentially the same spreadsheet here:
https://github.com/micropython/micropyt ... 405_af.csv
without the fancy colors. That, along with the pins.csv file for each board is whats used to generate the pyb.Pins for a particular board.

Post Reply