I am debugging with j-link.
When ethering, I sometimes stop at breakpoints and sometimes get an error.
I am using vs code and monitoring using uart at the same time.
It will show you a terminal message when uploading.
RAM: [ ] 2.5% (used 1668 bytes from 65536 bytes)
Flash: [= ] 5.4% (used 28268 bytes from 524288 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, dfu, jlink, serial, stlink
CURRENT: upload_protocol = jlink
Uploading .pio\build\genericSTM32F103VE\firmware.bin
SEGGER J-Link Commander V7.20 (Compiled Apr 28 2021 17:35:36)
DLL version V7.20, compiled Apr 28 2021 17:34:08
J-Link Command File read successfully.
Processing script file...
J-Link connection not established yet but required for command.
Connecting to J-Link via USB...O.K.
Firmware: J-Link V10 compiled Jun 17 2021 16:40:36
Hardware version: V10.10
S/N: 260118458
License(s): FlashBP, GDB
OEM: SEGGER-EDU
VTref=3.309V
Target connection not established yet but required for command.
Device "STM32F103VE" selected.
Connecting to target via SWD
InitTarget() start
InitTarget() end
Found SW-DP with ID 0x37401477
DAP error while determining CoreSight SoC version
InitTarget() start
InitTarget() end
Found SW-DP with ID 0x1BA01477
DPIDR: 0x1BA01477
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x14770011)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x411FC231. Implementer code: 0x41 (ARM)
Found Cortex-M3 r1p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
Cortex-M3 identified.
CPU could not be halted
Downloading file [.pio\build\genericSTM32F103VE\firmware.bin]...
CPU could not be halted
****** Error: Failed to download RAMCode.
Failed to prepare for programming.
Failed to download RAMCode!
Cannot read register 16 (XPSR) while CPU is running
Cannot read register 20 (CFBP) while CPU is running
Cannot read register 0 (R0) while CPU is running
Cannot read register 1 (R1) while CPU is running
Cannot read register 2 (R2) while CPU is running
Cannot read register 3 (R3) while CPU is running
Cannot read register 4 (R4) while CPU is running
Cannot read register 5 (R5) while CPU is running
Cannot read register 6 (R6) while CPU is running
Cannot read register 7 (R7) while CPU is running
Cannot read register 8 (R8) while CPU is running
Cannot read register 9 (R9) while CPU is running
Cannot read register 10 (R10) while CPU is running
Cannot read register 11 (R11) while CPU is running
Cannot read register 12 (R12) while CPU is running
Cannot read register 14 (R14) while CPU is running
Cannot read register 15 (R15) while CPU is running
Cannot read register 17 (MSP) while CPU is running
Cannot read register 18 (PSP) wh
Unspecified error -1
Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
T-bit of XPSR is 0 but should be 1. Changed to 1.
Script processing completed.
****** Error: Could not start CPU core. (ErrorCode: -1)
I am using stm32f103vet6.
I am connecting the spi using the arduino sd library.
Let me know if there’s anything I need to do
Thank you.