Questions tagged [semihosting]
11 questions
6
votes
1 answer
Where does STDOUT go with GDB, OopenOCD and semihosting?
I am trying to figure out semihostong on ARM (STM32042). I can see printf output if I run openocd directly from a command line and connect to it from gdb over TCP. But if I launch openocd from inside gdb, the output goes to some big /dev/null in the…

iter
- 4,171
- 8
- 35
- 59
3
votes
2 answers
What's the point of providing input and output operands if they are not specified in ASM template?
I found the following piece of code in u-boot/arch/arm/lib/semihosting.c that uses bkpt and other instructions and provides input and output operands even though they are not specified in the ASM template:
static noinline long smh_trap(unsigned int…

user1042840
- 1,925
- 2
- 16
- 32
2
votes
1 answer
OpenOCD exit on breakpoint
I'm developing an application on an STM32F042.
I drive everything from a makefile, including my unit tests.
I use OpenOCD and ST-LINK to flash the target.
My unit tests run on the host and on the target.
The host unit test driver returns 0 from…

iter
- 4,171
- 8
- 35
- 59
1
vote
1 answer
QEMU semihosting doesn't produce output
I'm trying to set up a testing environment for my project using semihosting within QEMU.
So far I had no issues with hello.c following this answer, however I'm having trouble getting it to work with CMake.
Here's how I'm building the exact same…

psykana
- 104
- 1
- 10
1
vote
1 answer
Capture QEMU Semihosted I/O
For unit testing purposes, I want to be able to run a bare-metal binary with qemu and capture it's output.
Sample file:
#include
#include
static void qemu_exit() {
register uint32_t r0 __asm__("r0");
r0 = 0x18;
register…

Edward Chamberlain
- 274
- 6
- 23
0
votes
1 answer
Does semihosting work for qemu-system-aarch64?
I am using Rust to code in a [no_std] environment, targeting ARM's aarch64-unknown-none. When I enable -semihosting as stipulated in the qemu-system-aarch64 command options below, I never see any display on my host computer qemu or terminal.
Is…

piosystems
- 1
- 2
0
votes
1 answer
Can you programmatically remove breakpoints in ARM Cortex M3 application at runtime?
In my bare metal C application for a CM3, I have a startup script that runs a CRC on code and data sections in their target regions in memory. I noticed sometimes the check on code would fail, sometimes not, depending on if I had any breakpoints…

us3rnotfound
- 23
- 3
0
votes
1 answer
QEMU Semihosting not working when building QEMU from Source
I'm emulating a Cortex-M33 using QEMU on a linux host. I've installed QEMU using sudo apt-get qemu-system-arm and semihosting is working fine (printf and file IO).
I'm calling QEMU as follows:
/usr/bin/qemu-system-arm -machine mps2-an505 -cpu…

cberk1
- 35
- 6
0
votes
0 answers
How to let Python interact with the stdout/stdin of GDB console?
I am trying to make some automation testing with an embedded application running in an ARM Microcontroller. For the I/O exchange I have setup the Semihosting using arm-none-eabi-gdb as GDB client:
arm-none-eabi-gdb my_binary.axf -ex "target…
0
votes
1 answer
Bare-metal ARM Cortex-A7 newlib crt0 not initializing .bss and .data regions
I'm learning to write bare-metal ARM Cortex-A7 firmware to run on QEMU with semihosting. I know that ARM GCC has a libc implementation called newlib, which supports semihosting for common libc functions. So I'm trying to get newlib to work as…

iNvEr7
- 1
- 1