Saturday, August 21, 2010

Zipit Z2 JTAG

So I finally managed to brick my Z2...

Trying to get the sleep / reset cycle working in u-boot (look for a subsequent post) I managed to generate some dodgy assembler and the next thing you know...

Luckily I had a nice JTAG adapter lyining around, an Olimex ARM-USB-OCD. The soldering wasn't too tricky, but here is a detailed picture to help out the weary:


The interesting part was getting OpenOCD to play along nicely. To get OpenOCD working you need some configuration scripts that identify your CPU, JTAG adapter etc.

Here is the Z2 specific script (save this as e.g. z2.cfg):
# config for ZipitZ2

jtag newtap pxa270 cpu -irlen 7 -ircapture 0x1 -irmask 0x7f -expected-id 0x49265013 -expected-id 0x79265013

target create pxa270.cpu xscale -endian little -chain-position pxa270.cpu -variant pxa27x

# maps to PXA internal RAM.
pxa270.cpu configure -work-area-phys 0x5c000000 -work-area-size 0x10000 -work-area-backup 0

#flash
flash bank pxa270.flash cfi 0x00000000 0x1000000 2 2 pxa270.cpu
And the ARM-USB-OCD configuration (save this as e.g. arm-usb-ocd.cfg):
#
# Olimex ARM-USB-OCD
#
# http://www.olimex.com/dev/arm-usb-ocd.html
#

interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG"
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15BA 0x0003

jtag_nsrst_delay 0
jtag_ntrst_delay 200
reset_config trst_and_srst separate

What is interesting to note in the script above are the jtag_nsrst_delay and jtag_ntrst_delay values. The ARM-USB-OCD has separate lines for SRST and TSRT and the above values were required to get reset halt to work reliably in OpenOCD.

Reflashing u-boot brought the Z2 back to life and I now have a JTAG debug option. I should have done this years ago!

HTH
-(e)

edit: stupidly I forgot to thank the original JTAG legend GPSFan for his help and pictures and G1PowerMac for his site.

Tuesday, July 27, 2010

[Dingux] OpenTyrian Save and High Score entry

I've started adding code for a limited kind of virtual keyboard.
This should allow save games names and high score entry in OpenTyrian.

So far it seems to be working for save games but I need to clean it up a bit and get it to work as a generic text entry mechanism.

Stay tuned, hopefully this will be finished before I depart overseas for a week.
-(e)

Sunday, July 25, 2010

Dingux OpenTyrian release


Here is an optimised build of OpenTyrian that plays full speed with sound. This archive ONLY contains the executable: opentyrian.dge, please overwrite your old tyrian executable or get the datafiles if you do not have them from:

OpenTyrian @ GoogleCode

LinkOther changes:
  • Key mapping now works (segfault in code fixed)
  • Key mapping now swaps keys if an in-use key is chosen
  • SDL mouse cursor removed
  • Soft mouse cursor removed from upgrade etc. screens
  • Display is centred
These fixes also apply to the GP2X version and the patches have been applied to HEAD in the mercurial dev tree so feel free to build your own :)

Get it from the GP2X.com archive.

-(e)

Sunday, January 10, 2010

sweetlilmre's tips to make your dev life suck less, part #1

Disclaimer: The title might suggest that I invented or this originated this stuff in some way. I certain DID NOT :) Just some good reading I have done lately. And thanks to JonH for some of the links and discussion.

Dependency Injection:

JonH (a mate of mine from work) and I have been having some very interesting chats on Dependency Injection, Inversion of Control and other bits and pieces.


What this had made me realize is that there are some very simple development concepts (dressed up in frightening terms like Dependency Injection!) that really make your life easier if you practice them. Some of this stuff you pick up as a dev as you go along but formalizing the concept as soon as possible is only going to help you.

So start off by reading this:

http://stackoverflow.com/questions/130794/what-is-dependency-injection

Then ask yourself if you understand what Design by Contract means and how using interfaces applies and to and works with DI to make your life easier. Then have a look at this:

http://googletesting.blogspot.com/2008/07/how-to-think-about-new-operator-with.html

Which gives a nice round off to the DI discussion. This also seems like a great blog to follow generally.

This is all building up to unit testing and mocking, but we'll get to that later :)

-(e)

Sunday, November 22, 2009

Under the radar

I bought myself one of these little toys: USB LED Message Board
Disgusted with the app that came with it (can you spell CPU hog?) I reverse engineered the app and have posted source code to talk to it here.

This is written in C#, if you are one of those "I'm too hardcore to code in C#" people, you should be hardcore enough to translate it into C/C++... :)

In other news I have been working furiously with the Vice dev team (what a great bunch!) to get the SDL dingo port ready as an official port from the next (2.2) release. Hopefully we'll make it.
(Big shout-out to Nojoopa for all his help)

As far as the zipit goes, not to much to tell. Once the building is complete on the house and I can move back into my study, I'll get hacking on it again.

-(e)

Monday, September 21, 2009

Slackness

Well yes, very slack am I. But I've been really busy in the background!!

Anyway lame excuses aside, I have a fullspeed port of Vice working on the Dingoo and am working with the Vice devs to integrate support into the main Vice tree, which is nice.

I see that much has been happening on the Zipit front! Hopefully Aliosa27 will get hold of me and I can merge his/her (?) work into the SVN tree. Come on people, get onto the #zipit channel on freenode so that we can co-ordinate all of this! :)

Again apologies for all the slackness, RL has me by the curlies.
-(e)

Tuesday, September 8, 2009

Just managed to get an alpha port of Vice (the C64 emulator) onto the Dingoo A320.
I am awaiting news approval on gp32x.com but you can get it to try it out: here.

I have managed to fix a few more issues with it since the alpha release and hope to have a beta shortly. MarbleMadness at 50fps with sound (sometimes :)) ROCKS!
-(e)