Using Jtager

From eLinux.org
Jump to: navigation, search

Using JTAGER with the Juicebox

Introduction

JTAGER has not been updated for a while but is a great program. It comes with support for the ARM7TDMI built in but only supports wiggler jtag hardware.

JTAGER is useful for debugging and downloading binary files to the JB. See JuiceBox Code Test for demo programs.


Install

Download the tarball from http://jtager.sourceforge.net/

Read the README file for install instructions (./configure && make && make install should do it)

Usage

This will take you through running the lcd_2 demo on your Juicebox using JTAGER. Note that I am using # for comments but this is not actually valid - it is just to clarify what the command is doing.


#see available commands
JTAGER> help
*snip - see your output from this*

#halt the CPU
JTAGER> halt
Requesting HALT target ... [OK]
The target is halted in ARM mode.

#Verify the CPU
JTAGER> idcode
Device ID = 0x1F0F0F0F
        bit[0] = 1, always be 1, required by IEEE Std 1149.1
        Manufacturer (bit[11:1]): 0x787 - SAMSUNG
        Part number (bit[27:12]): 0xF0F0
        Version (bit[31:28])    : 0x1

#Copy the lcd_2 demo to memory (you have to hit enter twice)
#be sure to copy the BIN file and not the ELF file
JTAGER> memset --base=0x0c001000 --infile=hacking/juicebox/jb-code/lcd_2.bin
memset: Fill the memory block [0x0C001000, 0x0C0017EB] with the file "hacking/juicebox/jb-code/lcd_2.bin" ...
. [OK]
Total 2028 bytes are written.


#restart the proc at the correct entry point
JTAGER>JTAGER> restart 0x0c001000
Restarting the target processor at 0x0C001000


That's it You should now be looking at the LCD demo starting with the text "Juicebox LCD Demo #2" on the screen.

What is going on here?

Read the lcd_2.dld file from the lcd_2 tarball - this gives a clue as to where to copy the BIN file.


/* Memory Definitions */
MEMORY
{
  RAM (rw) : ORIGIN = 0x0c001000, LENGTH = 0x00010000
  SRAM (rw) : ORIGIN = 0x010001000, LENGTH = 0x1000

}


The Juicebox memory (RAM) starts at 0x0c001000 - therefore that is where we copy the BIN to.

Now that you can copy binaries to your juicebox and run them it's time to start writing your own code. See JuiceBox Software Development for help.