cancel
Showing results for 
Search instead for 
Did you mean: 

SysTick_Handler stop working in 1.7.1 [STM32L431 generated project]

Anton Martinsen
Associate II

Hello all,

When upgrading to latest STM32CubeIDE 1.7.1, the generated project for STM32L431 did not trigger SysTick_Handler anymore.

I diffed the project from another project generated with 1.5.1 where it was working.

I found that it exclusively had to do with the file "Core/Src/system_stm32l4xx.c". There seems to have been some changes to VTOR addresses.

I diffed the files between projects with the following command:

$ diff working_project/Core/Src/system_stm32l4xx.c failing_project/Core/Src/system_stm32l4xx.c

I attach the diff in hopes for an explanation on what is wrong or in hopes that this is a bug that can be resolved.

[EDIT]

I noticed in the release notes for STM32L4xx CMSIS that this was added in V1.7.1:

  • system_stm32l4xx.c/.h
    • Update VTOR configuration to be modified by user

I understand that flexibility might be good but should not the default generated project at least have a working solution?

Best regards,

Anton

3 REPLIES 3
Anton Martinsen
Associate II

Just an update, in order to get it to work. I needed to go into system_stm32l4xx.c file and uncomment line 127:

/* #define USER_VECT_TAB_ADDRESS */

So that there is a define for USER_VECT_TAB_ADDRESS

Then it has a working vector table at the same flash address as in previous versions.

I am not sure if this is the intended way to work with this going forward.

Hello @Anton Martinsen​ ,

If you want to force SCB-> VTOR configuration, you shall just uncomment this line (Line 127) in system_stm32l4xx.c file:

The purpose is to set SCB->VTOR only when requested by user application, and this is deployed on all STM32 series.

/*!< Uncomment the following line if you need to relocate the vector table anywhere in Flash or Sram, else the vector table is kept at the automatic remap of boot address selected */
 
/* #define USER_VECT_TAB_ADDRESS */

The system_stm32l4xx.c available in CMSIS file is provided as template file and user shall copy/past this file in his application and customize it according to his needs.

Hope that I've answered your question 🙂 . If this the case, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly.

Do not hesitate to raise any issue/ feedback.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Hello @Imen DAHMEN​ 

Thank you for your answer!

I did not want to force anything, it was more like I was forced.

Before these changes STM32CubeMX always generated a project with a working vector table.

The generated project from STM32CubeMX (when using STM32CubeIDE) together with CMSIS 1.7.1 changes gave me a project that did not have a working vector table.

Now I have to go into system_stm32l4xx.c and uncomment a line of code in order to have working handlers.

Why are there no default addresses in the generated project anymore?

Maybe I am missing something here.

Have a wonderful day!

Best regards,

Anton