Skip to main content
Graduate
October 13, 2024
Solved

control of my stm32 with an external board

  • October 13, 2024
  • 2 replies
  • 1233 views

Good morning. I want to use my Nucleo to light up the LED of my stm32h747. For this, I first programmed a GPIO output for my nucleo board. I connected a wire and measured 3.4 volts and 120 mA with a multimeter. then, I decided to toggle the wire to port D0 of my stm32h747. I used the schematics to enable the port and then wrote a simple code to see if it worked: 

Capture d’écran 2024-10-13 à 15.48.09.png

Jad_0-1728827361944.png

I also toggled another LED(pin I15) to ensure my code worked.

Finally, I connected the wire from my Nucleo to the stm32h747 and two random ground pins from each board. It did not work, and I do not understand what I did wrong in my approach. Maybe I miss something.

best regards

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello @Jad ,

    First, please use </> button to paste your code instead of sharing screen shots.

    Second, in the while loop you are not toggling a LED you are setting it to the same value of the GPIO input.


    @Jad wrote:

    Finally, I connected the wire from my Nucleo to the stm32h747 and two random ground pins from each board. It did not work, and I do not understand what I did wrong in my approach. Maybe I miss something.

    best regards


    So use and add a delay for test:

    HAL_GPIO_TogglePin(GPIOI, GPIO_PIN_14);
    HAL_Delay(100); /* Add this delay to be able to see the togling */

     You need also to provide the GPIO config of the two GPIO pins.

     

    2 replies

    Graduate II
    October 13, 2024

    It did not work, and I do not understand what I did wrong in my approach.

    This is pretty vague. What didn't work? What are you trying to accomplish on the H747?

    JadAuthor
    Graduate
    October 13, 2024

    Sorry if I was not clear, the led Lightning of the stm747 did Not work: so it means that geting the gpio input on my stm747 was not correctly toggled I guess  

    Graduate II
    October 13, 2024

    @Jad wrote:

    Sorry if I was not clear, the led Lightning of the stm747 did Not work: so it means that geting the gpio input on my stm747 was not correctly toggled I guess  


    If you're using a button on the Nucleo to toggle the output going into the H747, then you need to check for button release state too. Right now you only set the Nucleo output to high. Without seeing code on the H747, don't know if you're looking for an interrupt or polling on the GPIO input?

     

    As for your Nucleo, try this to have the button toggle the output

    	if(state == GPIO_PIN_SET)
    	{
    		HAL_GPIO_Write(GPIOI, GOPIO_PIN_14, GPIO_PIN_SET);
    	}
    	else if(state == GPIO_PIN_RESET)
    	{
    		HAL_GPIO_Write(GPIOI, GOPIO_PIN_14, GPIO_PIN_RESET);
    	}

     

    mƎALLEmAnswer
    Technical Moderator
    October 13, 2024

    Hello @Jad ,

    First, please use </> button to paste your code instead of sharing screen shots.

    Second, in the while loop you are not toggling a LED you are setting it to the same value of the GPIO input.


    @Jad wrote:

    Finally, I connected the wire from my Nucleo to the stm32h747 and two random ground pins from each board. It did not work, and I do not understand what I did wrong in my approach. Maybe I miss something.

    best regards


    So use and add a delay for test:

    HAL_GPIO_TogglePin(GPIOI, GPIO_PIN_14);
    HAL_Delay(100); /* Add this delay to be able to see the togling */

     You need also to provide the GPIO config of the two GPIO pins.