STM32F QUESTIONS

For general Flowcode discussion that does not belong in the other sections.
max.tisc
Posts: 113
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 10 times

Flowcode v9 STM32F QUESTIONS

Post by max.tisc »

Hi everyone
Up until now I have been playing with Arduino and atmega which has an internal EEPROM memory for saving data and which was managed by the EEPROM component, now I am getting closer to STM32F446 and in the datasheet I see that there is no EEPROM memory to use but a 128Kb SRAM + another 4Kb also used by the internal RTC, the questions are:
what is the right memory to use for saving data?
Is there a component on FC9 that manages it? Is it better to use an external EEPROM type 24C16?
STM32 already has an internal RTC is there a component that manages it?
Thanks to everyone

LeighM
Valued Contributor
Posts: 457
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 82 times
Been thanked: 244 times

Re: STM32F QUESTIONS

Post by LeighM »

The Real Time Clock (Internal) component supports STM32F4 series devices

max.tisc
Posts: 113
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 10 times

Flowcode v9 Re: STM32F QUESTIONS

Post by max.tisc »

hi LeighM
thanks for the suggestion
I tried the internal component but it behaves strangely, I made a small preogram to test it and if at the beginning of the program I initialize the component the led does not flash and the program remains blocked even if in simulation it works, if it is not initialized the led flashes and in the uart I always read 00:00:00. so the program runs but does not read the time
Can you also give me an answer regarding saving in EEPROM?
thanks
Attachments
STM32F411_UART.fcfx
(13.85 KiB) Downloaded 57 times
Screenshot 2025-01-11 011032.png
Screenshot 2025-01-11 011032.png (254.22 KiB) Viewed 4027 times

LeighM
Valued Contributor
Posts: 457
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 82 times
Been thanked: 244 times

Re: STM32F QUESTIONS

Post by LeighM »

Have you got an external 32.768 KHz crystal?
Or try setting clock source to internal.

As for EEPROM, there's no doubt lots of views on this,
I don't think there is any EEPROM emulation for the STM32F devices,
but I've successfully used 24C16 type devices on numerous projects.

max.tisc
Posts: 113
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 10 times

Re: STM32F QUESTIONS

Post by max.tisc »

the card I'm testing is a blackpill (stm34f411 waiting for the stm32f446 to arrive) that mounts the 32khz quartz and as you can see from the screenshot I had already selected 32khz external clock, it seems that the problem arises from the initialization block of the RTC which if inserted blocks the normal continuation of the program
Attachments
original-schematic-STM32F411CEU6_WeAct_Black_Pill_V2.0.pdf
(100.3 KiB) Downloaded 64 times

max.tisc
Posts: 113
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 10 times

Re: STM32F QUESTIONS

Post by max.tisc »

could it be that the problem is in the configurations?
the board has a main resonator at 25Mhz and for RTC at 32.768Khz
Attachments
Screenshot 2025-01-12 000012.png
Screenshot 2025-01-12 000012.png (202.11 KiB) Viewed 3930 times

LeighM
Valued Contributor
Posts: 457
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 82 times
Been thanked: 244 times

Re: STM32F QUESTIONS

Post by LeighM »

Could you try adding this C code into a C icon just before the call to RTC::Initialise()

Code: Select all

__HAL_RCC_PWR_CLK_ENABLE();
HAL_PWR_EnableBkUpAccess();
__HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE);
If using internal clock, this should be the last line instead ...

Code: Select all

__HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI);

max.tisc
Posts: 113
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 10 times

Re: STM32F QUESTIONS

Post by max.tisc »

thanks to LeighM
configured with LSI it works, if configured with LSE it continues to block the program
Attachments
Screenshot 2025-01-12 170124.png
Screenshot 2025-01-12 170124.png (100.63 KiB) Viewed 3817 times

LeighM
Valued Contributor
Posts: 457
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 82 times
Been thanked: 244 times

Re: STM32F QUESTIONS

Post by LeighM »

Try this (I haven't got a board with crystal to test) ...

Code: Select all

__HAL_RCC_PWR_CLK_ENABLE();
HAL_PWR_EnableBkUpAccess();
__HAL_RCC_LSE_CONFIG(RCC_LSE_ON);
__HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE);

max.tisc
Posts: 113
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 10 times

Re: STM32F QUESTIONS

Post by max.tisc »

no it's still blocked

Post Reply