AnsweredAssumed Answered

PG2 GPIO output on Nucleo-F767ZI doesn't function

Question asked by Kristof Mulier on May 2, 2017
Latest reply on May 2, 2017 by waclawek.jan

I have made a board on which I plug the Nucleo-F767ZI microcontroller board. There is one GPIO pin that I cannot get to function as a digital output: PG2.

This is my code in mbed-os:

    static DigitalOut myPin_A(PG_2);
    static DigitalOut myPin_B(PG_3);

    ...

    static void someFunction()
    {
        myPin_A.write(1); // <- This one doesn't work :-(
        myPin_B.write(1); // <- But this one works!
    }


I thought: "Perhaps this problem has to do with mbed-os". So I have tried the ST HAL:

 

 

static void someFunction()
{
     GPIO_InitTypeDef GPIO_InitStruct;
     GPIO_InitStruct.Pin = GPIO_PIN_2;
     GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
     GPIO_InitStruct.Pull = GPIO_NOPULL;
     GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
     HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);

     GPIO_InitStruct.Pin = GPIO_PIN_3;
     GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
     GPIO_InitStruct.Pull = GPIO_NOPULL;
     GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
     HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);

     HAL_GPIO_WritePin(GPIOG, GPIO_PIN_2, GPIO_PIN_SET); // <- This one doesn't work :-(
     HAL_GPIO_WritePin(GPIOG, GPIO_PIN_3, GPIO_PIN_SET); // <- But this one works!
}

 

As you can see, I get exactly the same result. I've tried another Nucleo-F767ZI board standalone - I don't plug it into my custom board to reassure myself that the PG2 pin isn't affected by anything outside the Nucleo - but still got the same result.

 

I have posted my question also on StackOverflow:

stm32f7 - PG2 GPIO output on Nucleo-F767ZI doesn't function - Electrical Engineering Stack Exchange 

 

EDIT

I have generated a new project from scratch with CubeMX. As you know, CubeMX does not support mbed-os, but freeRTOS instead. When using freeRTOS, the pin PG_2works, using the code given above.
Why don't I get it working when mbed-os is running? This is so strange :-(

Outcomes