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

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
User avatar
aclassifier
Respected Member
Posts: 319
Joined: Wed Apr 25, 2012 8:52 pm
Contact:

Different results: correct when debugged but wrong when flashed

Postby aclassifier » Sun Mar 05, 2017 5:08 pm

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.
View Solution
User avatar
mon2
XCore Legend
Posts: 1320
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Postby mon2 » Sun Mar 05, 2017 11:56 pm

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: 319
Joined: Wed Apr 25, 2012 8:52 pm
Contact:

Postby aclassifier » Mon Mar 06, 2017 8:36 am

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)
User avatar
aclassifier
Respected Member
Posts: 319
Joined: Wed Apr 25, 2012 8:52 pm
Contact:

Postby aclassifier » Thu Mar 09, 2017 8:35 pm

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.

Who is online

Users browsing this forum: bear118 and 170 guests