ARMmbed / mbed-os-5-docs

Full documentation for Mbed OS 5 and 6
http://os.mbed.com/docs
98 stars 171 forks source link

Tutorial - Debugging - Visual Studio Code does not work #1279

Open tdjastrzebski opened 4 years ago

tdjastrzebski commented 4 years ago

Tutorial - Debugging - Visual Studio Code page presents approach to mbed-os 5.15 debugging with VS Code.

The proposed approach does not work for the several reasons.

  1. mbed-os compilation with MAKE utility fails under MS Windows. Makefile script generated by Mbed CLI export tool:
    • hits Windows 8192 character command length limit when link_options.txt file is built (see issues #10943 & #12646),
    • fails if project path contains whitespace,
    • contains some absolute paths to project files,
    • builds release profile only,
    • contains paths and defines, thus introduces significant maintenance overhead.
      For the above reasons, build with MAKE should NOT be recommended. Why recommend MAKE when you have quite-ok-working Mbed CLI Python-based tool?
  2. Mbed CLI export generated tasks.json VS Code configuration file has schema 0.1.0 depreciated long time ago. Current version is 2.0.0.
  3. The proposed approach to debugging is based on pyOCD. Perhaps this is OK but:
    • tutorial uses old pyOCD version. Current version is invoked differently: pyocd gdbserver instead of pyocd-gdbserver. Perhaps other changes are required as well. I never managed to get it working despite determination and effort. It does not seem pyOCD oficially support VS Code.
    • Why not use st-util instead? It works and configuration is much simpler - just 9 lines in launch.json instead of 30-40 lines with OS-specific paths settings.
ciarmcom commented 4 years ago

Internal Jira reference: https://jira.arm.com/browse/IOTDOCS-1473