cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX IS Corrupting Projects Generated in TouchGfx - What am I doing Wrong

Garnett.Robert
Senior III

Hi,

I am using:

  • touchgfc 4.1.16
  • cobeMX 6.6.1
  • STM32CubeIDE - Version: 1.6.0 - Build: 9614_20210223_1703 (UTC)

My target is:

  • STM32H7B3I

I created a single screen GUI for the target. It builds OK and displays on the target.

I then opened the project folder and double clicked on the CubeMX IOC file as I wanted to add my back-end peripherals, namely i2c1, the RTC and an interrupt digital I/O PC7 and the ADC.

I made my mods in cubeMX, pushed the create code button and then exited CubeMX.

I refreshed the project in the IDE and tried to compile it. The compile failed because CubeMX had screwed up all of the references to the touchgfx code.

I then recovered from a backup and tried again. This time I added the Toughgfx package in CubeMX.

Still failed.

I then tried simply opening cube MX without any mods, pushed the create source code button and the compile still failed.

Am I doing something wrong or is CubeMx just being CubeMX?

The graphics package is great, the IDE is pretty good, but I am really fed up with CubeMX.

My understanding from the videos on Youtube is that you can do mods with cubeMX and the IDE's will know about them and handle them.

It's not working for me like this.

Best regards

Rob

4 REPLIES 4
MM..1
Chief II

Try open ioc from IDE in plugin instead in full MXapp.

Garnett.Robert
Senior III

Hi,

Thanks for that, but neither the .ioc file or the .touchgfx is showing up in my Project Explorer tree.

I opened the IDE by double clicking on the .cproject file. It imports the project, compiles and runs, but doesn't include the .ioc file or the .touchgfx files.

Do you think this is the problem?

Do you know how to set up the IDE so it includes these?

Best regards

Rob

i mean you can simply add this files as existing resources, but when i remember IOC isnt prepared good, try search on forum steps for aply it in project, because on default place it generates next code and corrupt project as you write. Try move ioc to stmproject folder.

Garnett.Robert
Senior III

Hi,

I tried that. I looked at every youtube video on TouchGFX I could find. I couldn't find one example where someone created a project in TouchGfx and then added periperals using the CubeMX integrated into STM32CubeIDE. Isearched the forum, but couldn't find a solution.

When I used the integrated CubeMX (V6.1.2) to add Timer 2 with no i/o, for example it screwed up the .cproject file by putting blank lines in between statements. Cube did add Timer 2 initialisation code to the ...hal_msp file so it would seem that it is pointing to the correct directory structure for the project.

/**
* @brief TIM_Base MSP Initialization
* This function configures the hardware resources used in this example
* @param htim_base: TIM_Base handle pointer
* @retval None
*/
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
{
  if(htim_base->Instance==TIM2)
  {
  /* USER CODE BEGIN TIM2_MspInit 0 */
 
  /* USER CODE END TIM2_MspInit 0 */
    /* Peripheral clock enable */
    __HAL_RCC_TIM2_CLK_ENABLE();
  /* USER CODE BEGIN TIM2_MspInit 1 */
 
  /* USER CODE END TIM2_MspInit 1 */
  }
 
}

It looks like I will have to add the peripherals manually by creating a separate project with Cube and then copying the ...msp files into the target project. What a pain!!

I have attached the clean project to this post. It does compile and run as I have not used cube.

Please have a look at it and see if I've done something wrong.

Best regards

Rob