Closed henla464 closed 6 months ago
Discord pointed me to https://github.com/blackmagic-debug/blackmagic/pull/1249 and I tested: https://github.com/fk0815/blackmagic/tree/main
But still couldn't get it to work...
Sorry to hear you're having trouble. There are two things that would be helpful here to understand the problem better and suggest a way forward.
The first is that, helpful as a remote protocol trace can be, that does not supply the debug information needed in this instance - please do a build of main with ENABLE_DEBUG=1
. You might need to disable one or two targets such as efm32.c and nrf51.c to make the build fit. Once you have the build on your probe, please then run mon debug en
after attaching to the probe with tar ext /dev/ttyACM0
but before doing any of the others steps. Attach to the debug serial port with something like minicom by running minicom -D /dev/ttyACM1 -8
in another console and provide the output from minicom. This will allow us to see what's going on during each of the steps you're performing.
The second would be confirming what make line you're using to build the firmware for your probe and what source tree you're using and at what revision - this is mostly so we know where you are exactly and so can dive in deeper.
Thank you!
I did: git clone --recursive https://github.com/blackmagic-debug/blackmagic.git and followed your instructions and got this result in minicom:
scan_multidrop: false DP DPIDR 0x2ba01477 (v1 rev0) designer 0x43b partno 0xba RESET_SEQ failed AP 0: IDR=24770011 CFG=00000000 BASE=e00ff003 CSW=23000040 (AHB-AP var1 rev2) Halt via DHCSR: success 00030003 after 0ms ROM: Table BASE=0xe00ff000 SYSMEM=0x00000001, Manufacturer 43b Partno 4c3 0 0xe000e000: Generic IP component - Cortex-M3 SCS (System Control Space) (PIDR = 0x00000004000bb000 DEVTYPE = 0x00 ARCHID = 0x0000) -> cortexm_probe CPUID 0x412fc231 (M3 var 2 rev 1) DBGMCU_IDCODE 0x20036410, DEVID 0x410, REVID 0x2003 Detected clone STM32F1 1 0xe0001000: Generic IP component - Cortex-M3 DWT (Data Watchpoint and Trace) (PIDR = 0x00000004003bb002 DEVTYPE = 0x00 ARCHID = 0x0000) 2 0xe0002000: Generic IP component - Cortex-M3 FBP (Flash Patch and Breakpoint) (PIDR = 0x00000004002bb003 DEVTYPE = 0x00 ARCHID = 0x0000) 3 0xe0000000: Generic IP component - Cortex-M3 ITM (Instrumentation Trace Module) (PIDR = 0x00000004003bb001 DEVTYPE = 0x00 ARCHID = 0x0000) 4 0xe0040000: Debug component - Cortex-M3 TPIU (Trace Port Interface Unit) (PIDR = 0x00000004003bb923 DEVTYPE = 0x11 ARCHID = 0x0000) 5 Entry 0xfff42002 -> Not present ROM: Table END stm32f1 flash error 0x10 stm32f1 flash error 0x10 stm32f1 flash error 0x10 stm32f1 flash error 0x10 stm32f1 flash error 0x10
Seems like you're not alone in having STM32F1 unhappy.. #1257 seems to be related. Could you please try the patch suggested by that PR (mean00@4c9b7d70) and let us know how you get on with that?
We're going to be applying something similar in the process of cleaning up in stm32f1.c so it'll be useful to know if that makes your issue go away or if there's something further to investigate.
I have tested today just now with latest main but I get exactly the same as before, same error and the same output in minicom.
We're guessing that means the issue is unchanged by #1263 which addresses the issue we were trigging on the clones and even real devices by over-eagerly testing for errors
There have been a variety of fixes made to the STM32F1 code since this was last touched, could we ask you to check again and let us know if you still have issues on latest main?
We would note too that you must use an official Arm compiler, not one from your distribution's package manager (Ubuntu's miscompiles the code for example), and for a Bluepill you will want to use make PROBE_HOST=stlink BLUEPILL=1
.
Given you haven't responded and we've done a lot of work to fix the STM32F1 Flash code since this was opened, we are going to assume it is fixed. Please let us know if this is wrong and we will re-open the issue.
I am having problem with "load" hanging with my Bluepill; after reading https://github.com/blackmagic-debug/blackmagic/issues/1200 this I thought the latest version would solve it but it didn't.
I don't know what clone it is (it says STM32... on the chip). Maybe someone can identify it from the logs below? On v1.8.2 monitor swdp_scan identified it as a CH32F103 I believe. Now on cf2bd66 it says "STM32F1 (clone) medium density M3". Any ideas why it hangs, am I doing something wrong? Is there anything I can test or try?