Some questions - Recompiling, mbed and teensyduino libraries

Hi there, I am relatively new user to PIO and have come across a few things that I would like some help with if possible, thank you for your patience and time!

  • Recompilation:
    Occasionly PIO will recompile the core framework libraries (mbed or teensyduino), this happens even though I have only edited a few lines of code within main.cpp. I’ve read that this can happen when the platformio.ini is edited, but I haven’t touched this file.

Furthermore, this also happens when attempting to build/run the debugger. I assume there are two different build configurations between debug build and standard build, and this causes PIO to rebuild the entire library.

  • Library Compilation
    Why does PIO compile the entire mbed library/framework even though I only include specific parts of it?

  • Debugger
    I am having trouble using the debugger, I get the following error message:

    Info : Target voltage: 3.239843

    Info : stm32l4x.cpu: hardware has 6 breakpoints, 4 watchpoints

    Info : accepting ‘gdb’ connection from pipe

    Info : device id = 0x10036470

    Warn : Cannot identify target as a STM32L4 family.

    Error: auto_probe failed

    Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use ‘gdb_memory_map disable’.

    Error: attempted ‘gdb’ connection rejected

    Ignoring packet error, continuing…

    warning: unrecognized item “timeout” in “qSupported” response

I am using macosx, so I assume I don’t need an STLink driver.
Do I need a seperate debug environment configuration in platformio.ini for the debugger to work?

Thanks for your time.

What board is this? STM32L4R9I-DISCO?

STM32 L4R5ZI (Nucleo)

Openocd reads out the device ID, takes the last 3 hex digits from it and figures out the maximum flash size from that. The code for 0x470 was added to openocd 3 months ago (see source and this commit, in stm32l4_probe()). So, PIOs openocd version must be updated for this board to work. CC @ivankravets

You can try to manually upgrade your version now by replacing the openocd binaries and scripts inside your tool-openocd folder (in /home/<user>/.platformio/packages/tool-openocd). But first make sure to use pio platform update (or the update GUI in your VSCode IDE) to make sure you have the latest version.

For MacOS/Windows/Linux the download link is Releases · ilg-archived/openocd · GitHub.

1 Like

Did as stated by maxgerhardt and the debugger is now working as expected. Thanks for that.

I’ve just updated openOCD to the latest version. Could you retest upstream dev/platform? ST STM32 — PlatformIO latest documentation