STM32F410 RTC Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
kimmoli
Posts: 27
Joined: Sat Oct 01, 2016 8:02 pm
Has thanked: 11 times
Been thanked: 9 times
Contact:

STM32F410 RTC  Topic is solved

Postby kimmoli » Tue Jan 03, 2017 8:26 pm

STM32F410 has same new bit in RCC_APB1ENR as stm32f7[6,7]xx explained in this thread viewtopic.php?t=3527

Bit 10
RTCAPBEN:RTC APB clock enable
Set and cleared by software.
0: RTC clock disabled
1: RTC clock enabled


410 Reference manual states this... well it says "bits"

1. Enable the power interface clock by setting the PWREN bits in the RCC_APB1ENR register (see Section 5.3.9: RCC APB1 peripheral clock enable register (RCC_APB1ENR))


Fix mimiced from https://github.com/ChibiOS/ChibiOS/comm ... 56ba6b98d4

tested on STM32F410RB

See: https://github.com/kimmoli/ChibiOS/comm ... 12a9c6c7e5

Code: Select all

telakone GPS
------------

 - Loaded 1 variables
 - Watchdog is disabled
 - Initialisation complete
 - Threads started


ChibiOS/RT Shell
telakone> date
RTC time is Sun Jan  1 00:00:55 1980
telakone> date
RTC time is Sun Jan  1 00:03:43 1980
telakone> date
RTC time is Sun Jan  1 00:03:46 1980
telakone>

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32F410 RTC

Postby Giovanni » Thu Jan 12, 2017 11:21 am

Hi,

There are also other devices needing that and more may be introduced, I implemented it as follow:

Code: Select all

  /* PWR clock enable.*/
#if defined(HAL_USE_RTC) && defined(RCC_APB1ENR_RTCAPBEN)
  RCC->APB1ENR = RCC_APB1ENR_PWREN | RCC_APB1ENR_RTCAPBEN;
#else
  RCC->APB1ENR = RCC_APB1ENR_PWREN;
#endif


This should always work.

Giovanni

User avatar
kimmoli
Posts: 27
Joined: Sat Oct 01, 2016 8:02 pm
Has thanked: 11 times
Been thanked: 9 times
Contact:

Re: STM32F410 RTC

Postby kimmoli » Sun Jan 15, 2017 9:24 pm

For some reason, RCC_APB1ENR_RTCAPBEN was named RCC_APB1ENR_RTCEN in the other fix ?
Otherwise LGTM

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32F410 RTC

Postby Giovanni » Sun Jan 15, 2017 9:37 pm

LGTM?

The macro name is different in F4 and F7 headers. Am I missing something?

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 16 guests