Adding third (variable) debugger

This commit is contained in:
Jonathan Herrewijnen 2024-08-27 20:18:39 +02:00
parent a9f426292c
commit 91c7d60638
4 changed files with 42 additions and 1 deletions

View File

@ -8,7 +8,7 @@ OBJCOPY := $(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64
LD := $(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld.bfd
#==================Target Samsung S7 (8890)==================
all: samsung_s7 samsung_s7_reloc
all: samsung_s7 samsung_s7_reloc samsung_s7_reloc_0x2019e5c
CFLAGS_SAMSUNGS7 = -Os -Idevices/samsung_s7/
samsung_s7:
@ -26,3 +26,10 @@ samsung_s7_reloc:
$(LD) -T devices/samsung_s7/reloc_linkscript.ld bin/samsung_s7/reloc_entry.o bin/samsung_s7/reloc_debugger.o -o bin/samsung_s7/reloc_debugger.elf --just-symbols=devices/samsung_s7/reloc_symbols.txt
$(OBJCOPY) -O binary bin/samsung_s7/reloc_debugger.elf bin/samsung_s7/reloc_debugger.bin
CFLAGS_SAMSUNGS7_RELOC_0x2019e5c = -Os -DRELOC_DEBUGGER_2=1 -Idevices/samsung_s7/
samsung_s7_reloc_0x2019e5c:
[ -d bin/samsung_s7 ] || mkdir -p bin/samsung_s7/
$(CC) arm64_stub.S -c -o bin/samsung_s7/reloc_entry_0x2019e5c.o $(CFLAGS_SAMSUNGS7_RELOC_0x2019e5c)
$(CC) debugger.c -c -o bin/samsung_s7/reloc_debugger_0x2019e5c.o $(CFLAGS_SAMSUNGS7_RELOC_0x2019e5c)
$(LD) -T devices/samsung_s7/reloc_linkscript_0x2019e5c.ld bin/samsung_s7/reloc_entry_0x2019e5c.o bin/samsung_s7/reloc_debugger_0x2019e5c.o -o bin/samsung_s7/reloc_debugger_0x2019e5c.elf --just-symbols=devices/samsung_s7/reloc_symbols_0x2019e5c.txt
$(OBJCOPY) -O binary bin/samsung_s7/reloc_debugger_0x2019e5c.elf bin/samsung_s7/reloc_debugger_0x2019e5c.bin

View File

@ -29,6 +29,14 @@ int mystrlen(char *data) {
#define data_received 0x206f100
#endif
#ifdef RELOC_DEBUGGER_2
#define recv_buffer 0x14AC4200
#define data_received 0x14AC4000
#else
#define recv_buffer 0x206f000 //0x02021800 + 0x3000
#define data_received 0x206f100
#endif
void recv_data_cb(uint32_t endpoint, uint32_t len){
char *dest_buf = (char *)recv_buffer;
volatile void *dref = (void *)data_received;

View File

@ -0,0 +1,14 @@
MEMORY {
ROM (rwx): ORIGIN = 0x14AC0000, LENGTH = 0x1000
}
SECTIONS
{
. = 0x14AC0000;
.text . : {
*(.text*)
*(.data*)
*(.rodata*)
} >ROM
}

View File

@ -0,0 +1,12 @@
debugger_storage = 0x14AC3000;
debugger_stack = 0x14AC2000;
debugger_entry = 0x14AC0000;
maybe_usb_setup_read = 0x00006f88;
dwc3_ep0_start_trans = 0x0000791c;
usb_event_handler = 0x00007bac;
get_endpoint_recv_buffer = 0x00007a7c;
exynos_sleep = 0x000027c8;
g_recv_buffer = 0x14AC4200;
g_data_received = 0x14AC4000;