-
Notifications
You must be signed in to change notification settings - Fork 3k
[STM32F4 STM32F7] Overwrite HAL_Delay to allow SD example #1624
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
Conversation
The weak function HAL_Delay is overwritten to use mbed function 'wait_ms'. Thanks to this, the user can use stm32f[4/7]xx_hal_sd.c that calls HAL_Delay This will allow us to add an example detecting / writing / reading an SD card on DISCO_F469NI and DISCO_F746NG (cherry picked from commit d491e3c)
In the future, we should create common HAL implementation, for instance this wait_ms() could be moved there. @adustm What do you think? |
Hello, |
Hello, HAL_Delay() is impemented in stm32f4xx_hal.c as follows,
and HAL_GetTick() is incremented in hal_tick.c. dinau |
Hello @dinau , It seems we are blocked in the while((HAL_GetTick() - tickstart) < Delay) |
Hello @dinau @0xc0170 At this moment, the timer is off (it is switched off at the end of SystemInit, and restarted in mbed_skd_init). Using In case I use a local sd variable (inside the main function), the timer has been restarted by Could you let me know how you usually use a wait function between the SystemInit and the mbed_skd_init function, when timer is supposed to be off ? |
Hello, Cheers |
As I understand, you dont want to change HAL_Delay. Why not reimplement HAL_Delay as you did, but instead of using code from the upper layer, to just reinit ticker to get the same job done? |
Why is the global variable cleared "between SystemInit function and mbed_sdk_init function" ? dinau |
@dinau Create an issue with this problem, and you can paste there the info you shared about GCC |
@adustm What do we do, considering this is workaround for now. I am not in favour of using wait_ms in HAL for now. |
Hello, sorry for the long silent period. |
Any luck? |
Hello, I just commited this new version that uses mbedhal instead of mbed common. |
Thanks, Lets merge this. Please @adustm create an issue why this was added |
The weak function HAL_Delay is overwritten to use mbed function
'wait_ms'.
Thanks to this, the user can use stm32f[4/7]xx_hal_sd.c that calls
HAL_Delay
This will allow us to add an example detecting / writing / reading an SD
card on DISCO_F469NI and DISCO_F746NG
(cherry picked from commit d491e3c)