firmware debugging

A forum for discussing the applications and implementations of the DIY general code template for the GPIO and its 25 user inputs and outputs (+ serial & CAN). The code is 99% complete, the user just has to add their own conditional I/O logic and compile (with a free special Edition of CodeWarrior).
Post Reply
bsundahl
Posts: 3
Joined: Mon Sep 21, 2015 8:30 pm

firmware debugging

Post by bsundahl »

How do you guys do debugging on this platform? This probably applies to Megasquirt code as much as GPIO. I havnt had any success getting a debugger to run.

I can load code the "megasquirt way" using MS Download. That works, but then I dont have any debugger. I can use it this way, but it makes the debugging process slow and painful.

If I try to load code directly from CodeWarrior over the serial port (using the "Monitor" target), the code starts to download, then I get an error message "Error while writing to 7000..7200. No memory at this address". It then continues to download more code. The debugger appears to be working, but the code wont run.
And even if it did, I am pretty the serial port will be reconfigured for TunerStudio as soon as I run the code, so I would lose my debugger connection.

If I try to load code from CodeWarrior over the P&E Multilink cable (using the "P&E ICD" target), the code seems to download, and I can start single stepping thru startup code in Start12.c. Seems good until I click RUN, then I seem to start hitting illegal opcodes.
This also wipes out the serial monitor, which I then have to reload before I can go back to either of the other methods.

Does anyone use a debugger with this system? Any tips on how to make it work?

Thanks a bunch.
-bill
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: firmware debugging

Post by Bernard Fife »

Does anyone use a debugger with this system?
Bill,

I don't use the debugger (though I have P&E cables, etc.). I use a stim and actual inputs and outputs (plus various user input parameters for input and output channels to test internal values, states, and register contents; plus a scope of course). That way I am using only the actual code to test.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Post Reply