koala-1

koala-1
The Pen is mightier than the sword, but the Pen must sometimes move the sword against corruption if the corrupt are not moved by the pen.. An idea without an implementer is useless. "The Rulers do not carry the sword in vain"Rom 13:4

Sunday, March 15, 2015

CODE, TIME, DEADLINES and dark diabolical deviant issues in my workspace!

At the moment, I'm doing some coding for a product I make. I wonder if you've ever had this experience? I'm building the program, relating it to my flowchart and the schematic of the product... and I have basically "today" to get this up and running. (customer requirement)  BUT... as I clicked on the little icon "build" as in, download the program to the hardware through an emulator, I held my breat as it said:

Initializing hardware......
Downloading.

It's the very first bit of feedback above that's the worry. You suddenly realize that IF..... it didn't download and said some weird condition is happening like.. "Cannot identify processor" or "Firmware out of date" or... a hundred other reasons that would all take many hours to sort out...  then in that case it's like instant and severe depression. *sigh*.

Everything depends on so much communication and handshaking between various elements in the chain of information.  The problem can even be caused by some grotty connection, or a solder bridge  at the hardware end..or the Emulator could suddenly spit the dummy, or your PC could hemorrhage in a puff of cyber smoke.

Only when you see that beautiful green band of download indication growing wider do you feel you can relax.  But then the hard stuff begins.. "whyyyyyyyyyyyyyyy DOESN'T it work????????" and so on.  At least that problem can be remedied by having the correct bits and bytes, compare and branch instructions in the program.  But some faults can be elusive, and it can boild down to just ONE jolly bit in a bite that you've measured and use a wrong branch instruction, or you've compared a big number with a small one, and used the wrong logic to decide the branch.

Well.. so far so good..now I need to go through all that last bit... or? perhaps a half hour sleep might be in order....yes.. I think that might clear the head.

UPDATE. ***PROBLEM***

After blabbering away about "IF" there is a problem.... now (**&^%$#@) I have one!

Although I could download ok.... there is an issue!  I'm developing a TI - MSP430F2234 application, and have done this already with  the product I sell....(the previous revision.. REV 3)  But now...with my whizz bang bells and whistles Rev 4......aaargh.. I'm using the IAR kickstart platform, (the free limited size one) and to debug you need to use the following:

RUN TO CURSOR
SINGLE STEP
BREAKPOINTS.

Unnnnnfortunately, Run to Cursor and Breakpoints are not working in this revision. So.... I start blaming!  Code is crap? Platform is crap? Need to update crap firmware ? Some problem in the target board? I end up downloading the current newest version of Kickstart, also downloaded the TI Code Composer platform....neither of which I've got going yet.  IAR have a licence process that would make a NASA Scientist glazed eyed!  CC is just too much to sort out with my limited timeframe.

Soooo....I did some testing of REV 3 with everything still the same...and VOILA... everything worked!  I put Rev 3 code into Rev 4 workspace and...CRASH...no jolly good!  I put Rev 4 code into Rev 3 workspace and.... its OK....

Obviously.. I have a gremlin in my Rev 4 workspace!   (to be continued!)

UPDATE  21/3/15
NO....THE GREMLIN IS.... (you guessed it... MEEEEEE)  Much as I detest to admit it...I'm relieved! I found the problem and it was 'me'. Here's how it went down.  In my code I initialize the processor to run at 'moderate' speed by initializing the registers in the clock module accordingly. Then, after the product is turned on with full external voltage, I have a few lines that crank up the clock speed to pretty much it's maximum!  To function reliably at this high speed, it requires a 3.5v Vcc rather than the standard 3.3v that the emulator provides. (I use the MSP430F2234) The uP can handle up to 3.6v ok so it's within limits. 

In my basic testing of the code, I did not have the external power supply connected because I just wanted to verify the code flow logically!  THAT was my problem.  Without the higher Vcc, the poor old chip just sagged at the shoulders and sent bent weird binary garbage information back to the PC and emulator causing it to become very very lost!

As soon as I disabled the fast clock speed code.... the universe suddenly came back into balance, and microprocessor Utopia permeated my office and lab.

My joy was tempered though by my brilliant son, to whom I've lent one of my work vehicles to give him an income while he does his Masters of Entrepreneurship and Innovation, and who 'lost' the rear ladder rack (which is removable).  I couldn't growl at him too much because I've done the same thing myself in earlier days.. twice!  In my case though, I managed to retrace my steps and get it back. No such luck with him.  Aaaah well...life goes on, until that is... my daughter rang to tell me she is buying a near new car because of all the problems she's having trying to manage children at school, husband to and from work, and the RACV (Vehicle roadside assistance club) and still stay sane!  Which of course dragged me to the 'edge' of emotional collapse.... kind of... (I tend to over dramatize).... well... now it's 7:32 am, and....

Time to wander off on my morning walk of about 25 km...aah..gotcha.. told you I dramatize.. it's only 5km... and takes me through this pristine bit of semi natural bush where I've seen at least one Dingo. This bush is behind suburban houses.  On a related matter re that bush, some local clown of an 'ecologist' (the amateur kind) made the hysterical claim that there is a kind of native orchid only found in THIS little patch and no where else in the world. (he knows this of course because he has traveled the whole wide world and checked very square inch of the planet to confirm his theory).  So...he whined to the local shire Council, obtained prolific signage to the effect that people must not step to the right or to the left of the paths to avoid stomping on this precious little orchid. (He said there is only ONE single plant still flowering)..

Aside from the comical environmental analysis by this joker, it became every funnier when the local council torched the place in the interests of fuel reduction for the fire season.  How strange and funny is this world eh?






No comments:

Post a Comment

Please make comments here. Vulgarity or namecalling will not survive the moderator. Reasoned argument alone will survive.