[NUCLEO-F767ZI] pins G15 G12 G10 not defined/usable [help!]

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
tiberiu21
Posts: 3
Joined: Sat Aug 21, 2021 4:15 pm

[NUCLEO-F767ZI] pins G15 G12 G10 not defined/usable [help!]

Post by tiberiu21 » Sat Aug 21, 2021 4:56 pm

Hello everyone,
I use the NUCLEO-F767ZI with an custom made hat
I'm triyng to set up an application (fairly simple but with large number of pin used)
I encounter the folowing problem - not able to initialize 3 pin: G15 ,G12 and G10
All other pin used in application seems to be properly initialised

Code: Select all

Traceback (most recent call last):  
  File "main.py", line 122, in <module>
AttributeError: type object 'cpu' has no attribute 'G15'
MicroPython v1.16-236-gb51e7e9d0 on 2021-08-21; NUCLEO-F767ZI with STM32F767
the line pointing to this: (next two lines don't work too)

Code: Select all

.....
port_B.append(pyb.Pin(pyb.Pin.cpu.E6,Pin.OUT))
port_B.append(pyb.Pin(pyb.Pin.cpu.G9,Pin.OUT))
....
port_B.append(pyb.Pin(pyb.Pin.cpu.G15,Pin.OUT))
port_B.append(pyb.Pin(pyb.Pin.cpu.G12,Pin.OUT))
port_B.append(pyb.Pin(pyb.Pin.cpu.G10,Pin.OUT))
.....
I don't find any of three pin (G15, G12 , G10) in Nucleo 767 pins.csv
Verified with Stm32CubeIde if the pins are disponible to be used and no problem.
I don't figure where is my fault...
Thank you!
Best regards,
Tiberiu
-------------
[Edit]
Hello everyone,
I made one try with the same code using NUCLEO -F429ZI instead and in this case those pins (PG15, PG12, and PG10) seems to be properly defined on this board (they are listed also in pins.csv for NUCLEO-F429ZI)

Code: Select all

.............
port_B.append(pyb.Pin(pyb.Pin.cpu.G15,Pin.OUT))
port_B.append(pyb.Pin(pyb.Pin.cpu.G12,Pin.OUT))
port_B.append(pyb.Pin(pyb.Pin.cpu.G10,Pin.OUT))


>>> port_B[19] 
port_B[19]
Pin(Pin.cpu.G10, mode=Pin.OUT)
>>> port_B[18] 
port_B[18]
Pin(Pin.cpu.G12, mode=Pin.OUT)
>>> port_B[17] 
port_B[17]
Pin(Pin.cpu.G15, mode=Pin.OUT)
>>>
However I have to use Nucleo -F767ZI and I have no ideea how to manage to use those 3 pin
This is the result of the same code running in Nucleo -F767ZI

Code: Select all

Traceback (most recent call last):
File "main.py", line 122, in <module>
AttributeError: type object 'cpu' has no attribute 'G15'
MicroPython v1.16-236-gb51e7e9d0 on 2021-08-21; NUCLEO-F767ZI with STM32F767
Please help me if you have any suggestion
Thank You
Best regards,
Tiberiu

edit 24/08/21

Hello everyone,
Same NUCLEO-F767ZI,
after various trials to workaround (at hardware side switching the pins way around) I found another 3 pins not assignable PF11, PD10, PG8.
So far I'm not able to use PD10, PF11, PG8, PG10, PG12, PG15, .

Code: Select all

AttributeError: type object 'cpu' has no attribute 'G15'
...
AttributeError: type object 'cpu' has no attribute 'D10'
...

Any ideas to make them usable? please help!
Thank you
Best regards,
Tiberiu

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

Re: [NUCLEO-F767ZI] pins G15 G12 G10 not defined/usable [help!]

Post by Roberthh » Tue Aug 24, 2021 3:45 pm

I can only use a PYBD_SF6 for comparison, but that uses the same .af file for the Pin definitions. And on that I get:

Code: Select all

>>> dir(pyb.Pin.cpu)
['__class__', '__name__', '__bases__', '__dict__', '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', 'C14', 'C2', 'C3',
'C4', 'C5', 'C6', 'C7', 'C8', 'C9', 'D0', 'D1', 'D10', 'D11', 'D12', 'D13', 'D14', 'D15', 'D2', 'D3',
'D4', 'D5', 'D6', 'D7', 'D8', 'D9', 'E0', 'E1', 'E10', 'E11', 'E12', 'E13', 'E14', 'E15', 'E2', 'E3', 
'E4', 'E5', 'E6', 'E7', 'E8', 'E9', 'F0', 'F1', 'F10', 'F11', 'F12', 'F13', 'F14', 'F15', 'F2', 'F3',
'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'G0', 'G1', 'G10', 'G11', 'G12', 'G13', 'G14', 'G15', 'G2', 
'G3', 'G4', 'G5', 'G6', 'G7', 'G8', 'G9', 'H10', 'H11', 'H12', 'H13', 'H14', 'H15', 'H2', 'H3',
'H4', 'H5', 'H6', 'H7', 'H8', 'H9', 'I0', 'I1', 'I10', 'I11', 'I2', 'I3', 'I4', 'I5', 'I6', 'I7', 'I8', 'I9']
>>> 

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

Re: [NUCLEO-F767ZI] pins G15 G12 G10 not defined/usable [help!]

Post by dhylands » Tue Aug 24, 2021 5:05 pm

The pins.csv file in the NUCLEO_F767SI board definition: https://github.com/micropython/micropyt ... I/pins.csv doesn't have any pins listed for the missing pins.

Looking at the user manual for the NUCLEO 144 pin parts, those pins are exposed from the MCU, so it's really just a case of adding them to the pins.csv file.

tiberiu21
Posts: 3
Joined: Sat Aug 21, 2021 4:15 pm

Re: [NUCLEO-F767ZI] pins G15 G12 G10 not defined/usable [help!]

Post by tiberiu21 » Tue Aug 24, 2021 5:40 pm

Hello ,
I noticed that the pins aren't listed in nucleo 767 pins.csv and shure I can edit it to add those pin, but I really dont't know the internals and what to do to reflect it on the micropython image (I suppose that I neeed to reflash with the corrected image)
Thank you
Best regards,
Tiberiu

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

Re: [NUCLEO-F767ZI] pins G15 G12 G10 not defined/usable [help!]

Post by dhylands » Tue Aug 24, 2021 5:53 pm

The pins.csv file basically contains a mapping of board name to CPU pin name.

The first column is the board name, and the second column in the CPU name.

For boards like the NUCLEO series, the CPU name is silkscreened on the back of the board, so you would just add these using the same thing for the board name and CPU name (i.e. PG10,PG10)

Once you update the pins.csv file you'll need to rebuild the firmware (I don't think you need to do a clean first, but it couldn't hurt) and reflash the device.

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

Re: [NUCLEO-F767ZI] pins G15 G12 G10 not defined/usable [help!]

Post by Roberthh » Tue Aug 24, 2021 6:29 pm

I understand that a Pin not listed in pins.csv will not appear in Pin.board, but it should still be available in Pin.cpu.

tiberiu21
Posts: 3
Joined: Sat Aug 21, 2021 4:15 pm

Re: [NUCLEO-F767ZI] pins G15 G12 G10 not defined/usable [help!]

Post by tiberiu21 » Tue Aug 24, 2021 10:38 pm

Hello,
thank you very much, I'll try to make an updated image with the pins.csv (not so simple though, I'm on the way to setting up toolchain on windows...)

however this is listing of all pins disponible (without PF11,PD10,PG8,PG10,PG12,PG15):

Code: Select all

KeyboardInterrupt:
MicroPython v1.16-236-gb51e7e9d0 on 2021-08-21; NUCLEO-F767ZI with STM32F767
Type "help()" for more information.
>>> dir(pyb.Pin.cpu)
['__class__', '__name__', '__bases__', '__dict__', 'A0', 'A1', 'A10', 'A11', 'A12',
 'A13', 'A14', 'A15', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', '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', 'D0', 'D1', 'D11', 'D12', 'D13', 'D14', 'D15', 'D2', 'D3', 'D4', 'D5', 'D6',
 'D7', 'D8', 'D9', 'E0', 'E1', 'E10', 'E11', 'E12', 'E13', 'E14','E15', 'E2', 'E3',
 'E4', 'E5', 'E6', 'E7', 'E8', 'E9', 'F0', 'F1', 'F10', 'F12','F13', 'F14', 'F15',
 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'G0', 'G1','G11', 'G13', 'G14', 
'G2', 'G3', 'G6', 'G7', 'G9']
>>>
>>>
Best regards,
Tiberiu

Post Reply