Wednesday, January 24th 2018, 12:37pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

replaysMike

Beginner

Date of registration: May 15th 2017

Posts: 4

Location: Vancouver, Canada

Occupation: Software Engineer

1

Monday, May 15th 2017, 10:04am

Stack Overflow when using emWin Touchscreen libraries

Hey all - first post so thanks for being patient.

I've been working with the emWin libraries included with Keil on my STM32F746G-Discovery board and mostly things are working well. But as soon as I include the Touchscreen pack within Keil I get a stack overflow almost immediately on startup. Keil's examples use the CMSIS-RTOS (Keil RTX) and I don't know if it's an issue there. I've tried cranking the stack sizes up with no change in behavior. When removing the Touchscreen pack my app continues to work fine.

Any suggestions on what to look for?

Thanks! :D

replaysMike

Beginner

Date of registration: May 15th 2017

Posts: 4

Location: Vancouver, Canada

Occupation: Software Engineer

2

Monday, May 15th 2017, 11:40am

I finally solved it.

The default setting from the first basic example I used leads to the stack overflow when enabling touch input:

[RTX_Conf_CM.c]
#define OS_TIMERSTKSZ 256 // default: was 50

#define OS_TIMERCBQS 10 // default: was 4


I also modified the following, which is what the full UI demo sets:
#define OS_STKSIZE 256

#define OS_MAINSTKSIZE 1024

replaysMike

Beginner

Date of registration: May 15th 2017

Posts: 4

Location: Vancouver, Canada

Occupation: Software Engineer

3

Monday, May 15th 2017, 11:54am

Haha, actually I had to set it to:

#define OS_TIMERSTKSZ 512



otherwise it would crash when I placed a second finger on the display (capacitive touch display)

replaysMike

Beginner

Date of registration: May 15th 2017

Posts: 4

Location: Vancouver, Canada

Occupation: Software Engineer

4

Monday, May 15th 2017, 12:02pm

A value of 1024 provided the most reliable operation when using multiple fingers or lots of movement. In the full emWin UI Demo sample it was easy to get it to lockup on the Radial Menu screen but seemed stable at 1024. :thumbup: