2021-02-26 11:15 PM
Hi,
I am using:
My target is:
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
2021-02-27 01:06 AM
Try open ioc from IDE in plugin instead in full MXapp.
2021-02-27 03:35 PM
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
2021-02-27 10:51 PM
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.
2021-02-28 04:13 PM
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