Sysprogs forums › Forums › VisualGDB › Unpause ARM Semihosting Console after restart?
Tagged: semihosting
- This topic has 5 replies, 2 voices, and was last updated 4 days, 23 hours ago by
support.
-
AuthorPosts
-
May 13, 2025 at 01:56 #36644
wtywtykk
ParticipantHi,
I’m using ARM Semihosting Console to print my log. I had 2 problems:
- The window stays paused when I restart the debugging. And nothing is displayed because it’s paused. It always takes me some time to realize it was paused.
- If restart with the window paused, old contents are not cleared. But if not paused, they are cleared.
Is it possible to make it unpause when the debugging restarts(reloads the firmware)?
Thanks!
May 15, 2025 at 16:42 #36670support
KeymasterHi,
That would be a bit tricky. The fast semihosting driver (that detects the resets) is designed to be interchangeable with several other drivers that can produce similar output, and the console window is also interchangeable with other parts that consume text output. Routing pausing/unpausing through it would make things unnecessarily complicated, and could introduce bugs.
We have made an internal note on it and will look into it next time we do a major redesign of the console logic, but we wouldn’t promise any timeline for it currently.
As for the old contents, they should normally not get cleared at all, but restarting temporarily fills the buffer with zeroes (or bootloader-specific contents) and that could quickly fill the semihosting window, scrolling beyond the previous contents out of view.
May 26, 2025 at 23:44 #36678wtywtykk
ParticipantHi,
To clearify, by “restart” I mean the blue button from VS. and “reset” is the green button added by visual gdb.
My problem happens when I click “restart” (the one from VS). And I agree “reset” shouldn’t clear the content.
After some digging, I found the old content is actually cleared. What it not cleared it the content that received/buffered after I pause the window. They are shown to the window immeidately after unpause. I think this is not expected.
Reproduce:
- write a program that prints strng in main with some interval
- start the program, the string is shown in semihosting window
- pause the window, wait for a while
- restart the debugging(by the restart button or by stop then launch)
- quickly unpause
- you can see the data before restarting is added to the beginning.
Some other problems:
- when reading the semihosting with “gets”, restarting will show a error message “Object reference not set to an instance of an object.”
- resetting during reading will cause the semihosting to stuck/show some garbage data.
reproduce:
- run the following code. This program echos back the input line.
for (;;) { HAL_GPIO_WritePin(GPIOC, GPIO_PIN_12, GPIO_PIN_SET); HAL_Delay(500); HAL_GPIO_WritePin(GPIOC, GPIO_PIN_12, GPIO_PIN_RESET); HAL_Delay(500); puts("aaa\n"); char bb[128]; gets(bb); puts(bb); }
2. the program should wait for input from semihosting
3. reset the mcu (if end debugging here, “Object reference not set to an instance of an object.” is shown)
4. type something
5. the mcu is stuck at gets (no echo is showed after pressing enter)
Thanks!
June 13, 2025 at 17:19 #36741support
KeymasterOK, we have done some testing with the example you provided. We couldn’t reproduce the null reference problem, however resetting the device during an active read call would indeed cause the semihosting subsystem to stall.
We have fixed it in this build: VisualGDB-6.0.108.5354.exe
June 14, 2025 at 19:36 #36745wtywtykk
ParticipantHi, Thanks for your reply, but the installer doesn’t look like a valid exe file. I can’t run it.
Os info:
Edition Windows 10 Pro
Version 2009
Installed on 4/16/2021
OS Build 19045.5965June 15, 2025 at 18:35 #36746support
KeymasterSorry about that, a glitch on our side. We recently updated our build distribution system to support CodeVROOM that has separate Windows/Linux/MacOS installers, and it incorrectly renamed the temporary VisualGDB builds to .exe. You can rename the file back to .msi and it should work again. We have also fixed it on our side.
-
AuthorPosts
- You must be logged in to reply to this topic.