Closed lukgni closed 3 years ago
@fkjagodzinski Can you try this PR on linux ?
There is still some build issues, I supposed it is due to mbed-tools
being used which is v7.
@pan- #88 solves issue with mbed-tools v7. Additionally it improves a little bit creating build output directory structure so we could reuse it as feature for debug/flash tasks (as a possibility to have debug/release/develop builds in separated directory).
Problem
Missing capability to flash and debug mbed shell examples in vscode.
As someone may notice, I didn't change profile of build shell application to 'debug' - ConnectivyManagerImpl.h stub causes a problem when we want to build application with debug profile (undefined reference in multiple places). I decided to not fix this issue within this change because problem probably will be solved when we merge wifi or ble work into 'development' branch (as they extend ConnectivityManagerImpl.h)
After switching to Mbed 6.7.0 and mbed-tools 7.1.2 it is possible to have separated build directory depending on mbed application profile. This change includes that 'feature'
I observed that for STLink probe, the gdbserver can't automatically detect debug target if it's run inside container. This is related to limited access to host mounted volumes inside container, which are used by STLink to pass information about connected stm hardware. In result,breakpoints doesn't work properly during debugging. We may workaround this issue by passing directly target name to gdbserver and for that reason I decided to use fixed configuration for debug tasks which are run inside container.
In result we will have below tasks:
[Build]
Build Mbed Shell Example
(target and profile selected via input variables)Flash Mbed Shell Example
(target and profile selected via input variables) [requires linux host][Debug]
Shell Mbed Example Debug [remote]
- it will try to connect with hostpyocd-gdbserver --allow-remote
server. Should work on every system. Target and profile selected via input variables.Shell Mbed Example Debug [local stm32l475xg]
(profile selected via input variables) - gdbserver will run inside container, requires linux host for proper connection with HW.Shell Mbed Example Debug [local nrf52840]
(profile selected via input variables) - gdbserver will run inside container, requires linux host for proper connection with HW.Summary of Changes
Update .devcontainer.json to pass through usb debug probe from host to vscode container. Add flash tasks to tasks.json, add sepearted tast for building shell example on DISCO board and rename build tasks. Add debug launch configuration for debugging mbed shell example. Add pyocd, pyusb modules to the final vscode container. Add mbed_example_utils.sh helper script for simplify calling pyocd within vscode tasks.
Fixes #74 Fixes #75
This change requires #88.