Jump to content

Problems while gfxinit() in ginput()


Recommended Posts

Posted

Hello everyone,

I have got a problem. I just tried to implement ginput. There are no errors from the compiler, but the debugger always stops in the gfxinit() routine. I debbuged everything and got to the point where the debugger actual stops. 
It stops always after: port_unlock_from_isr(); in the "chcore_v7m.c" file.

 

I don't know why?
Can anyone help me please?

 

Posted

Sorry. I use the Embest-Base Board with the Touchscreen. I included all the board files and tried to implement the demo /gdisp/basics. Everything went fine. The dispaly worked. But then I tried to implement the Ginput. So I added to the gfxconf.h:

///////////////////////////////////////////////////////////////////////////
// GINPUT                                                                //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GINPUT                               TRUE
#define GINPUT_NEED_MOUSE                            TRUE

Here is the full gfxconf.h:
 

#ifndef _GFXCONF_H
#define _GFXCONF_H

/* The operating system to use. One of these must be defined - preferably in your Makefile */
//#define GFX_USE_OS_CHIBIOS	FALSE
//#define GFX_USE_OS_WIN32		FALSE
//#define GFX_USE_OS_LINUX		FALSE
//#define GFX_USE_OS_OSX		FALSE

/* GFX sub-systems to turn on *
#define GFX_USE_GDISP			TRUE

/* Features for the GDISP sub-system. */
#define GDISP_NEED_VALIDATION	TRUE
#define GDISP_NEED_CLIP			TRUE

///////////////////////////////////////////////////////////////////////////
// GINPUT                                                                //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GINPUT                               TRUE
#define GINPUT_NEED_MOUSE                            TRUE

#endif /* _GFXCONF_H */

When I set GFX_USE_GINPUT and GINPUT_NEED_MOUSE to FALSE everything works again.

But with both on TRUE the Debugger stops after port_unlock_from_isr(); in the "chcore_v7m.c" file.

I didn't changed anything at the main.c from the gdisp/basics Demo.

Do you need more Information?

Posted

Does the program jump to a hard fault handler? It seems that you are using ChibiOS and in some cases it catches overflows etc and gives an error message of what went wrong. If that is the case that can tell you what is going on.

It might be a good idea to look at an example project in the "demos/modules/ginput/keyboard".

Posted

I just tested an existing example. The Debugger also stops in the _ginputInit() routine while mouse Initialization.

void SVCallVector(void) {
  struct extctx *ctxp;

#if CORTEX_USE_FPU
  /* Enforcing unstacking of the FP part of the context.*/
  SCB_FPCCR &= ~FPCCR_LSPACT;
#endif

  /* Current PSP value.*/
  asm volatile ("mrs     %0, PSP" : "=r" (ctxp) : : "memory");

  /* Discarding the current exception context and positioning the stack to
     point to the real one.*/
  ctxp++;

  /* Restoring real position of the original stack frame.*/
  asm volatile ("msr     PSP, %0" : : "r" (ctxp) : "memory");
  port_unlock_from_isr();
}

The Debugger Stops after port_unlock_from_isr(); in the SVCalVector() Function. The Program doesn't jump to a hard fault handler.

The actual stack size is:

LDFLAGS  = -Wl,--defsym=__process_stack_size__=0x0800 -Wl,--defsym=__main_stack_size__=0x0800

Do I have to change both, main_stack_size and process_stack_size. Is the stack size big enough?
 

Posted

Update:
I tested to change both process stack size and main stack size. I changed both to 0x23000, but it didn't worked. The debugger stops also, like before, after port_unlock_from_isr();.

Posted

This stuff seems to be buried in what looks like chibios code. It certainly doesn't look like uGFX code.

I have a couple of suggestions for you...

1. Try to debug and find out what the last line that was executed in the uGFX code and we might be able to help you find a cause.

2. Contact the chibios forums as it definitely looks like a chibios problem.

Posted

Another note: just looking at the code that looks like an interrupt handler. Try setting the interrupt stack size.

Also note: 0x23000 is way too big for a stack on this hardware. Try numbers like 2k (0x0800) or 4k (0x1000).

Posted (edited)

ok, i tried 0x1000 for stack

file. That didn't worked.

Here is my gfxconf file:

/*
 * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
 * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket
 */

#ifndef _GFXCONF_H
#define _GFXCONF_H

/* The operating system to use. One of these must be defined - preferably in your Makefile */
//#define GFX_USE_OS_CHIBIOS	FALSE
//#define GFX_USE_OS_WIN32		FALSE
//#define GFX_USE_OS_LINUX		FALSE
//#define GFX_USE_OS_OSX		FALSE

/* GFX sub-systems to turn on */
#define GFX_USE_GDISP			TRUE
#define GFX_USE_GWIN			TRUE
#define GFX_USE_GINPUT			TRUE
#define GFX_USE_GEVENT			TRUE
#define GFX_USE_GTIMER			TRUE
#define GFX_USE_GQUEUE			TRUE

/* Features for the GDISP sub-system. */
#define GDISP_NEED_VALIDATION		TRUE
#define GDISP_NEED_CLIP				TRUE
#define GDISP_NEED_IMAGE			TRUE
#define GDISP_STARTUP_COLOR			HTML2COLOR(0xC0C0C0)
#define GDISP_NEED_CIRCLE		TRUE
#define GDISP_NEED_TEXT			TRUE
#define GDISP_NEED_MULTITHREAD	TRUE

/* GDISP image decoders */
//#define GDISP_NEED_IMAGE_NATIVE		TRUE
//#define GDISP_NEED_IMAGE_GIF		TRUE
#define GDISP_NEED_IMAGE_BMP		TRUE
//#define GDISP_NEED_IMAGE_JPG		TRUE
//#define GDISP_NEED_IMAGE_PNG		TRUE
#define GFX_USE_GFILE				TRUE
#define GFILE_NEED_ROMFS			TRUE
//#define GFILE_NEED_NATIVEFS			TRUE

/* GDISP fonts to include */
#define GDISP_INCLUDE_FONT_UI2	TRUE

/* Features for the GWIN subsystem. */
#define GWIN_NEED_WINDOWMANAGER	TRUE
#define GWIN_NEED_WIDGET		TRUE
#define GWIN_NEED_SLIDER		TRUE
#define GWIN_NEED_CONSOLE		TRUE

/* Features for the GINPUT subsystem. */
#define GINPUT_NEED_MOUSE		TRUE

/* Features for the GQUEUE subsystem. */
#define GQUEUE_NEED_ASYNC		TRUE

#endif /* _GFXCONF_H */

and my makefile:

#Makefile für UGFX Embest-STM32-DMSTF4BB


#------------------------------------------------------------------------------
# Haupteinstellungen
#

# Einstellungen
	# Unter $(GFXLIB)/tools/gmake_scripts/readme.txt Liste der Variablen
	OPT_OS					= chibios
	OPT_THUMB				= yes
	OPT_LINK_OPTIMIZE		= no
	OPT_CPU					= stm32m4

# uGFX Einstellungen
	# Unter $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk Liste der Variablen
	GFXLIB					= ../../ugfx
	GFXBOARD				= Embest-STM32-DMSTF4BB
	GFXDEMO					= modules/gdisp/basics

# ChibiOS Einstellungen
ifeq ($(OPT_OS),chibios)
	# Unter $(GFXLIB)/tools/gmake_scripts/os_chibios_x.mk Liste der Variablen
	CHIBIOS				= ../../chibios26
	CHIBIOS_VERSION		= 2
	CHIBIOS_BOARD		=
	CHIBIOS_PLATFORM	= STM32F4xx
	CHIBIOS_PORT		= GCC/ARMCMx/STM32F4xx
	CHIBIOS_LDSCRIPT	= STM32F407xG.ld
endif

##############################################################################################
# Weiteres für's Projekt
#

ARCH     = arm-none-eabi-
SRCFLAGS = -ggdb -O0
CFLAGS   =
CXXFLAGS = -fno-rtti
ASFLAGS  =
LDFLAGS  = -Wl,--defsym=__process_stack_size__=0x1000 -Wl,--defsym=__main_stack_size__=0x1000

SRC      =
OBJS     =
DEFS     =
LIBS     =
INCPATH  = 
LIBPATH  =
LDSCRIPT =

#------------------------------------------------------------------------------
# Includes immer am Ende einbinden
#

include $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk
include $(GFXLIB)/tools/gmake_scripts/os_$(OPT_OS).mk
include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk
# *** Ende ***

 

The last line that was executed in the gfx files is: 

i2cMasterTransmitTimeout(&I2CD1, STMPE811_ADDR, txbuf, 2, 0, 0, MS2ST(STMPE811_TIMEOUT));

in the "gmouse_lld_STMPE811_board.h"

 

Thanks for the help :)

Edited by Sinalco94
Posted

Your gfxconf and Makefile look ok. If your program stops at the i2c transfers than it is possible that ChibiOS is not configured correctly.
In your halconf do you have conflicting dma channels?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...