User Tools

Site Tools


Sidebar

Table of contents

using_debug_mode

Using debug mode

Debug mode does not normally need to be used, but it can be used if you want to view variable values, for example.

Debug mode instructions

a. Start debug mode by clicking the hourglass + red “D” toolbar button in uVision ( the quad should be connected via programming cable and powered) This will upload the last compiled firmware, and start debug mode.

b. When the mode starts ( after clicking the popup and a few seconds more) press f5. The quad should start working now. This is the same as menu “Debug/run”

c. (once only) Go to menu “View/Periodic windows update” and enable. Go to menu “View/watches/watch 1/2 “and enable one or both. Watches are where the variables of interest can be added. Windows refresh updates those variables dynamically.

d. in the watch window there are some variables, attitude is the angle in degress. That should show if level mode works ok. On the second watch page there is acccal which should be pretty small, under 300 (+-) for example. If the angle keeps drifting while the quad is standing still it's a good indication it's not working.

e. Add more variables if needed: accel (raw), gyro (rad/sec) , accelcal ( loaded from flash unless calibration is performed), gyrocal ( calibration at startup in gyro raw units ) , attitude ( in degrees , only first 2), vbattfilt ( current battery) , looptime ( should be near 0.001 in seconds), rx ( incomming data from tx , roll, pitch yaw, throttle) , aux ( auxilliary buttons/switches from tx), and more. Only global and static variables can be seen, but some may require a breakpoint at least once before they show. Some variables are already added from when I used them.

The variables can be added by doubleclicking on <enter expression> in the watch window. They can also be added by right clicking the variable name in the code, while in debug mode ( select add to). Only persistent vars show, not those define within functions.

f. When finished press the toolbar button in step “a” again, to exit. You can use the quad afterwards.

The debug mode does not like to be disconnected from the quad while on but it will be ok after some time. Turn it off by pressing the same button again.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
using_debug_mode.txt · Last modified: 2016/04/30 00:43 by silverxxx