Learn to Swin - A Debugger(?) for Embedded Systems

Talks | Submit a talk
Authors Sriram V Iyer
Level Beginner
Topic Testing
Tags debugging, embedded systems
Summary

Swin is a debugger / interactive console for truly limited config embedded systems without a display and keyboard. Swin was developed purely in Python and has a lot of interesting features that are not available to embedded systems programmers who use a serial / ethernet ports to debug their applications. Swin is built on some fundamental abstractions to access memory and can be used to debug any system that does not have a MMU. Swin runs on the PC and can connect to the embedded device over multiple interfaces (that implement the fundamental abstractions)

Outline

Python is usually not embraced by developers for low level embedded systems because Python cannot run in very low CPU / memory configurations - Python will also not be realtime. However, Python can be used to create tools for embedded systems rather than directly trying to put Python inside the system.

Swin is one such utility. Developing for systems that don't have a display / keyboard can be challenging - Esp, if there is no JTAG / BDM connectivity. Developers rely on reading directly from memory based on: (1) Writing Debug Information to fixed Memory Locations (2) If that's not possible, use Linker Map files to read addresses of variables .bss/.data sections and read the variable values

Option (2) is a problem because the location of variables change with (almost) every build.

Swin uses linker map files and provides a user with a command-line console with which user can read / write variables in an interactive manner. Swin can also interpret memory locations as structures or array of structures (excellent logging tool).

To achieve all the above and more, Swin uses a lot of Python - I plan to explain how the debugger is used and then explain the concepts involved in developing the debugger: a. Command Handling Engine b. Permissions Handler c. Data-Structure Interpretation Engine d. Linker MAP parser e. Stack Tracer (when exception occurs) f. Batch mode / simple macro expansions 6. Post Mortem Debug

Detailed Overview of the Presentation

Swin - What it is? What can it do? Why did I do Swin? Why use Swin? Why Python for Swin? Fundamental Abstractions that are required by Swin Swin / Python --- How commands are interpreted --- How memory/map files are parsed --- Simple stack tracer (MIPS architecture dependent) Future Directions --- Heuristics based Assistance --- Dynamically add Heuristics --- Remote / Online Debug
I am not a Python expert, but Swin was a terrific success in terms of adoption (100% !) within my prev company's software development community. It is also used by many network operators around the world to get dynamic information about the mobile device (for which Swin was originally developed) - I attribute the entire success of Swin to Python, and Swin has created about 20+ developers to learn Python!

Notes

Thought this was a good opportunity to evangelize Python even to developers who cannot technically run Python inside their system, but use it from outside! Just thought it wouldn't harm anyone to submit this proposal!

I wrote Swin in my stint as Principal Engineer with my prev employer, who is a world leader in mobile WiMax chipset development

Profile of the authors

Sriram V Iyer is currently Chief Technology Officer at United Mobile Apps Pvt Ltd (www.umobile.in, www.usyncworld.com), a India based Tech startup that believes that the user owns the data in his mobile device (currently, the mobile device owns the data!). He is a Python enthusiast and evangelist. He has applied for a couple of patents on Scheduling algorithms for wireless systems and testing based on dynamic languages. He has also authored a book - 'Embedded Realtime Systems Programming', published by Tata McGrawHill. He blogs infrequently at sviyer-tech.blogspot.com

Files
No files uploaded. You can upload a file if you are author of this talk.