diff --git a/bootloader_hex/master.bat b/bootloader_hex/master.bat new file mode 100644 index 0000000..1875e9a --- /dev/null +++ b/bootloader_hex/master.bat @@ -0,0 +1,85 @@ +@echo off +setlocal ENABLEDELAYEDEXPANSION + +REM ====================================================================== +REM COLOR DEFINITIONS (ANSI ESC SEQUENCES) +REM ====================================================================== +set "RED=" +set "GREEN=" +set "YELLOW=" +set "RESET=" + +REM ====================================================================== +REM CONFIGURATION +REM ====================================================================== + +REM Путь к flash8051.exe (лежит в соседней папке ..\c8051\) +set "FLASH_TOOL=%~dp0..\c8051\flash8051.exe" + +REM Путь к HEX файлу +set "HEX_FILE=%~dp0master_boot.hex" + +REM Серийный номер Debug Adapter (должен быть ДЕСЯТИЧНЫЙ!) +set "SERIAL=EC3005A03C4" + +REM ====================================================================== +REM CHECK FILES +REM ====================================================================== + +echo %YELLOW%Using tool:%RESET% "%FLASH_TOOL%" +echo %YELLOW%HEX file:%RESET% "%HEX_FILE%" +echo %YELLOW%Serial:%RESET% %SERIAL% +echo. + +if not exist "%FLASH_TOOL%" ( + echo %RED%[ERROR] flash8051.exe not found:%RESET% + echo "%FLASH_TOOL%" + echo. + echo Press any key to exit . . . + pause >nul + exit /b 1 +) + +if not exist "%HEX_FILE%" ( + echo %RED%[ERROR] HEX file not found:%RESET% + echo "%HEX_FILE%" + echo. + echo Press any key to exit . . . + pause >nul + exit /b 1 +) + +REM ====================================================================== +REM FLASH PROCESS +REM ====================================================================== + +echo %YELLOW%Starting flash...%RESET% +echo. + +"%FLASH_TOOL%" -sn %SERIAL% -tif c2 -erase -upload "%HEX_FILE%" +set "ERR=%ERRORLEVEL%" + +echo. + +REM ====================================================================== +REM RESULT HANDLING +REM ====================================================================== + +if not "%ERR%"=="0" ( + echo %RED%[ERROR] Flash failed! Error code: %ERR%%RESET% + echo Check: + echo - Debug Adapter connection + echo - Target power + echo - Correct serial number + echo - Valid HEX file + echo. + echo Press any key to exit . . . + pause >nul + exit /b %ERR% +) + +echo %GREEN%[OK] Flash completed successfully.%RESET% +echo. +echo Press any key to exit . . . +pause >nul +exit /b 0 diff --git a/bootloader_hex/master_bootloader.hex b/bootloader_hex/master_boot.hex similarity index 100% rename from bootloader_hex/master_bootloader.hex rename to bootloader_hex/master_boot.hex diff --git a/bootloader_hex/slave.bat b/bootloader_hex/slave.bat new file mode 100644 index 0000000..c30e871 --- /dev/null +++ b/bootloader_hex/slave.bat @@ -0,0 +1,85 @@ +@echo off +setlocal ENABLEDELAYEDEXPANSION + +REM ====================================================================== +REM COLOR DEFINITIONS (ANSI ESC SEQUENCES) +REM ====================================================================== +set "RED=" +set "GREEN=" +set "YELLOW=" +set "RESET=" + +REM ====================================================================== +REM CONFIGURATION +REM ====================================================================== + +REM Путь к flash8051.exe (лежит в соседней папке ..\c8051\) +set "FLASH_TOOL=%~dp0..\c8051\flash8051.exe" + +REM Путь к HEX файлу +set "HEX_FILE=%~dp0slave_boot.hex" + +REM Серийный номер Debug Adapter (должен быть ДЕСЯТИЧНЫЙ!) +set "SERIAL=EC3005A03C4" + +REM ====================================================================== +REM CHECK FILES +REM ====================================================================== + +echo %YELLOW%Using tool:%RESET% "%FLASH_TOOL%" +echo %YELLOW%HEX file:%RESET% "%HEX_FILE%" +echo %YELLOW%Serial:%RESET% %SERIAL% +echo. + +if not exist "%FLASH_TOOL%" ( + echo %RED%[ERROR] flash8051.exe not found:%RESET% + echo "%FLASH_TOOL%" + echo. + echo Press any key to exit . . . + pause >nul + exit /b 1 +) + +if not exist "%HEX_FILE%" ( + echo %RED%[ERROR] HEX file not found:%RESET% + echo "%HEX_FILE%" + echo. + echo Press any key to exit . . . + pause >nul + exit /b 1 +) + +REM ====================================================================== +REM FLASH PROCESS +REM ====================================================================== + +echo %YELLOW%Starting flash...%RESET% +echo. + +"%FLASH_TOOL%" -sn %SERIAL% -tif c2 -erase -upload "%HEX_FILE%" +set "ERR=%ERRORLEVEL%" + +echo. + +REM ====================================================================== +REM RESULT HANDLING +REM ====================================================================== + +if not "%ERR%"=="0" ( + echo %RED%[ERROR] Flash failed! Error code: %ERR%%RESET% + echo Check: + echo - Debug Adapter connection + echo - Target power + echo - Correct serial number + echo - Valid HEX file + echo. + echo Press any key to exit . . . + pause >nul + exit /b %ERR% +) + +echo %GREEN%[OK] Flash completed successfully.%RESET% +echo. +echo Press any key to exit . . . +pause >nul +exit /b 0 diff --git a/bootloader_hex/slave_bootloader.hex b/bootloader_hex/slave_boot.hex similarity index 100% rename from bootloader_hex/slave_bootloader.hex rename to bootloader_hex/slave_boot.hex diff --git a/c8051/.featureId b/c8051/.featureId new file mode 100644 index 0000000..efc72f0 --- /dev/null +++ b/c8051/.featureId @@ -0,0 +1,2 @@ +featureId=com.silabs.apack.c8051.feature +featureVersion=5.0.5 \ No newline at end of file diff --git a/c8051/Readme.txt b/c8051/Readme.txt new file mode 100644 index 0000000..1956e6c --- /dev/null +++ b/c8051/Readme.txt @@ -0,0 +1,22 @@ +.\flash8051 -tif c2 -erase -upload firmware.hex + + + +@echo off +setlocal + +REM Путь к flash8051 (соседняя папка c8051) +set FLASH_TOOL=%~dp0..\c8051\flash8051.exe + +REM Путь к HEX файлу (лежит рядом с bat) +set HEX_FILE=%~dp0firmware.hex + +echo Using tool: %FLASH_TOOL% +echo Flashing: %HEX_FILE% +echo. + +"%FLASH_TOOL%" -tif c2 -erase -upload "%HEX_FILE%" + +echo. +echo Done. +pause diff --git a/c8051/apack.info b/c8051/apack.info new file mode 100644 index 0000000..0bdb0d4 --- /dev/null +++ b/c8051/apack.info @@ -0,0 +1,164 @@ +# Adapter pack file for Studio. +# +label=Adapter pack for c8051 Devices + +featureLevel=11 + +adapter_types=EC3,UDA,Toolstick + +path=.,win32,win64,linux,macosx + +executable(flash8051:linux.x86_64) { + exe=flash8051 + lib=libslab8051.so + lib=libslabhiddevice.so +} + +executable(flash8051:linux.x86) { + exe=flash8051 + lib=libslab8051.so + lib=libslabhiddevice.so +} + +executable(flash8051:win32.x86) { + exe=flash8051.exe + lib=slab8051.dll + lib=slabhiddevice.dll + lib=libgcc_s_dw2-1.dll + lib=libstdc++-6.dll + lib=mingwm10.dll +} + +executable(flash8051:win32.x86_64) { + exe=flash8051.exe + lib=slab8051.dll + lib=slabhiddevice.dll + lib=libgcc_s_seh-1.dll + lib=libstdc++-6.dll + lib=libwinpthread-1.dll +} + +executable(flash8051:macosx.x86_64) { + exe=flash8051 + lib=libslab8051.dylib + lib=libslabhiddevice.dylib +} + +executable(siagentc8051:linux.x86_64) { + exe=siagentc8051 + lib=libslab8051.so + lib=libslabhiddevice.so + lib=libsiagent.so +} + +executable(siagentc8051:linux.x86) { + exe=siagentc8051 + lib=libslab8051.so + lib=libslabhiddevice.so + lib=libsiagent.so +} + +executable(siagentc8051:win32.x86) { + exe=siagentc8051.exe + lib=slab8051.dll + lib=slabhiddevice.dll + lib=siagent.dll + lib=libgcc_s_dw2-1.dll + lib=libstdc++-6.dll + lib=mingwm10.dll +} + +executable(siagentc8051:win32.x86_64) { + exe=siagentc8051.exe + lib=slab8051.dll + lib=slabhiddevice.dll + lib=siagent.dll + lib=libgcc_s_seh-1.dll + lib=libstdc++-6.dll + lib=libwinpthread-1.dll +} + +executable(siagentc8051:macosx.x86_64) { + exe=siagentc8051 + lib=libslab8051.dylib + lib=libslabhiddevice.dylib + lib=libsiagent.dylib +} + +executable(cptstreamer:linux.x86_64) { + exe=cptstreamer_c8051 + lib=libsiagent.so + lib=libsegger_support.so +} + +executable(cptstreamer:linux.x86) { + exe=cptstreamer_c8051 + lib=libsiagent.so + lib=libsegger_support.so +} + +executable(cptstreamer:win32.x86) { + exe=cptstreamer_c8051.exe + lib=siagent.dll + lib=segger_support.dll + lib=libgcc_s_dw2-1.dll + lib=libstdc++-6.dll + lib=mingwm10.dll +} + +executable(cptstreamer:win32.x86_64) { + exe=cptstreamer_c8051.exe + lib=siagent.dll + lib=segger_support.dll + lib=libgcc_s_seh-1.dll + lib=libstdc++-6.dll + lib=libwinpthread-1.dll +} + +executable(cptstreamer:macosx.x86_64) { + exe=cptstreamer_c8051 + lib=libsiagent.dylib + lib=libsegger_support.dylib +} + +# TouchXpress/cpt devices is not allowed to be debugged, but we need this "debug" +# function to read from the devices in XpressConfigurator. +function(debug:mcu.8051.*,ffd.touchxpress.*) { + cmd=$(siagentc8051) [ -date ${dateStr} ] +} + +function(debuggers:mcu.8051.*,ffd.touchxpress.*) { + cmd=$(siagentc8051) -list +} + +function(help) { + cmd=$(flash8051) -? +} + +function(upload:mcu.8051.*,ffd.touchxpress.*) { + cmd=$(flash8051) ( -sn ${sn} ) ( -tif ${tif} ) ( -upload ${file} ) [ -erasemode ${erasemode} ] [ -clkstrobe ${clkstrobe} ] [ -keeppower ${keeppower} ] +} + +function(erase:mcu.8051.*,ffd.touchxpress.*) { + cmd=$(flash8051) ( -sn ${sn} ) ( -tif ${tif} ) -erase +} + +function(lock:mcu.8051.*,ffd.touchxpress.*) { + cmd=$(flash8051) ( -sn ${sn} ) ( -tif ${tif} ) -lock +} + +function(unlock:mcu.8051.*,ffd.touchxpress.*) { + cmd=$(flash8051) ( -sn ${sn} ) ( -tif ${tif} ) -unlock +} + +function(checklocked:mcu.8051.*,ffd.touchxpress.*) { + cmd=$(flash8051) ( -sn ${sn} ) ( -tif ${tif} ) -checklocked +} + +function(serialports) { + cmd=$(cptstreamer) -ports +} + +function(cptstreamer:mcu.8051.c8051.*,ffd.touchxpress.*) { + cmd=$(cptstreamer) +} diff --git a/c8051/cptstreamer_c8051.exe b/c8051/cptstreamer_c8051.exe new file mode 100644 index 0000000..8544442 Binary files /dev/null and b/c8051/cptstreamer_c8051.exe differ diff --git a/c8051/flash8051.exe b/c8051/flash8051.exe new file mode 100644 index 0000000..fc56895 Binary files /dev/null and b/c8051/flash8051.exe differ diff --git a/c8051/libapack_cpp64.dll b/c8051/libapack_cpp64.dll new file mode 100644 index 0000000..5fd7e3b Binary files /dev/null and b/c8051/libapack_cpp64.dll differ diff --git a/c8051/libgcc_s_seh-1.dll b/c8051/libgcc_s_seh-1.dll new file mode 100644 index 0000000..822988f Binary files /dev/null and b/c8051/libgcc_s_seh-1.dll differ diff --git a/c8051/libstdc++-6.dll b/c8051/libstdc++-6.dll new file mode 100644 index 0000000..bd3737c Binary files /dev/null and b/c8051/libstdc++-6.dll differ diff --git a/c8051/libwinpthread-1.dll b/c8051/libwinpthread-1.dll new file mode 100644 index 0000000..cadc79b Binary files /dev/null and b/c8051/libwinpthread-1.dll differ diff --git a/c8051/python27.dll b/c8051/python27.dll new file mode 100644 index 0000000..703bb7b Binary files /dev/null and b/c8051/python27.dll differ diff --git a/c8051/segger_support.dll b/c8051/segger_support.dll new file mode 100644 index 0000000..f18c7d8 Binary files /dev/null and b/c8051/segger_support.dll differ diff --git a/c8051/siagent.dll b/c8051/siagent.dll new file mode 100644 index 0000000..59936ac Binary files /dev/null and b/c8051/siagent.dll differ diff --git a/c8051/siagentc8051.exe b/c8051/siagentc8051.exe new file mode 100644 index 0000000..7cbe8cd Binary files /dev/null and b/c8051/siagentc8051.exe differ diff --git a/c8051/siagentc8051_log_28952.txt b/c8051/siagentc8051_log_28952.txt new file mode 100644 index 0000000..2e9793c --- /dev/null +++ b/c8051/siagentc8051_log_28952.txt @@ -0,0 +1,10 @@ +TCF 07:09:23.561: Cleaning up old log files. Create '.keeplogs' file to disable(C:\Yandex\__WORK__\Entering_AR_150\bootloader_hex\c8051\.keeplogs) +TCF 07:09:23.562: found 1 log files. keeping 20 +TCF 07:09:23.562: Launched as: C:\Yandex\__WORK__\Entering_AR_150\bootloader_hex\c8051\siagentc8051.exe +TCF 07:09:23.562: Plugin path: + C:\Yandex\__WORK__\Entering_AR_150\bootloader_hex\c8051\plugins +TCF 07:09:23.562: Adding C:\Yandex\__WORK__\Entering_AR_150\bootloader_hex\c8051\plugins to the DLL search path +TCF 07:09:23.562: Scanning plugins in C:\Yandex\__WORK__\Entering_AR_150\bootloader_hex\c8051\plugins... +TCF 07:09:23.563: DeviceScriptingService::DeviceScriptingService +TCF 07:10:03.717: signal_handler handling signo 2 + diff --git a/c8051/siagentc8051_log_35148.txt b/c8051/siagentc8051_log_35148.txt new file mode 100644 index 0000000..4c1a8ad --- /dev/null +++ b/c8051/siagentc8051_log_35148.txt @@ -0,0 +1,10 @@ +TCF 07:24:03.721: Cleaning up old log files. Create '.keeplogs' file to disable(C:\Yandex\__WORK__\Entering_AR_150\c8051\.keeplogs) +TCF 07:24:03.723: found 2 log files. keeping 20 +TCF 07:24:03.725: Launched as: C:\Yandex\__WORK__\Entering_AR_150\c8051\siagentc8051.exe +TCF 07:24:03.726: Plugin path: + C:\Yandex\__WORK__\Entering_AR_150\c8051\plugins +TCF 07:24:03.726: Adding C:\Yandex\__WORK__\Entering_AR_150\c8051\plugins to the DLL search path +TCF 07:24:03.726: Scanning plugins in C:\Yandex\__WORK__\Entering_AR_150\c8051\plugins... +TCF 07:24:03.726: DeviceScriptingService::DeviceScriptingService +TCF 07:24:14.001: signal_handler handling signo 2 + diff --git a/c8051/slab8051.dll b/c8051/slab8051.dll new file mode 100644 index 0000000..51d571a Binary files /dev/null and b/c8051/slab8051.dll differ diff --git a/c8051/slabhiddevice.dll b/c8051/slabhiddevice.dll new file mode 100644 index 0000000..5ad2a84 Binary files /dev/null and b/c8051/slabhiddevice.dll differ