mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-07-09 05:57:48 +02:00
Add files via upload
This commit is contained in:
@@ -4,45 +4,40 @@ REM FILE: build.bat
|
|||||||
REM
|
REM
|
||||||
REM DESCRIPTION:
|
REM DESCRIPTION:
|
||||||
REM Build script for RP2350.
|
REM Build script for RP2350.
|
||||||
|
REM
|
||||||
|
REM BRIEF:
|
||||||
REM Automates the process of assembling, linking, and generating UF2 firmware.
|
REM Automates the process of assembling, linking, and generating UF2 firmware.
|
||||||
REM
|
REM
|
||||||
REM AUTHOR: Kevin Thomas
|
REM AUTHOR: Kevin Thomas
|
||||||
REM CREATION DATE: October 5, 2025
|
REM CREATION DATE: October 5, 2025
|
||||||
REM UPDATE DATE: October 5, 2025
|
REM UPDATE DATE: October 5, 2025
|
||||||
REM
|
|
||||||
REM STEPS:
|
|
||||||
REM 1. Assemble source files (gpio16_blink.s, image_def.s)
|
|
||||||
REM 2. Link objects with linker script (linker.ld)
|
|
||||||
REM 3. Convert ELF to BIN
|
|
||||||
REM 4. Convert BIN to UF2 with correct family ID (RP2350 = 0xe48bff59)
|
|
||||||
REM 5. Provide flashing instructions (UF2 drag‑and‑drop or OpenOCD)
|
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
|
|
||||||
echo Building GPIO16 blink...
|
echo Building GPIO16 blink...
|
||||||
|
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
REM Assemble source files
|
REM Assemble Source Files
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
arm-none-eabi-as -mcpu=cortex-m33 -mthumb main.s -o main.o
|
arm-none-eabi-as -mcpu=cortex-m33 -mthumb main.s -o gpio16_blink.o
|
||||||
if errorlevel 1 goto error
|
if errorlevel 1 goto error
|
||||||
|
|
||||||
arm-none-eabi-as -mcpu=cortex-m33 -mthumb image_def.s -o image_def.o
|
arm-none-eabi-as -mcpu=cortex-m33 -mthumb image_def.s -o image_def.o
|
||||||
if errorlevel 1 goto error
|
if errorlevel 1 goto error
|
||||||
|
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
REM Link object files into ELF using linker script
|
REM Link Object Files
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
arm-none-eabi-ld -T linker.ld gpio16_blink.o image_def.o -o gpio16_blink.elf
|
arm-none-eabi-ld -T linker.ld gpio16_blink.o image_def.o -o gpio16_blink.elf
|
||||||
if errorlevel 1 goto error
|
if errorlevel 1 goto error
|
||||||
|
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
REM Create raw binary from ELF
|
REM Create Raw Binary from ELF
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
arm-none-eabi-objcopy -O binary gpio16_blink.elf gpio16_blink.bin
|
arm-none-eabi-objcopy -O binary gpio16_blink.elf gpio16_blink.bin
|
||||||
if errorlevel 1 goto error
|
if errorlevel 1 goto error
|
||||||
|
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
REM Create UF2 image for RP2350
|
REM Create UF2 Image for RP2350
|
||||||
REM -b 0x10000000 : base address
|
REM -b 0x10000000 : base address
|
||||||
REM -f 0xe48bff59 : RP2350 family ID
|
REM -f 0xe48bff59 : RP2350 family ID
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
@@ -50,7 +45,7 @@ python uf2conv.py -b 0x10000000 -f 0xe48bff59 -o gpio16_blink.uf2 gpio16_blink.b
|
|||||||
if errorlevel 1 goto error
|
if errorlevel 1 goto error
|
||||||
|
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
REM Success message and flashing instructions
|
REM Success Message and Flashing Instructions
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
echo.
|
echo.
|
||||||
echo =================================
|
echo =================================
|
||||||
@@ -68,7 +63,7 @@ echo.
|
|||||||
goto end
|
goto end
|
||||||
|
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
REM Error handling
|
REM Error Handling
|
||||||
REM ==============================================================================
|
REM ==============================================================================
|
||||||
:error
|
:error
|
||||||
echo.
|
echo.
|
||||||
|
|||||||
Reference in New Issue
Block a user