Page 1 of 1

BLACKPILL STM32F411 RTC

Posted: Tue Nov 25, 2025 6:27 pm
by max.tisc
Hi, I wanted to ask if the internal RTC component can read and write to the STM32f411's RTC. That would be great, so I don't have to add any other components to get an RTC.
Thanks.

Re: BLACKPILL STM32F411 RTC

Posted: Wed Nov 26, 2025 11:11 am
by BenR
Hello,

Thanks for your question.

I've checked and it looks like the internal RTC should be supported already for that device.

Let us know if you have any problems.

Re: BLACKPILL STM32F411 RTC

Posted: Wed Nov 26, 2025 6:19 pm
by max.tisc
Hi Ben,
I made this simple code to test, but it doesn't work and everything is frozen; the LED isn't even blinking. I think I understand that RTC must be enabled in the configuration, and I didn't see it in the oscillator settings screen. It seems that RTC is disabled by default. I'm attaching a screenshot of the affected part that's enabled.
Thanks

Re: BLACKPILL STM32F411 RTC

Posted: Wed Nov 26, 2025 8:38 pm
by max.tisc
Hi leightM
Yes, I remembered the issue and tried to replicate it, but it doesn't work unless I have to reload STARM_CAL_RTC.c. Should it already be up to date with the various updates released subsequently, or not?
Thanks

Re: BLACKPILL STM32F411 RTC

Posted: Thu Nov 27, 2025 10:54 am
by LeighM
Hi,
I just done a full update (V10), the CAL file is up to date, and includes the RTC enable code.
I've successfully compiled your test program and it runs fine on my Blackpill, LED flash, no lockup and UART output OK.
I also added a read and output of RTC seconds, which do increment.

Hope that helps.

Re: BLACKPILL STM32F411 RTC

Posted: Thu Nov 27, 2025 12:07 pm
by LeighM
Update...
Ah, my previous post might not be true..
The Full Update doesn't seem to check all files.
I'm running on the STARM_CAL_RTC.c from the "STM32F QUESTIONS" thread.
Even if I delete it, Flowcode doesn't seem to detect this and update it, so I can't check what's in the Matrix repo.
Ben, is this fixable? :)
Thanks!

Re: BLACKPILL STM32F411 RTC

Posted: Thu Nov 27, 2025 12:18 pm
by LeighM
but it doesn't work unless I have to reload STARM_CAL_RTC.c
.. does this mean your Flowcode update reverts to the earlier original version?

Re: BLACKPILL STM32F411 RTC

Posted: Thu Nov 27, 2025 5:50 pm
by max.tisc
Hi,
I reloaded the STARM_CAL_RTC.c file but it didn't work. Did you have to change the project options settings to get it to work?
Thanks

Re: BLACKPILL STM32F411 RTC

Posted: Thu Nov 27, 2025 6:36 pm
by LeighM
No, I didn't change any settings.
Have you tried a power cycle of the board after the updated build is transferred?

If it still locks up, maybe my working version is due to some previously run code? :?
I think all the C code I've tried/run is posted on that previous post/thread

Re: BLACKPILL STM32F411 RTC

Posted: Thu Nov 27, 2025 8:06 pm
by max.tisc
tried different configurations, turning it off and on again but it always blocked