Home › Forums › TinyG › TinyG Support › debugging with mkII PDI in Studio 6
Tagged: debug pdi mkII tinyg
- This topic has 5 replies, 2 voices, and was last updated 11 years, 9 months ago by alden.
-
AuthorPosts
-
February 9, 2013 at 5:09 am #3750oleksiyMember
Hello,
I just got the latest code loaded up through PDI, but I have a hard time debugging through PDI. I’m using Studio 6 (SP2).
When I try to start debugging the Build finishes:
—— Build started: Project: tinyg, Configuration: Debug AVR ——
Build started.
Project “tinyg.cproj” (default targets):
Target “PreBuildEvent” skipped, due to false condition; (‘$(PreBuildEvent)’!=”) was evaluated as (”!=”).
Target “CoreBuild” in file “C:\Program Files (x86)\Atmel\Atmel Studio 6.0\Vs\Compiler.targets” from project “C:\Users\opikalo\TinyG\firmware\tinyg\tinyg.cproj” (target “Build” depends on it):
Task “RunCompilerTask”
C:\WinAVR-20100110\utils\bin\make.exe all
make: Nothing to be done for `all’.
Done executing task “RunCompilerTask”.
Task “RunOutputFileVerifyTask”
Program Memory Usage:86388 bytes 42.2 % Full
Data Memory Usage:8175 bytes 49.9 % Full
Done executing task “RunOutputFileVerifyTask”.
Done building target “CoreBuild” in project “tinyg.cproj”.
Target “PostBuildEvent” skipped, due to false condition; (‘$(PostBuildEvent)’ != ”) was evaluated as (” != ”).
Target “Build” in file “C:\Program Files (x86)\Atmel\Atmel Studio 6.0\Vs\Avr.common.targets” from project “C:\Users\opikalo\TinyG\firmware\tinyg\tinyg.cproj” (entry point):
Done building target “Build” in project “tinyg.cproj”.
Done building project “tinyg.cproj”.
Build succeeded.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
and the debug tab has:
The program ‘tinyg.elf’ has exited with code 0 (0x0).
But the debug mode does not start!
I have attempted to do something with Studio 4, but it cannot connect to my mkII (is the USB driver different between Studios?)
Any advice on how to start debugging on the platform through PDI would be greatly appreciated! Thanks!
- This topic was modified 11 years, 9 months ago by oleksiy.
February 9, 2013 at 6:09 am #3752oleksiyMemberI guess AVRISP mkII is for downloading code only ;-(
February 9, 2013 at 7:18 am #3753aldenMemberI just tried out your scenario. A couple of things – the PDI is not a hardware debugger. Atmel offeres a ICE but it’s $425 and slow and molasses on – well – ICE. I used to have a JTAG connector on the board but I took it off in v7.
But all is not lost. I do almost all my debugging in the simulator2. It has some pros and cons. It’s hard to emulate real-time actions like serial IO or limit switches. But it’s portable because it doesn’t require any HW and I use it on the road all the time. Another down-side is that it’s slow to emulate very long sequences.
I have some tools int eh code to help with this. In tinyg.h there are some defines that take out a lot of the startup stuff like messages and NVM writes. There is also a way to feed a command to the serial buffer on startup. See test.c
I like the simulator on Studio4 better than studio6. There are some workarounds I documented here:
https://github.com/synthetos/TinyG/wiki/Developer-Notes
Lastly, if you are going to play with the code I recommend using the current push in edge (build 367.04). It’s a release candidate for version 0.95
Alden
February 9, 2013 at 7:20 am #3754aldenMemberOne last thing – I fired up the debug in Studio6 and it worked – it didn.t fail like it did for you. You may want to grab the Studio6 project files from the /support directory in the edge and see if you get better results
February 9, 2013 at 9:20 pm #3760oleksiyMemberThank you for advice. I had a had time using mkII with Studio 4, after installing Studio 6 first. Probably usb driver gets updated to version 11.00 in Studio 6, and I thought this is the reason Studio 4 can not recognize mkII on usb port.
When you say it worked, does it mean that it compiled and loaded the image and quit, or that you were able to start debug session on the target?
February 10, 2013 at 10:56 am #3762aldenMemberI was able to compile and start a debugging session in Simulator 2. This is normally what happens – I have not experienced the failure you noted. Setting up an existing project in 6 is a bear. See the developer notes link from a few posts back.
I use 4 for simulation as the interface is actually better (less broken). The compiler and libs used in 6 generate better code, though. Also, I almost always simulate in -O0 optimization as that way you see every instruction and declared variable instead of jumping around and having to look at the register set to see what’s going on. I takes longer to run, though as there are more instructions to execute.
Alden
-
AuthorPosts
- You must be logged in to reply to this topic.