-
-
Notifications
You must be signed in to change notification settings - Fork 770
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 broken in v1.10 #1678
Comments
Confirming there is a bug in BMF at current main, but not BMDA. I've been investigating this for the last few days and my findings are inconclusive. I managed to enable logging in blackpill-f411ce platform thanks to its big internal flash and uncrippled ENABLE_DEBUG=1 build setting (skips rdimon entirely), and observed all syscalls with arguments on debug_serial. What's worse, syscalls appeared in pairs with hiccups, leading me to believe that some syscalls or packets get skipped or lost. I tested BMDA semihosting on Linux and Windows 10 via JLink, but also recent BMF, and that behaves properly due to its different implementation -- it does not rely on hostio code, which I at the moment assume is suspect. I used the sketch and library for semihosting. |
@pavel-kirienko Please revisit after building fresh firmware -- there should be no more missed calls and 2-second timeouts. |
I was testing the latest release v1.10 to see if #970 is resolved there. While doing so, I discovered that the semihosting support appears to be broken there. Testing has been conducted with arm-none-eabi GDB versions 10.3 and 12.3 with identical results. The target MCU is STM32F446 connected via SWD. The BMP hardware is the native probe.
First, I was able to successfully load and run ordinary firmware that does not use semihosting. The whole stack operated as intended without noticeable issues.
When I attempted to run a different firmware image that does make use of semihosting, I discovered that some of the semihosting calls were not being executed by the host and that at least some attempts to execute a semihosting call caused the debugger to stall code execution for somewhere between a few hundred ms up to seconds. Shortly after starting code execution, GDB prints the following message and then stops completely:
Sic! There is nothing after the colon. Pressing Ctrl+C results in "Disconnected from target." being printed.
Enabling remote protocol debugging revealed the following:
For comparison, here is the log captured with BMP firmware v1.9.1 with the same firmare using GDB v10.3 (not possible to test it with GDB v12.3 because of #929), where everything is functioning correctly:
The connection sequence I used is as follows:
The text was updated successfully, but these errors were encountered: