pyocd / pyocd/pyOCD

Option `enable_semihosting` is not working

Open
#1,264 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug gdbserver
Dominant language
Python
Stars
1.5k
Forks
560
Avg merge
1h 41m
Merged PRs (30d)
3

Description

Thank you for this great project. I have been using it as part of the Zephyr project and it works great.

I am using ARM semihosting for my printf statements and for each debug session I type monitor arm semihosting enable. After getting sick of doing that I wanted to enable semihosting by default for my board. When looking at the pyOCD options documentation, I got the feeling that I needed to create the following config file to enable arm semihosting.

# Set to True to handle semihosting requests. Also see the semihost_console_type option. Default is False.
enable_semihosting: True

However with this config file the semihosting breakpoints were still not parsed. So I tried pyocd gdbserver -O enable_semihosting=true, which also didn't work. After trying lots of variations I finally found the following working command: pyocd gdbserver --semihosting.

My conclusion was that the options parsing doesn't work correctly for enable_semihosting.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the options documentation and reproduce the issue using the YAML setting and pyocd gdbserver -O enable_semihosting=true, then compare that behavior with pyocd gdbserver --semihosting. Trace how these option forms are parsed and verify that enabling semihosting works consistently through the config file and command-line option.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools, embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.