cancel
Showing results for 
Search instead for 
Did you mean: 

How Is "system_stm32xxxx.c" File Included?

jvavra
Associate III

I'm having a brain fart and can't figure this out. I'm porting an existing project from the STM32F205 series to the STM32L496 series. So I replaced "system_stmf2xx.c" with "system_stml4xx.c" in my project workspace, but my compiler (IAR) isn't picking it up. It looks like the startup_stm32l496xx.s assembly file is making calls into the system file. So where is the startup file included?

6 REPLIES 6
TDK
Guru

Is the error from the linker?

In STM32CubeIDE, you would need to ensure system_stml4xx.c is being compiled and passed to the linker. Should be something similar in IAR.

If you feel a post has answered your question, please click "Accept as Solution".
jvavra
Associate III

The error(s) are actually about variable types being undefined: u8, u16, etc. These are all defined in stm32l4xx.h, so I deduced that's not being included. That header gets called out in system_stm32l4xx.c. system_stm32l4xx.c should actually have about 30 header files under it in the project tree if it was being included properly. I have none.

TDK
Guru

It's going to be easier if you show the exact error message.

If you feel a post has answered your question, please click "Accept as Solution".
jvavra
Associate III

0693W00000DqFsnQAF.jpgHere's some of them.

Pavel A.
Evangelist III

https://github.com/STMicroelectronics/cmsis_device_l4/blob/master/Include/stm32l4xx.h

As you see, stm32l4xx.h does not define types "u16", "u8" etc. It rather uses stdint.h.

Also, system_stml4xx.c does not include a lot of .h files.

https://github.com/STMicroelectronics/cmsis_device_l4/blob/master/Source/Templates/system_stm32l4xx.c

Confused? the messages come from compiling some other .c file, not system_stml4xx.c

TDK
Guru

Sure looks like the error messages are from "adjust_px5000.c" and not from a system startup file.

If you feel a post has answered your question, please click "Accept as Solution".