From ba9ed5940189977efc7997f6d2354e3e7ee4aa38 Mon Sep 17 00:00:00 2001 From: rusefi Date: Thu, 28 Mar 2019 07:38:15 -0400 Subject: [PATCH] Firmware Update via UART and/or USB #398 bootloader into jenkins --- firmware/bootloader/!clean_bootloader.bat | 1 + firmware/bootloader/!compile_bootloader.bat | 13 ++++++++----- firmware/bootloader/!compile_bootloader_405.bat | 2 +- firmware/bootloader/!compile_bootloader_469.bat | 2 +- .../bootloader/!compile_bootloader_discovery407.bat | 2 +- firmware/bootloader/src/Makefile | 1 + .../build_current_bundle.bat | 8 ++++++++ 7 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 firmware/bootloader/!clean_bootloader.bat diff --git a/firmware/bootloader/!clean_bootloader.bat b/firmware/bootloader/!clean_bootloader.bat new file mode 100644 index 0000000000..8cfe7a579f --- /dev/null +++ b/firmware/bootloader/!clean_bootloader.bat @@ -0,0 +1 @@ +make -f src/Makefile clean \ No newline at end of file diff --git a/firmware/bootloader/!compile_bootloader.bat b/firmware/bootloader/!compile_bootloader.bat index f24f43bb9a..36110930df 100644 --- a/firmware/bootloader/!compile_bootloader.bat +++ b/firmware/bootloader/!compile_bootloader.bat @@ -1,19 +1,22 @@ @echo off rem Needed for board overrides -IF "%BOOTLOADER_CODE_PATH%"=="" (SET BOOTLOADER_CODE_PATH="..") +IF "%BOOTLOADER_CODE_DESTINATION_PATH%"=="" (SET BOOTLOADER_CODE_DESTINATION_PATH="..") -echo Starting compilation -make -f src/Makefile %1 %2 %3 +BOOTLOADER_CODE_DESTINATION_FILE=%BOOTLOADER_CODE_DESTINATION_PATH%/bootloader_generated.hxx +rm -f %BOOTLOADER_CODE_DESTINATION_FILE% + +echo Starting bootloader compilation... +make -j4 -f src/Makefile %1 %2 %3 if errorlevel 1 echo make compilation failed if errorlevel 1 exit -1 -echo Build complete success. +echo Bootloader build success. cd blbuild rem Generate a header file with binary bootloader code -java -jar ../../../java_tools/bin2header.jar bootloader.bin %BOOTLOADER_CODE_PATH%/bootloader_generated.hxx "static const volatile uint8_t bootloader_code[] BOOTLOADER_SECTION" +java -jar ../../../java_tools/bin2header.jar bootloader.bin %BOOTLOADER_CODE_DESTINATION_FILE% "static const volatile uint8_t bootloader_code[] BOOTLOADER_SECTION" cd .. rem Touch 'bootloader_storage.c' to update its modification date (needed for make) diff --git a/firmware/bootloader/!compile_bootloader_405.bat b/firmware/bootloader/!compile_bootloader_405.bat index 2ce9a9baf0..2bd95ae734 100644 --- a/firmware/bootloader/!compile_bootloader_405.bat +++ b/firmware/bootloader/!compile_bootloader_405.bat @@ -5,7 +5,7 @@ echo Starting compilation for Prometheus-405 set PROJECT_BOARD=Prometheus set PROMETHEUS_BOARD=405 set EXTRA_PARAMS=-DDUMMY -DSTM32F405xx -DEFI_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_CHECKS=FALSE -DCH_DBG_ENABLE_TRACE=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE -set BOOTLOADER_CODE_PATH="../Prometheus/469" +set BOOTLOADER_CODE_DESTINATION_PATH="../Prometheus/469" set DEBUG_LEVEL_OPT="-O2" call !compile_bootloader.bat -r diff --git a/firmware/bootloader/!compile_bootloader_469.bat b/firmware/bootloader/!compile_bootloader_469.bat index 09d7463c36..24f5cccab3 100644 --- a/firmware/bootloader/!compile_bootloader_469.bat +++ b/firmware/bootloader/!compile_bootloader_469.bat @@ -5,7 +5,7 @@ echo Starting compilation for Prometheus-469 set PROJECT_BOARD=Prometheus set PROMETHEUS_BOARD=469 set EXTRA_PARAMS=-DDUMMY -DSTM32F469xx -DEFI_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_CHECKS=FALSE -DCH_DBG_ENABLE_TRACE=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE -set BOOTLOADER_CODE_PATH="../Prometheus/469" +set BOOTLOADER_CODE_DESTINATION_PATH="../Prometheus/469" set DEBUG_LEVEL_OPT="-O2" call !compile_bootloader.bat -r diff --git a/firmware/bootloader/!compile_bootloader_discovery407.bat b/firmware/bootloader/!compile_bootloader_discovery407.bat index 1c95ad0cb3..f30b1c179f 100644 --- a/firmware/bootloader/!compile_bootloader_discovery407.bat +++ b/firmware/bootloader/!compile_bootloader_discovery407.bat @@ -5,7 +5,7 @@ echo Starting compilation for Discovery-407 rem set PROJECT_BOARD=Prometheus rem set PROMETHEUS_BOARD=405 rem set EXTRA_PARAMS=-DDUMMY -DSTM32F405xx -DEFI_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_CHECKS=FALSE -DCH_DBG_ENABLE_TRACE=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE -set BOOTLOADER_CODE_PATH="." +set BOOTLOADER_CODE_DESTINATION_PATH=".." rem set DEBUG_LEVEL_OPT="-O2" call !compile_bootloader.bat -r diff --git a/firmware/bootloader/src/Makefile b/firmware/bootloader/src/Makefile index 3bfa5b2e92..61e60c3071 100644 --- a/firmware/bootloader/src/Makefile +++ b/firmware/bootloader/src/Makefile @@ -184,6 +184,7 @@ CPPSRC = $(CHCPPSRC) \ $(PROJECT_DIR)/controllers/algo/engine_configuration.cpp \ $(PROJECT_DIR)/controllers/persistent_store.cpp \ $(PROJECT_DIR)/hw_layer/io_pins.cpp \ + $(PROJECT_DIR)/util/efilib.cpp \ $(PROJECT_DIR)/hw_layer/pin_repository.cpp \ src/rusefi_stubs.cpp \ src/dfu.cpp \ diff --git a/misc/jenkins/functional_test_and_build_bundle/build_current_bundle.bat b/misc/jenkins/functional_test_and_build_bundle/build_current_bundle.bat index 098d2be101..50ff1b33eb 100644 --- a/misc/jenkins/functional_test_and_build_bundle/build_current_bundle.bat +++ b/misc/jenkins/functional_test_and_build_bundle/build_current_bundle.bat @@ -10,6 +10,14 @@ echo build_current_bundle.bat: Hello rusEfi build full bundle echo %date% %time% +cd firmware/bootloader +call !clean_bootloader.bat +call !compile_bootloader_discovery407.bat +if not exist bootloader_generated.hxx echo FAILED TO COMPILE BOOTLOADER +if not exist bootloader_generated.hxx exit -1 +pwd +cd ../.. + cd firmware echo %date% %time%