LPCXpresso 1769 debug build (debugging vs not debugging)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPCXpresso 1769 debug build (debugging vs not debugging)

2,004 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Mon Dec 05 10:50:23 MST 2011
1. I build my TCL program and run it using "Debug 'TCL' [Debug]" Option in my IDE. It runs fine.
2. I stop the debug by ALT-F2. The program still produces sends out good data through uart.
3. I disconnect the usb cable (my lpcxpresso is still in one piece with the lpc-link) and my application goes crazy (?). It produces data I would never guess it would produce.

What runs on my device in such situation? What is going on? Please help me understand.

regards,
--
Luke
0 Kudos
Reply
12 Replies

1,994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Polux rsv on Wed Dec 07 10:18:37 MST 2011
Calibrating after powerup is good when debugging, with board leveled on the table. But when your board will be on your bike, it will not always be at good level when powering up.
Use the onboard 24C64 eeprom to store the calibration values. You will calibrate only once in the lab, and then imeditely use these values at each startup.

Angelo
0 Kudos
Reply

1,994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Wed Dec 07 09:42:23 MST 2011
Indeed - something definitely changes.

I have noticed that when debugging, after downloading the code it is actually running before the debugger stops and restarts with a break at the main() function.
In my FatFS test program I actually see that the "hello" string is printed after download even before the debugger halts at the first line in main() - so this means the program must have been running after download...

Another thing that is different is that your code start running immediately after power-on, there is no delay due to starting the debugger or downloading code. So if your hardware needs a stable power supply before being initialized, you need to wait a bit. Alternatively, you may try to reset your device after applying power just to see if this resolves the problem.

Regards,
[INDENT]Rob
[/INDENT]
0 Kudos
Reply

1,994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Wed Dec 07 07:35:33 MST 2011
Ok. It was related to speed when not debugging. Some things just happen faster and it seems my gyro didn't properly initialize.
All I had to do was to add sleep(100) before the first calibration read.
0 Kudos
Reply

1,994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Tue Dec 06 10:27:56 MST 2011
So who/where do I ask?
As I understand it should behave the same way in both situations?
0 Kudos
Reply

1,994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Dec 06 10:22:13 MST 2011
This is not an clairvoyant forum :eek:

So 'simply' ask the guys who connected the hardware and wrote the software to decide if your hardware is wrong, your inputs are wrong or your code is faulty :rolleyes:
0 Kudos
Reply

1,994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Tue Dec 06 10:11:35 MST 2011
Noone here who can tell me what changes between simply plugging the usb cable and using a debugger?
Something definitely changes ...
0 Kudos
Reply

1,994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Mon Dec 05 13:06:20 MST 2011
This is really looking weird.
I output all my initial data to uart now.
When I debug or stop debug without disconnecting the cable the results look like this:
...
[      0 ;       2;       2] [     15 ;      24;    4082] [   0.09 ;    0.08]
[      1 ;      -2;       2] [     19 ;       3;    4100] [   0.09 ;    0.08]
[      4 ;       0;       0] [     22 ;       5;    4101] [   0.10 ;    0.08]
[     -2 ;      -2;       0] [     15 ;       2;    4124] [   0.10 ;    0.08]
[      2 ;      -2;      -1] [    -28 ;       3;    4083] [   0.09 ;    0.07]
[     -1 ;      -1;       1] [     13 ;      18;    4112] [   0.09 ;    0.08]
[      1 ;      -5;      -2] [     -2 ;     -10;    4081] [   0.09 ;    0.07]
...


But when I disconnect the usb cable and reconnect it, it looks like this:
...
[    173 ;   -1662;    1282] [      2 ;      -4;    4086] [   6.01 ;  -56.70]
[    168 ;   -1667;    1283] [     -3 ;      -6;    4103] [   6.01 ;  -56.71]
[    171 ;   -1665;    1279] [     31 ;      14;    4108] [   6.01 ;  -56.70]
[    171 ;   -1667;    1281] [     12 ;       4;    4093] [   6.01 ;  -56.70]
[    173 ;   -1663;    1283] [     -7 ;     -16;    4085] [   6.01 ;  -56.71]
[    164 ;   -1666;    1281] [     12 ;     -16;    4146] [   6.00 ;  -56.71]
...

The first three numbers are gyro readings, second three are accelerometer readings and last two are calculated angles.

Still no clue what's going on
0 Kudos
Reply

1,994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Mon Dec 05 11:39:39 MST 2011
Yh, wait, I badly described my problem.
Point 3. should say:
3. I disconnect AND RECONNECT usb cable ...
If I just disconnect it the dicece is unpowered...

Changing to run_cont doesn't change this behavior.

edit: I thought that maybe timing is different and thus my calculation's results differ, but I checked and timing is the same, results differ.
To be more precise about the problem. In my 100hz loop I calculate roll and pitch angles based on data read from my accelerometer and gyroscope. I use the complementary algorithm for that. When I use debug the results for a non-moving device are OK - floating around -0.01 to 0.01 for both axes. When I disconnect the usb cable and reconnect it the results start at 0.0, 0.0 but then grow very fast, to about 10.0, 65.0. Wtf!?

Any ideas please?
0 Kudos
Reply

1,994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Mon Dec 05 11:34:50 MST 2011
the setting is "cont".
The program running is the program I loaded last time, but it produces different results... I have completely no idea what could be the reason...
0 Kudos
Reply

1,994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Dec 05 11:26:54 MST 2011
And what is your Disconnect setting?

http://support.code-red-tech.com/CodeRedWiki/DebugDisconnect
0 Kudos
Reply

1,994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dragilla on Mon Dec 05 11:09:09 MST 2011
Or ctrl-f2... can't rememeber, and I can't start my app right now... anyway - it's the key-shortcut for command stopping the debug.

edit: it's crtl-f2 and it is the shortcut for: Run -> Terminate
0 Kudos
Reply

1,994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Dec 05 10:57:57 MST 2011
What's 'ALT-F2' :confused:
0 Kudos
Reply