little help with ADS7843

daviddawe1982
Posts: 94
Joined: Thu Apr 11, 2013 10:35 am

Re: little help with ADS7843

Postby daviddawe1982 » Mon May 20, 2013 4:15 am

Ok Techu I will try as soon as I get home, one difference I did notice is I am creating the thread this way
chThdCreateFromHeap
And you are using this
chThdCreateStatic
This may be my problem..

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

Re: little help with ADS7843

Postby Tectu » Mon May 20, 2013 11:27 am

If you create a thread using chThdCreateFromHeap() you have to make sure that you have enough memory since it will be allocated dynamically. This routine should only be used when you create threads while run time. Threads, like yours, where you know that you will need it should be created using the chThdCreateStatic routine.


~ Tectu

daviddawe1982
Posts: 94
Joined: Thu Apr 11, 2013 10:35 am

Re: little help with ADS7843

Postby daviddawe1982 » Mon May 20, 2013 12:03 pm

Ok Techu,
Your code worked fine, So I went back to my code and started to remove certain things and I have found the course of my problems..
sprintf
I use it twice in one thread and without them all of my code works fine including the buttons that toggle a led!
Is there a alternative to sprintf for drawing a ADC result??

Abhishek
Posts: 266
Joined: Wed May 23, 2012 3:15 pm
Location: India

Re: little help with ADS7843

Postby Abhishek » Mon May 20, 2013 12:38 pm

Use chprintf, with a GWinConsole.

You can find a guide here: http://www.chibios-gfx.com/documentation/gwin/console .

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

Re: little help with ADS7843

Postby Tectu » Mon May 20, 2013 12:51 pm

What Abhishek said is totally accurate and might be the best solution for you.


~ Tectu

daviddawe1982
Posts: 94
Joined: Thu Apr 11, 2013 10:35 am

Re: little help with ADS7843

Postby daviddawe1982 » Mon May 20, 2013 2:01 pm

Well I tried chprintf and it did the same thing, The working area of the thread calling it is sill 1024.
Are the print commands resource hungry?
I also tried to chprintf to console in Main thread and it also stops the code..

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

Re: little help with ADS7843

Postby Tectu » Mon May 20, 2013 2:13 pm

Please read this documentation explaining how to debug stack issues. I might have a look at your code tonight.
Just set the stack size higher and see yourself. Also check your optimization flags.


~ Tectu


Return to “LCD Driver and Graphic Framework”

Who is online

Users browsing this forum: No registered users and 18 guests