Hello Everyone,
I have got a problem. I started a project with ChibiOS using the library UGfx for my Embest Board STM32F4 Base Board with the STM32F407VG and a Touchscreen. First everything went good, but now i ran into some problems. I first thought it was a Problem regarding the Ugfx but in the ugfx forum someone told me that it's maybe a Problem regarding ChibiOS.
My Problem:
I started my Project with displaying just a picture on my touchscreen, that went fine, and then I implemented a Widget with an Input Function. That doesn't went so well. So I debugged my whole project to find out where the debugger stops.
It stops in a ChibiOS File. The Debugger always after: port_unlock_from_isr(); in the "chcore_v7m.c" file. So the line "port_unlock_from_isr() is executed and after that the debugger stops.
I hope anyone can help me with my problem.
Thanks in advance
Problem with ChibiOS using ugfx for Embest Board with Touchscreen
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Problem with ChibiOS using ugfx for Embest Board with Touchscreen
Hi,
Follow advice found in this article then eventually report back.
http://chibios.org/dokuwiki/doku.php?id ... ebug_guide
Giovanni
Follow advice found in this article then eventually report back.
http://chibios.org/dokuwiki/doku.php?id ... ebug_guide
Giovanni
Re: Problem with ChibiOS using ugfx for Embest Board with Touchscreen
I couldn't solve the Problem yet.
I tried to change PORT_IDLE_THREAD_STACK_SIZE 12 from "12" to "64", because I thought it could be a stack size problem. But this didn't solve my Probelm.
Maybe It helps to let you know where the debugger stops exactly.
Here are the last few steps before it halted:
i2cMasterTransmitTimeout();
--> rdymsg = i2c_lld_master_transmit_timeout();
-->chSchGoSleepS(THD_STATE_SUSPENDED);
-->chSysSwitch(currp,otp);
-->port_unlock_from_isr();
But the Line "port_unlock_from_isr()" is executed. The Debugger halted after this line.
So I thought that it just could be a stack size problem because nothing is executed while the debugger halted. Is that right or do I miss something here?
I tried to change PORT_IDLE_THREAD_STACK_SIZE 12 from "12" to "64", because I thought it could be a stack size problem. But this didn't solve my Probelm.
Maybe It helps to let you know where the debugger stops exactly.
Here are the last few steps before it halted:
i2cMasterTransmitTimeout();
--> rdymsg = i2c_lld_master_transmit_timeout();
-->chSchGoSleepS(THD_STATE_SUSPENDED);
-->chSysSwitch(currp,otp);
-->port_unlock_from_isr();
But the Line "port_unlock_from_isr()" is executed. The Debugger halted after this line.
So I thought that it just could be a stack size problem because nothing is executed while the debugger halted. Is that right or do I miss something here?
Re: Problem with ChibiOS using ugfx for Embest Board with Touchscreen
UPDATE:
I followed your advice:
I changed following in the chconf.h
CH_DBG_SYSTEM_STATE_CHECK=TRUE
CH_DBG_ENABLE_CHECKS=TRUE
CH_DBG_ENABLE_ASSERTS=TRUE
CH_DBG_ENABLE_TRACE=TRUE
CH_DBG_ENABLE_STACK_CHECK=TRUE
CH_DBG_FILL_THREADS=TRUE
After changing everything, I debugged again now the debugger halted at another Point
void dbg_trace(Thread *otp) {
dbg_trace_buffer.tb_ptr->se_time = chTimeNow();
dbg_trace_buffer.tb_ptr->se_tp = currp;
dbg_trace_buffer.tb_ptr->se_wtobjp = otp->p_u.wtobjp;
dbg_trace_buffer.tb_ptr->se_state = (uint8_t)otp->p_state;
if (++dbg_trace_buffer.tb_ptr >=
&dbg_trace_buffer.tb_buffer[CH_TRACE_BUFFER_SIZE])
dbg_trace_buffer.tb_ptr = &dbg_trace_buffer.tb_buffer[0];
*here the debugger stops*}
The way the debugger goes before is:
i2cMasterTransmitTimeout();
--> rdymsg = i2c_lld_master_transmit_timeout();
-->chSchGoSleeps(THD_STATE_SUSPENDED);
-->chSysSwitch(currp,otp);
-->void dbg_trace(Thread *otp){ "look above"}
I followed your advice:
I changed following in the chconf.h
CH_DBG_SYSTEM_STATE_CHECK=TRUE
CH_DBG_ENABLE_CHECKS=TRUE
CH_DBG_ENABLE_ASSERTS=TRUE
CH_DBG_ENABLE_TRACE=TRUE
CH_DBG_ENABLE_STACK_CHECK=TRUE
CH_DBG_FILL_THREADS=TRUE
After changing everything, I debugged again now the debugger halted at another Point
void dbg_trace(Thread *otp) {
dbg_trace_buffer.tb_ptr->se_time = chTimeNow();
dbg_trace_buffer.tb_ptr->se_tp = currp;
dbg_trace_buffer.tb_ptr->se_wtobjp = otp->p_u.wtobjp;
dbg_trace_buffer.tb_ptr->se_state = (uint8_t)otp->p_state;
if (++dbg_trace_buffer.tb_ptr >=
&dbg_trace_buffer.tb_buffer[CH_TRACE_BUFFER_SIZE])
dbg_trace_buffer.tb_ptr = &dbg_trace_buffer.tb_buffer[0];
*here the debugger stops*}
The way the debugger goes before is:
i2cMasterTransmitTimeout();
--> rdymsg = i2c_lld_master_transmit_timeout();
-->chSchGoSleeps(THD_STATE_SUSPENDED);
-->chSysSwitch(currp,otp);
-->void dbg_trace(Thread *otp){ "look above"}
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Problem with ChibiOS using ugfx for Embest Board with Touchscreen
Hi,
You have a memory corruption issue, crash points mean nothing. It could be a stack overflow, array overflow or similar.
Giovanni
You have a memory corruption issue, crash points mean nothing. It could be a stack overflow, array overflow or similar.
Giovanni