[bleeding edge alert, researchy]

Assuming one were to use the AM335x PRU realtime processors to, for instance, 
write a stepgen or encoder thread function, one had to do this in PRU assembler.

TI supplies an assembler program and the glue code to load, execute and 
interface with such PRU programs. However, no debug tools except the TI 
Development Environment (clunky licenseware) is provided. Without debugger, 
this is a fire-and-forget affair. Luckily its quite simple to access, inspect 
registers, step, halt, continue and reset the PRU's through a memory mapped 
interface.

I've created a debugger which works as a HAL component, and has a GladeVCP UI 
to provide a basic debugger tool.

The assumed scenario is like so:
- there's some component (here: hal_pru) which loads, executes and interacts 
with some PRU code
- the hal_prudebug component can be loaded separately, with a GladeVCP UI, to 
attach to the PRU
  and trace/singlestep/inspect the registers etc.
- the UI component can read the .dbg output of the PASM assembler to correlate 
the source line
  and program counter.

first, run 'make' in this directory, this will assemble the PRU source code and 
create the .bin and .dbg files

then run this as:
$ halcmd debugger-example.hal

- in the file chooser, select pruexample.dbg (the assembler's debug output)
- select stepping, contuous
- step through program by clicking continue

(on a beaglebone or some other AM335x CPU based board, that is - nothing else 
makes sense)

screenshot:  the result looks like so: 
http://static.mah.priv.at/public/prudebug.png

---

the effort is moderate - roughly: 450loc C for hal_prudebug.c, 150 lines Python 
for the GladeVCP UI.

the branch is here: 
http://git.mah.priv.at/gitweb/emc2-dev.git/shortlog/refs/heads/arm335x-hal-pru-module

the example hal file: 
http://git.mah.priv.at/gitweb/emc2-dev.git/blob/67d2648163343012de14fdb8cbb6efc230e87774:/configs/pru-examples/debugger-example.hal
the debug component: 
http://git.mah.priv.at/gitweb/emc2-dev.git/blob/67d2648163343012de14fdb8cbb6efc230e87774:/src/hal/components/hal_prudebug.c
the ui Python code 
http://git.mah.priv.at/gitweb/emc2-dev.git/blob/67d2648163343012de14fdb8cbb6efc230e87774:/configs/pru-examples/ui.py

with that tool it should be relatively easy to move a time critical function 
into a PRU.

- Michael

ps: this is a proof-of-concept with several warts.






------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to