cancel
Showing results for 
Search instead for 
Did you mean: 

Debug Error with Touchgfx

Hben.1
Associate

Hi.

board : stm32L4R9-EVAL

LCD : MB1315A

TouchGFX version : 4.16.1

STM32CubeMX : 6.2.1

I try to get index of scrollList selected.

before add callback function, debugging is work.

However If I add callback function, Debugging is Strange.

(Some function is removed. I don't want to show.)

In View. hpp

class SearchScreenView : public SearchScreenViewBase
{
public:
    SearchScreenView();
    virtual ~SearchScreenView() {}
    virtual void setupScreen();
    virtual void tearDownScreen();
 
protected:
	Callback<SearchScreenView, int16_t> scrollListItemSelectedCallback;
	void scrollListItemSelectedHandler(int16_t itemSelected);
 
};

in view.cpp

SearchScreenView::SearchScreenView() : scrollListItemSelectedCallback(this, &SearchScreenView::scrollListItemSelectedHandler)
{
 
}
 
void SearchScreenView::setupScreen()
{
    SearchScreenViewBase::setupScreen();
    ScrollList.setItemSelectedCallback(scrollListItemSelectedCallback);
 
 
}
 
void SearchScreenView::tearDownScreen()
{
    SearchScreenViewBase::tearDownScreen();
}
 
void SearchScreenView::scrollListItemSelectedHandler(int16_t itemSelected)
{
	printf("Selected Index : %d\n",itemSelected);
}

If I start to debug

in main.c

/* 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();
 
  /* USER CODE BEGIN SysInit */
 
  /* USER CODE END SysInit */
 
  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_DMA_Init();
  MX_CRC_Init();
  MX_DMA2D_Init();
  MX_I2C2_Init();
  MX_LTDC_Init();
  MX_UART4_Init();
  MX_TouchGFX_Init();
  /* USER CODE BEGIN 2 */
 
  printf("START\n");

in main.c after line 23, debugging happened error.

can not excute next line.

debug arrow is disappeared, I try to suspend.

and then address is moved strange address. like under screenshot.

0693W00000BarY7QAJ.jpg

​If I remove callback function, it is work normally.

another strange is If I run , not debug mode, it is work well.

the program is run well except can not debug.

Could you give any advice?

thank you.

2 REPLIES 2
MM..1
Chief II

Try remove printf from handler

thank you relpy

but it is not work.