I’ve developed an Arduino sketch that runs on one Arduino and allows it to control and debug another Arduino or an AVR-Series micro-controller, such as an ATTiny85. With some limitations, you can use the controlling Arduino to disassemble code, single step code, inspect and modify the current value of registers. I/O ports and SRAM and run code with a hardware breakpoint set.
The code I've developed is still rather unpolished and assumes the user has a basic understanding of AVR assembly language in order to benefit from using it. However, I think parts of it, such as the ability to set hardware and software break points could benefit a larger audience if integrated properly into the Arduino IDE.
I've done some experiments with writing my own, Arduino-like IDE for the ATTiny10 series and, from this, I've learned how to get the GNU compiler to emit interlaced C and ASM code. I believe this could be parsed to find the corresponding ASM starting addresses for lines of C code such that a user could set breakpoints for them. I think it also might be possible to parse the symbol table combine this with other parts of my debugger in order to inspect and modify at least the non register-based variables. However, this is just conjecture on my part at this point.
I'm posting here on the off chance that my work might be of some use to the Arduino community and that perhaps other developers might want to adapt, or contribute to what I've produced so far. Any type of constructive feedback would be appreciated. At the moment, I'm working to integrate portions of the "Arduino ISP" sketch into my code so it can both upload to and debug code on the target device.
You can read more about my project at https://sites.google.com/site/wayneholder/debugwire and/or watch a short, demo video at https://youtu.be/kI_Z78a_0y0
Wayne
Hi All
I am a recent Arduino user after an enforced break of many years due to my career. Prior to that I developed many 8 bit systems, based mainly on the Intel 8051 family and latterly its derivatives, with a mixture of Hitachi, Zilog and Molorola 8 and 16 bit devices for embedded control projects using plain ‘C’.
My current project, which is near completion, is a GPS navigation aid for sailors with visual impairment based on the 328 processor. I did all my initial research and development using standard UNO module with a range of breakout modules until I converged on the final design. This will become a custom PCB.
Being focused on the task in hand, I did not have much time to develop ‘development tools’ to ease my research. However, I did make my own ICSP which has been modified to exactly suit my development environment. This automatically handles program download, the setting of the fuses and security bits and also sets the OSCCAL automatically. I also believe that I could easily modify my ISCP to perform the debugging function that Wayne has mentioned, if I had the time.
For me, the major omissions from the IDE is the ability to automatically (and easily) generate:-
1) Mixed C and ASM listings
2) Easy to view Symbol Table
3) Memory Map
These are features which are common in virtually all of the development systems I have used in the past, but are probably not a requirement for the ‘Hobbyist’ user. Thus have been overlooked in the IDE development. The Forums have numerous requests on how to generate the above information, and many responders have avoided giving a clear answer/tutorial for a complete, easy to use solution. I have found ways of generating the information but it is tiresome and thus grossly underused. One tends to use the ‘I hope it is OK’ approach.
I do like Wayne’s work and ideas and if it was finalised and issued, would have got me out of many a ‘hole’ that I fell into. I would be willing to help if I had time, which currently looks like next winter. If Wayne were to PM me, I would happily discuss it with him in the near future.
In addition, my preferences are:-
1) The ability to set a breakpoints
2) A simple Single-Step and/or TRACE function would be nice. (However, this has limited usage in a highly Interrupt driven system)
3) I have rarely found a dis-assembler to be of any use, other than trying to hack someone else’s system.
I realise that what I am doing is beyond the scope of the average ‘Arduino User’. The Arduino concept is excellent and meets the needs of most Hobbyist users and novices. I just wish a similar system was available when I started with the Motorola 6800 and twin cassette tape development system back in the mid 70’s.
If my preferences were included, or a tutorial was developed to provide the information I desire, then it would become a truly excellent low cost development system.
As I am a sole developer, using my own money, an Arduino system, my own ISCP and a digital storage scope and I am highly unlikely to make any profit, the following phrase applies:-
‘When you're up to your neck in alligators, it's easy to forget that the initial objective was to drain the swamp’
Keep up the good work Wayne, and feel free to contact me.
Cheers
Bob G.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
Thank you for working on this. I’ve been frustrated for a long time by the lack of information about debugwire, and things along the lines of this work are highly necessary if we’re ever to have the sort of “simplified debugging environment” that Arduino needs… BillW/WestfW -- You received this message because you are subscribed to the Google Groups "Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.
I’ve posted a new, part 3 article on my debugger project, along with new code and an overview video. The new code is now able debug an Arduino UNO running at 16 MHz and also includes some bug fixes and enhancements.
[url=https://youtu.be/F1202b0l5D]https://youtu.be/F1202b0l5DA[/url]
Wayne
> email to developers+unsubscribe@arduino.cc.
>
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.
--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.