Stm32 internal clock problems with arduino ide

I want use STM32's internal clock with STM32RTC library. I use an example code. But when I upload the code, I take an error:

Arduino:1.8.8 (Windows 10), Kart:"Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STM32duino bootloader, 72Mhz (Normal), Smallest (default)"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\omerf\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\omerf\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\omerf\OneDrive\Belgeler\Arduino\libraries -fqbn=stm32duino:STM32F1:genericSTM32F103C:device_variant=STM32F103C8,upload_method=DFUUploadMethod,cpu_speed=speed_72mhz,opt=osstd -vid-pid=0X1EAF_0X0004 -ide-version=10808 -build-path C:\Users\omerf\AppData\Local\Temp\arduino_build_543908 -warnings=all -build-cache C:\Users\omerf\AppData\Local\Temp\arduino_cache_671723 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.stm32tools.path=C:\Users\omerf\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2022.9.26 -prefs=runtime.tools.stm32tools-2022.9.26.path=C:\Users\omerf\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2022.9.26 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\omerf\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=C:\Users\omerf\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -verbose C:\Users\omerf\AppData\Local\Temp\arduino_modified_sketch_574543\SimpleRTC.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\omerf\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\omerf\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\omerf\OneDrive\Belgeler\Arduino\libraries -fqbn=stm32duino:STM32F1:genericSTM32F103C:device_variant=STM32F103C8,upload_method=DFUUploadMethod,cpu_speed=speed_72mhz,opt=osstd -vid-pid=0X1EAF_0X0004 -ide-version=10808 -build-path C:\Users\omerf\AppData\Local\Temp\arduino_build_543908 -warnings=all -build-cache C:\Users\omerf\AppData\Local\Temp\arduino_cache_671723 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.stm32tools.path=C:\Users\omerf\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2022.9.26 -prefs=runtime.tools.stm32tools-2022.9.26.path=C:\Users\omerf\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2022.9.26 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\omerf\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=C:\Users\omerf\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -verbose C:\Users\omerf\AppData\Local\Temp\arduino_modified_sketch_574543\SimpleRTC.ino
Using board 'genericSTM32F103C' from platform in folder: C:\Users\omerf\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26
Using core 'maple' from platform in folder: C:\Users\omerf\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2022.9.26
Detecting libraries used...
"C:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOC -DERROR_LED_PIN=13 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10808 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DSERIAL_USB -DGENERIC_BOOTLOADER -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple" "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/include" "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/stm32f1/include" "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/usb/stm32f1" "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/usb/usb_lib" "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\cores\\maple" "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\variants\\generic_stm32f103c" "C:\\Users\\omerf\\AppData\\Local\\Temp\\arduino_build_543908\\sketch\\SimpleRTC.ino.cpp" -o nul
"C:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\arm-none-eabi-gcc\\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -w -DDEBUG_LEVEL=DEBUG_NONE -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8002000 -DERROR_LED_PORT=GPIOC -DERROR_LED_PIN=13 -w -x c++ -E -CC -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10808 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DSERIAL_USB -DGENERIC_BOOTLOADER -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ -DMCU_STM32F103C8 -mthumb -march=armv7-m -D__STM32F1__ "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple" "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/include" "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/stm32f1/include" "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/usb/stm32f1" "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\system/libmaple/usb/usb_lib" "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\cores\\maple" "-IC:\\Users\\omerf\\AppData\\Local\\Arduino15\\packages\\stm32duino\\hardware\\STM32F1\\2022.9.26\\variants\\generic_stm32f103c" "-IC:\\Users\\omerf\\OneDrive\\Belgeler\\Arduino\\libraries\\STM32RTC-main\\src" "C:\\Users\\omerf\\AppData\\Local\\Temp\\arduino_build_543908\\sketch\\SimpleRTC.ino.cpp" -o nul
In file included from C:\Users\omerf\OneDrive\Belgeler\Arduino\libraries\STM32RTC-main\src/STM32RTC.h:44:0,

                 from C:\Users\omerf\AppData\Local\Temp\arduino_modified_sketch_574543\SimpleRTC.ino:17:

C:\Users\omerf\OneDrive\Belgeler\Arduino\libraries\STM32RTC-main\src/rtc.h:42:23: fatal error: stm32_def.h: No such file or directory

 #include "stm32_def.h"

                       ^

compilation terminated.

Şu dizinde 1.4.0 sürümündeki STM32RTC-main kütüphanesi kullanılıyor: C:\Users\omerf\OneDrive\Belgeler\Arduino\libraries\STM32RTC-main 
exit status 1
Error compiling for board Generic STM32F103C series.

I use a STM32F103C8 board. What should I do?

My codes:

/*
  SimpleRTC

  This sketch shows how to configure the RTC and to display
  the date and time periodically

  Creation 12 Dec 2017
  by Wi6Labs
  Modified 03 Jul 2020
  by Frederic Pillon for STMicroelectronics

  This example code is in the public domain.

  https://github.com/stm32duino/STM32RTC
*/

#include <STM32RTC.h>

/* Get the rtc object */
STM32RTC& rtc = STM32RTC::getInstance();

/* Change these values to set the current initial time */
const byte seconds = 0;
const byte minutes = 52;
const byte hours = 16;

/* Change these values to set the current initial date */
/* Monday 15th June 2015 */
const byte weekDay = 1;
const byte day = 15;
const byte month = 6;
const byte year = 15;

void setup()
{
  Serial.begin(9600);

  // Select RTC clock source: LSI_CLOCK, LSE_CLOCK or HSE_CLOCK.
  // By default the LSI is selected as source.
  //rtc.setClockSource(STM32RTC::LSE_CLOCK);

  rtc.begin(); // initialize RTC 24H format

  // Set the time
  rtc.setHours(hours);
  rtc.setMinutes(minutes);
  rtc.setSeconds(seconds);

  // Set the date
  rtc.setWeekDay(weekDay);
  rtc.setDay(day);
  rtc.setMonth(month);
  rtc.setYear(year);

  // you can use also
  //rtc.setTime(hours, minutes, seconds);
  //rtc.setDate(weekDay, day, month, year);
}

void loop()
{
  // Print date...
  Serial.printf("%02d/%02d/%02d ", rtc.getDay(), rtc.getMonth(), rtc.getYear());

  // ...and time
  Serial.printf("%02d:%02d:%02d.%03d\n", rtc.getHours(), rtc.getMinutes(), rtc.getSeconds(), rtc.getSubSeconds());

  delay(1000);
}

What is [IMMEDIATE] about your topic ?

Have you posted the complete error message copied from the IDE with the button provided for the purpose ? When posting it please use code tags

Sorry, I don't understand. What do you mean

Which part don't you understand ?

Have you posted the complete error message copied from the IDE with the button provided for the purpose ? When posting it please use code tags

OP labels all topics like this.

Because for my project

You have multiple topics on the same subject.

Same subject? IMMIDIATE? Or other?

Yes.

But why do you care so much about this?

You signed the papers...

And, you were warned before...

I have never done anything bad to you. I'm just doing a few projects at once and need to be fast. That's why I'm opening a title like this.

I agree, and likewise.

For topic?

Okay. I delete "IMMEDIATE"

  • Make one topic (title) per subject.
  • If you have a different subject (content of your issue), another topic is good.
  • State your issue, show drawings (as best you can), show sketch (minimum, reproducible)

Please answer the question posed earlier

Ok. I did.

I've read the 3 topics by the OP and accept that they are sufficiently different to warrant being posted separately, so I will leave them alone. I think the OP understood my warning about multiple topics that I gave him / her.

I think the discussion about the urgency has gone on long enough, I shall summarise:
The help you get here is given free of change by volunteers working in their spare time, so they respond when it suits them. People requiring a response in a particular time frame should post in the Jobs forum category and offer a fee for a response in the desired time frame, and hope someone is willing to oblige.

Please do continue to assist the OP.