This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SYSTICK_HANDLER DEFINITION

Good morning 

I would use the SysTick to generate an interrupt every 1ms, to toggle a pin.

If I have understood well I could use the following line of code to configure the systick

 SysTick_Config(SystemCoreClock / 1000);

Is it correct?

Besides in a startup.c file ( under the ra folder) the SysTick_Handler() is week reference to the default handler :-

 #define WEAK_REF_ATTRIBUTE    __attribute__((weak, alias("Default_Handler")))

void SysTick_Handler(void) WEAK_REF_ATTRIBUTE;

How and where in my application can I redefine the SysTick_Handler function?

Thabnks in advance




[locked by: IK_Renesas at 16:35 (GMT 0) on 12 Feb 2024]
Parents
  • I think it should be (SystemCoreClock/1000)-1

    Or that’s what is says in NXP’s manuals.

    so, if you have a 16MHz clock and you want an interrupt every second, set it to 15999999.

    I would have expected an entry on the FSP CLOCKs page to set whether Systick is clocked from LOCO or ICLK, but it appears that has to be done manually by setting or clearing bit 2 of Systick CSR.

    Is it 1 for ICLK and 0 for the Systick clock?

Reply
  • I think it should be (SystemCoreClock/1000)-1

    Or that’s what is says in NXP’s manuals.

    so, if you have a 16MHz clock and you want an interrupt every second, set it to 15999999.

    I would have expected an entry on the FSP CLOCKs page to set whether Systick is clocked from LOCO or ICLK, but it appears that has to be done manually by setting or clearing bit 2 of Systick CSR.

    Is it 1 for ICLK and 0 for the Systick clock?

Children
No Data