6 years, 7 months ago.

How to change pin (PA_1) purpose?

Hi guys, I have a problem which I've tried to solve myself, but I failed...

For one of my projects I'm using a Nucleo-F767ZI board and almost all GPIOs. Right now I'm having hard time with GPIO PA_1 which is originally connected to ethernet interface (datasheet page 77 -> RMII_REF_CLK).

So the problem is that when SB13 jumper is placed and PA_1 is connected to eth. interface I'm unable to use it for anything else! If I remove SB13 I can use it normally as any other pin, but how can I change software to use still unconnected GPIO as it would use PA_1 (I know that then I'll have to connect that pin to SB13 jumper with hard-wire, but that is not a problem...)? I found a lib with eth. GPIO configuration (https://developer.mbed.org/users/mbed_official/code/lwip-eth/file/9de8bd8ca1c8/arch/TARGET_STM/stm32f4_emac.c) - at least I think so...but how can I change it in my project?

HOW CAN I CHANGE ETHERNET GPIO CONFIGURATION?

Datasheet: http://www.st.com/content/ccc/resource/technical/document/user_manual/group0/26/49/90/2e/33/0d/4a/da/DM00244518/files/DM00244518.pdf/jcr:content/translations/en.DM00244518.pdf

Thank you all for your help & time.

Question relating to:

STM32 Nucleo-144 development board with STM32F767ZIT6 MCU, supports Arduino, ST Zio and morpho connectivity

3 Answers

6 years, 7 months ago.

You have to remove SB13 in order to use it for something else. Otherwise the Ethernet chip on board will fight the signal and you can not expect it to work. It's well documented here http://www.st.com/content/ccc/resource/technical/document/user_manual/group0/26/49/90/2e/33/0d/4a/da/DM00244518/files/DM00244518.pdf/jcr:content/translations/en.DM00244518.pdf

Yes I understand that. I’ve already removed SB13 and I’m able to use PA_1 for something else but how can I configure another GPIO pin to work like PA_1 when connected to ethernet interface (I know I’d have to make a hard connection from that other GPIO to where PA_1 is originally connected - not a problem at all). My problem here is how to recofigure or change GPIOs that are used with ethernet interface...

posted by Ales Zupanc 20 Aug 2017

Hello Ales,
For NUCLEO-F767ZI the GPIO pins used for the Ethernet interface (PA_1 included) are mapped as GPIO_AF11_ETH Ethernet Alternate function by calling the void HAL_ETH_MspInit(ETH_HandleTypeDef* heth) function which is implemented in the mbed-os/features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/stm32f7_eth_init.c file. So I'm afraid that to substitute PA_1 with other GPIO pin would be a quite complex task or maybe even impossible to achieve.

posted by Zoltan Hudak 20 Aug 2017
6 years, 7 months ago.

Hello Ales,
According to this datasheet, Table 12 - "STM32F765xx, STM32F767xx, STM32F768Ax and STM32F769xx alternate function mapping" only the PA1 pin can be mapped to the ETH_RMII_REF_CLK alternate function. Unfortunately it means that the STM32F767ZI microcontroller cannot use any other pin than PA1 to receive the 50MHz reference clock from the LAN8742A-CZ-TR PHY Ethernet chip.
Zoltan

Ow...shit I didn’t even think about that...damn ;) Ok, thank you for that info.

Ales Zupanc

posted by Ales Zupanc 21 Aug 2017
6 years, 7 months ago.

Hello Ales,

Removing SB13 is the first thing to do.

Then you can disable the LWIP stack for your program, so that it won't configure PA_1 for the GPIO_AF11_ETH (stm32f7_eth_init.c won't be called).

You have to create a mbed_app.json file at the root of your program with the following content

{
    "target_overrides": {
        "NUCLEO_F767ZI": {
            "target.features_remove": ["LWIP"]
        }
    }
}

This way the LWIP protocol stack will not be part of your program. I think it should solve your problem.

Kind regards

Armelle