diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml new file mode 100644 index 0000000..fd94bda --- /dev/null +++ b/.github/workflows/build_and_release.yml @@ -0,0 +1,63 @@ +name: Build and Create Release + +on: + push: + tags: + - 'v*.*' + workflow_dispatch: + +jobs: + generate: + name: Generate Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install ARM gcc Toolchain + uses: carlosperate/arm-none-eabi-gcc-action@v1 + + - name: Verify ARM gcc Version + run: arm-none-eabi-gcc --version + + - name: Make Release + run: make release + + # - name: List build directory contents + # run: ls -al + + # - name: Compress build artifacts + # run: zip -r output_build.zip ./build + + - name: Upload Build Artifact + uses: actions/upload-artifact@v4 + with: + name: build + path: ./release + + createrelease: + name: Create Release + runs-on: [ubuntu-latest] + needs: generate + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Get tag name + id: get_tag_name + run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Download Build Artifact + uses: actions/download-artifact@v4 + with: + name: build + path: ./release + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2.0.5 + with: + tag_name: ${{ env.tag_name }} + files: ./release/**/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 45d0cdb..6c20b88 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -1,33 +1,18 @@ { "configurations": [ { - "name": "STM32", + "name": "windows-gcc-x86", "includePath": [ - "Core/Inc", - "Drivers/CMSIS/Device/ST/STM32F4xx/Include", - "Drivers/CMSIS/Include", - "Drivers/STM32F4xx_HAL_Driver/Inc", - "Drivers/STM32F4xx_HAL_Driver/Inc/Legacy", - "Lib/SCan/SC22EVO/artifacts/HVCB/c_source", - "Lib/SCan/SC22EVO/artifacts/MCB/c_source", - "Lib/adc1283", - "Lib/stmlibs", - "Lib/stmlibs/circular_buffer", - "Lib/stmlibs/critical_section", - "Lib/stmlibs/error_utils", - "Lib/stmlibs/fsm", - "Lib/stmlibs/lock", - "Lib/stmlibs/logger", - "Lib/stmlibs/longcounter", - "Lib/stmlibs/pwm", - "Lib/stmlibs/timebase", - "Lib/stmlibs/timer_utils" + "${workspaceFolder}/**" ], "defines": [ "STM32F446xx", "USE_HAL_DRIVER" ], - "compilerPath": "/usr/bin/arm-none-eabi-gcc" + "compilerPath": "C:/MinGW/bin/gcc.exe", + "cStandard": "${default}", + "cppStandard": "${default}", + "intelliSenseMode": "windows-gcc-x86" } ], "version": 4 diff --git a/.vscode/settings.json b/.vscode/settings.json index 6c50ed5..1e07df5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,67 @@ { - "cortex-debug.armToolchainPath": "/usr/bin", - "cortex-debug.openocdPath": "/usr/bin/openocd", - "files.associations": { - "anal.h": "c", - "memory.h": "c", - "sd_sensing.h": "c", - "adc.h": "c" - } + "cortex-debug.armToolchainPath": "/usr/bin", + "cortex-debug.openocdPath": "/usr/bin/openocd", + "files.associations": { + "anal.h": "c", + "memory.h": "c", + "sd_sensing.h": "c", + "adc.h": "c" + }, + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "", + "C_Cpp_Runner.cppStandard": "", + "C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wcast-align", + "-Wconversion", + "-Wsign-conversion", + "-Wnull-dereference" + ], + "C_Cpp_Runner.msvcWarnings": [ + "/W4", + "/permissive-", + "/w14242", + "/w14287", + "/w14296", + "/w14311", + "/w14826", + "/w44062", + "/w44242", + "/w14905", + "/w14906", + "/w14263", + "/w44265", + "/w14928" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false, + "C_Cpp_Runner.useUndefinedSanitizer": false, + "C_Cpp_Runner.useLeakSanitizer": false, + "C_Cpp_Runner.showCompilationTime": false, + "C_Cpp_Runner.useLinkTimeOptimization": false, + "C_Cpp_Runner.msvcSecureNoWarnings": false } \ No newline at end of file diff --git a/Core/Src/can_utils.c b/Core/Src/can_utils.c index 8896ad9..b9a13f8 100644 --- a/Core/Src/can_utils.c +++ b/Core/Src/can_utils.c @@ -34,10 +34,12 @@ void can_init(void) { filter.FilterIdHigh = MCB_D_SPACE_PERIPHERALS_CTRL_FRAME_ID << 5; // to 2^11 - 1 filter.FilterMaskIdHigh = MCB_D_SPACE_PERIPHERALS_CTRL_FRAME_ID << 5; // Don't care on can id bits filter.FilterMaskIdLow = MCB_D_SPACE_PERIPHERALS_CTRL_FRAME_ID << 5; // Don't care on can id bits + /* HAL considers IdLow and IdHigh not as just the ID of the can message but as the combination of: STDID + RTR + IDE + 4 most significant bits of EXTID */ + filter.FilterFIFOAssignment = CAN_FILTER_FIFO0; filter.FilterBank = 1; filter.FilterScale = CAN_FILTERSCALE_16BIT; diff --git a/openblt_f446re/Drivers/CMSIS/Core/Template/ARMv8-M/main_s.c b/openblt_f446re/Drivers/CMSIS/Core/Template/ARMv8-M/main_s.c index 273607b..dd2b304 100644 --- a/openblt_f446re/Drivers/CMSIS/Core/Template/ARMv8-M/main_s.c +++ b/openblt_f446re/Drivers/CMSIS/Core/Template/ARMv8-M/main_s.c @@ -55,4 +55,5 @@ int main(void) { while (1) { __NOP(); } + } diff --git a/openblt_f446re/Drivers/CMSIS/Core/Template/ARMv8-M/tz_context.c b/openblt_f446re/Drivers/CMSIS/Core/Template/ARMv8-M/tz_context.c index e2e8294..b5f9e0a 100644 --- a/openblt_f446re/Drivers/CMSIS/Core/Template/ARMv8-M/tz_context.c +++ b/openblt_f446re/Drivers/CMSIS/Core/Template/ARMv8-M/tz_context.c @@ -4,6 +4,7 @@ * @version V1.1.1 * @date 10. January 2018 ******************************************************************************/ + /* * Copyright (c) 2016-2018 Arm Limited. All rights reserved. *