Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


[solved] Symbol 'SysTick_IRQn' could not be resolved

Hi everyone.
I’m making my first steps (a simple “blink” program) with SW4STM32 but I’m really struggling.
I created a project with STM32CubeMX and followed the instructions on how to import it to SW4STM32. I then wrote my main with the blink code.
But when I build all, I get the following error : ‘SysTick_IRQn’ could not be resolved on the line : HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);

I tried refreshing the index already but it didn’t do much.

Also, I tried removing the line and just resetting my LED with HAL_GPIO_WritePin but when I upload it to the board with Texane’s stlink, the LED stays on... I don’t know if the problem comes from the .bin or from my installation of Texane’s STlink.
Well I realized that I shouldn’t use command line to flash the NUCLEO, just drag-drop the .bin to the Nucleo in my file manager.
I have tried a “toggle GPIO” example of CubeMX, the one that were given with the software and it works. I don’t understand why it doesn’t on my own project, generated with Cube...


Thanks in advance for your help

PS : I’m running on ubuntu, and my platform is a Nucleo-F411RE

I have the same issue. Happened on the wonderful day that I was demoing OpenSTM32 for a development team.

I tried changing the systick timer to another timer and commented out the SysTick_IRQn from the declaration. Not a great solution.

Looking forward to a solution.


Haha sounds embarrassing... I did the same, seems like HAL_Delay doesn’t use Systick after all. If I figure out a way around it I will let you know!

One of my machines doesn’t recognize Systick_IRQn, one setup does. Not sure if a header has been dropped in an update. Quick fix (patch) replace Sytick_IrQn with -1 . That is the Cortex M4 Systick processor exception number.

If you work with STM32CubeMX you have to check the BOX “Generate peripheral init as a pair ...”.
An ohter issue that i had was, to plug my STM32... over an USB HUB.

The document behind link pipopoplin provided was very us full for me.
I’m facing the same problem as mdundas does. I assume, that I have a more complex configuration than mdundas has, because I get error messages also for DMA1_Ch2_3_DMA2_Ch1_2_IRQn and DMA1_Ch4_7_DMA2_Ch3_5_IRQn. These are all exception numbers defined in “stm32fxc.h” in the enum “IRQn_Type”.
If I rename “SysTick_IRQn” to something else, for example to “SysTick_IRQn2”, in this header file and in my main.c, the error message disappears for the main.c If document out the definition of “SysTick_IRQn” in the header file, I get the same error message as with the original definition.
I created a new enum. All members worked fine, except “SysTick_IRQn”. The suspicion rose, that “SysTick_IRQn” is multiple defined. I renamed all “stm32fxc.h” files, except the one for my processor type. With the result, that the error for “SysTick_IRQn” was solved. When I gave one of the other “stm32fxc.h” his original name back, the error was also back. I added the following line to this file: #define Foo 1”, right after

  1. ifndef __STM32F038xx_H
  2. define __STM32F038xx_H

and in my main.c: Foo; Foo couldn’t be resolved. Then I added this piece of code right before the enumeration, same result. Now I added Foo = -1, inside the enumeration. Now Foo could be resolved!
My conclusion is, that in some mysterious way this enumeration from any of theses header files in my project find it’s way in to the program building process, even the rest of the file is ignored.
By the way, also the error messages for the other interrupt definitions disappeared.

Have look at “Forums » System Workbench for STM32» importing a CubeMX project”. The problem is raised by the indexer. Exclude unused header files from the index solved all my problems!
Germany

Hello @all

I´ve got here the same problem!

If under Project settings, you uncheck “Generate Under Root” before generating your project files it resolves the issue.
France

The proper solution, as explained In this FAQ entryQuestion is to uncheck “Index unused headers” from the project properties (or workspace preferences) on the C/C++ Build >> Indexer page.

Unchecking “Renerate under root” just accidentally solve this problem but creates other problems (difficulty to manage your project under SVN or GIT or to add your own source and header files for example) that made it a less-than-optimal solution.

Bernard (Ac6)

I agree with dautrevaux. Unchecking “Generate under root” is just hiding the problem, not really solving it. Source code management in this becomes extemely inconvenient as well as directory structure in the project.
Thank you, that was the solution.

Seems like the solution with keeping “Generate under root” in place found.

My current project uses L151CCT , but definitely it should work with any other.
So, in my directory ../Drivers/CMSIS/Device/ST/STM32L1xx/Include
only three working files left:

stm32l1xx.h
stm32l151xc.h
system_stm32l1xx.h

All the other headers I moved to archive just in case.
Actually it’s been said above about deleting all the other headers from this directory. I’m not so radical :-)

Definitely this is a bug (not huge, but...), that should be fixed in the next releases.

Happy STMting :-)

France

The proper solution, as explained In this FAQ entryQuestion is to uncheck “Index unused headers” from the project properties (or workspace preferences) on the C/C++ Build >> Indexer page. This will automatically do exactly what you have done, but in a lot cleaner way as, as soon as you need one of th eexcluded files it will again be indexed.

Bernard (Ac6)

Bernard,
Hmm... I’m still not too familiar with Eclipse. And, if read how many threads were created about this problem, not too many people know Eclipse in details :-)

And, BTW,
‘’To solve this error, you should request that System Workbench do not parse files that are not used by your project, by opening th eindexer properties dialog (project >> Properties >> C/C++ General >> Indexer) then check the Enable project specific settings checkbox and uncheck the Index unused headers checkbox.

You may also suppress indexing of unused headers for all projects that do not have project-specific indexer settings by modifying the workspace settings at Window >> Preferences >> C/C++ >> Indexer.’’

I could not find anything about indexer at these paths...

Nevertheless, seems like this option set be default now.


I looked into it a bit and figured that the enum is in the stm32f411xe.h (for my board), under the type name IRQn.
THis header is indeed called and the enum names respect the names that create the errors, I really don’t get why...

Anyway, one can replace every IRQn name by its value in enum, but I hope there is a better solution!

By the way, stm32f411xe.h (or any unit’s name that you use) is called by stm32f4xx.h, which is called by system_stm32f4xx.c .


Hi

One can check Project -> Properties -> (Tree) C/C++ Bulid -> Settings -> (Tab) Target if the right MCU is configured. (stm32f103cb for me)
One can view the includes with the include browser:
Open Window -> Show View -> Include Browser then drag and drop main.c into the window.

For me the hira is:

main.c -> stm32f1xx_hal.h -> stm32f1xx_hal_config.h -> stm32f1xx_hal_rcc.h -> stm32f1xx_hal_def.h -> stm32f1xx.h -> stm32f103xb.h

There the typedef is found.

When I export from CubeMX as SW4STM32 project with “Generate under root” checked, then the Systick_IRQn def is missing.
So I stay with the “classic” way of export/import.

Dieter


Same happens for example with “DMA1_Channel6_IRQn”

There seems to be some kind of System behind this missing values.

Harry


Hi dieter, you’re right : unchecking “generate under root” solved the issue for me. What does this option stand for? What’s the difference between the 2?

Thanks for the fix!


Hi,
I know that this topic are marked as solved, but I figured out another solution to this problem.
The problem is that some symbol aren’t recognized. So the solution is “refreshing” the environment.

Right click the project, then go to “Index” and click in all options available, leaving the “Rebuild” option for the last. This may solve the problem.

Bug Symbol


If you work with STM32CubeMX you have to check the BOX “Generate peripheral init as a pair ...”.
An ohter issue that i had was, to plug my STM32... over an USB HUB.



 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs