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

Bare metal, Assembly language • Re: SIMD LDR from device memory

$
0
0
Thanks for the reply!

To view my SIMD registers I'm using a

Code:

brk #0
assembly instruction and a custom exception handler that loads a debugger. The debugger, when prompted to display SIMD registers, STPs the high and low 64bit values of each SIMD register to memory then loops through and prints them. Even without a debugger though, the actual program (which prints the SDCard manuf ID to screen on card initialization) displays the same bad values I describe above. So I'm pretty certain the register values presented by my debugger and my actual code match.

From your asm output though, it's not clear to me whether you're actually duplicating my own issue...

Code:

0x82090: ldr    x9, #0x1680x82094: ldr    s0, [x9, #0x18]0x82098: ldr    w9, [x9, #0x18
Looks like you're loading 0x168 as your base address...? Is that low of an address mapped to device memory on RPI4?
Also, your offset is over 128 bits from the base address. I'm having trouble reading individual 32bit words within a 128 bit range... So an offset of 4, 8, or 12 bytes would be the only offset values I'd expect to see. 0x18 is 24 bytes (192 bits) beyond the base register.

I don't doubt your code works, as I find it hard to believe it wouldn't work, but there's something about either my CPU or mmu configuration that's causing mine to not work. My MAIR is also set to 0x00 for everything above 0x3f000000.

Still hoping someone can maybe mention something that I can explore to find the cause... Maybe it's something in one of the system config registers... Since it works just fine on QEMU, it's got to be something specific to the hardware itself...

Thanks again!

Statistics: Posted by willdieh — Fri May 17, 2024 4:38 am



Viewing all articles
Browse latest Browse all 4989

Trending Articles