Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4536

Troubleshooting • Raspberry Pi 5, Can Alignment Faults Be Turned Off?

$
0
0
Hello,

I'm writing a custom OS with Arm64 assembly and Go. So far, I've done most of the development in an emulator. Now, I'm testing the OS on real hardware for the first time using the Raspberry Pi 5. I'm also using the Raspberry Pi Debug Probe, OpenOCD, and GDB to debug my OS on the Raspberry Pi 5.

It's going okay, but I'm running into an issue where unaligned memory accesses cause faults. With the code I write, I can make sure that all memory accesses are aligned but Go has runtime code that uses unaligned accesses that I can't modify. Is there a way to configure the Raspberry Pi 5 to allow unaligned memory access?

Here's an example of an instruction that causes a fault:

Code:

ldr x2, [x0]
Here x0 is 0x1aa531 which is 1-byte aligned instead of 8-byte aligned

Let me know if I need to provide additional info or modify my question. I appreciate any help!

Statistics: Posted by Raspberry_Confused — Wed Oct 16, 2024 8:24 pm — Replies 0 — Views 33



Viewing all articles
Browse latest Browse all 4536

Trending Articles