C:\msys64\home\bvern\openocd_cx32l003_algo_buspirate_windows\build\bin\test_perf.txt
Requires reset;halt to re-program the Flash after flashing E220-900T22SD_7259-11-23.bin or other
This version use MCU embedded algorithm for erase/program (do not use target_write_u32()/target_read_u32())

Tests 02 Aug 2023 20h

> program E220-900T22SD_7259-11-23.bin verify
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x000005a4 msp: 0x20000fe8
** Programming Started **
cx32l003_mass_erase
cx32l003_mass_erase retval=0 elapsed_ms=345
cx32l003 mass erase complete
cx32l003_write buffer=000002c85ce892b0 offset=0x00000000 count=65536
cx32l003_write retval=0 elapsed_ms=2008
** Programming Finished **
** Verify Started **
** Verified OK **

# Stop openocd / Power Off-On target / Start openocd

> program E220-900T22SD_7259-11-23.bin verify
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x00001c50 msp: 0x20000bb0
** Programming Started **
cx32l003_mass_erase
cx32l003_mass_erase retval=0 elapsed_ms=345
cx32l003 mass erase complete
cx32l003_write buffer=000001beca978ce0 offset=0x00000000 count=65536
cx32l003: Flash operation failed, status=0xff000000
cx32l003_write retval=-4 elapsed_ms=879
error writing to flash at address 0x00000000 at offset 0x00000000
embedded:startup.tcl:1524: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1589
at file "embedded:startup.tcl", line 1524

> init;reset;halt
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x41000000 pc: 0x20000478 msp: 0x20000800

> program uart_print.elf verify
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x41000000 pc: 0x20000478 msp: 0x20000800
** Programming Started **
Adding extra erase range, 0x00002f64 .. 0x00002fff
cx32l003_erase first=0 last=23
cx32l003_erase retval=0 elapsed_ms=84
cx32l003_write buffer=000001beca98cc70 offset=0x00000000 count=12132
cx32l003_write retval=0 elapsed_ms=391
** Programming Finished **
** Verify Started **
** Verified OK **

> init;reset;halt
Disabling watchdog...
[cx32l003.cpu] clearing lockup after double fault
[cx32l003.cpu] halted due to debug-request, current mode: Handler HardFault
xPSR: 0x21000003 pc: 0xfffffffe msp: 0x20000b70
Polling target cx32l003.cpu failed, trying to reexamine
[cx32l003.cpu] Cortex-M0+ r0p1 processor detected
[cx32l003.cpu] target has 4 breakpoints, 2 watchpoints
Disabling watchdog..

> program uart_print.elf verify
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Handler HardFault
xPSR: 0x21000003 pc: 0xfffffffe msp: 0x20000b70
** Programming Started **
Adding extra erase range, 0x00002f64 .. 0x00002fff
cx32l003_erase first=0 last=23
SWD DPIDR 0x0bc11477
Failed to read memory and, additionally, failed to find out where
cx32l003_flash_erase_sector: target_read_u32() fail
SWD DPIDR 0x0bc11477
failed erasing sectors 0 to 23
embedded:startup.tcl:1524: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1589
at file "embedded:startup.tcl", line 1524

> reset;halt
Disabling watchdog...
[cx32l003.cpu] clearing lockup after double fault
[cx32l003.cpu] halted due to debug-request, current mode: Handler HardFault
xPSR: 0x21000003 pc: 0xfffffffe msp: 0x20000b70
Polling target cx32l003.cpu failed, trying to reexamine
[cx32l003.cpu] Cortex-M0+ r0p1 processor detected
[cx32l003.cpu] target has 4 breakpoints, 2 watchpoints
Disabling watchdog...

# Stop openocd / Power Off-On target / Start openocd

Connected to 127.0.0.1.
Escape character is '^]'.
Open On-Chip Debugger
> program uart_print.elf verify
Disabling watchdog...
timed out while waiting for target halted
embedded:startup.tcl:1524: Error: ** Unable to reset target **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1561
at file "embedded:startup.tcl", line 1524
Halt timed out, wake up GDB.

> reset;halt
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x000005a8 msp: 0x20000fe8

> program uart_print.elf verify
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x000005a8 msp: 0x20000fe8
** Programming Started **
Adding extra erase range, 0x00002f64 .. 0x00002fff
cx32l003_erase first=0 last=23
cx32l003_erase retval=0 elapsed_ms=84
cx32l003_write buffer=0000023698c0cd50 offset=0x00000000 count=12132
cx32l003_write retval=0 elapsed_ms=393
** Programming Finished **
** Verify Started **
** Verified OK **

# Stop openocd / Power Off-On target / Start openocd

> reset;halt
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x000005a8 msp: 0x20000fe8

> program E220-900T22SD_7259-11-23.axf verify
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x000005a8 msp: 0x20000fe8
** Programming Started **
Flash write discontinued at 0x00006000, next section at 0x0000fa00
cx32l003_erase first=0 last=47
cx32l003_erase retval=0 elapsed_ms=144
cx32l003_write buffer=000001c0aeb4a300 offset=0x00000000 count=24576
cx32l003_write retval=0 elapsed_ms=764
cx32l003_erase first=125 last=127
cx32l003_erase retval=0 elapsed_ms=35
cx32l003_write buffer=000001c0aeb4a300 offset=0x0000FA00 count=1536
cx32l003_write retval=0 elapsed_ms=76
** Programming Finished **
** Verify Started **
** Verified OK **

# Power Off-On target check the app work with "E220  V1.1.exe" (UART)
Model: E220-900T22S/D
Version: 7259-11-2
FrequencyStr: 873.125MHz
Parameter:  0xc0 0x00 0x08 0x00 0x00 0x62 0x00 0x17 0x03 0x00 0x00

# Power Off-On target / Start openocd
> reset;halt
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x00001c50 msp: 0x20000bb0

> program uart_print.elf verify reset
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x00001c50 msp: 0x20000bb0
** Programming Started **
Adding extra erase range, 0x00002f64 .. 0x00002fff
cx32l003_erase first=0 last=23
cx32l003_erase retval=0 elapsed_ms=85
cx32l003_write buffer=000001dbf9f4a300 offset=0x00000000 count=12132
cx32l003_write retval=0 elapsed_ms=401
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
Disabling watchdog...
[cx32l003.cpu] halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x20000bb0

# Power Off-On target check the app with UART 96008N1 return each second "Printf loop using UART1, PA2-TXD, PA1-RXD"

# HydraBus console uart1 / bridge
> uart
Device: UART1
Speed: 9600 bps
Parity: none
Stop bits: 1
uart1> bridge
Interrupt by pressing user button.

PPrintf loop using UART1, PA2-TXD, PA1-RXD
Printf loop using UART1, PA2-TXD, PA1-RXD
Printf loop using UART1, PA2-TXD, PA1-RXD
Printf loop using UART1, PA2-TXD, PA1-RXD
Printf loop using UART1, PA2-TXD, PA1-RXD
Printf loop using UART1, PA2-TXD, PA1-RXD
Printf loop using UART1, PA2-TXD, PA1-RXD
Printf loop using UART1, PA2-TXD, PA1-RXD
Printf loop using UART1, PA2-TXD, PA1-RXD
Printf loop using UART1, PA2-TXD, PA1-RXD
Printf loop using UART1, PA2-TXD, PA1-RXD
Printf loop using UART1, PA2-TXD, PA1-RXD

# Power Off-On target / Start openocd
C:\Users\bvern>telnet 127.0.0.1 4444
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Open On-Chip Debugger
> reset;halt
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x00000554 msp: 0x20000fe8

> program E220-900T22SD_7259-11-23.bin verify
Disabling watchdog...
[cx32l003.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x00000554 msp: 0x20000fe8
** Programming Started **
cx32l003_mass_erase
cx32l003_mass_erase retval=0 elapsed_ms=345
cx32l003 mass erase complete
cx32l003_write buffer=000001c1bf058d10 offset=0x00000000 count=65536
cx32l003_write retval=0 elapsed_ms=1999
** Programming Finished **
** Verify Started **
** Verified OK **

# Power Off-On target check the app work with "E220  V1.1.exe" (UART)
Model: E220-900T22S/D
Version: 7259-11-2
FrequencyStr: 873.125MHz
Parameter:  0xc0 0x00 0x08 0x00 0x00 0x62 0x00 0x17 0x03 0x00 0x00

> dump_image test_dump_E220-900T22SD_7259-11-23.bin 0 65536
dumped 65536 bytes in 0.840885s (76.110 KiB/s)
