Skip to main content
Visitor II
January 9, 2024
Question

HAL_GetTick always returns 0 after modifying the icf file

  • January 9, 2024
  • 2 replies
  • 2188 views

Hi, I am using H743.

I am testing to upgrade my firmware using the FWupgrade_Standalone example.

My firmware worked fine.

However, when I modified the next two lines of the icf file to 0x08020000 to upload to FWupgrade_Standalone, HAL_GetTick returned 0 and it doesn't work.

 

/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08020000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x08020000;

 

Is there a solution?

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    January 25, 2024

    Hello @Croaker ,

    You must also respect the way it defines the SCB->VTOR on the basis you have chosen in SystemInit().

    Please take a look to this post may help.

    Thank you.

    Kaouthar

    Technical Moderator
    January 25, 2024

    Hi @Croaker 

    It should be OK to set SCB->VTOR to 0x08020000 as we require to locate the VTOR at the beginning of the code region. 

    But it is easier and more compliant with HAL to change the  VECT_TAB_OFFSET, the Vector Table base offset field. This value must be a multiple of 0x200.

    In you case, you need to change it as follow: 

    #define VECT_TAB_OFFSET 0x20000UL 

    I modified the GPIO example in ~\Repository\STM32Cube_FW_H7_V1.11.1\Projects\NUCLEO-H743ZI\Examples\GPIO\GPIO_EXTI and It is working well. 

    Please find attached the 2 modified files for your use case. Please search inside ( /* MODIF ) to see the changes in that files.

    Best Regards,

    Younes

     

    Graduate II
    January 25, 2024

    Could I please ask the ST move away from using #defines to set the vector address, but rather use the linker symbol created for the Vector Table so it then follows the linker script, scatter file, or .ICF and whatever build address the user selects therein?

    Technical Moderator
    January 25, 2024

    Excellent request, I will double check the reasons behind using both scatter files and pre-processing macros for code and data mapping configurations !!! then suggest keeping only the configuration inside the scatter files !!