You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently trying to develop a small application for FZ. It utilizes some C++ Code and I would like to debug it. Sadly, it does not work. FreeRTOS and hardware close development is relatively new for me. I'm able to add C breakpoints. Yes, I could definitely write it in C but where is the fun in that?
Any help or hint would be appreciated.
Setup:
JLink Mini EDU
VS-Code
fbt (application in applications_user/; not using ufbt)
build it and try to attach a debugger to the application
Target
f7 with VS-Code and C++
Logs
VS-Code Debug Console
Cortex-Debug: VSCode debugger extension version 1.12.1 git(652d042). Usage info: https://github.com/Marus/cortex-debug#usage
Reading symbols from /Users/user/Projects/flipper/flipperzero-firmware/toolchain/current/bin/arm-none-eabi-objdump --syms -C -h -w /Users/user/Projects/flipper/flipperzero-firmware/build/latest/firmware.elf
Reading symbols from /Users/user/Projects/flipper/flipperzero-firmware/toolchain/current/bin/arm-none-eabi-nm --defined-only -S -l -C -p /Users/user/Projects/flipper/flipperzero-firmware/build/latest/firmware.elf
Launching GDB: /Users/user/Projects/flipper/flipperzero-firmware/toolchain/current/bin/arm-none-eabi-gdb-py3 -q --interpreter=mi2
IMPORTANT: Set "showDevDebugOutput": "raw" in "launch.json" to see verbose GDB transactions here. Very helpful to debug issues or report problems
Launching gdb-server: JLinkGDBServer -singlerun -nogui -if swd -port 50000 -swoport 50001 -telnetport 50002 -device STM32WB55RG -rtos GDBServer/RTOSPlugin_FreeRTOS.dylib
Please check TERMINAL tab (gdb-server) for output from JLinkGDBServer
Finished reading symbols from objdump: Time: 42 ms
Output radix now set to decimal 10, hex a, octal 12.
Input radix now set to decimal 10, hex a, octal 12.
Finished reading symbols from nm: Time: 767 ms
vPortSuppressTicksAndSleep (expected_idle_ticks=30) at targets/f7/furi_hal/furi_hal_os.c:172
172 return;
Program stopped, probably due to a reset and/or halt issued by debugger
Firmware version on attached Flipper:
Version: 0.104.0
Built on: 24-07-2024
Git branch: release
Git commit: ee1b8b9f
Dirty: False
HW Target: 7
Origin: Official
Git origin: [email protected]:user/flipperzero-firmware.git,https://github.com/flipperdevices/flipperzero-firmware.git
Support for Flipper external apps debug is loaded
Set 'build/latest/.extapps' as debug info lookup path for Flipper external apps
Attaching to Flipper firmware
[New Remote target]
[New Thread 536882256]
[New Thread 537080456]
[New Thread 537081676]
[New Thread 536882912]
[New Thread 537106944]
[New Thread 537072504]
[New Thread 537085728]
[New Thread 537083920]
[New Thread 537085336]
[New Thread 536950776]
[New Thread 536886176]
[New Thread 537073724]
[New Thread 536910936]
[New Thread 536909416]
[New Thread 536884472]
[New Thread 537085532]
[New Thread 537074944]
[New Thread 536890328]
[New Thread 537084116]
[New Thread 537079236]
Thread
3 received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 536882256]
vPortSuppressTicksAndSleep (expected_idle_ticks=86) at targets/f7/furi_hal/furi_hal_os.c:172
172 return;
Thread
3 received signal SIGTRAP, Trace/breakpoint trap.
vPortSuppressTicksAndSleep (expected_idle_ticks=60) at targets/f7/furi_hal/furi_hal_os.c:172
172 return;
[New Thread 536919432]
Thread
11 received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 537085336]
loader_start_external_app (error_message=0x2000c250, args=0x0, path=<optimized out>, storage=<optimized out>, loader=0x200066e0) at applications/services/loader/loader.c:530
530 __asm volatile("bkpt 0");
New application loaded. Adding debug info
Loading debug information from build/latest/.extapps/dolphin_jump_d.elf
add symbol table from file "build/latest/.extapps/dolphin_jump_d.elf" at
.text_addr = 0x2000c75c
.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7_S_copyEPcPKcj_addr = 0x2000c8f4
.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEjjPKcj_addr = 0x2000d0cc
.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3__addr = 0x2000ce1c
.text._ZNSt15__new_allocatorIcE10deallocateEPcj_addr = 0x2000ab0c
.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv_addr = 0x2000ca1c
.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEjjPKcj_addr = 0x2000d25c
.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_mutateEjjPKcj_addr = 0x2000cf04
.bss_addr = 0x2000c474
.rodata_addr = 0x2000d2ac
.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7_S_moveEPcPKcj_addr = 0x2000cae4
.text._ZNSt15__new_allocatorIcE8allocateEjPKv_addr = 0x2000cb44
.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERjj_addr = 0x2000cc34
.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag_addr = 0x2000cc84
warning: section .text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEjjPKcj not found in /Users/user/Projects/flipper/flipperzero-firmware/build/f7-firmware-C/.extapps/dolphin_jump_d.elf
warning: section .text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_ not found in /Users/user/Projects/flipper/flipperzero-firmware/build/f7-firmware-C/.extapps/dolphin_jump_d.elf
warning: section .text._ZNSt15__new_allocatorIcE10deallocateEPcj not found in /Users/user/Projects/flipper/flipperzero-firmware/build/f7-firmware-C/.extapps/dolphin_jump_d.elf
warning: section .text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEjjPKcj not found in /Users/user/Projects/flipper/flipperzero-firmware/build/f7-firmware-C/.extapps/dolphin_jump_d.elf
warning: section .text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_mutateEjjPKcj not found in /Users/user/Projects/flipper/flipperzero-firmware/build/f7-firmware-C/.extapps/dolphin_jump_d.elf
warning: section .text._ZNSt15__new_allocatorIcE8allocateEjPKv not found in /Users/user/Projects/flipper/flipperzero-firmware/build/f7-firmware-C/.extapps/dolphin_jump_d.elf
warning: section .text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERjj not found in /Users/user/Projects/flipper/flipperzero-firmware/build/f7-firmware-C/.extapps/dolphin_jump_d.elf
warning: section .text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag not found in /Users/user/Projects/flipper/flipperzero-firmware/build/f7-firmware-C/.extapps/dolphin_jump_d.elf
Failed to set debug mode: Cannot access memory at address 0x200009cc
@hedger I've just testet it with the WiFi Dev Board and backmagic. The same issue is present. My best guess is, that the optimization is messing with something and breaking some debugging stuff.
I think a lot of issued might be caused by the -Os flag.
I also encountered different results when using ufbt and fbt. The issue was that ufbt applies the -Os optimization flag. My quick solution at the time was to use the following directive:
Describe the bug.
I'm currently trying to develop a small application for FZ. It utilizes some C++ Code and I would like to debug it. Sadly, it does not work. FreeRTOS and hardware close development is relatively new for me. I'm able to add C breakpoints. Yes, I could definitely write it in C but where is the fun in that?
Any help or hint would be appreciated.
Setup:
applications_user/
; not using ufbt)Reproduction
Target
f7 with VS-Code and C++
Logs
VS-Code Debug Console
Full Build log
The text was updated successfully, but these errors were encountered: