Quoting "David Brownell" <[email protected]>:

On Thursday 11 February 2010, [email protected] wrote:
I have successfully programmed the AT90CAN128, based on the mega128  
example and some
small modifications.

Could you repost those modifications in the form of a patch?

You can generate patches using

        diff -NaurP old.c new.c

and similar for non-C files ... use the full path from the root
of the source tree.

- Dave



Yes. Here is the patch and the new cfg used to test (almost just a copy of the one for mega128)


/ Hans Peter Mortensn
--- src/flash/nor/avrf-old.c	2010-02-12 08:43:48.000000000 +0100
+++ src/flash/nor/avrf.c	2010-02-07 19:31:41.000000000 +0100
@@ -54,6 +54,7 @@
 {
 //	 name,			chip_id,	flash_page_size,	flash_page_num,	eeprom_page_size,	eeprom_page_num
 	{"atmega128",	0x9702,		256,				512,	8,					512},
+	{"at90can128",	0x9781,		256,				512,	8,					512},
 };
 
 int avr_jtag_sendinstr(struct jtag_tap *tap, uint8_t *ir_in, uint8_t ir_out);
@@ -200,7 +201,24 @@
 
 static int avrf_erase(struct flash_bank *bank, int first, int last)
 {
-	LOG_INFO("%s", __FUNCTION__);
+	LOG_INFO("HP HACKED: %s", __FUNCTION__);
+	//return ERROR_OK;
+	struct target *target = bank->target;
+	struct avr_common *avr = target->arch_info;
+
+	if (target->state != TARGET_HALTED)
+	{
+		LOG_ERROR("Target not halted");
+		return ERROR_TARGET_NOT_HALTED;
+	}
+
+	if ((ERROR_OK != avr_jtagprg_enterprogmode(avr))
+		|| (ERROR_OK != avr_jtagprg_chiperase(avr))
+		|| (ERROR_OK != avr_jtagprg_leaveprogmode(avr)))
+	{
+		return ERROR_FAIL;
+	}
+
 	return ERROR_OK;
 }
 
# for avr
   set  _CHIPNAME avr
   set  _ENDIAN little
# jtag speed
jtag_khz 4500
reset_config  srst_only
jtag_nsrst_delay 100
#jtag scan chain
if { [info exists CPUTAPID ] } {
   set _CPUTAPID $CPUTAPID
} else {
#   set _CPUTAPID 0x8970203F
   set _CPUTAPID 0x0978103F
}
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 
$_CPUTAPID
set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
target create $_TARGETNAME avr -endian $_ENDIAN -chain-position $_TARGETNAME

$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 
-work-area-size 16384 -work-area-backup 0
#flash bank avr 0 0 0 0 0 at90can128
#flash bank avr avr 0 0 0 0 $_TARGETNAME
flash bank avr1.flash avr 0 0 0 0 $_TARGETNAME

#avr_program.cfg:
# default ports
telnet_port 4444
gdb_port 3333
tcl_port 6666
init
jtag_khz 4500
reset init
verify_ircapture disable
halt
wait_halt
poll
#avr mass_erase 0
flash probe 0
flash write_image erase 
/home/navis/aausat3/software/boards/platform/platform.hex
reset run
shutdown

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to