[Solved ] No debugging symbols

Hi all,
First post here to share an issue I have when trying some debugging with an STM32F103C8 board using OPENOCD and an STlinkV2 dongle.
Settings
Linux Mint 19.1 (Linux x64 4.18.0-13-lowlatency), Visual studio code V1.30.1(181218) with PlatformIO 1.6.0 (Home 2.0.0, Core 3.6.3). Installed platforms are ST STM32(V4.5.0) and ATMEL AVR (V1.12.1). I also installed cortex-debug (0.1.21)

I created a project and the build_flags = -g3 are set in the platformio.ini file in order to have the debugging symbols created. The Cortex-debug gives me always timeout errors so I started to test gdb manually…

steps.

  1. Compile the file via vscode/platformIO : all goes well and firmware.elf file created in .pioenvs/genericSTM32F103C8/firmware.elf
  2. upload the code via the STlink via vscode/platformIO : all goes well in 3.75 Sec
  3. start a terminal to launch openocd via the command :
    /home/democles/.platformio/packages/tool-openocd/bin/openocd -f /home/democles/.platformio/packages/tool-openocd/scripts/interface/stlink.cfg -f /home/democles/.platformio/packages/tool-openocd/scripts/target/stm32f1x.cfg
    This goes well and openocd starts listening on 3333.
  4. open terminal to launch gdb:
    /home/democles/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gdb /home/democles/Documents/PlatformIO/Projects/Brokkingdrone/.pioenvs/genericSTM32F103C8/firmware.elf
    the debugger starts and gives this as output:
    GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git
    Copyright © 2017 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later link
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type “show copying”
    and “show warranty” for details.
    This GDB was configured as “–host=x86_64-linux-gnu --target=arm-none-eabi”.
    Type “show configuration” for configuration details.
    For bug reporting instructions, please see: link
    Find the GDB manual and other documentation resources online at: link
    For help, type “help”.
    Type “apropos word” to search for commands related to “word”…
    Reading symbols from /home/democles/Documents/PlatformIO/Projects/Brokkingdrone/.pioenvs/genericSTM32F103C8/firmware.elf…(no debugging symbols found)…done.
    (gdb)

What am I doing wrong? Any help much appreciated!

Try -g3 -ggdb please.

Thanks for the quick reply… I’ll try this this weekend… no access to my computers for the moment (holidays)… will provide feedback.

OK, I started with a clean of the project and did the compiling using the various flags… I must have been using the wrong file during compiling the other day because now I have debugging symbols when using -g3 or -ggdb as build_flags.
So this seems to be solved. Now I have to get native debugging or cortex-debug working as both don’t whereas the “manual” method using 2 xterms with the openocd and the gdb does the job…