cancel
Showing results for 
Search instead for 
Did you mean: 

Generated TouchGFX 4.13 from Cube 5.6 task dont do GUI init.

MM..1
Chief II

Migrated working project from Cube5.4 to 5.6 stop working.

After correcting all issues and compile without errors i debug code. Main have default GUItask and next two tasks added. Started code init all hw and start rtos, but display show nothing . I make test add after init grey level to framebuffer and it show ok. Too pattern generator show color horizontal and vertical ok.

When i debug two added task work ok.

Only GUI noting init ...

 /* Initialize all configured peripherals */

 MX_GPIO_Init();

 MX_DMA_Init();

 MX_SPI2_Init();

 MX_I2C3_Init();

 MX_ADC1_Init();

 MX_CRC_Init();

 MX_TIM2_Init();

 /* USER CODE BEGIN 2 */

 HAL_GPIO_WritePin(SPI_CS_GPIO_Port, SPI_CS_Pin, GPIO_PIN_RESET);

 HAL_SPI_Transmit(&hspi2, (uint8_t *)"\0", 1, 5); //relay off

 SPI_CS_GPIO_Port->BSRR = SPI_CS_Pin;

 RC5_Init();

 Turn_ON();

// EE_Write();

 HAL_TIM_PWM_Start(&htim2,TIM_CHANNEL_1);//LCD_LIGHT

 HAL_Delay(321);

 /* USER CODE END 2 */

 /* USER CODE BEGIN RTOS_MUTEX */

 /* add mutexes, ... */

 MX_FMC_Init();

 memset((void *)disp_mem,0,6*1024*1024);

 MX_DMA2D_Init();

 MX_LTDC_Init();

 MX_TIM1_Init();

 MM_MX_DSI();

 MX_TouchGFX_Init();

 /* USER CODE END RTOS_MUTEX */

 /* USER CODE BEGIN RTOS_SEMAPHORES */

 /* add semaphores, ... */

 /* USER CODE END RTOS_SEMAPHORES */

 /* USER CODE BEGIN RTOS_TIMERS */

 /* start timers, add new ones, ... */

 /* USER CODE END RTOS_TIMERS */

 /* USER CODE BEGIN RTOS_QUEUES */

 /* add queues, ... */

 /* USER CODE END RTOS_QUEUES */

 /* Create the thread(s) */

 /* definition and creation of defaultTask */

 osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 4096);

 defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);

 /* USER CODE BEGIN RTOS_THREADS */

 /* add threads, ... */

 //display test

 TIM2->CCR1 = 0x1666;

 HAL_DSI_PatternGeneratorStart(&hdsi, 0, 0);

 HAL_Delay(1621);

 HAL_DSI_PatternGeneratorStart(&hdsi, 0, 1);

 HAL_Delay(321);

 while (HAL_GPIO_ReadPin(SW_PWR_GPIO_Port, SW_PWR_Pin) == GPIO_PIN_SET);

 HAL_DSI_PatternGeneratorStop(&hdsi);

 HAL_Delay(321);

 Encoder_Init();

 //led pcb test potom inde TCA6424 ext

 //SPI latch ULN test

 //SPI_CS_GPIO_Port->BRR = SPI_CS_Pin;

 HAL_GPIO_WritePin(SPI_CS_GPIO_Port, SPI_CS_Pin, GPIO_PIN_RESET);

 HAL_SPI_Transmit(&hspi2, (uint8_t *)"\000", 1, 5); //relays

 SPI_CS_GPIO_Port->BSRR = SPI_CS_Pin;

 HAL_Delay(321); //stab ADC inputs without inputs and with unmute fix

 HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc_buf, ADC_BUF_LEN);

 HAL_Delay(100);

 Preamp_Set_Input();

 xTaskCreate(db_task, "DBTask",

       512,

       NULL,

 osPriorityNormal,

       NULL);

 xTaskCreate(test_task, "LEDFadeTask",

       512,

       NULL,

 osPriorityBelowNormal,

 //osPriorityNormal,

       NULL);

 /* USER CODE END RTOS_THREADS */

 /* Start scheduler */

 osKernelStart();

 /* We should never get here as control is now taken by the scheduler */

 /* Infinite loop */

 /* USER CODE BEGIN WHILE */

 while (1)

 {

  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

 }

 /* USER CODE END 3 */

void StartDefaultTask(void const * argument)

{

 /* USER CODE BEGIN 5 */

MX_TouchGFX_Process();

 /* Infinite loop */

 for(;;)

 {

  osDelay(1);

 }

 /* USER CODE END 5 */ 

}

1 ACCEPTED SOLUTION

Accepted Solutions
MM..1
Chief II

We try optimize code better in new version. We have custom board and LCD and need go to max possibble refresh rate.

Now dotclock LTDC 20MHz and DSI 60MHzx8

Display 480x1280 around 29,3Hz refresh, we try find way to go up, but sdram IS42S16400J is only 16bit ...

EDIT 1: Today i read one docu about FMC SPI displays and touchgfx and see, that custom display settings is for this purposes and not for my DSI display in video mode. Here need be set LTDC in CubeMX 5.6 and up and not custom.

EDIT 2: Code from CubeMX 5.6 now can use dot clock 30MHz and display refresh around 50Hz

View solution in original post

4 REPLIES 4
Alexandre RENOUX
Principal

Hello,

Have you tried comparing the new code with the old one ? There must be some differences.

/Alexandre

MM..1
Chief II

Of course Alexandra, must differ. First diff is main in Core\Src\ cube 5.4 have cpp , but 5.6 c file.

Second is TouchGFX\target\ dir

5.4:

HW_Init.hpp

STM32F4Instrumentation.cpp

STM32F4Instrumentation.hpp

STM32F4TouchController.hpp

STM32F4TouchController.cpp

STM32F4HAL.hpp

STM32F4HAL.cpp

STM32F4DMA.hpp

STM32F4DMA.cpp

touchgfx_gpio.cpp

BoardConfiguration.cpp

HW_Init.cpp

5.6

generated\

TouchGFXGPIO.cpp

STM32TouchController.cpp

STM32TouchController.hpp

TouchGFXHAL.cpp

TouchGFXHAL.hpp

and in generated

OSWrappers.cpp

STM32DMA.cpp

STM32DMA.hpp

TouchGFXGeneratedHAL.cpp

TouchGFXGeneratedHAL.hpp

TouchGFXConfiguration.cpp

Then some files in 5.6 is new some dont exist ...

I compare all and migrate from 5.4 some functions step by step , but 5.6 touchcode not work for me. No error.

On 5.4 i mean all thinks is started in hw_init.cpp and Boardconfig.cpp and all works.

On 5.6 where is same points nobody know.

Alexandre RENOUX
Principal

Hello,

Yes migrating from 5.4 to 5.6 can involve quite a lot of changes and struggle.

Do you have to update your project because you need something not available in 5.4 ?

What board are you working on ? If you need to update to 5.6, I can suggest you to start a new project with the corresponding Application Template and do the porting of your code from your current project to the Application Template.

Note that 6.0 is out so porting to CubeMX 6.0 directly can be an option as well.

/Alexandre

MM..1
Chief II

We try optimize code better in new version. We have custom board and LCD and need go to max possibble refresh rate.

Now dotclock LTDC 20MHz and DSI 60MHzx8

Display 480x1280 around 29,3Hz refresh, we try find way to go up, but sdram IS42S16400J is only 16bit ...

EDIT 1: Today i read one docu about FMC SPI displays and touchgfx and see, that custom display settings is for this purposes and not for my DSI display in video mode. Here need be set LTDC in CubeMX 5.6 and up and not custom.

EDIT 2: Code from CubeMX 5.6 now can use dot clock 30MHz and display refresh around 50Hz