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

General • Execute from SRAM

$
0
0
Hello. I am attempting to make a third stage bootloader that will execute out of SRAM5. The boot process would be: bootrom, as it always does, loads the 252 bytes from QSPI Flash (addr 0x0 -> 0xfb) into SRAM5_0 (0x20041000 -> 0x200410fb), which will run the second stage bootloader directly out of SRAM5_0.

The second stage bootloader will read 3840 bytes from QSPI flash (addr 0x100 -> 0xfff) into the remaining portion of SRAM5_1 (0x20041100 -> 0x20041fff) using normal serial SPI commands of the SSI, then jump to that location.

I've managed to use an LED to debug and tell that the second stage bootloader is doing what I think it should: Reading bytes out of QSPI flash correctly, storing into the appropriate SRAM addresses, and verified that SRAM5_1 contains the correct bytes.

However, when I jump to the third stage bootloader at 0x20041100, I get no signs of life (expecting LED to turn on). I've verified in the disassembly that the third stage bootloader function correctly appears at 0x20041100. I've tried jumping to the main function of the third stage bootloader as a normal c function call, and also as a void function pointer with hard coded address. Neither worked.

Wondering if I'm forgetting to do something (some kind of cache flush, endian swap?), or if there's a different way I need to enter the function.

Any ideas?

Statistics: Posted by rdb9878 — Sun Apr 21, 2024 12:18 pm



Viewing all articles
Browse latest Browse all 4907

Trending Articles