Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JLink debug #1102

Closed
medovarsky opened this issue Oct 2, 2017 · 5 comments
Closed

JLink debug #1102

medovarsky opened this issue Oct 2, 2017 · 5 comments
Milestone

Comments

@medovarsky
Copy link

Hi,

After some time not using JLink, I am unable to run JLink as debugger anymore, using debug_tool = custom as documented according to platformio.ini instructions on the documentation page.

On the contrary, I am currently able to debug and upload to STM32L073Z-EVAL board using JLink with extra_script.py as described in issue #1029, using PlatformIO version 3.5.0a13 and VSCode.

My vote for adding JLink as a standard driver.

@ivankravets
Copy link
Member

After some time not using JLink, I am unable to run JLink as debugger anymore

Do you see any errors? Could you provide your platformio.ini?

@medovarsky
Copy link
Author

platformio.ini:
`
[platformio]
env_default = eval_l073z

[env:settings]
platform = ststm32
framework = stm32cube
build_unflags = -Os
build_flags =
-Og
-DUSE_FULL_LL_DRIVER
-DHAL_MODULE_ENABLED
-DHAL_ADC_MODULE_ENABLED
-DHAL_COMP_MODULE_ENABLED
-DHAL_DAC_MODULE_ENABLED
-DHAL_DMA_MODULE_ENABLED
-DHAL_FLASH_MODULE_ENABLED
-DHAL_GPIO_MODULE_ENABLED
-DHAL_IWDG_MODULE_ENABLED
-DHAL_LPTIM_MODULE_ENABLED
-DHAL_PWR_MODULE_ENABLED
-DHAL_RCC_MODULE_ENABLED
-DHAL_RTC_MODULE_ENABLED
-DHAL_TIM_MODULE_ENABLED
-DHAL_UART_MODULE_ENABLED
-DHAL_WWDG_MODULE_ENABLED
-DHAL_CORTEX_MODULE_ENABLED

[env:debug]
build_flags = ${env:settings.build_flags} -DDEBUG

[env:eval_l073z]
platform = ${env:settings.platform}
framework = ${env:settings.framework}
board = eval_l073z
build_flags = ${env:debug.build_flags} -DBOARD_EVAL_L073Z -DSTM32L0XX -DF_CPU=32000000
extra_scripts = extra_script.py
debug_tool = custom
debug_server =
/usr/bin/JLinkGDBServer
-singlerun
-if
SWD
-select
USB
-port
2331
-device
STM32L073VZ
`

@medovarsky
Copy link
Author

medovarsky commented Oct 3, 2017

Debug console output (slightly redacted):

`[Mon Oct 2 17:09:25 2017] Processing eval_l073z (extra_scripts: extra_script.py; build_flags: -Og, -DUSE_FULL_LL_DRIVER, -DHAL_MODULE_ENABLED, -DHAL_ADC_MODULE_ENABLED, -DHAL_COMP_MODULE_ENABLED, -DHAL_DAC_MODULE_ENABLED, -DHAL_DMA_MODULE_ENABLED, -DHAL_FLASH_MODULE_ENABLED, -DHAL_GPIO_MODULE_ENABLED, -DHAL_IWDG_MODULE_ENABLED, -DHAL_LPTIM_MODULE_ENABLED, -DHAL_PWR_MODULE_ENABLED, -DHAL_RCC_MODULE_ENABLED, -DHAL_RTC_MODULE_ENABLED, -DHAL_TIM_MODULE_ENABLED, -DHAL_UART_MODULE_ENABLED, -DHAL_WWDG_MODULE_ENABLED, -DHAL_CORTEX_MODULE_ENABLED -DDEBUG -DBOARD_EVAL_L073Z -DSTM32L0XX -DF_CPU=32000000 -DRADIO_RN2483A -DRTC_LSE; debug_tool: custom; platform: ststm32; board: eval_l073z; framework: stm32cube; debug_server: /usr/bin/JLinkGDBServer, -singlerun, -if, SWD, -select, USB, -port, 2331, -device, STM32L073VZ)

Verbose mode can be enabled via -v, --verbose option
Collected 1 compatible libraries
Looking for dependencies...
Library Dependency Graph
|-- <BSP-STM32L0xx_Nucleo>
Compiling .pioenvs/eval_l073z/src/eval_l073z.o
Compiling .pioenvs/eval_l073z/src/main.o
[redacted]
Compiling .pioenvs/eval_l073z/src/stm32l0xx_it.o
Compiling .pioenvs/eval_l073z/FrameworkHALDriver/Src/stm32l0xx_hal.o
[shortened]
Compiling .pioenvs/eval_l073z/FrameworkCMSISDevice/gcc/startup_stm32l073xx.o
Compiling .pioenvs/eval_l073z/FrameworkCMSISDevice/system_stm32l0xx.o
Compiling .pioenvs/eval_l073z/lib/BSP-STM32L0xx_Nucleo/stm32l0xx_nucleo.o
Archiving .pioenvs/eval_l073z/libFrameworkHALDriver.a
Indexing .pioenvs/eval_l073z/libFrameworkHALDriver.a
Archiving .pioenvs/eval_l073z/lib/libBSP-STM32L0xx_Nucleo.a
Indexing .pioenvs/eval_l073z/lib/libBSP-STM32L0xx_Nucleo.a
Archiving .pioenvs/eval_l073z/libFrameworkCMSISDevice.a
Indexing .pioenvs/eval_l073z/libFrameworkCMSISDevice.a
Linking .pioenvs/eval_l073z/firmware.elf
Building .pioenvs/eval_l073z/firmware.bin
Calculating size .pioenvs/eval_l073z/firmware.elf
text data bss dec hex filename
11084 1196 1952 14232 3798 .pioenvs/eval_l073z/firmware.elf
========================= [SUCCESS] Took 9.13 seconds =========================

================================== [SUMMARY] ==================================
Environment settings [SKIP]
Environment git [SKIP]
Environment debug [SKIP]
Environment eval_l073z [SUCCESS]
Environment nucleo_l053r8 [SKIP]
Environment isdd-proto [SKIP]
========================= [SUCCESS] Took 9.14 seconds =========================

SEGGER J-Link GDB Server V6.12e Command Line Version

source .pioinit
JLinkARM.dll V6.12e (DLL compiled Jan 6 2017 17:21:51)

-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: yes
Generate logfile: off
Verify download: off
Init regs on start: off
Silent mode: off
Single run mode: on
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: STM32L073VZ
Target interface: SWD
Target interface speed: 1000kHz
Target endian: little

Connecting to J-Link...
Running executable
J-Link is connected.
Firmware: J-Link V9 compiled Sep 1 2017 18:12:20
Hardware: V9.40
S/N: 269402129
OEM: SEGGER-EDU
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 3.63 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
0x08001120 in HAL_InitTick (TickPriority=<error reading variable: Cannot access memory at address 0x20005004>) at /home/lubos/.platformio/packages/framework-stm32cube/l0/Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal.c:270
270 }
Not implemented stop reason (assuming exception): undefined
Reading all registers
Temporary breakpoint 1 at 0x8000ee4: file src/main.c, line 49.
Loading section .isr_vector, size 0xc0 lma 0x8000000
Loading section .text, size 0x2a10 lma 0x80000c0
Loading section .rodata, size 0x74 lma 0x8002ad0
Loading section .ARM, size 0x8 lma 0x8002b44
Loading section .init_array, size 0x8 lma 0x8002b4c
Loading section .fini_array, size 0x4 lma 0x8002b54
Loading section .data, size 0x4a0 lma 0x8002b58
Start address 0x8002a08, load size 12280
Writing register (PC = 0x082a0008)
Transfer rate: 11992 KB/sec, 1754 bytes/write.
Resetting target
Halting target CPU...
...Target halted (PC = 0x08002A08)
Resetting target
Starting target CPU...
Reading all registers
[Switching to Thread 57005]
Performing single step...
...Target halted (DBGRQ, PC = 0x0800186C)
Reading all registers
Performing single step...
...Target halted (DBGRQ, PC = 0x0800186E)
Reading all registers
Performing single step...
...Target halted (DBGRQ, PC = 0x08001870)
Reading all registers
Performing single step...
...Target halted (DBGRQ, PC = 0x08001872)
Reading all registers
Performing single step...
...Target halted (DBGRQ, PC = 0x08001874)
Reading all registers
Performing single step...
...Target halted (DBGRQ, PC = 0x08001876)
Reading all registers
Performing single step...
...Target halted (DBGRQ, PC = 0x08001878)
Reading all registers
Performing single step...
Reading all registers
Performing single step...
Reading all registers
Starting target CPU...
Debugger requested to halt target...
...Target halted (PC = 0x08002A58)
Reading all registers
`

@ivankravets
Copy link
Member

Could we close this issue?

@medovarsky
Copy link
Author

Yes, please close. Still, JLink does not work.

@ivankravets ivankravets added this to the 3.5.0 milestone Nov 3, 2017
ivankravets added a commit that referenced this issue Dec 28, 2017
… issue #1236, issue #1235, issue #953, issue #1118, issue #1107, issue #1196, issue #1179, issue #1161, issue #1126, issue #104, issue #1033, issue #1034, issue #1175, issue #1173, issue #1155, issue #1188, issue #1111, issue #1153, issue #1150, issue #1145, issue #1139, issue #1137, issue #1170, issue #1157, issue #1102, issue #1105, issue #1140, issue #1154, issue #1066, issue #1038, issue #1054, issue #1055, issue #1061, issue #1017)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants