Search code examples
simulatorarm64fast-model

ARMv8 Foundation Model: switches and leds


I am trying to boot my small ARMv7 kernel (which runs just fine using qemu vexpress model) in ARMv8 Foundation Model v2.1. The model boots at level EL3 / 64 bits, and I managed to go down to level EL1 / 32 bits, but I encounter some issues (in a few words, the timer doesn't tick and some kprintf are missing, but that's not the issue here).

To debug my UART issue, I wanted to use the led / switches provides by the model. I can read their value from software quite easily, but I can't write a new value to either of them. The kernel seems to hang. Here is a minimal asm code that writes to the switches register:

.global Start
Start: 
    # we are in EL3 / 64 bits mode
    # create the 0x1C010000 + 0x4 address of switches
    mov  x0, #4
    movk x0, #0x1c01, lsl #16
    # value to write
    mov  w1, #0xaa
    # actual writing
    strb w1, [x0]

It seems I am stuck at the strb instruction. For the record, if I replace strb with ldrb, I can correctly read and display the value of this register (I played with the --switches flag to be sure it worked).

Any one knows what I am doing wrong here ?

EDIT: thanks to unixsmurf suggestions, I know now that I got an synchronous Data Abort Exception with no level change, and that the reason is "Synchronous External Abort". I don't know how to inspect further, I guess I'll try ARM's forum.

Best,

V.


Solution

  • The ARM community finally solved the problem. The complete discussion can be found here.