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


CubeMx corrupting the project

Hello everyone!
This is my first project with AC6 + CubeMX and I’m in trouble ...
The CubeMx can generate the project correctly! However, if I add a file “.c” the CubeMx corrupts the project to re-generate ....

To add files, followed the tip of this post:
   http://www.openstm32.org/forumthread543Question

I also discovered that the CubeMx also corrupts the project if I add a new “Path Variables” (where the ‘project_loc’, ‘workspace_loc’, among others) ...

Has anyone had a similar problem?
Thank you!

I guess CubeMX simply regen the .project and .cproject each time
this is the 2 eclipse file you are modifying when you add a file folder or do change any c/c++ setting etc ...
so your can see why you are in trouble to add any file or customize any file and you regenerates code.

normaly you should only add code in between
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
nothing else ! What is definitvely not apropriate to build more complex project starting or keepign playing with cube to do part of the work for you.

It is actualy a shame how the ac6 project is managed if project was directly linking the cube “src” and “inc” instead of having a real folder with linked file
then you would just need to put your extra file in here and voila new file would be added automaticaly (not new folder)

here are some recipe to customize CubeMX project

One simple way i have found to add a couple of file for quick/dirty test is to put file in the cubemx root “inc” folder and incldue fiile in the main

/* USER CODE BEGIN 0 */

  1. include “myfile.c”

/* USER CODE END 0 */

file does not appear in src and depedencies may not work well but for simple and quick project test that’s conveniant .
Sure it’s not the nicest but i do not see simpler alternative.

A more complex way is to mirror “duplicate” the full intilial sw4stm32 folder into some new folder at exact same level
open the mirorred .project and .cproejct search and replace project name by new one (name of the new folder )
that is mandatory if you want to open both project in ecplise as it will not let you open 2 project with same name in same workspace!
Do all your custom file adition setting, etc from no own in the mirror poject , the initial project simply remain for cube gen and will never build due to missing file.

When you need to add an ip etc and regen.if you add file folder include option etc you will need to reflect changes
Grab changes (include new folder files etc.. ...) from original .projects and .cproject by using external diff tools (winmerge/meld)
comparing side by side the file/fodler make it easy an fast.
take care eclipse may not quite like you edit .project and .cproject file when project is iopen (close project or eclispe)

If you like to do many loo with CubeMX , I strongly recomend to use git localy or whatever scc you like or always backup ioc and full project prior to regen code!
CubeMX can easily trash a lot of work when regenerating ,
it will already trash all what not in between user code
It may even trash what in between user define zone (when changing cubemx version or when starting to add rtos etc ... changing some ip or config option)

if you need to customisze a file that is not meant to be by user (hal drivers etc ) then copy it where you like under your project folder (it maybe directly into src)
remove the orignal linked file or exclude it from build (ilinked file removal can corrupt the full project) so it is wise to backup/commit prior to try  !
add /link the new file now if needed.

You can also miror the full thing and use directory + file compare to keep the customized project in track, that may be more work to diff each time but it’s even safer.


Thanks for the answer!
Migrated to CooCox (CoIDE 2) and found one million times better than AC6 ....
The AC6 is garbage compared to the CoIDE ...
The worst thing AC6 is the virtual mapping of folders (terrible) ... the AC6 is so bad that you can not import the templates correctly the CubeMx repository (most examples do not work).

I followed a tutorial to import a CubeMx project to CoIDE and that’s OK !


This definitely bug of the AC6.
The problem appears when you need to make some changes in configuration and regenerate the files. After that all links of used .c files changed to file startup_stm32l152xe.s Every single c.file used in the prject: Application, Drivers, etc...

The cure I’ve found so far:

  • Click on + signs for the project .c files. If it shows internal defines, variable, functions, it is OK. If ” sign disappeares, the link has been changed.
  • Choose those files in windows showing your working directories and drug&drope them into required place.
  • Choose link files. They will be placed into the project correctly.

Don’t forget to submit your current working project to the version control system before changing configuration.

I hope the AC6 team will fix this bug ASAP. It is really embarradsing. cry

In some verison it got fixed.
Thanks :-)


Hi,
I got always by updates searching the message: No repository found at http://www.st.com/web/en/catalog/tools/PF257931.Question
/ What is the page for STM32CubeMX.
And really my in AC6 version of Cube is oldier as for standalone version...
best regards
zbyno


 

Newest Forum Posts

  1. Можно ли установить камин на балконе или лоджии? by Grand3kpdErorb, 03:38
  2. reservation car service Seattle by Jamesprede, 2025-05-01 10:06
  3. Last day: drone bonus by Danielrug, 2025-04-19 16:55
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  5. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  6. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  7. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  8. Insightful Perspectives on This Subject by davidsycle, 2025-03-04 05:45
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05

Last-Modified Blogs