host-aprom/flash.cmd

32 lines
908 B
Batchfile
Raw Normal View History

2024-08-04 21:27:46 +00:00
@ECHO off
FOR /F "tokens=* USEBACKQ" %%g IN (`
..\..\openocd-0.12.0-3\bin\openocd.exe -f ..\..\nucxxx.cfg ^
-c "init; PrintPart; exit" 2^>NUL
`) DO (SET "PART_NUM=%%g")
IF NOT "%PART_NUM%"=="NUC123SD4AN0" (
ECHO Invalid part number %PART_NUM%. Make sure you're connected to HOST not LED!
EXIT /B 1
)
REM SET LDROM_PATH=../bootloader/host_bl.bin
SET LDROM_PATH=../../../TASOLLER_HOST_LDROM.bin
SET APROM_PATH=host_aprom.bin
..\..\openocd-0.12.0-3\bin\openocd.exe -f ..\..\nucxxx.cfg ^
2024-06-29 20:17:34 +00:00
-c "SysReset halt" ^
-c "flash read_bank 1 dataflash.bin" ^
-c "ChipErase" ^
-c "WriteConfigRegs 0xFFFFFF7F 0xFFFFFFFF" ^
-c "ReadConfigRegs" ^
2024-08-04 21:27:46 +00:00
-c "program %LDROM_PATH% 0x100000" ^
-c "program %APROM_PATH% 0" ^
2024-06-29 20:17:34 +00:00
-c "program dataflash.bin 0x1F000" ^
2024-08-04 21:27:46 +00:00
-c "ReadConfigRegs" ^
2024-06-29 20:17:34 +00:00
-c "SysReset aprom run" ^
2024-08-04 21:27:46 +00:00
-c "exit" -d0
2024-06-29 20:17:34 +00:00
2024-08-04 21:27:46 +00:00
REM Clean up after ourself
del dataflash.bin