Skip to main content
Despair1337
Associate III
October 20, 2020
Question

User code regions are not generated everywhere when generation is set to .c/.h pair

  • October 20, 2020
  • 3 replies
  • 1365 views

Hello,

I found in CubeIDE awesome feature, where it generate peripheral initialization as pair of ".c/.h" files per peripheral. So far, it works perfectly, but I noticed, that I can't anymore define user-code in some functions. For example:

This is how FMC Init function looks like, when everything is in main.c

0693W000004KKpeQAG.pngBut when is code generated in separate .c / .h file, it doesn't have user-code regions:

0693W000004KKpjQAG.pngSo, where should I put my code now? I know that I can make my own functions in those files and call them from main.c, but having user-code regions would be most elegant solution. Also, the other functions like "HAL_SDRAM_MspInit" have user code regions. Any ideas?

Thanks.

EDIT: Also, fmc.c miss USER CODE 1 region :(

This topic has been closed for replies.

3 replies

Khouloud ZEMMELI
ST Employee
October 20, 2020

Hello @Despair1337​ 

Thanks for your feedback,

Could you please share some details about the part number used and the CubeMX/CubeIDE version (or share your ioc file)?

Thanks

Khouloud

Despair1337
Associate III
October 20, 2020

Hi @Khouloud ZEMMELI​ ,

It's STM32F429I-DISC1, CubeIDE version is 1.4.2, latest SDK for F4. I'm also attaching .ioc file.

Thanks

Khouloud ZEMMELI
ST Employee
October 20, 2020

Issue reproduced @Despair1337​  and it will be fixed.

Thanks for bringing this to our attention.

Regards,

Khouloud