-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32F411RET6 hangs before boot #4653
Comments
@waymond91 Hey, let's try to address your own issues. So let's focus on your need: you want to boot F411RE based HW from HSI with the online compiler right ? |
@LMESTM Sorry I wasn't trying to dredge up the past, just looking for a solution that might already be out there. |
@waymond91 there is ongoing work to make selection of clock source easier so we'll keep you informed on this. And in the process we'll make sure that NUCLEO_F411RE can boot from HSI when using online IDE. |
Sorry, I am very new to the work flow around here. |
@waymond91 We'll keep you posted on our findings here. Then when it comes to releases to the online compiler, there will be some delay, but we can rely on ARM maintainers to confirm to us when this is available. |
@LMESTM Thank you, once again! |
Hi #include "mbed.h" About setting the clock source, in the current default code, HSE is tried; then if it fails, after a timeout period, HSI is configured. (see #4422) In the future (see #4421) you will be able to configure explicitly your clock source thanks to mbed_app.json file. Note that this method will work with online compiler and with local IDE. |
Thank you for letting me know! |
@waymond91 what I'd suggest is that you try to use mbed master branch together with #4421 proposals and try to boot your board from HSI by setting the proper setting in mbed_app.json. This would validate the concept that @jcostm is proposing |
Ok, so I have updated my mbed cli and looking through the target files for the stm32f411 it seems like the clock config has been moved to a json file per system_clock.c in for the nucleo board on line 42
I have been suspecting that what may have been the issue is that most of the stm32 discovery boards use a 25Mhz crystal for the HSE and I am using an 8 Mhz. Best regards gang |
HSE_VALUE value is defined in targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_conf.h #if !defined (HSE_VALUE) You can update it. Another way is to define in in mbed_app json files:
|
@waymond91 have your questions been successfully answered ? |
@waymond91 |
Bump |
Description
Type: Bug
Priority: Blocker
Related issues:
I have seen this issue in a number of places online. The first place I encountered was here: https://developer.mbed.org/forum/bugs-suggestions/topic/5600/
But from what I have seen, this solution seems to have been rolled out a long time ago.
After rooting around online even more, it seemed issue #4532 captured a description of my problem.
But it seems like a lot of these similar problems were recently solved by pr #4543
I also found this post from over a year ago that seems very similar, the fact that no solution was found makes me feel like my current hardware design is dead in the water:
https://developer.mbed.org/questions/61589/Program-hangs-at-SetSysClock-on-a-custom/
Any ideas of what I should do? I felt like this must have been a hardware issue when I first started. But now I see that I can run & debug code if I use the system default clock, so I should be able to configure the HSI to run at a reasonabe speed, preferably with the Mbed environment!
Bug
Target
NUCLEO_F411RE
Toolchain:
GCC_ARM
Toolchain version:
6.3.1
mbed-cli version:
1.0.0
Expected Behavior
Platform should boot to the beginning of the main() function.
Actual Behavior
Application times out/crash before reaching the main application while configuring the MCU clocks.
Hey Guys,
After playing around with a Nucleo-F411 board for a while I decided I wanted to deploy this MCU to a custom PCB for my application.
I am using an external 8 Mhz crystal, and I believe I have selected the right capacitors for the oscillator.
Regardless, my system hangs and does not make it to the main() function of my code when building via mbed-cli.
I have tried removing the external crystal and configuring the HSI. However, when using the mbed compiler does not work because the program doesn't reach my main function.
If I comment out this line of system_stm32f4xx.c
237 SetSysClock();
the program will make it to my application, but of course everything runs at the default 16Mhz, while the rest of the application expects 96Mhz.
So from here I should be able to configure the HSI to run similarly to the HSE:
SYSCLK = 96 Mhz
AHBCLK = 96 Mhz
APB1CLK = 48 Mhz
APB2CLK = 96 Mhz
But I don't really know how much of this configuration Mbed is performing in the background.
Using CoIde + ARM_GCC, I have tried to configure the clocks in a variety of ways, shown below.
But the program often crashes after
HAL_RCC_OscConfig(&RCC_OscInitStruct)
although sometimes it runs if I step the processor through the entire stm32f4xx_hal_rcc.c file manually?The text was updated successfully, but these errors were encountered: