2017-11-20 07:58 AM
On our custom board we don't use RTC clock for time or date.
But I need to activate RTC to use Backup registers, and we use GPIOC PIN13 in mode OUTPUT_PP for leds.
With STM32CUbeMX 4.23.0 and STM32CubeF1 package 1.6.0 I have two options in Pinout :
Activate RCT with 'RTC OUT' as 'Disable' or 'No RTC OutPut'.
When 'RTC OUT' is 'Disable', in the screen 'RTC Configuration', I can't select 'No output on tamper pin' so GPIOC PIN13 can't be used.
When 'RTC OUT' is 'No RTC OutPut', in the generated code we have :hrtc.Init.OutPut = RTC_OUTPUTSOURCE_NONE; which is OK, but the initialisation of time and date uses RTC_BKP_DR1 with value 0x32f2.
So I have the choice of not beeing able to use GPIOC PIN13 or RTC_BKP_DR1.
I choosed the first Option, and then manually modify the generated code to write hrtc.Init.OutPut = RTC_OUTPUTSOURCE_NONE;
Is there another solution ?
Is it possible to have the option 'No output on TAMPER pin' when 'RTC OUT' is 'Disable' in STM32CUbeMX ?
Regards,
Fred.
♯
‌♯
‌https://community.st.com/tags♯/?tags=rtc%20backup
‌#stm32cubemx #stm32f103 #rtc-backupSolved! Go to Solution.
2018-02-27 09:18 AM
For 1 & 2: if you check 'Activate Calendar', 0x32F2 will be written to RTC_BKP_DR1.
4. I will share your request with our STM32CubeMX team.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2018-02-27 01:19 AM
Same problem with STM32CUbeMX 4.24.0 and STM32CubeF1 package 1.6.0
2018-02-27 07:53 AM
Hi
Surleau.Fr_d_ric
,Checking from my side, I noted that:
RTC OUT is
''
Disable'' or ''No RTC Output''), you can set PC13 as a GPIO_Output and it is configured accordingly in the generated code
In the case RTC OUT is ''No RTC Output'', hrtc.Init.OutPut = RTC_OUTPUTSOURCE_NONE. This is OK for you,
right
?In the case RTC OUT is
''
Disable'',hrtc.Init.OutPut = RTC_OUTPUTSOURCE_ALARM. Your request is to set it toRTC_OUTPUTSOURCE_NONE in such case.
Right
?Please note that you shouldn't use PC13 to drive a LED. This is explained in the RM0008 (page 68):
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2018-02-27 08:15 AM
Hi,
1. and 2. When RTC_OUT is Disable
set PC13 as a GPIO_Output, I can't use it.
Generated code for RTC_OUT Disabled :
/* RTC init function */
static void MX_RTC_Init(void){/**Initialize RTC Only
*/ hrtc.Instance = RTC; hrtc.Init.AsynchPrediv = RTC_AUTO_1_SECOND; hrtc.Init.OutPut = RTC_OUTPUTSOURCE_ALARM; if (HAL_RTC_Init(&hrtc) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); }}
3. Yes
4. Yes, or add the choice in the combo box (in RTC Configuration).
And of course the LED is not drived directly via PC13.
Regards,
Fred.
2018-02-27 09:18 AM
For 1 & 2: if you check 'Activate Calendar', 0x32F2 will be written to RTC_BKP_DR1.
4. I will share your request with our STM32CubeMX team.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2018-02-27 09:29 AM
Hi,
For 1 & 2 : Ok, we don't use the calendar. In our application, RTC is activated only to enable access to Backup registers.
So I was looking for a configuration with no side effect like use of RTC_BKP_DR1 for 'date' or GPIO_PC13 for 'tamper'.
Thanks,
Fred.
2018-08-22 12:05 PM
I bumped into that bug yesterday and it took me hours to find the problem.
PC13 was working then after a few changes it stopped.
Reverting to a previous version of my code didn't solve the problem!
After erasing the ic completely when uploading a .hex blink example pc13 came back to life and my previous code was also working.
The problem is that RTC configuration of pc13 seems to last if you don't completely erase the chip.
But all that came from CUBEMX that let you configure pc13 to be a gpio output and enable RTC on the same pin WITHOUT ANY WARNING !!!!!
:thumbs_down:
Also the configuration of the RTC output is split in 2 parts. One in Pinout tab/RTC/RTC OUT and one in Configuration tab/RTC.
:clockwise_vertical_arrows:
And finally the Pinout tab/RTC/RTC OUT values Disable/No RTC Output are quite confusing if you are not an expert...
CubeMx is supposed to help you if you are not an expert...
:face_screaming_in_fear: