chprintf() crashes system in GXF/console

goeck
Posts: 92
Joined: Mon Feb 11, 2013 12:00 pm
Location: Germany

chprintf() crashes system in GXF/console

Postby goeck » Fri Jun 28, 2013 9:04 am

Hey everyone,

during work on my SSD1306 driver I wanted to use the console module, which actually works (based on template on GFX website) until I call chprintf() with any of those special chars:
"!", "\n", "\r"
When calling chprintf() with one of those chars included e.g. (...) nothings gets executed on the MCU, no gfxInit(), nothing. It breaks everything. If I leave those chars out, everything works fine.

Code: Select all

chprintf(S1, "Hello GFX\n",1);

So I am stuck with just one row.

EDIT:
Just found out, that using this command, gets me a new line. Note that the newline only seems to work when I just in front of it place an integer placeholder (float also works, seems it has to be just any kind of placeholder)

Code: Select all

chprintf(S1, "Hello GFX v%i\n",1);

Using this command stops ChibOS again at startup.

Code: Select all

chprintf(S1, "Hello GFX v\n",1);

Does anybody have a hint, why this is happening?

Thanks everyone!
Cheers

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: chprintf() crashes system in GXF/console

Postby Tectu » Fri Jun 28, 2013 10:19 am

Hello goeck,

This is very unusual... There are different locations which can cause this problem and I'm currently not able to give any pointer where to look at... Furthermore I'm currently not able to debug it myself because I am out of house and I don't took any hardware with me. When I get some time during the next train ride, I'll try it out in the simulator as soon as possible.

Thanks for finding and sharing this bug!


~ Tectu

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: chprintf() crashes system in GXF/console

Postby Tectu » Fri Jun 28, 2013 2:40 pm

Okay, I just got some more spare time than expected and I tried it out in my simulator - everything works great there. Then I re-read your post and I saw the nothings gets executed on the MCU, no gfxInit(), nothing. This sounds more like a compiler issue. What toolchain are you using?

There have been more problems related to ChibiOS/RT and string manipulation when using the "wrong" toolchain. Most of the community members use this one.


~ Tectu

goeck
Posts: 92
Joined: Mon Feb 11, 2013 12:00 pm
Location: Germany

Re: chprintf() crashes system in GXF/console

Postby goeck » Mon Jul 01, 2013 9:46 am

Hey,

thanks for the replies. I am actally using this toolchain (see shell output)

Code: Select all

C:\Windows\System32>arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.7.3 20121207 (release) [ARM/embedded-4_7-branch revision 194305]
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I just pulled the latest version, but have to point to thr new location... I will tell, if that solves the issue.

EDIT:
Now using the latest GNU embedded toolchain (4.7.4 20130613) and it seems to work. I don't have those crashes anymore and text is dropped on the display nicely. The issues are solved :-)
Anyway, I am not quite really sure, whether I pointed away from the yagarto toolchain - which was also installed on my system - to the GNU embedded toolchain, or whether it really was the updated GNU toolchain.
After a little fumbling around I am pretty sure, I must have been using yagarto, since it also works with the "old" GNU toolchain I have here.

So Tectu, thanks for the hint!

Now I am about to implement nice console scrolling...having a little trouble though. It just scrolls all the time..;-)
Maybe I'll get back on you for that topic.

Cheers

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: chprintf() crashes system in GXF/console

Postby Tectu » Mon Jul 01, 2013 10:34 am

Good to hear that you got it working! Don't worry, you're not the first one that had a toolchain related problem.
Let us know whenever you need any help (maybe open a new thread, if it's too off-topic).


~ Tectu


Return to “LCD Driver and Graphic Framework”

Who is online

Users browsing this forum: No registered users and 10 guests