Page 1 of 1

RTC driver stm32F103

Posted: Mon Sep 24, 2012 11:20 am
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? :)

Re: RTC driver stm32F103

Posted: Tue Sep 25, 2012 6:25 am
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