cancel
Showing results for 
Search instead for 
Did you mean: 

Timer activation in ThreadX causes Hardfault

MGuth.1
Associate III

Hi all,

I'm trying to get a TouchGFX application running. I'm controlling a 16bit TFT LCD through FMC (16 lanes) with my Nucleo U575ZI-Q. As I'm using a custom LCD driver, I set both the Interface and the Application Tick Source to 'custom' in the .ioc file. As an RTOS I'd like to use ThreadX.

As far as I understand the TouchGFX Documentation, I need to call the OSWrappers::signalVSync(); function periodically to let TouchGFX render the next Image.

I'm trying to get a ThreadX (Software-) Timer running to periodically call this function. Creating the timer with tx_timer_create() in the MX_ThreadX_Init() works just fine, if I don't activate it. I get a HardFault when activating the timer (either with TX_AUTO_ACTIVATE in tx_timer_create or with tx_timer_activate())

What am I doing wrong? Do I need to create/activate the timer within another function? Where is the best option to create/activate such a timer inside a TouchGFX application?

Best regards

1 REPLY 1
MGuth.1
Associate III

Ok, so I managed to fix it myself.

Instead of creating and activating the software timer in the app_threadx.c file I'm creating and activating the timer in app_azure_rtos.c right after the MX_TouchGFX_init() was called successfully in tx_define_application()

Now I only need to call the touchgfx::OSWrappers:signalVSync() function from the function that's called by the timer. As app_azure_rtos.c is C, I'm struggling with calling a C++ function from there, but that's another question. The timer itself works (I can control the LEDs with it)