cancel
Showing results for 
Search instead for 
Did you mean: 

Why my LED PG13 does not light up when I use the external crystal, but it does when I use the internal crystal, what went wrong? I initialized in cubeMX, debugged and burned in keil

XIAOHE
Associate II
 
9 REPLIES 9
XIAOHE
Associate II


_legacyfs_online_stmicro_images_0693W00000bjrnJQAQ.png
_legacyfs_online_stmicro_images_0693W00000bjrOAQAY.png
_legacyfs_online_stmicro_images_0693W00000bjrlsQAA.png
_legacyfs_online_stmicro_images_0693W00000bjrnnQAA.png
_legacyfs_online_stmicro_images_0693W00000bjrbzQAA.png

VDDIO2 pin is connected?

Is PWR_CR2.IOSV bit set?


_legacyfs_online_stmicro_images_0693W00000bjrz0QAA.png 

JW

XIAOHE
Associate II

@Community member​ I'm sorry, I can't fully understand what you mean

To use GPIOG bank pins there must be a VDDIO2 supply and you must explicitly enable it in your code somewhere. ​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
XIAOHE
Associate II

@Community member​ So how do I do it?

PWR->CR2 |= PWR_CR2_IOSV;

Or, as an experiment, look at the PWR_CR2 register in the debugger and click there to set the IOSV bit.

JW

https://community.st.com/s/question/0D53W00001rApk7SAC/about-gpio

  /* VddIO2 must be enabled to access GPIO port G[2:15] */

  __HAL_RCC_PWR_CLK_ENABLE();

  HAL_PWREx_EnableVddIO2();

  __HAL_RCC_GPIOG_CLK_ENABLE();

Where you initialize the pins, or in SystemClock_Config()

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
XIAOHE
Associate II

@Community member​ This is really bad, especially for a newbie like me. I've read a lot of manuals and know that iOSV is to be set to 1, but I can't make changes to the code. For other development boards, I just need to open the external crystal on the CUBEMX, configure its frequency in the clock tree, set the lamp level low, and finally import it into Keil to run. But not for STM32L4P5G-DK.Please help me. I want to know if there is something wrong with the initialization configuration in CUBEMX or if I have to add to make changes after the initialization

AScha.3
Chief III

on STM32L4P5G-DK is no 24M crystal , clock is 8M from onboard stlinkV3 :


_legacyfs_online_stmicro_images_0693W00000bk1IQQAY.pngso set "bypass" clock and 8 MHz . then try ...

If you feel a post has answered your question, please click "Accept as Solution".