cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX and ThreadX from CubeIDE issue

I've been trying to get anything to show up on a STM32F429-DISC1 Discovery Kit display.

I start a new project in CubeIDE using the '429 Discovery board as a base.

I delete the USB and FreeRTOS configurations. I configure the clock for external 8MHz crystal, PLL, HCLK 168MHz, LCD-TFT clock 6.25MHz

I add CRC, DMA2D, LTDC, FMC, and SPI according to the settings from a running  '429 example project generated starting with TouchGFX. Add ThreadX, add TouchGFX, configure them appropriately, use the .part file to fire up Designer, add a box and a text field, generate the code, go into CubeIDE, refresh, compile...end up with a skeleton with no flesh, but it shows the issue.

Then I got referred to the documentation https://support.touchgfx.com/docs/development/touchgfx-hal-development/scenarios/scenarios-configure-rtos#threadx for hints as how to proceed.

The documentation appears to say that my code should call:

/* Call PreOsInit function */
MX_TouchGFX_PreOSInit();
...
MX_ThreadX_Init();

The call to MX_TouchGFX_PreOSInit() eventually calls OSWrappers::initialize() that creates a queue and a semaphore. Then MX_ThreadX_Init is called and it eventually calls _tx_initialize_high_level() which clobbers the queue and semaphore.

There is a difference in the way that FreeRTOS works, where you typically set up all of your resources then start the OS, and ThreadX where you start the OS and the creation of resources happens later.

ANYWAY, can someone from the TouchGFX team provide a running sample of a project, starting with CubeIDE or CubeMX and not through the Designer (which gives me links rather than files and doesn't fill in headers), for a running "Hello, world!" program for a 429 Discovery board running ThreadX?

There is a set of videos from the TouchGFX people that show how to set up a project in CubeIDE that gets all of the way to the interesting parts, but never fills in the BSP, or explains how to get anything on the screen. The video series just ends with the next parts being an exercise for the student. People in the comments even ask for the series to continue through the magic bits, but it never happens.

Thanks mate, cheers mate, bye.

1 REPLY 1

Progress - I managed to find a project on GitHub from someone who, 2 years ago, generated a project from Designer for 429Discovery, then converted it from FreeRTOS to ThreadX by starting with a CubeIDE base. It ran great on my board, so it must be possible.

So I started a project in CubeIDE and started the cut/paste procedure to duplicate the code. Did it work, NO! Of course not. But after a couple of days of messing around I figured it out.

Apparently the order in which the 429's peripherals were initialized in main.c is very important. The difference between what Cube generates normally and what works is: SPI5 for the display has to be initialized BEFORE the LTDC.

Why is there a coupling? No idea.