Hi, 
 
This issue is due to a bad configuration of flash bank :
 
jtag_nsrst_delay 100
jtag_ntrst_delay 100
#use combined on interfaces or targets that can't set TRST/SRST
separately
reset_config srst_only
#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag newtap $_CHIPNAME cpu -irlen 5  -ircapture 0x1 -irmask 0x1f
-expected-id $_CPUTAPID
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME mips_m4k -endian $_ENDIAN -chain-position
$_TARGETNAME
$_TARGETNAME configure -work-area-virt 0xbd000000 -work-area-phys
0xa0000000 -work-area-size 0x4000 -work-area-backup 0
flash bank pic32mx 0x1d000000 0x00040000 0 0 $_TARGETNAME
flash bank pic32mx 0x1fc00000 0x00003000 0 0 $_TARGETNAME
init
halt
 
now trying to program with this configuration I have:
 
Debug: 56 2902355 command.c:68 script_debug(): command - write_image
Debug: 57 2902355 command.c:77 script_debug(): write_image -
argv[0]=ocd_flash_write_image
Debug: 58 2902355 command.c:77 script_debug(): write_image -
argv[1]=unlock
Debug: 59 2902355 command.c:77 script_debug(): write_image -
argv[2]=blinky_leds.hex
Debug: 60 2902355 command.c:77 script_debug(): write_image - argv[3]=0
Debug: 61 2902355 command.c:77 script_debug(): write_image -
argv[4]=ihex
User : 62 2902370 command.c:400 command_print(): auto unlock enabled
Debug: 63 2902386 configuration.c:83 find_file(): found blinky_leds.hex
Debug: 64 2902542 target.c:1054 target_alloc_working_area(): MMU
disabled, using physical address for working memory 0xa0000000
Debug: 65 2902542 target.c:1116 target_alloc_working_area(): allocated
new working area at address 0xa0000000
Debug: 66 2902542 target.c:1246 target_write_buffer(): writing buffer of
512 byte at 0xa0000000
Debug: 67 2902542 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xa0000000, size: 0x00000004, count: 0x00000080
Debug: 96 2916853 pic32mx.c:500 pic32mx_write_row(): addr: 0x1d000000
srcaddr: 0xa0000000
Debug: 97 2916853 target.c:1560 target_write_u32(): address: 0xbf80f420,
value: 0x9d000000
Debug: 98 2916853 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f420, size: 0x00000004, count: 0x00000001
Debug: 99 2917181 target.c:1560 target_write_u32(): address: 0xbf80f440,
value: 0x00000000
Debug: 100 2917181 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f440, size: 0x00000004, count: 0x00000001
Debug: 102 2917525 target.c:1560 target_write_u32(): address:
0xbf80f400, value: 0x00004003
Debug: 103 2917525 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f400, size: 0x00000004, count: 0x00000001
Debug: 105 2917853 target.c:1560 target_write_u32(): address:
0xbf80f410, value: 0xaa996655
Debug: 106 2917853 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f410, size: 0x00000004, count: 0x00000001
Debug: 107 2918181 target.c:1560 target_write_u32(): address:
0xbf80f410, value: 0x556699aa
Debug: 108 2918181 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f410, size: 0x00000004, count: 0x00000001
Debug: 110 2918509 target.c:1560 target_write_u32(): address:
0xbf80f408, value: 0x00008000
Debug: 111 2918509 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f408, size: 0x00000004, count: 0x00000001
Debug: 113 2918853 mips_m4k.c:853 mips_m4k_read_memory(): address:
0xbf80f400, size: 0x00000004, count: 0x00000001
Debug: 114 2919118 target.c:1483 target_read_u32(): address: 0xbf80f400,
value: 0x00006003
Debug: 115 2919118 target.c:1560 target_write_u32(): address:
0xbf80f404, value: 0x00004000
Debug: 116 2919118 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f404, size: 0x00000004, count: 0x00000001
Error: 118 2919446 pic32mx.c:438 pic32mx_write_block(): Flash write
error NVMERR (status = 0x00006003)
Debug: 119 2919446 target.c:1560 target_write_u32(): address:
0xbf80f420, value: 0x9d000000
Debug: 120 2919446 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f420, size: 0x00000004, count: 0x00000001
Debug: 121 2919775 target.c:1560 target_write_u32(): address:
0xbf80f430, value: 0x0f400006
Debug: 122 2919775 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f430, size: 0x00000004, count: 0x00000001
Debug: 124 2920103 target.c:1560 target_write_u32(): address:
0xbf80f400, value: 0x00004001
Debug: 125 2920103 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f400, size: 0x00000004, count: 0x00000001
Debug: 127 2920431 target.c:1560 target_write_u32(): address:
0xbf80f410, value: 0xaa996655
Debug: 128 2920431 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f410, size: 0x00000004, count: 0x00000001
Debug: 129 2920774 target.c:1560 target_write_u32(): address:
0xbf80f410, value: 0x556699aa
Debug: 130 2920774 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f410, size: 0x00000004, count: 0x00000001
Debug: 132 2921087 target.c:1560 target_write_u32(): address:
0xbf80f408, value: 0x00008000
Debug: 133 2921087 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f408, size: 0x00000004, count: 0x00000001
Debug: 135 2921415 mips_m4k.c:853 mips_m4k_read_memory(): address:
0xbf80f400, size: 0x00000004, count: 0x00000001
Debug: 136 2921681 target.c:1483 target_read_u32(): address: 0xbf80f400,
value: 0x00006001
Debug: 137 2921681 target.c:1560 target_write_u32(): address:
0xbf80f404, value: 0x00004000
Debug: 138 2921681 mips_m4k.c:885 mips_m4k_write_memory(): address:
0xbf80f404, size: 0x00000004, count: 0x00000001
Error: 140 2922009 pic32mx.c:462 pic32mx_write_block(): Flash write
error NVMERR (status = 0x00006001)
Error: 141 2922009 pic32mx.c:549 pic32mx_write(): flash writing failed
with error code: 0xfffffc7a
Error: 142 2922009 flash.c:103 flash_driver_write(): error writing to
flash at address 0x1d000000 at offset 0x00000000 (-902)
Debug: 143 2922009 command.c:444 run_command(): Command failed with
error code -902
 
NVMERR = 0c6003 signify that the programs row selected is write
protected
Where's is the issue? 0xA0000000 for working area is a good address?
Someone has already suceeded in writing in pic32 flash?
 
on the other hand, the dump_image function seems working but it's very
low : 50 sec for 1024 bytes ! Is it normal? My Jtag speed is 6 MHz.
 
If someone has a suggestion ....
 
Thomas
 
 
 
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to