Skip to main content
Graduate II
December 26, 2024
Solved

Error: Symbol SysTick_Handler multiply defined (by port_arm_cm4f.o and delay.o)

  • December 26, 2024
  • 6 replies
  • 2415 views

Hello,
I'm using the STM32F407 board. I'm trying to implement FreeRTOS on a smart parking system but when using the RFID i need to define SysTick_Handler two times. How can i resolve this problem.

    This topic has been closed for replies.
    Best answer by TDK

    When you add FreeRTOS manually, search for and delete the duplicate definitions for SysTick_Handler, etc. Use Search -> File... to search all files in the project.

    6 replies

    Technical Moderator
    December 26, 2024

    Hello @Azizz and welcome to the community,

    Need to clarify what do you mean by :


    @Azizz wrote:

     i need to define SysTick_Handler two times. 


    Please provide more details about your use case.

    Technical Moderator
    December 26, 2024

    May be I understood your question.

    I think you have a multiple duplication error when compiling the project. But for that you need to share your project so we could have a look at it. Sharing the main.c file is not sufficient.

    AzizzAuthor
    Graduate II
    December 26, 2024

    I am using an RC522 library for RFID functionality. When I manually add FreeRTOS to my project, the code reports that the SVC_Handler, SysTick_Handler, and PendSV_Handler functions are defined twice: once in the FreeRTOS port files and again in the stm32f4xx_it.c file. However, if I remove these functions from stm32f4xx_it.c, the RFID functionality stops working.

    AzizzAuthor
    Graduate II
    December 26, 2024

    can you please apply freertos task in the project because i can't due to the error .
    its a simple project when rfid detect a card in generate a pwm signal to control a servo motor to open.

    Technical Moderator
    December 26, 2024

    I'm not expert of RFID interface.

    To me when you enable FreeRTOS you need to select another time base for HAL because FreeRTOs is using Systick.

    In CubeMx, select another time base source instead of Systick. Example select TIM6:

    SofLit_0-1735210776855.png

     

    AzizzAuthor
    Graduate II
    December 26, 2024

    same problem  the code reports that the SVC_Handler, SysTick_Handler, and PendSV_Handler functions are defined twice(when i select TIM6 as time base for HAL).

    Technical Moderator
    December 26, 2024

    Sorry I didn't understand how you did add FreeRTOS in your project? manually? or over CubeMx?

    You need to add FreeRTOS in CubeMx:

    SofLit_0-1735211874200.png

    Don't add FreeRTOS manually.

    You need to configure FreeRTOS, tasks, etc.. in this menu:

    SofLit_1-1735211944515.png

    And as stated previously, don't forget to set select another time base source instead of Systick.

    AzizzAuthor
    Graduate II
    December 26, 2024
     
    I am required to add FreeRTOS manually; it is a constraint given by my university professor. Is there another solution?
     
    Technical Moderator
    December 26, 2024

    I recommend to add it from CubeMx. Otherwise it will be more difficult to adapt it with CubeMx for many reasons and I don't recommend adding it manually. Or tell your professor to help you on that.

    TDKAnswer
    Super User
    December 26, 2024

    When you add FreeRTOS manually, search for and delete the duplicate definitions for SysTick_Handler, etc. Use Search -> File... to search all files in the project.