RTC driver stm32F103

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

RTC driver stm32F103

Post by DeusExMachina »

Where is any example using RTC driver? I use one this way:

Code: Select all

RTCDriver * rtc;
RTCTime * ts;
...
   Init_BKP();
   read_BKP_settings();                      
   halInit();
   chSysInit();
   stm32_IwdgSetup();


   if (RCC->CSR & (1<<29))                           // IWDG Reset Flag set
       RCC->CSR |= (1<<24);                        // Clear Reset Flags

   SetupUSART2(9600, 30); // -<<< CRASH HERE
   SetupUART4(115200, 3);
   SetupUART5(PM_SPEED, PM_PARITY, PM_STOP_BITS); //RS485

   //tim2+interrupts
   SetupTIM2();
   //tim7 +interrupts
   SetupTIM7();
   spi2_init();

/*IF i disable this 3 lines program will run OK*/
   ts->tv_sec = 0; // при запуске сбрасываем время на 0
   ts->tv_msec = 0;
   rtcSetTime(rtc, ts);
...

After running this code OS hangs up, gdb kiks me to vectors.c endless loop. I don't use HAL uart and spi drivers at all. I think I have problems with redefining of interrupt vectors. What i can do? :)
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: RTC driver stm32F103

Post by Giovanni »

Hi,

The HAL examples are under ./testhal but the code you posted is not sufficient to explain what you are experiencing, the exception happens in one of your functions and I don't know what you do inside there.

Try to create a smaller test case if you believe there is a problem in the OS code.

Giovanni
Post Reply