You can de-select the top-node in that wizard to get rid of the "*_expanded" folder. But that is just a cosmetic thing and should not effect the function.
The interesting part in your screenshots is that it is only files managed by CubeMX which has the "exclamation mark" icon. Files managed by IDE sysmem.c/syscalls.c are OK.
This leads me to believe that you have modified the Code generator option CubeMX:
If you use "Add necessary library files as references in the toolchain project configuration file", then you should probably run into this problem. Why?
- Because the project will not contain the HAL-files.
- The project will instead just link to these files.
- If you export the project the linked files will not be copied.
- If you import the project on another machine then these links can only be resolved if that computer has the STM32Cube firmware repo on exactly the same path: C:\Users\MY_USER_NAME\STM32Cube\Repository\STM32Cube_FW_F4_V1.26.1\ Which is maybe not the case since it could have another MY_USER_NAME
If the above does not explain the issue, then:
- Are you certain that the project builds?
- I am thinking that maybe all compilation unites compiles successfully. But if main.c and startup.s does not exist, then there is not much of an application at the "linker" stage to try to link together? Consequently you may not see all build errors?
- Have you renamed the project?