{"id":2636,"date":"2024-06-28T05:43:01","date_gmt":"2024-06-28T05:43:01","guid":{"rendered":"https:\/\/blog.embeddedexpert.io\/?p=2636"},"modified":"2024-06-28T05:43:04","modified_gmt":"2024-06-28T05:43:04","slug":"getting-started-with-stm32g0-and-stm32cubeide-internal-rtc","status":"publish","type":"post","link":"https:\/\/blog.embeddedexpert.io\/?p=2636","title":{"rendered":"Getting Started with STM32G0 and STM32CubeIDE : Internal RTC"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"400\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/pt156578902-100_original_arm_mcu_stm32g070kbt6_stm32g070_stm32g_lqfp_32_microcontroller.jpg-2-4-2-1-2.webp\" alt=\"\" class=\"wp-image-2637\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/pt156578902-100_original_arm_mcu_stm32g070kbt6_stm32g070_stm32g_lqfp_32_microcontroller.jpg-2-4-2-1-2.webp 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/pt156578902-100_original_arm_mcu_stm32g070kbt6_stm32g070_stm32g_lqfp_32_microcontroller.jpg-2-4-2-1-2-300x300.webp 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/pt156578902-100_original_arm_mcu_stm32g070kbt6_stm32g070_stm32g_lqfp_32_microcontroller.jpg-2-4-2-1-2-150x150.webp 150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/pt156578902-100_original_arm_mcu_stm32g070kbt6_stm32g070_stm32g_lqfp_32_microcontroller.jpg-2-4-2-1-2-250x250.webp 250w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/figure><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>In this guide on the internal RTC of STM32G0, we shall configure the RTC and display the time and date on the serial terminal.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In this guide, we shall cover the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Internal RTC.<\/li><li>Driver development.<\/li><li>Results.<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Internal RTC:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>The RTC provides an automatic wakeup to manage all low-power modes.<\/p>\n\n\n\n<p>The real-time clock (RTC) is an independent BCD timer\/counter. The RTC provides a timeof-day clock\/calendar with programmable alarm interrupts.<\/p>\n\n\n\n<p>As long as the supply voltage remains in the operating range, the RTC never stops, regardless of the device status (Run mode, low-power mode or under reset).<\/p>\n\n\n\n<p>The RTC is functional in Vbat mode.<\/p>\n\n\n\n<p>RTC main features<\/p>\n\n\n\n<p>The RTC supports the following features:<\/p>\n\n\n\n<p>\u2022 Calendar with subsecond, seconds, minutes, hours (12 or 24 format), week day, date, month, year, in BCD (binary-coded decimal) format.<\/p>\n\n\n\n<p>\u2022 Automatic correction for 28, 29 (leap year), 30, and 31 days of the month.<\/p>\n\n\n\n<p>\u2022 Two programmable alarms.<\/p>\n\n\n\n<p>\u2022 On-the-fly correction from 1 to 32767 RTC clock pulses. This can be used to synchronize it with a master clock.<\/p>\n\n\n\n<p>\u2022 Reference clock detection: a more precise second source clock (50 or 60 Hz) can be used to enhance the calendar precision.<\/p>\n\n\n\n<p>\u2022 Digital calibration circuit with 0.95 ppm resolution, to compensate for quartz crystal inaccuracy.<\/p>\n\n\n\n<p>\u2022 Timestamp feature which can be used to save the calendar content. This function can be triggered by an event on the timestamp pin, or by a tamper event, or by a switch to V BAT mode.<\/p>\n\n\n\n<p>\u2022 17-bit auto-reload wakeup timer (WUT) for periodic events with programmable resolution and period.<\/p>\n\n\n\n<p>The RTC is supplied through a switch that takes power either from the V present or from the V BAT pin.<\/p>\n\n\n\n<p>The RTC clock sources can be:<\/p>\n\n\n\n<p>\u2022 A 32.768 kHz external crystal (LSE)<\/p>\n\n\n\n<p>\u2022 An external resonator or oscillator (LSE)<\/p>\n\n\n\n<p>DD<\/p>\n\n\n\n<p>supply when<\/p>\n\n\n\n<p>\u2022 The internal low power RC oscillator (LSI, with typical frequency of 32 kHz)<\/p>\n\n\n\n<p>\u2022 The high-speed external clock (HSE), divided by a prescaler in the RCC.<\/p>\n\n\n\n<p>The RTC is functional in V BAT mode and in all low-power modes when it is clocked by the LSE. When clocked by the LSI, the RTC is not functional in V BAT mode, but is functional in all low-power modes.<\/p>\n\n\n\n<p>All RTC events (Alarm, WakeUp Timer, Timestamp) can generate an interrupt and wakeup the device from the low-power modes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"1024\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.21.41\u202fAM-826x1024.png\" alt=\"\" class=\"wp-image-2638\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.21.41\u202fAM-826x1024.png 826w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.21.41\u202fAM-242x300.png 242w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.21.41\u202fAM-768x952.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.21.41\u202fAM-1239x1536.png 1239w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.21.41\u202fAM-1150x1425.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.21.41\u202fAM-750x930.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.21.41\u202fAM-400x496.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.21.41\u202fAM-250x310.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.21.41\u202fAM.png 1612w\" sizes=\"(max-width: 826px) 100vw, 826px\" \/><\/figure>\n\n\n\n<p>For more information about the internal RTC, please refer to STM32G0x0 reference manual.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Driver Development:<\/h2>\n\n\n\n<p>We start of by creating new project with name of RTC. For how to create new project, please refer to <a href=\"https:\/\/blog.embeddedexpert.io\/?p=2299\" data-type=\"URL\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=2299\" target=\"_blank\" rel=\"noreferrer noopener\">this guide<\/a>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Once you have created your project, from System Core, select RCC and set Low Speed Clock (LSE) to be Crystal \/ Ceramic oscillator.<\/p>\n\n\n\n<p>Note: If your board doesn&#8217;t have external LSE, skip this part.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"571\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-44-11-1024x571.jpg\" alt=\"\" class=\"wp-image-2639\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-44-11-1024x571.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-44-11-300x167.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-44-11-768x428.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-44-11-1536x856.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-44-11-2048x1141.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-44-11-1150x641.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-44-11-750x418.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-44-11-400x223.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-44-11-250x139.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Then from timers, select RTC and select active clock source then activate calendar.<\/p>\n\n\n\n<p>Leave the settings as is or set the time and date as your need.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"569\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-45-23-1024x569.jpg\" alt=\"\" class=\"wp-image-2640\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-45-23-1024x569.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-45-23-300x167.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-45-23-768x427.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-45-23-1536x854.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-45-23-2048x1138.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-45-23-1150x639.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-45-23-750x417.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-45-23-400x222.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-45-23-250x139.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Next, from Clock Configuration tab, set LSE to be the RTC clock source as shown in figure below:<\/p>\n\n\n\n<p>Skip this step if you are not using external oscillator.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"564\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-46-16-1024x564.jpg\" alt=\"\" class=\"wp-image-2641\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-46-16-1024x564.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-46-16-300x165.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-46-16-768x423.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-46-16-1536x846.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-46-16-2048x1128.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-46-16-1150x633.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-46-16-750x413.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-46-16-400x220.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/2024-06-28_07-46-16-250x138.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Also, you need to enable the UART, please refer to <a href=\"https:\/\/blog.embeddedexpert.io\/?p=2316\" data-type=\"URL\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=2316\" target=\"_blank\" rel=\"noreferrer noopener\">this guide<\/a> for how to enable the UART.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Save the project this shall generate the codes needed.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In main.c file.<\/p>\n\n\n\n<p>In user begin includes, include the stdio header file as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">\/* USER CODE BEGIN Includes *\/\n#include &quot;stdio.h&quot;\n\/* USER CODE END Includes *\/<\/pre><\/div>\n\n\n\n<p>Next, in user code begin PV, declare the following two data structure for the RTC operation:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">\/* USER CODE BEGIN PV *\/\nRTC_TimeTypeDef gTime = {0};\nRTC_DateTypeDef gDate = {0};\n\/* USER CODE END PV *\/<\/pre><\/div>\n\n\n\n<p>First data structure is to store the time while the second one is to store the date.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In user code begin 0, we shall retarget the printf to user UART as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">int __io_putchar(int ch)\n{\n\tHAL_UART_Transmit(&amp;huart2, &amp;ch, 1, 5);\n\n\treturn ch;\n}<\/pre><\/div>\n\n\n\n<p>This will allow us to use terminal to display the results.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In RTC_MX_Init function, at user code begin check_RTC_BKUP:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">  \/* USER CODE BEGIN Check_RTC_BKUP *\/\n  if (HAL_RTCEx_BKUPRead(&amp;hrtc, RTC_BKP_DR1)== 0x4567)\n  {\n\t  return ;\n  }\n  \/* USER CODE END Check_RTC_BKUP *\/<\/pre><\/div>\n\n\n\n<p>This line, will prevent entering new date and time once the MCU is reseted.<\/p>\n\n\n\n<p>At user code begin RTC_Init_2, add this line:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">  \/* USER CODE BEGIN RTC_Init 2 *\/\n  HAL_RTCEx_BKUPWrite(&amp;hrtc, RTC_BKP_DR1, 0x4567);\n\n\n  \/* USER CODE END RTC_Init 2 *\/<\/pre><\/div>\n\n\n\n<p>By writing any value to the RTC backup register, this will lock the RTC from configuration. During the boot, we shall check this register if it has the same value, then no need to reinitialize the RTC data.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In while 1 loop, user code begin 3:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">\t\tif (HAL_RTC_GetTime(&amp;hrtc, &amp;gTime, RTC_FORMAT_BIN) != HAL_OK)\n\t\t{\n\t\t\tError_Handler();\n\t\t}\n\t\tif(HAL_RTC_GetDate(&amp;hrtc, &amp;gDate, RTC_FORMAT_BIN)!=HAL_OK)\n\t\t{\n\t\t\tError_Handler();\n\t\t}\n\n\t\tprintf(&quot;Time is %d:%d:%d\\r\\n&quot;,gTime.Hours,gTime.Minutes,gTime.Seconds);\n\t\tprintf(&quot;Date is %d\/%d\/%d\\r\\n&quot;,gDate.Date,gDate.Month,gDate.Year);\n\t\tHAL_Delay(500);<\/pre><\/div>\n\n\n\n<p>Read the RTC time and date.<\/p>\n\n\n\n<p>Print the time and date.<\/p>\n\n\n\n<p>Delay by 500ms.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Results:<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Build and run the project on your STM32G070, open your serial terminal application and set the buadrate to 115200 and you should get the following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"741\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.13.17\u202fAM-1024x741.png\" alt=\"\" class=\"wp-image-2642\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.13.17\u202fAM-1024x741.png 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.13.17\u202fAM-300x217.png 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.13.17\u202fAM-768x556.png 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.13.17\u202fAM-1150x832.png 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.13.17\u202fAM-750x543.png 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.13.17\u202fAM-400x289.png 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.13.17\u202fAM-250x181.png 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/06\/Screenshot-2024-06-28-at-8.13.17\u202fAM.png 1164w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide on the internal RTC of STM32G0, we shall configure the RTC and display the time and date on the serial terminal. In this guide, we shall cover the following: Internal RTC. Driver development. Results. 1. Internal RTC: The RTC provides an automatic wakeup to manage all low-power modes. The real-time clock (RTC) [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,2,11,12],"tags":[],"class_list":["post-2636","post","type-post","status-publish","format-standard","hentry","category-data-structures","category-embedded-systems","category-peripheral-drivers","category-stm32"],"_links":{"self":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/2636"}],"collection":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2636"}],"version-history":[{"count":1,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/2636\/revisions"}],"predecessor-version":[{"id":2643,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/2636\/revisions\/2643"}],"wp:attachment":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}