2024-12-05 03:14 PM
I have a working touch GFX project. I want to break out the individual peripheral initializations, so I open the ioc file in cubeMX and Check to Generate peripheral initializations as a pair of '.c/.h' ... in the Project manager.
The code builds, but when I debug it immediately goes to hard fault before is gets thru MPU_Config
I created another touchGFX project the only has one screen and only loads a background. After verifying that it runs I tried to Generate peripheral initializations as a pair of '.c/.h' . and this will not build because non of the peripherals .h files were created (crc.h, dma2d.h etc..)
How can I create a touchGFX project without having all the peripherals in main.c?
2024-12-06 05:50 AM
Hello @FJB2069 ,
Splitting into pairs of c and h files often leads to issues with the generated code which require manual fixes.
It is therefore recommended to not select that option if you can avoid it.
However, if you want to use that option, the generated and user code for the init of the various files will be missing.
A simple way to fix this is to create the same project without the pairs of c and h and look at the generated code and manually add it in the initial project.
You can find an example of that fix here .
I hope this helps you! :smiling_face_with_smiling_eyes:
Regards,
2025-01-15 07:38 AM
Hello @FJB2069 ,
Have you been able to move forward with the fix?
Regards,
2025-01-15 08:39 AM
i just left project as is for now. Too much of a PITA. I think it's better to be done at the start of a new project. I'd be happy to provide a github link if you wanted to give it a go?
2025-01-21 03:01 AM - edited 2025-01-21 03:01 AM
Hello @FJB2069 ,
Thanks for offering the GitHub link.
I'm glad to help troubleshoot if you decide to revisit the project. However, I provided a potential fix, and I currently don't have the time to implement it myself. If you change your mind or need assistance later on, feel free to reach out.
Regards,