ec2-new icon indicating copy to clipboard operation
ec2-new copied to clipboard

EC3 debugger cannot read SL51 flash

Open SmallJoker opened this issue 5 years ago • 0 comments

The adapter is connected and detected properly using ec2adapters. Reading the adapter's firmware also works, but not reading the microcontroller's flash contents.

Microcontroller: C8051F330 Adapter: USB Debug Adapter, EC3 debugger

Host OS: Ubuntu 18.04 Compiler: GCC 7.3

Code modifications: ec2drv.c: #define HAVE_USB_DETACH_KERNEL_DRIVER_NP 1

(Spoiler) Flash reading with debug output enabled
$ sudo ./ec2readflash --port=USB --mode=C2 --debug
ec2_reset C2
TX: 03 00 00 00 
RX: 01 02 
01 02 
TX: 03 01 0c 00 
RX: 01 00 
01 00 
TX: 03 06 00 00 
RX: 01 24 
01 24 
EC3 debugger firmware version = 0x24
Warning: this version is newer than the versions tested by the developers,
Please report success / failure and version via ec2drv.sf.net
Currently tested versions from 0x07 to 0x14
TX: 01 20 
RX: 01 0d 
01 0d 
TX: 01 22 
RX: 03 0a 00 0d 
03 0a 00 0d 
TX: 01 23 
RX: 03 06 60 0d 
03 06 60 0d 
TX: 04 2e 00 00 01 
RX: 02 74 0d 
02 74 0d 
TX: 04 2e ff 0f 01 
RX: 02 ff 0d 
02 ff 0d 
TX: 04 29 20 01 00 
RX: 01 0d 
01 0d 
TX: 04 29 21 01 00 
RX: 01 0d 
01 0d 
FOUND:
device	: C8051F330
mode	: C2

ERROR: couldn't read flash
TX: 01 21 
RX: 01 0d 
01 0d 
TX: 01 ff 
RX: 01 ff 
01 ff 
Exiting now
Disconnect done
(Spoiler) ec2test-any output
$ sudo ./ec2test-any --port=USB --mode=C2
Testing device / debugger connected to 'USB'
Warning: this version is newer than the versions tested by the developers,
Please report success / failure and version via ec2drv.sf.net
Currently tested versions from 0x07 to 0x14
FOUND:
device	: C8051F330
mode	: C2

Support for this device has not been fully tested or may not be complete
You can be of assistance, please visit:
http://sourceforge.net/tracker/?atid=775284&group_id=149627&func=browse
Please feel free to report your succcess / failure.
If there are any issues we can probably resolve them with your help since we don't have boards for every supported processor.
NOTE some tests may take a few minutes to run so please be patient

Test DATA RAM
-------------------------------------------------------------
	write / read 0x00 ... PASS
	write / read 0xff ... PASS
	write / read Random data, sequential addr ... PASS
	write / read 0x00 ... PASS
	write / read even addr ... PASS
	write / read odd addr ... PASS
	write / read 0x00 ... PASS
	write / read Random data, random addr ... PASS

Test XDATA RAM - onchip
-------------------------------------------------------------
	write / read 0x00 ... PASS
	write / read 0xff ... PASS
	write / read Random data, sequential addr ... PASS
	write / read 0x00 ... PASS
	write / read Random data, random addr ... PASS
flash_size = 0x2000
reserved bottom = 0x00001e00
	Top User address = 0x00001dfe

Test FLASH
-------------------------------------------------------------
	Top address = 0x2000
	Top User address = 0x1dfe
	sector size = 1024 bytes
	lock addr = 0x1dff
	read lock addr = 0xffffffff
	write lock addr = 0xffffffff

	Erase Flash ... Start erase
Warning: this version is newer than the versions tested by the developers,
Please report success / failure and version via ec2drv.sf.net
Currently tested versions from 0x07 to 0x14
Start erase2
Start erase3
Start erase4
Start erase5
Start erase6
End erase
Warning: this version is newer than the versions tested by the developers,
Please report success / failure and version via ec2drv.sf.net
Currently tested versions from 0x07 to 0x14
PASS
	Checking Erase worked ... PASS
	Write / Read all Flash, ec2_write_flash_auto_erase (random data) ... PASS
	Write block in middle, ec2_write_flash_auto_keep ... FAIL
Write buffer
85 01 75 43 18 34 98 FF 1A 4C 4F 92 8F 88 CD F0 0C D9 AF D5 D5 C1 40 DB BB 9D 9B D1 1F 02 E7 A4 03 5D E8 1B 91 80 1B AB CC 6A 3D 5B F3 0B 4B FF E4 FA D4 B9 BB 15 95 77 B2 30 48 D1 32 2F 76 36 8C 5E 51 1E DE 6C C9 <snip>
Read buffer
85 01 75 43 18 34 98 FF 1A 4C 4F 92 8F 88 CD F0 0C D9 AF D5 D5 C1 40 DB BB 9D 9B D1 1F 02 E7 A4 03 5D E8 1B 91 80 1B AB CC 6A 3D 5B F3 0B 4B FF E4 FA D4 B9 BB 15 95 77 B2 30 48 D1 32 2F 76 36 8C 5E 51 1E DE 6C C9 AA D7 07 05 CA 12 50 C9 F6 4A 9D B0 06 B2 45 7D 65 75 C5 36 A8 F4 AC DE 81 0A 2F 9F E8 9C <snip>
mismatch at 0x0200, [0xa1,0xff]
mismatch at 0x0201, [0x15,0xff]
mismatch at 0x0202, [0x86,0xff]
mismatch at 0x0203, [0xe1,0xff]
mismatch at 0x0204, [0xc8,0xff]
<any address.. snip>
mismatch at 0x0676, [0x36,0x02]
mismatch at 0x0677, [0x83,0x81]
	Erase Flash ... Start erase
Warning: this version is newer than the versions tested by the developers,
Please report success / failure and version via ec2drv.sf.net
Currently tested versions from 0x07 to 0x14
Start erase2
Start erase3
Start erase4
Start erase5
Start erase6
End erase
Warning: this version is newer than the versions tested by the developers,
Please report success / failure and version via ec2drv.sf.net
Currently tested versions from 0x07 to 0x14
PASS
dss 0
Test Program Counter Access
-------------------------------------------------------------
	PC = 0x0000 ... PASS
	PC = 0x0110 ... PASS
	PC = random ... PASS

Test Debug operations
-------------------------------------------------------------
	Load program ... PASS
	Reset Target ... PASS
	Add single breakpoint ... C2: Adding breakpoint into position 0, addr=0x00000005
PASS
	Run to BP ... FAIL
	Run to BP again ... FAIL
	Add second breakpoint ... C2: Adding breakpoint into position 1, addr=0x00000007
PASS
	Test with 2 BP's ... FAIL
	Add Third breakpoint ... C2: Adding breakpoint into position 2, addr=0x00000008
PASS
	Test with 3 BP's ... FAIL
	Add forth breakpoint ... C2: Adding breakpoint into position 3, addr=0x00000002
PASS
	Test with 4 BP's ... FAIL
	Delete 2 breakpoints BP_1 and BP_3 ... PASS
	Test with 2 BP's, BP_0 and BP_2 ... FAIL
	Remove all breakpoints ... FAIL
	Halt a running processor ... FAIL
	Stepping the target ... PASS
Test Failed

exiting now
disconnect done

SmallJoker avatar Apr 21 '19 18:04 SmallJoker