RTEMS | Unknown Trap error on testing sparc/leon3 bsp using qemu (#5551)

SHIVAM DEOLANKAR (@D3athSkulll) gitlab at rtems.org
Tue Apr 14 11:18:53 UTC 2026



SHIVAM DEOLANKAR created an issue: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5551



## Summary

On testing sparc/leon3 bsp with qemu, we recieve an unknown trap error.

Execution on LEON3 via QEMU fails immediately with a Trap 0x02 (Illegal Instruction) while interrupts are disabled. All registers are zero, indicating the program never initializes properly. This suggests a mismatch between the compiled binary and the LEON3 architecture/BSP or an incorrect build configuration, causing unsupported instructions to be executed at startup.

```
qemu: fatal: Trap 0x02 (Illegal Instruction) while interrupts disabled, Error state
pc: f153118 npc: f15311c
%g0-7: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
%o0-7: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
%l0-7: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
%i0-7: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
%f00: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f08: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
psr: f3400c0 (icc: --- SPE: SP-) wim: 00000001
fsr: 00080000 y: 00000000

Aborted (core dumped) qemu-system-sparc -M leon3_generic -nographic -bios build/sparc/leon3/testsuites/samples/hello.exe
```

## Steps to reproduce

Build using following config.ini 

```ini
[DEFAULT]
RTEMS_POSIX_API = True
BUILD_TESTS = True
[sparc/leon3]
```

and then run the command

```
qemu-system-sparc -M leon3_generic -nographic -bios build/sparc/leon3/testsuites/samples/hello.exe
```

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5551
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260414/40b909d6/attachment.htm>


More information about the bugs mailing list