Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

semihosting on the "blue pill" board #77

Open
ldericher opened this issue Mar 25, 2024 · 1 comment
Open

semihosting on the "blue pill" board #77

ldericher opened this issue Mar 25, 2024 · 1 comment

Comments

@ldericher
Copy link

ldericher commented Mar 25, 2024

Hello knurling-rs,

I can't seem to get semihosting to work with the app-template and my STM32F103C8T6 "blue pill" board. I'm using VSCode and the "Debugger for probe-rs" behind an STLink V2:

$ probe-rs list
The following debug probes were found:
[0]: STLink V2 (VID: 0483, PID: 3748, Serial: [...], StLink)
$ probe-rs info
Probing target via JTAG

ARM Chip:
Debug Port: Version 1, DP Designer: ARM Ltd
└── 0 MemoryAP
    └── ROM Table (Class 1)
        ├── Cortex-M3 SCS   (Generic IP component)
        │   └── CPUID
        │       ├── IMPLEMENTER: ARM Ltd
        │       ├── VARIANT: 1
        │       ├── PARTNO: 3107
        │       └── REVISION: 1
        ├── Cortex-M3 DWT   (Generic IP component)
        ├── Cortex-M3 FBP   (Generic IP component)
        ├── Cortex-M3 ITM   (Generic IP component)
        └── Cortex-M3 TPIU  (Coresight Component)

[...]

Now, whenever I start debugging anything, I end up in line 212 of cortex-m-semihosting/src/lib.rs, indicative of a failed semihosting attempt.

In a more "bare" setup (without knurling-rs, using the "Cortex-Debug" VSC extension and a manually setup "cargo build" prelaunch task) I was able to resolve the same issue leveraging "preLaunchCommands" for the gdb process, i.e. "monitor arm semihosting enable". I can't seem to find a similar setting with the arguably better approach using probe-rs and knurling.

I've selfhosted both experimental projects in my gitea instance and added a containers.dev config for convenience.

Any ideas forward?

Crossposted at probe-rs/vscode/issues/89

@jonathanpallant
Copy link
Contributor

The Knurling project generally recommends defmt over RTT as the logging mechanism instead of semihosting. We typically only suggest semihosting for causing probe-rs to quit, e.g. after running a short example. You could ask the probe-rs team on Matrix to see if they support whichever semihosting operation you are attempting to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants