updated docs

This commit is contained in:
Jonathan Herrewijnen 2024-08-12 16:57:40 +02:00
parent cf83b3d34e
commit 19d20965db
6 changed files with 31 additions and 4 deletions

View File

@ -8,10 +8,11 @@ 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 LD := $(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld.bfd
#==================Target Samsung S7 (8890)================== #==================Target Samsung S7 (8890)==================
CFLAGS_SAMSUNGS7 = -Os CFLAGS_SAMSUNGS7 = -Os # -Os for optimization for size
dwc3: dwc3:
$(CC) entry.S -c -o entry.o $(CFLAGS_SAMSUNGS7) $(CC) entry.S -c -o entry.o $(CFLAGS_SAMSUNGS7) # -c compiles assembly code, and -o creates an object file (containing linking and symbol information)
$(CC) $(CFLAGS_SAMSUNGS7) -c test_dwc3.c -o dwc3.o $(CC) $(CFLAGS_SAMSUNGS7) -c test_dwc3.c -o dwc3.o # compiles test_dwc3.c to dwc3.o
$(LD) -T test_dwc3.ld entry.o dwc3.o -o dwc3.elf --just-symbols=symbols.txt $(LD) -T test_dwc3.ld entry.o dwc3.o -o dwc3.elf --just-symbols=symbols.txt # -T for linker script, --just-symbols for symbols file
$(OBJCOPY) -O binary dwc3.elf dwc3.bin $(OBJCOPY) -O binary dwc3.elf dwc3.bin

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,17 @@
ifeq ($(ANDROID_NDK_ROOT),)
$(error Error : Set the env variable 'ANDROID_NDK_ROOT' with the path of the Android NDK (version 20))
endif
CC := $(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android27-clang
AR := $(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar
OBJCOPY := $(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-objcopy
LD := $(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld.bfd
#==================Target Samsung S7 (8890)==================
CFLAGS_SAMSUNGS7 = -Os
stage1:
$(CC) entry.S -c -o entry.o $(CFLAGS_SAMSUNGS7)
$(CC) $(CFLAGS_SAMSUNGS7) -c stage1.c -o stage1.o
$(LD) -T linkscript.ld entry.o stage1.o -o stage1.elf --just-symbols=symbols.txt
$(OBJCOPY) -O binary stage1.elf stage1.bin

View File

@ -0,0 +1,8 @@
# Open a binary file and modify it
bl1 = open('../S7/bl1.bin', 'rb').read()
# Modify the binary file at 1C10
bl1 = bl1[:0x1C1C] + b'\x48' + bl1[0x1C1D:]
# Write the modified binary file
open('../S7/bl1_mod.bin', 'wb').write(bl1)

View File

@ -15,3 +15,4 @@ stage1:
$(CC) $(CFLAGS_SAMSUNGS7) -c stage1.c -o stage1.o $(CC) $(CFLAGS_SAMSUNGS7) -c stage1.c -o stage1.o
$(LD) -T linkscript.ld entry.o stage1.o -o stage1.elf --just-symbols=symbols.txt $(LD) -T linkscript.ld entry.o stage1.o -o stage1.elf --just-symbols=symbols.txt
$(OBJCOPY) -O binary stage1.elf stage1.bin $(OBJCOPY) -O binary stage1.elf stage1.bin