Topic : SysTick interrupt stopped working after updating Ride&RKIT-ARM

Forum : ARM

Original Post
Post Information Post
February 18, 2009 - 12:56pm
Guest

Hi,
I have a project on STM32-eval board (STM32F106VET6) and after updating Ride7 and RKIT-ARM to their versions 7.16.0000 and 1.16.0930 a working systick-interrupt stopped working. Would this reguire some changes to project settings and/or code? I have an Rlink Pro for debugging and I have a breakpoint in stm3210x_it.c's sysTickHandler() but the program never executes it. Handler code is:

void SysTickHandler(void)
{
TimingDelay_Decrement();
TickCounter++; // a global u32 variable
}

In project settings/LD linker/Libraries "ST" library is set to "No" to make sure that program uses project's own interrupt-handler. In Application Options/Directories/Library Directories currently include the library from ride7 (C:\Program Files\Raisonance\Ride\Lib\ARM) and I have modified C:\Program Files\Raisonance\Ride\Lib\ARM\STM32F10x_LIB\library\src\stm3210x_it.c to include the interrupt above. In main.c the systick is enabled as following:

/* SysTick end of count event each 1ms with input clock equal to 9MHz (HCLK/8, default) */
SysTick_SetReload(9000);

/* Enable the SysTick Counter */
SysTick_CounterCmd(SysTick_Counter_Enable);
/* Enable SysTick interrupt */
SysTick_ITConfig(ENABLE);

Thanks for any help.

Replies
Post Information Post
+1
0
-1
February 18, 2009 - 2:45pm
Guest

Hi

The new gcc version 4.3.2 might be the reason explaining why you do not have the same behaviour.
This compiler has higher optimization process so your variable TickCounter might have been optimized.
To avoid such issues it is better to declare it as volatile if you need to use it this way.

If trying this does not help, please try to make a small project which shows this issue and sentd it to me
so it would be easier for us to find where is the problem.

Regards,
Matloub

+1
0
-1
February 19, 2009 - 2:42pm
Guest

Hi,
Thank you for your answer!
I tried to set the variable as volatile but it had no effect. I reproduced the issue with a test project and sent it to you via E-mail. Then I found a CD with older versions 7.02.0001 and 1.04.0001 and installing these solved the issue, so there seems to be a problem in the project/it's settings and the newer compiler.

+1
0
-1
April 1, 2009 - 5:11pm
Guest

Hi

Discussing by email with TR we had solve the issue:

There is a mistake in startup file which places systick at a wrong place in vector table.
The workaround is to modify the crt0_stm32x_HD.c file (c:\program files\raisonance\ride\lib\arm\),
Please note that you need to compile it and place the output in: c:\program files\raisonance\ride\lib\arm

The problem is corrected and won't appear on next release.

Modification:

Change this

void (* const g_pfnVectors[])(void) =
{
 &_estack,            /* The initial stack pointer*/
  Reset_Handler,             /* The reset handler*/
  NMIException,
  HardFaultException,
  MemManageException,
  SysTickHandler,
  BusFaultException,
  UsageFaultException,
  0, 0, 0, 0,            /* Reserved */ 
  0,                      /* Reserved */
  PendSVC,
  SVCHandler,
  DebugMonitor,

To

void (* const g_pfnVectors[])(void) =
{
&_estack,            // The initial stack pointer
  Reset_Handler,             // The reset handler
  NMIException,
  HardFaultException,
  MemManageException,
  BusFaultException,
  UsageFaultException,
  0, 0, 0, 0,            /* Reserved */ 
  SVCHandler,
  DebugMonitor,
  0,                      /* Reserved */
  PendSVC,
  SysTickHandler,

Regards,
Matloub