Page 4 of 4

Re: little help with ADS7843

Posted: Mon May 20, 2013 4:15 am
by daviddawe1982
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..

Re: little help with ADS7843

Posted: Mon May 20, 2013 11:27 am
by Tectu
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

Re: little help with ADS7843

Posted: Mon May 20, 2013 12:03 pm
by daviddawe1982
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??

Re: little help with ADS7843

Posted: Mon May 20, 2013 12:38 pm
by Abhishek
Use chprintf, with a GWinConsole.

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

Re: little help with ADS7843

Posted: Mon May 20, 2013 12:51 pm
by Tectu
What Abhishek said is totally accurate and might be the best solution for you.


~ Tectu

Re: little help with ADS7843

Posted: Mon May 20, 2013 2:01 pm
by daviddawe1982
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..

Re: little help with ADS7843

Posted: Mon May 20, 2013 2:13 pm
by Tectu
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