Different results: correct when debugged but wrong when flashed Topic is solved

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
User avatar
aclassifier
Respected Member
Posts: 483
Joined: Wed Apr 25, 2012 8:52 pm
Contact:

Different results: correct when debugged but wrong when flashed

Post by aclassifier »

I have a special case.

When I download and debug my code on the startKIT I get a correct result. I do printf logging to xTIMEcomposer console.

When I flash it I get different, wrong results. (Three temperatures some 20-40 degC seem to get values some 5 degC too low). Values are displayed in an embedded display.

In both cases the raw data (from I2C) are as expected and correct.

Does anybody have any suggestion about where to look? Is there some setup? Could this not be the tool, but my coding?

(Update: I woke up this morning thinking that I must have a look at initialisation of some of my variables. Like, there's a FIR-filter in there..)

I use xTIMEcomposer "Community_14.2.4 (build 15898, Dec-20-2016)". I have not tried older versions.


(I am able to do code inspections at the moment, but the HW isn't accessible right now)
Last edited by aclassifier on Mon Mar 06, 2017 8:33 am, edited 1 time in total.


--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/
View Solution
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Review the code that is related to the embedded lcd display. Is it possible to debug with printf and also use the embedded lcd display?
User avatar
aclassifier
Respected Member
Posts: 483
Joined: Wed Apr 25, 2012 8:52 pm
Contact:

Post by aclassifier »

Thanks, yes I must review my own code! Like I have a FIR filter in there. Init of values.. The display I have had for a long time (it's a 128x32 OLED monochrome, by the way. Quite nice)
--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/
User avatar
aclassifier
Respected Member
Posts: 483
Joined: Wed Apr 25, 2012 8:52 pm
Contact:

Post by aclassifier »

The fault was entirely mine! I had not initialised correctly.

So, when the startKIT after FLASHing was unpowered and then powered the init values would be different than from the last DEBUG run with an always powered unit.

The number of samples in my mean value FIR filter got wrong, and the values appeared too low.
--
Øyvind Teig
Trondheim (Norway)
https://www.teigfam.net/oyvind/home/
Post Reply