cancel
Showing results for 
Search instead for 
Did you mean: 

Howto combine TouchGFX and WPAN BLE ?

MM..1
Chief III

Project MX created without RTOS generate this main part

MX_TouchGFX_Init();
  MX_RTC_Init();
  /* USER CODE BEGIN 2 */
 
  /* USER CODE END 2 */
 
  /* Init code for STM32_WPAN */
  MX_APPE_Init();
  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */
    MX_APPE_Process();
 
  MX_TouchGFX_Process();
    /* USER CODE BEGIN 3 */
  if((HAL_GPIO_ReadPin(TOUCH_IRQ_GPIO_Port,TOUCH_IRQ_Pin) == GPIO_PIN_RESET ||
		  i2cRXbuff[0]!=0) && TouchDELAY==0)
	  	  if (HAL_I2C_Master_Transmit(&hi2c1, 0x5c, (uint8_t *)"\340", 1, 1) == HAL_OK)
		{
	  		  TouchDELAY=14;
			HAL_I2C_Master_Receive_IT(&hi2c1, 0x5c, i2cRXbuff, 5);
		}
  }
  /* USER CODE END 3 */

If i comment RTC and APPE = TouchgfX works.

If TouchGFX commented BLE works.

Is BLE RTOS compliant? Or how add (move) TouchGFX_Process into sequencer?

1 ACCEPTED SOLUTION

Accepted Solutions

Fine i make more tests and firstly i use TGFX 4.17 and BLE 1.12.x stack.

Second testing latest 4.19.1 and 1.13.x and code without LPM works normal.

Your example why in ISR VSYNC change PRIO repeatly?

How to setup LPM enable after som time and wake on touch detected ...

View solution in original post

6 REPLIES 6
Remy ISSALYS
ST Employee

Hello,

If you disable low power mode (see #define CFG_LPM_SUPPORTED in app_conf.h file) your code should works. If not, you should create a task which call TouchGFX_Process in order to use sequencer.

Some examples of STM32CubeWB package running with FreeRTOS instead of sequencer.

Maybe the following documentation can help you:

Operating Systems | TouchGFX Documentation

Best Regards

MM..1
Chief III

Hi your define is ok , but i need create code switching LPM inapp.

Too ofcourse i read one example P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS/

and i see here zero usable information...

Hi Remy,
FYI default code
/**
* When set to 1, the low power mode is enable
* When set to 0, the device stays in RUN mode
*/
#define CFG_LPM_SUPPORTED 0
...
Remy ISSALYS
ST Employee

Hello,

In order to add TouchGFX_Process into sequencer follows these steps:

  • In main.c file, remove the call to MX_TouchGFX_Process:
while (1)
{
    /* USER CODE END WHILE */
    MX_APPE_Process();
    //MX_TouchGFX_Process();
    /* USER CODE BEGIN 3 */
}
  • In app_conf.h file, add CFG_TASK_SYSTEM_GFX_ID:
typedef enum
{
  CFG_FIRST_TASK_ID_WITH_NO_HCICMD = CFG_LAST_TASK_ID_WITH_HCICMD - 1,        /**< Shall be FIRST in the list */
  CFG_TASK_SYSTEM_HCI_ASYNCH_EVT_ID,
  /* USER CODE BEGIN CFG_Task_Id_With_NO_HCI_Cmd_t */
  CFG_TASK_SYSTEM_GFX_ID,
  /* USER CODE END CFG_Task_Id_With_NO_HCI_Cmd_t */
  CFG_LAST_TASK_ID_WITH_NO_HCICMD                                            /**< Shall be LAST in the list */
} CFG_Task_Id_With_NO_HCI_Cmd_t;
  • In app_entry.c file, register the task CFG_TASK_SYSTEM_GFX_ID:
/* USER CODE BEGIN APPE_Init_2 */
  UTIL_LPM_SetStopMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE);
  UTIL_SEQ_RegTask(1<< CFG_TASK_SYSTEM_GFX_ID, UTIL_SEQ_RFU, touchgfx_taskEntry);
/* USER CODE END APPE_Init_2 */
  • In OSWrappers.cpp (generated file), set the task like this:
/*
* Signal that a VSYNC has occurred. Should make the vsync queue/mutex available.
*
* Note This function is called from an ISR, and should (depending on OS) trigger a
* scheduling.
*/
void OSWrappers::signalVSync()
{
    vsync_sem = 1;
    UTIL_SEQ_SetTask(1<<CFG_TASK_SYSTEM_GFX_ID, CFG_SCH_PRIO_0);
}

Best Regards

Fine i make more tests and firstly i use TGFX 4.17 and BLE 1.12.x stack.

Second testing latest 4.19.1 and 1.13.x and code without LPM works normal.

Your example why in ISR VSYNC change PRIO repeatly?

How to setup LPM enable after som time and wake on touch detected ...

Remy ISSALYS
ST Employee

Hello,

The SetTask function allows to start the execution of a task and not to change a priority.

The sequencer allows to go in low power mode when there is nothing to do. To wake up from low power mode, you can use an EXTI.

Best Regards