2023-03-13 07:11 AM
Good morning.....
I have a CubeIDE prj with .ioc and main. All compiles fine. I have created a second file with a main function (gfsk.c). I have excluded the original main.c for build. I would like to know when I go back into the .ioc to make a small change how do I get it to update the new gfsk.c file??? Where is the pointer to this in the IDE? I am finding that if I update the .ioc file in continually updates the old main.c file.
Solved! Go to Solution.
2023-03-13 10:20 AM
You can't. CubeMX (standalone or within CubeIDE) is hard-coded to generate main.c. If you want to use a different "main" you will need to manually merge CubeMX's changes in main.c into your gfsk.c. Or, keep your non-Cube code in gfsk.c, renaming its main() to something else, then add a line in main.c (between the "USER" comments) calling your function. For example:
/* USER CODE BEGIN WHILE */
while (1)
{
my_gfsk_main(); // <----- ADD THIS LINE HERE
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
2023-03-13 10:20 AM
You can't. CubeMX (standalone or within CubeIDE) is hard-coded to generate main.c. If you want to use a different "main" you will need to manually merge CubeMX's changes in main.c into your gfsk.c. Or, keep your non-Cube code in gfsk.c, renaming its main() to something else, then add a line in main.c (between the "USER" comments) calling your function. For example:
/* USER CODE BEGIN WHILE */
while (1)
{
my_gfsk_main(); // <----- ADD THIS LINE HERE
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
2023-03-13 11:45 AM
Thank you...