Use of JTAG for debugging
JTAG can be used to single-step and debug loaded applications, including RedBoot. Only JTAG and ROM configuration applications should be debugged using JTAG, RAM applications assume the presence of RedBoot.
Ronetix PEEDI notes
On the Ronetix PEEDI, the peedi.mcimx25x.cfg file should be used to setup and configure the hardware to an appropriate state to load programs. This includes setting up the PLLs and SDRAM controller.
The peedi.mcimx25x.cfg file also contains an option to define whether hardware or software breakpoints are used by default, using the CORE0_BREAKMODE directive in the [PLATFORM_ARM] section. Edit this file if you wish to use hardware break points, and remember to restart the PEEDI to make the changes take effect.
On the PEEDI, debugging can be performed either via the telnet interface or using arm-eabi-gdb and the GDB interface. In the case of the latter, arm-eabi-gdb needs to connect to TCP port 2000 on the PEEDI's IP address. For example:
(gdb) target remote 111.222.333.444:2000
By default when the PEEDI is powered up, the target will always run the initialization section of the peedi.mcimx25x.cfg file, and halts the target. This behaviour is repeated with the reset command.
If the board is reset (either with the 'reset', or by pressing the reset button) and the 'go' command is then given, then the board will boot as normal.
Consult the PEEDI documentation for information on other features.
Running JTAG applications
Applications configured for either JTAG or ROM startup can be run directly under JTAG. Once loaded and running via JTAG, HAL diagnostic output will appear by default on the serial debug port. There is in fact minimal difference between ROM and JTAG applications and these can mostly be used interchangeably.
Installing user applications into Flash with JTAG
If you wish to install a ROM startup application into Flash to be automatically booted, you can follow a similar procedure to installing RedBoot into Flash. However before you can do so, you must first prepend a header to your application image in order for the on-chip boot loader to recognize it as a valid application.
You will need to locate the program flashimg_imx supplied with the eCosPro installation and generate a binary image of your program using the arm-eabi-objcopy command. The following gives an example simplified command sequence which can be run at a command shell prompt:
arm-eabi-objcopy -O binary myapp myapp.bin flashimg_imx myapp.bin myapp.img
Once you have the .img file, you can follow the same process as installing RedBoot via JTAG. Alternatively, you can write it to an SD card and boot it directly after changing the board switches.