2025-12-07 4:45 AM
Hello everyone,
I am currently trying to integrate TouchGFX into an existing STM32 project (an FDCAN master node application), and I am facing several issues.
I enabled the TouchGFX generator in STM32CubeMX and configured all required peripherals (LTDC, FreeRTOS, DMA2D, OSPI/HyperRAM, clocks, etc.).
I also adjusted the clock configuration to match the display timing.
However, after flashing the application, the screen remains completely black.
Nothing I have tried so far has made any difference.
I have now discovered that the thread I created for the TouchGFX task is never executed, and I have not been able to find the root cause of this.
Any hints or guidance would be greatly appreciated.
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* Configure the peripherals common clocks */
PeriphCommonClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_ADC1_Init();
MX_ADC2_Init();
MX_ADC3_Init();
MX_DAC1_Init();
MX_ETH_Init();
MX_FDCAN1_Init();
MX_FDCAN2_Init();
MX_I2C4_Init();
MX_LTDC_Init();
MX_OCTOSPI1_Init();
MX_OCTOSPI2_Init();
MX_SAI1_Init();
// MX_SDMMC1_SD_Init();
MX_TIM1_Init();
MX_TIM4_Init();
MX_TIM5_Init();
MX_USART1_UART_Init();
MX_USART3_UART_Init();
MX_USB_OTG_HS_USB_Init();
MX_TIM17_Init();
MX_CRC_Init();
MX_DMA2D_Init();
MX_LIBJPEG_Init();
MX_TouchGFX_Init();
/* Call PreOsInit function */
MX_TouchGFX_PreOSInit();
/* USER CODE BEGIN 2 */
canOpenNodeSTM32_Master.CANHandle = &hfdcan1;
canOpenNodeSTM32_Master.HWInitFunction = MX_FDCAN1_Init;
canOpenNodeSTM32_Master.timerHandle = &htim17;
canOpenNodeSTM32_Master.desiredNodeID = 0x18; // Master Node-ID
canOpenNodeSTM32_Master.baudrate = 1000; // 1M
canopen_app_init(&canOpenNodeSTM32_Master);
printf("main starting\r\n");
/* USER CODE END 2 */
printf("TouchGFX_Task Adresse: %p\r\n", (void*)TouchGFX_Task);
printf("StartDefaultTask Adresse: %p\r\n", (void*)StartDefaultTask);
HAL_Delay(100);
/* Init scheduler */
osKernelInitialize();
defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);
TouchGFXTaskHandle = osThreadNew(TouchGFX_Task, NULL, &TouchGFXTask_attributes);
osKernelStart();
while (1)
{
printf(" if while bad news \r\n");
}
}TouchGFX_Task in app_touchgfx.c : i am not getting this print message :(
void TouchGFX_Task(void* argument)
{
// Calling forward to touchgfx_taskEntry in C++ domain
touchgfx_taskEntry();
printf("touchgfx task\n\r");
}