[Black STM32F407VET6] Pin map

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.
ProudPagan
Posts: 35
Joined: Fri Apr 12, 2019 8:55 am

[Black STM32F407VET6] Pin map

Post by ProudPagan » Sat Jun 15, 2019 1:10 pm

Hi,

I am looking for the MicroPython pin name <--> board pin name (PX-## etc.) mapping for the
Black STM32F407VET6.

Could anyone point me to that?

Thanks

PP

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: [Black STM32F407VET6] Pin map

Post by jimmo » Sat Jun 15, 2019 1:20 pm

I found a blurry photo of that board, looks like they're labelled with their "CPU" names (like you say -- P<port><num>).

The easiest way to use them is machine.Pin.cpu.<port><num> (or machine.Pin('<port><num>')

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: [Black STM32F407VET6] Pin map

Post by jimmo » Sat Jun 15, 2019 1:25 pm

Which board definition are you using? If it's https://github.com/mcauser/BLACK_F407VE then it should even just work directly using what's printed on the board as e.g. machine.Pin('PA10') or machine.Pin.board.PA10

Can you run dir on machine.Pin.cpu / machine.Pin.board (this is the output for my Pyboard 1.1 for comparison)

Code: Select all

>>> dir(machine.Pin.cpu)
['__class__', '__name__', 'A0', 'A1', 'A10', 'A11', 'A12', 'A13', 'A14', 'A15', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'B0', 'B1', 'B10', 'B11', 'B12', 'B13', 'B14', 'B15', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B9', 'C0', 'C1', 'C10', 'C11', 'C12', 'C13', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9', 'D2']
>>> dir(machine.Pin.board)
['__class__', '__name__', 'LED_BLUE', 'LED_GREEN', 'LED_RED', 'LED_YELLOW', 'MMA_AVDD', 'MMA_INT', 'SD', 'SD_CK', 'SD_CMD', 'SD_D0', 'SD_D1', 'SD_D2', 'SD_D3', 'SD_SW', 'SW', 'USB_DM', 'USB_DP', 'USB_ID', 'USB_VBUS', 'X1', 'X10', 'X11', 'X12', 'X17', 'X18', 'X19', 'X2', 'X20', 'X21', 'X22', 'X3', 'X4', 'X5', 'X6', 'X7', 'X8', 'X9', 'Y1', 'Y10', 'Y11', 'Y12', 'Y2', 'Y3', 'Y4', 'Y5', 'Y6', 'Y7', 'Y8', 'Y9']
>>> 

ProudPagan
Posts: 35
Joined: Fri Apr 12, 2019 8:55 am

Re: [Black STM32F407VET6] Pin map

Post by ProudPagan » Sat Jun 15, 2019 2:46 pm

Thanks. I can see these.

Code: Select all

__class__       __name__        DAC1            DAC2
LED_D2          LED_D3          OSC32_IN        OSC32_OUT
PA0             PA1             PA10            PA11
PA12            PA13            PA14            PA15
PA2             PA3             PA4             PA5
PA6             PA7             PA8             PA9
PB0             PB1             PB10            PB11
PB12            PB13            PB14            PB15
PB2             PB3             PB4             PB5
PB6             PB7             PB8             PB9
PC0             PC1             PC10            PC11
PC12            PC13            PC14            PC15
PC2             PC3             PC4             PC5
PC6             PC7             PC8             PC9
PD0             PD1             PD10            PD11
PD12            PD13            PD14            PD15
PD2             PD3             PD4             PD5
PD6             PD7             PD8             PD9
PE0             PE1             PE10            PE11
PE12            PE13            PE14            PE15
PE2             PE3             PE4             PE5
PE6             PE7             PE8             PE9
RED_LED         SD_CK           SD_CMD          SD_D0
SD_D1           SD_D2           SD_D3           USB_DM
USB_DP          USB_ID          USB_VBUS
An observation:

Code: Select all

machine.Pin.board.LED_D2.off()
turns the LED on! Same with

Code: Select all

machine.Pin.board.LED_D2.value(0)

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: [Black STM32F407VET6] Pin map

Post by Roberthh » Sat Jun 15, 2019 4:55 pm

Then most likely the LED anode is connected to Vdd, such that it requires a low level to shine.

ProudPagan
Posts: 35
Joined: Fri Apr 12, 2019 8:55 am

Re: [Black STM32F407VET6] Pin map

Post by ProudPagan » Sat Jun 15, 2019 5:44 pm

I see.

The header directly opposite to the JTAG connector is marked "For mcudev/TFT" -- looks like the parallel LCD bus... is this documented somewhere?

I found all the GPIO pin mux in ports/stm32/boards/stm32f405_af.csv. This is referenced by boards/BLACK_F407VE/mpconfigboard.mk.

stm32f405_af.csv contains ports PF## through PI## which don't show (are not available?) in MicroPython.

Thanks

PP
Attachments
STM32F407VET6_board.jpg
STM32F407VET6_board.jpg (193.61 KiB) Viewed 6151 times

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: [Black STM32F407VET6] Pin map

Post by OutoftheBOTS_ » Sat Jun 15, 2019 8:25 pm

The TFT header is a copy of the needed pins on the side to use the 16bit parallel FSMC peripheral.

U can find the TFT pin-out here https://wiki.stm32duino.com/images/a/a8 ... AG-TFT.pdf

And here is a pic of the pins used but the MCU for the FSMC peripheral
fsmc.JPG
fsmc.JPG (75.62 KiB) Viewed 6140 times

ProudPagan
Posts: 35
Joined: Fri Apr 12, 2019 8:55 am

Re: [Black STM32F407VET6] Pin map

Post by ProudPagan » Sun Jun 16, 2019 4:22 am

Thanks, that PDF is what I was looking for!

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: [Black STM32F407VET6] Pin map

Post by mcauser » Mon Jun 17, 2019 11:12 am

There are also pin diagram images here showing which pins are on the TFT header:
https://os.mbed.com/users/hudakz/code/S ... /shortlog/

ProudPagan
Posts: 35
Joined: Fri Apr 12, 2019 8:55 am

Re: [Black STM32F407VET6] Pin map

Post by ProudPagan » Tue Jun 18, 2019 4:49 am

Great, thanks.

Post Reply