STM32F407G RTC & SD Card(SPI) Not working simultaneously
Hello,
I am developing a board based on STM32F407G (Disc1) Where I am connecting an SD-Card over the SPI to store some data in the file on SD card. I am configuring internal RTC for the time tracking, On internal clock, a 16x2 LCD connected via 4-bit mode and some push buttons.
The problem I am facing is, When the Code do file operation on SD card(i.e writing data in file) the RTC time becomes 0. If board powered-up without the SD-card on it, It just works fine. For debugging I tried to do SD-Card activity after some time of booting(i.e. 30 Sec), So during the first 30 sec the RTC date-time showing fine, as the SD-Card operation started after 30 sec, RTC time-date became 0.
CubeMx configuration of the project is as below;
USART2(PD5, PD6)- asynchronous mode UART
SPI1(PB3-Clk, PB4-Miso, PB5-Mosi, PA15-GPIO_Out for CS)
PC0 to PC7-GPIO Output for LCD
PE0 to PE5-GPIO Input for Push-buttons
FATFS-User defined
RTC-Internal clock
TIM1-Micro second delay
For SD-Card configuration I followed: https://controllerstech.com/sd-card-using-spi-in-stm32/#:~:text=In%20this%20tutorial%20we%20will,writing%2C%20reading%2C%20deleting%20etc.
RTC: https://controllerstech.com/internal-rtc-in-stm32/
Can anyone please help me to understand what I missed here and resolve the issue? Also Let me know if anymore information required.
Thanks,
