Altium Universal JTAG I/F and the PXA270 - Karo Triton SK3

Hello - has anyone tried this combination with OpenOCD?

I have managed to get to the point of manipulating flash (P30) but at the moment this is restricted to single byte writes but full sector erases and reads.

My 'scope suggested that the ntrst and nsrst signals arrived swapped at the board and whether this is an sk3 board error or altium cable config problem I’m not sure. Also with the Altium flying leads you do need to short the jtag connector on the SK3 board pin 14 to gnd.

I’m thinking that the problem is connected to the debug handler not being correctly loaded, the code in this area is difficult to follow.

Also the OpenOCD code throws a warning about the flash protection register field being 2 which is correct for the P30.[/b]

Studied the problem further and the code is falling over on the cfi intel write block at the point where a hardware breakpoint is being added (xscale.c:2225 xscale_add_breakpoint). The single byte write doesn’t use this which is why single byte writes work.

The debug handler times out after this with target_read_u32(): address:0xffff0004 failed. Seems the write algorithm code is failing.

Now studying the 46 pages of the Intel manual describing the software debug in the processor - could take some time"!

Study continues but I have now managed to handle all flash operations by commenting out code in xscale.c - xscale_resume ( a few debug messages added to orig code svn 721).

Could it be xscale_update_vectors(…) is not correctly handled by the debug_handler code - this causes an rx timeout if I leave it in.

int xscale_resume(struct target_s *target, int current, u32 address, int handle_breakpoints, int debug_execution)
{
	armv4_5_common_t *armv4_5 = target->arch_info;
	xscale_common_t *xscale= armv4_5->arch_info;
	breakpoint_t *breakpoint = target->breakpoints;

	u32 current_pc;

	int retval;
	int i;

	LOG_DEBUG("-");

	if (target->state != TARGET_HALTED)
	{
		LOG_WARNING("target not halted");
		return ERROR_TARGET_NOT_HALTED;
	}

	if (!debug_execution)
	{
		LOG_WARNING("freeing work areas");
		target_free_all_working_areas(target);
	}

	/* update vector tables */
	//LOG_WARNING("about to check set vectors");
	
	//if ((retval=xscale_update_vectors(target))!=ERROR_OK)
	//{
	//	LOG_WARNING("xscale_update_vectors fault");
	//	return retval;
	//}

	/* current = 1: continue on current pc, otherwise continue at <address> */
	if (!current)
		buf_set_u32(armv4_5->core_cache->reg_list[15].value, 0, 32, address);

This probably clobbers the handling of (gdb) code debug but at least I can restore my RedBoot code. I can debug code from linux with redboot running but that doesn’t help OpenOCD.

Meanwhile I will continue to investigate in the hope someone can put me out of my misery before I spend much more time on this.