Execute from RAM

This commit is contained in:
Kris Kwiatkowski 2025-02-17 23:49:17 +00:00
parent e392f01c65
commit e2c86a90f4
3 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ run:
-nographic \ -nographic \
-kernel runner.elf \ -kernel runner.elf \
-semihosting \ -semihosting \
-device loader,file=libpqscheme_test.elf,addr=0x00300000 -device loader,file=libpqscheme_test.elf,addr=0x20000000
# -S -gdb tcp::1234 # -S -gdb tcp::1234
# -monitor unix:/tmp/qemu-monitor,server,nowait # -monitor unix:/tmp/qemu-monitor,server,nowait

View File

@ -16,7 +16,7 @@ SECTIONS
.text : { .text : {
*(.text) *(.text)
*(.rodata) *(.rodata)
} > FLASH } > RAM
.data : { .data : {
*(.data) *(.data)

View File

@ -2,7 +2,7 @@
#include <platform/printf.h> #include <platform/printf.h>
#include <stdint.h> #include <stdint.h>
#define RAM_START 0x00300000 #define RAM_START 0x20000000
#define RAM_END RAM_START + 0x00800000 #define RAM_END RAM_START + 0x00800000
#define LIB_MAGIC 0x88DAD0F2 #define LIB_MAGIC 0x88DAD0F2
@ -37,7 +37,7 @@ void execute_library_function() {
printf(">> %d\n", test_func()); printf(">> %d\n", test_func());
} }
*/ */
uint32_t entry_point = 0x300044 | 1; uint32_t entry_point = (0x20000000 + 0x44) | 1;
func_t test_func = (func_t)entry_point; func_t test_func = (func_t)entry_point;
printf("> Entry point\n", entry_point); printf("> Entry point\n", entry_point);
int res = test_func(); int res = test_func();