This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PM: can not access the systick handeler

Part Number: TM4C123GH6PM

Hello Team,

My Customer can not access the systick handler to execute their code even they enable interrupt bit in the control register where they used this preferral just to normal counting for the delay and this preferal did not need NVIC enabling too.

GPIO_TEST6.rar

Regards,

Renan

  • Hi,

      - If the code is intending to generate a systick interrupt then I don't see the systick vector declared in the vector table. On line 85 of the vector table, it is pointing to IntDefaultHandler instead of a specific systick ISR. 

    - There is a systick example in TivaWare library. You can find in C:\ti\TivaWare_C_Series-2.2.0.295\examples\peripherals\systick. The example configures the systick to generate interrupt every 1s. 

    - The code you show is custom driver. Any reason not using the proven TivaWare peripheral drivers? I will suggest you compare your driver with the TivaWare. 

  • Hello Charles,

    Good day and thank you for this response.

    My customer provided a reply below:

    in the tm4c123gh6pm_startup_ccs.obj file when i replaced IntDefaultHandler with SysTickIntHandler for define it in the vector table it give me error.

    Regards,

    Renan

  • Hi Renan,

    in the tm4c123gh6pm_startup_ccs.obj file when i replaced IntDefaultHandler with SysTickIntHandler for define it in the vector table it give me error.

      Can you be more specific on what error? Are you getting a compiler/linker error? You declare the SysTickIntHandler in the vector table but do you have this ISR function defined in your source file?

      Did you have a chance to run the systick example that I mentioned? 

  • Hello Charles,

    Please see my customer response below:

    i update the code to replace IntDefaultHandler with SysTickIntHandler in tm4c123gh6pm_startup_ccs.c for define it in the vector table it give me "error #20: identifier "SysTickIntHandler" is undefined". there is some thing else.please check the code.

    GPIO_TEST6_2.rar

    Thank you in advance

    Regards,

    Renan

  • i update the code to replace IntDefaultHandler with SysTickIntHandler in tm4c123gh6pm_startup_ccs.c for define it in the vector table it give me "error #20: identifier "SysTickIntHandler" is undefined".

    The tm4c123gh6pm_startup_ccs.c needs a declaration for the SysTickIntHandler function.

    Try adding:

    //*****************************************************************************
    //
    // External declarations for the interrupt handlers used by the application.
    //
    //*****************************************************************************
    void SysTickIntHandler(void);

  •  Hello Charles,

    Please see my customer response below:

    I update the code as you mention but i had new error ""../main.c", line 10: fatal error #1965: cannot open source file " tm4c123gh6pm_startup_ccs.h"" the problem still remain.

    Thank you in advance

    Regards,

    Renan

     

  • Hi Renan,

      I don't understand why you rejected Chester's answer who is our community contributor without first verifying his solution is correct. First of all, there is no such file as tm4c123gh6pm_startup_ccs.h but rather the tm4c123gh6pm_startup_ccs.c file instead. I simply added the below line as suggested by Chester to the tm4c123gh6pm_startup_ccs.c and everything compiles fine. 

    extern void SysTickIntHandler(void);

    Here is the modified project. 

    GPIO_TEST6.zip

  • Hello Carles,

    Thank you for this response. We already fix systick handler but still face issues. the code
    SYSTICK_SINGLE_INTERVAL(50000000 , fun );
    when i put it in while (1){......}
    it did not work to periodically perform fun code as time end .it loop without entering handler but it work when t put this code before while(1) 

    Thanks in advance.

    Regards,

    Renan

  • When you are in while (1) you keep reinitializing the systick timer by calling SYSTICK_SINGLE_INTERVAL repeatedly. The timer is reinitialized to preload value of 50000000 constantly. Before it has a chance to count down to 0 to generate an interrupt, it is reinitialized again to 50000000 . That is why it didn't work. 

    I think Chester and I have already solved your original question. If you have new question, please open a new thread instead continuing on the same thread for different questions. This is to not to clutter the threads per forum guideline.