Gissio / radpro

Custom firmware for Geiger counters/radiation meters (FS2011, Bosean FS-600, FS-1000, FS-5000, FNIRSI GC-01)
MIT License
191 stars 23 forks source link

radpro-flashtool: Flashing error with FS2011 (GD32F150C8) #66

Open Dsl71 opened 7 months ago

Dsl71 commented 7 months ago

cmd shell was still open:

grafik

`c:\temp\ft>flash-fs2011-gd32f150c8.bat Backing up old firmware image... xPack Open On-Chip Debugger 0.12.0+dev-01557-gdd1758272-dirty (2024-04-02-07:27) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html 0 Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '. Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD Info : clock speed 1000 kHz Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748 Info : Target voltage: 3.221466 Info : [stm32f0x.cpu] Cortex-M3 r2p1 processor detected Info : [stm32f0x.cpu] target has 6 breakpoints, 4 watchpoints Info : [stm32f0x.cpu] Examination succeed Info : starting gdb server for stm32f0x.cpu on 3333 Info : Listening on port 3333 for gdb connections Info : Unable to match requested speed 1000 kHz, using 950 kHz Info : Unable to match requested speed 1000 kHz, using 950 kHz [stm32f0x.cpu] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc

Flashing new firmware image... xPack Open On-Chip Debugger 0.12.0+dev-01557-gdd1758272-dirty (2024-04-02-07:27) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html 0 Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '. Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD Info : clock speed 1000 kHz Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748 Info : Target voltage: 3.221466 Info : [stm32f0x.cpu] Cortex-M3 r2p1 processor detected Info : [stm32f0x.cpu] target has 6 breakpoints, 4 watchpoints Info : [stm32f0x.cpu] Examination succeed Info : starting gdb server for stm32f0x.cpu on 3333 Info : Listening on port 3333 for gdb connections Info : Unable to match requested speed 1000 kHz, using 950 kHz Info : Unable to match requested speed 1000 kHz, using 950 kHz [stm32f0x.cpu] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc Info : device id = 0x13030410 Info : flash size = 64 KiB Info : Unable to match requested speed 1000 kHz, using 950 kHz Info : Unable to match requested speed 1000 kHz, using 950 kHz [stm32f0x.cpu] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc Info : Unable to match requested speed 8000 kHz, using 4000 kHz Info : Unable to match requested speed 8000 kHz, using 4000 kHz Programming Started Error: Error setting register xpsr Error: failed to get read pointer Error: timed out while waiting for target halted [stm32f0x.cpu] halted due to debug-request, current mode: Handler HardFault xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffd8 Error: error waiting for target flash write algorithm Error: error writing to flash at address 0x08000000 at offset 0x00000000 embedded:startup.tcl:1689: Error: Programming Failed in procedure 'program' in procedure 'program_error' called at file "embedded:startup.tcl", line 1754 at file "embedded:startup.tcl", line 1689 Done. Drücken Sie eine beliebige Taste . . . `

Gissio commented 7 months ago

Let me understand. Are you reporting two issues? The flashing problem, and the instantaneous view bar disappearing after you return from the menu?

Does the second issue appear if you flash with stlink.exe? Could you post a brief video?

Dsl71 commented 7 months ago

Ah i found with short press power you can change the bar and show other info... so no bug.

I changed topic and deleted post regarding bar

Gissio commented 7 months ago

I'm glad. Thanks for the feedback!

Gissio commented 7 months ago

Could you edit flash-fs2011-gd32f150c8.bat and change the content to:

@echo off
flashtool.bat "radpro-fs2011-gd32f150c8" "-c ""set CPUTAPID 0"" -f target/stm32f1x.cfg -c ""init; reset halt; dump_image BACKUP_PATH 0x08000000 0x10000; exit;""" "-c ""set CPUTAPID 0"" -f target/stm32f1x.cfg -c ""init; reset halt; stm32f1x mass_erase 0; program IMAGE_PATH 0x08000000; reset run; exit;""" %1

?

Dsl71 commented 7 months ago

c:\temp\ft>flash-fs2011-gd32f150c8.bat Backing up old firmware image... xPack Open On-Chip Debugger 0.12.0+dev-01557-gdd1758272-dirty (2024-04-02-07:27) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html 0 Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '. Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD Info : clock speed 1000 kHz Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748 Info : Target voltage: 3.223576 Info : [stm32f1x.cpu] Cortex-M3 r2p1 processor detected Info : [stm32f1x.cpu] target has 6 breakpoints, 4 watchpoints Info : [stm32f1x.cpu] Examination succeed Info : starting gdb server for stm32f1x.cpu on 3333 Info : Listening on port 3333 for gdb connections [stm32f1x.cpu] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x080005d0 msp: 0x20002000 Flashing new firmware image... xPack Open On-Chip Debugger 0.12.0+dev-01557-gdd1758272-dirty (2024-04-02-07:27) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html 0 Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '. Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD Info : clock speed 1000 kHz Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748 Info : Target voltage: 3.222004 Info : [stm32f1x.cpu] Cortex-M3 r2p1 processor detected Info : [stm32f1x.cpu] target has 6 breakpoints, 4 watchpoints Info : [stm32f1x.cpu] Examination succeed Info : starting gdb server for stm32f1x.cpu on 3333 Info : Listening on port 3333 for gdb connections [stm32f1x.cpu] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x080005d0 msp: 0x20002000 Info : device id = 0x13030410 Info : flash size = 64 KiB [stm32f1x.cpu] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc Programming Started Error: timed out while waiting for target halted [stm32f1x.cpu] halted due to debug-request, current mode: Handler HardFault xPSR: 0x61000003 pc: 0x08000620 msp: 0x20001fe0 Error: error waiting for target flash write algorithm Error: error writing to flash at address 0x08000000 at offset 0x00000000 embedded:startup.tcl:1689: Error: Programming Failed in procedure 'program' in procedure 'program_error' called at file "embedded:startup.tcl", line 1754 at file "embedded:startup.tcl", line 1689 Done. Drücken Sie eine beliebige Taste . . .

nope

Gissio commented 7 months ago

Ok. Can you change the content of flash-fs2011-gd32f150c8.bat:

@echo off
flashtool.bat "radpro-fs2011-gd32f150c8" "-c ""set CPUTAPID 0"" -f target/stm32f0x.cfg -c ""init; reset halt; dump_image BACKUP_PATH 0x08000000 0x10000; exit;""" "-d3 -c ""set CPUTAPID 0"" -f target/stm32f0x.cfg -c ""init; reset halt; stm32f0x mass_erase 0; program IMAGE_PATH 0x08000000; reset run; exit;""" %1

This will fix the problem, but will produce a lot of debugging output. Could you post it in a .txt file?

Dsl71 commented 7 months ago

log.txt

Bitte

Gissio commented 7 months ago

~It seems there was an SWD parity error (STLINK_SWD_AP_STICKY_ERROR), which should occur when there is a data transmission error. Could you try again?~

No, it's something else! I'll let you know.

Dsl71 commented 7 months ago

ok, with the standard st-link tool it works like a charm