diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 0408f00d6..935f83deb 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -16,3 +16,5 @@ aa7bb070e259fb73fba4d8f4ea46abc24abbced9 # Rename marlin_client members 2933bc5568ce0a1fd05e9221c1d8629a5a157329 # xl: Rename Dwarf::set_led() to Dwarf::set_cheese_led() 87bb1927f87520ce063069a178291295183e1597 # Set ClangFormat AlignTrailingComments: Kind: Never bd27a08249dd1dc9919b547f4ca757258c779271 # Unify footer naming style with our dev guidelines +26025874ae0798b467aa5426dc46e02ef94d8e64 # Apply clang-format InsertBraces +95a5c28643f164c6cbc8bf4d7150aee42b571c89 # Partial reformat of hwio pins diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eed4f2f50..f0e931ec3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,44 +47,40 @@ repos: - id: mixed-line-ending exclude: | (?x)( - ^tests/unit/lang/translator/(keys|cs|es|fr|de|pl|it)\.txt$| - ^tests/unit/common/gcode/.*\.gcode$| - ^lib/printf| - ^lib/inih/| + ^lib/Catch2/| + ^lib/CrashCatcher/| + ^lib/Drivers/| + ^lib/ESP/prusa/src/serial-flasher/serial_comm.c| + ^lib/ESP/serial-flasher/| ^lib/Marlin/(?! Marlin/src(/gcode)?/feature/prusa/| Marlin/src(/gcode)?/feature/input_shaper/| Marlin/src(/gcode)?/feature/pressure_advance/| Marlin/src(/gcode)?/feature/precise_stepping/| + Marlin/src(/gcode)?/feature/phase_stepping/| Marlin/src/module/prusa/| Marlin/src/gcode/calibrate/M958.cpp )| - ^lib/Prusa-Error-Codes/| - ^lib/TMCStepper/| + ^lib/Middlewares/Third_Party/FatFs/| + ^lib/Middlewares/Third_Party/FreeRTOS/| ^lib/Middlewares/Third_Party/LwIP/| - ^lib/jsmn/| - ^lib/Drivers/| - ^lib/ESP/serial-flasher/| - ^lib/ESP/lwesp/| - ^lib/ESP/prusa/src/serial-flasher/serial_comm.c| - ^lib/ESP/prusa/include/sockets/lwesp_netbuf.h| - ^lib/ESP/prusa/include/sockets/lwesp_sockets.h| - ^lib/ESP/prusa/include/sockets/lwesp_sockets_priv.h| - ^lib/ESP/prusa/src/sockets/lwesp_netbuf.c| - ^lib/ESP/prusa/src/sockets/lwesp_sockets.c| - ^lib/Catch2/| - ^lib/libsysbase/| - ^lib/Segger| - ^lib/tinyusb| ^lib/Middlewares/Third_Party/littlefs/| - ^lib/Prusa-Firmware-MMU/| - ^lib/Middlewares/Third_Party/CycloneTCP/| ^lib/Middlewares/Third_Party/mbedtls/| - ^lib/liblightmodbus/| + ^lib/Prusa-Error-Codes/| + ^lib/Prusa-Firmware-MMU/| ^lib/QR/| - ^lib/LiquidCrystal_I2C/| - ^lib/CrashCatcher/| - ^lib/libbgcode/| + ^lib/Segger| + ^lib/TMCStepper/| ^lib/cpp-std-extensions/| - ^lib/heatshrink/ + ^lib/heatshrink/| + ^lib/inih/| + ^lib/jsmn/| + ^lib/libbgcode/| + ^lib/liblightmodbus/| + ^lib/libsysbase/| + ^lib/printf| + ^lib/tinyusb/| + ^tests/stubs/FreeRTOS| + ^tests/unit/common/gcode/.*\.gcode$| + ^tests/unit/lang/translator/(keys|cs|es|fr|de|pl|it)\.txt$ ) diff --git a/.vscode/launch.json b/.vscode/launch.json index 2005f077a..3cc97e042 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,15 +8,26 @@ "request": "launch", "type": "cortex-debug", "servertype": "openocd", - "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-10.3.1/bin", - "openOCDPreConfigLaunchCommands": ["set bbf_over_debugger_path ./build-vscode-buddy/firmware.bbf"], - "configFiles": ["${workspaceRoot}/utils/debug/00_common.cfg", "${workspaceRoot}/utils/debug/10_custom_config.cfg", "${workspaceRoot}/utils/debug/20_board_buddy.cfg", "${workspaceRoot}/utils/debug/30_rtt_workaround.cfg"], + "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-13.2.1/bin", + "openOCDPreConfigLaunchCommands": [ + "set bbf_over_debugger_path ./build-vscode-buddy/firmware.bbf" + ], + "configFiles": [ + "${workspaceRoot}/utils/debug/00_common.cfg", + "${workspaceRoot}/utils/debug/10_custom_config.cfg", + "${workspaceRoot}/utils/debug/20_board_buddy.cfg", + "${workspaceRoot}/utils/debug/30_rtt_workaround.cfg" + ], "toolchainPrefix": "arm-none-eabi", "device": "STM32F427ZI", - "svdFile": "${workspaceRoot}/.dependencies/cmsis-svd-0.4.9999/data/STMicro/STM32F427.svd", + // swd file is disabled, it is known to cause issues in some cases. Enable it if you need to see register view. + //"svdFile": "${workspaceRoot}/.dependencies/cmsis-svd-0.4.9999/STM32F427.svd", "rtos": "FreeRTOS", "breakAfterReset": false, "preLaunchTask": "Backup current ELF", + "liveWatch": { + "enabled": true, + }, "rttConfig": { "enabled": true, "address": "auto", @@ -41,13 +52,24 @@ "request": "attach", "type": "cortex-debug", "servertype": "openocd", - "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-10.3.1/bin", - "openOCDPreConfigLaunchCommands": ["set bbf_over_debugger_path ./build-vscode-buddy/firmware.bbf"], - "configFiles": ["${workspaceRoot}/utils/debug/00_common.cfg", "${workspaceRoot}/utils/debug/10_custom_config.cfg", "${workspaceRoot}/utils/debug/20_board_buddy.cfg", "${workspaceRoot}/utils/debug/30_rtt_workaround.cfg"], + "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-13.2.1/bin", + "openOCDPreConfigLaunchCommands": [ + "set bbf_over_debugger_path ./build-vscode-buddy/firmware.bbf" + ], + "configFiles": [ + "${workspaceRoot}/utils/debug/00_common.cfg", + "${workspaceRoot}/utils/debug/10_custom_config.cfg", + "${workspaceRoot}/utils/debug/20_board_buddy.cfg", + "${workspaceRoot}/utils/debug/30_rtt_workaround.cfg" + ], "toolchainPrefix": "arm-none-eabi", "device": "STM32F427ZI", - "svdFile": "${workspaceRoot}/.dependencies/cmsis-svd-0.4.9999/data/STMicro/STM32F427.svd", + // swd file is disabled, it is known to cause issues in some cases. Enable it if you need to see register view. + //"svdFile": "${workspaceRoot}/.dependencies/cmsis-svd-0.4.9999/STM32F427.svd", "rtos": "FreeRTOS", + "liveWatch": { + "enabled": true, + }, "rttConfig": { "enabled": true, "address": "auto", @@ -72,12 +94,19 @@ "request": "launch", "type": "cortex-debug", "servertype": "openocd", - "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-10.3.1/bin", - "openOCDPreConfigLaunchCommands": ["set PUPPY_TYPE dwarf"], - "configFiles": ["${workspaceRoot}/utils/debug/00_common.cfg", "${workspaceRoot}/utils/debug/10_custom_config.cfg", "${workspaceRoot}/utils/debug/20_board_puppy.cfg", "${workspaceRoot}/utils/debug/30_rtt_workaround.cfg"], + "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-13.2.1/bin", + "openOCDPreConfigLaunchCommands": [ + "set PUPPY_TYPE dwarf" + ], + "configFiles": [ + "${workspaceRoot}/utils/debug/00_common.cfg", + "${workspaceRoot}/utils/debug/10_custom_config.cfg", + "${workspaceRoot}/utils/debug/20_board_puppy.cfg", + "${workspaceRoot}/utils/debug/30_rtt_workaround.cfg" + ], "toolchainPrefix": "arm-none-eabi", "device": "STM32G07", - "svdFile": "${workspaceRoot}/.dependencies/cmsis-svd-0.4.9999/data/STMicro/STM32G07x.svd", + "svdFile": "${workspaceRoot}/.dependencies/cmsis-svd-0.4.9999/STM32G07x.svd", "rtos": "FreeRTOS", "presentation": { "group": "XL Puppies", @@ -107,12 +136,19 @@ "request": "attach", "type": "cortex-debug", "servertype": "openocd", - "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-10.3.1/bin", - "openOCDPreConfigLaunchCommands": ["set PUPPY_TYPE dwarf"], - "configFiles": ["${workspaceRoot}/utils/debug/00_common.cfg", "${workspaceRoot}/utils/debug/10_custom_config.cfg", "${workspaceRoot}/utils/debug/20_board_puppy.cfg", "${workspaceRoot}/utils/debug/30_rtt_workaround.cfg"], + "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-13.2.1/bin", + "openOCDPreConfigLaunchCommands": [ + "set PUPPY_TYPE dwarf" + ], + "configFiles": [ + "${workspaceRoot}/utils/debug/00_common.cfg", + "${workspaceRoot}/utils/debug/10_custom_config.cfg", + "${workspaceRoot}/utils/debug/20_board_puppy.cfg", + "${workspaceRoot}/utils/debug/30_rtt_workaround.cfg" + ], "toolchainPrefix": "arm-none-eabi", "device": "STM32G07", - "svdFile": "${workspaceRoot}/.dependencies/cmsis-svd-0.4.9999/data/STMicro/STM32G07x.svd", + "svdFile": "${workspaceRoot}/.dependencies/cmsis-svd-0.4.9999/STM32G07x.svd", "rtos": "FreeRTOS", "rttConfig": { "enabled": true, @@ -138,12 +174,19 @@ "request": "launch", "type": "cortex-debug", "servertype": "openocd", - "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-10.3.1/bin", - "openOCDPreConfigLaunchCommands": ["set PUPPY_TYPE modularbed"], - "configFiles": ["${workspaceRoot}/utils/debug/00_common.cfg", "${workspaceRoot}/utils/debug/10_custom_config.cfg", "${workspaceRoot}/utils/debug/20_board_puppy.cfg", "${workspaceRoot}/utils/debug/30_rtt_workaround.cfg"], + "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-13.2.1/bin", + "openOCDPreConfigLaunchCommands": [ + "set PUPPY_TYPE modularbed" + ], + "configFiles": [ + "${workspaceRoot}/utils/debug/00_common.cfg", + "${workspaceRoot}/utils/debug/10_custom_config.cfg", + "${workspaceRoot}/utils/debug/20_board_puppy.cfg", + "${workspaceRoot}/utils/debug/30_rtt_workaround.cfg" + ], "toolchainPrefix": "arm-none-eabi", "device": "STM32G07", - "svdFile": "${workspaceRoot}/.dependencies/cmsis-svd-0.4.9999/data/STMicro/STM32G07x.svd", + "svdFile": "${workspaceRoot}/.dependencies/cmsis-svd-0.4.9999/STM32G07x.svd", "rtos": "FreeRTOS", "presentation": { "group": "XL Puppies", @@ -157,12 +200,19 @@ "request": "attach", "type": "cortex-debug", "servertype": "openocd", - "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-10.3.1/bin", - "openOCDPreConfigLaunchCommands": ["set PUPPY_TYPE modularbed"], - "configFiles": ["${workspaceRoot}/utils/debug/00_common.cfg", "${workspaceRoot}/utils/debug/10_custom_config.cfg", "${workspaceRoot}/utils/debug/20_board_puppy.cfg", "${workspaceRoot}/utils/debug/30_rtt_workaround.cfg"], + "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-13.2.1/bin", + "openOCDPreConfigLaunchCommands": [ + "set PUPPY_TYPE modularbed" + ], + "configFiles": [ + "${workspaceRoot}/utils/debug/00_common.cfg", + "${workspaceRoot}/utils/debug/10_custom_config.cfg", + "${workspaceRoot}/utils/debug/20_board_puppy.cfg", + "${workspaceRoot}/utils/debug/30_rtt_workaround.cfg" + ], "toolchainPrefix": "arm-none-eabi", "device": "STM32G07", - "svdFile": "${workspaceRoot}/.dependencies/cmsis-svd-0.4.9999/data/STMicro/STM32G07x.svd", + "svdFile": "${workspaceRoot}/.dependencies/cmsis-svd-0.4.9999/STM32G07x.svd", "rtos": "FreeRTOS", }, { @@ -173,7 +223,7 @@ "windows": { "serverpath": "${workspaceRoot}/.venv/Scripts/simulator_as_qemu" }, - "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-10.3.1/bin", + "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-13.2.1/bin", "cwd": "${workspaceFolder}", "executable": "${workspaceRoot}/build-vscode-buddy/firmware", "request": "launch", @@ -186,11 +236,13 @@ "type": "cortex-debug", "servertype": "qemu", "serverpath": "${workspaceRoot}/.venv/bin/simulator_as_qemu", - "serverArgs": ["--scripted"], + "serverArgs": [ + "--scripted" + ], "windows": { "serverpath": "${workspaceRoot}/.venv/Scripts/simulator_as_qemu" }, - "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-10.3.1/bin", + "armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-13.2.1/bin", "cwd": "${workspaceFolder}", "executable": "${workspaceRoot}/build-vscode-buddy/firmware", "request": "launch", @@ -203,7 +255,7 @@ "target": ":1234", "remote": true, "cwd": "${workspaceRoot}", - "gdbpath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-10.3.1/bin/arm-none-eabi-gdb", + "gdbpath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-13.2.1/bin/arm-none-eabi-gdb", "autorun": [] }, { @@ -219,7 +271,11 @@ "compounds": [ { "name": "XL - ALL", - "configurations": ["Launch Buddy","Launch Dwarf", "Launch ModularBed"], + "configurations": [ + "Launch Buddy", + "Launch Dwarf", + "Launch ModularBed" + ], "presentation": { "group": "XL Puppies", }, diff --git a/.vscode/settings.json b/.vscode/settings.json index d7e97c00f..e09d7015d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "cmake.configureOnOpen": true, "cmake.copyCompileCommands": "${workspaceFolder}/compile_commands.json", - "cmake.cmakePath": "${workspaceFolder}/.dependencies/cmake-3.22.5/bin/cmake", + "cmake.cmakePath": "${workspaceFolder}/.dependencies/cmake-3.28.3/bin/cmake", "cmake.generator": "Ninja", "files.insertFinalNewline": true, "files.associations": { diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ffd92edc..94cfcc555 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ include(ExternalProject) include(cmake/Utilities.cmake) include(cmake/GetGitRevisionDescription.cmake) include(cmake/ProjectVersion.cmake) +include(cmake/CheckRemotes.cmake) include(cmake/Littlefs.cmake) include(cmake/Options.cmake) @@ -12,6 +13,9 @@ project( VERSION ${PROJECT_VERSION} ) +# Sets Python3_FIND_STRATEGY to "LOCATION" +cmake_policy(SET CMP0094 NEW) + # Enable initialization of subprojects without their submodules cmake_policy(SET CMP0097 NEW) @@ -112,7 +116,7 @@ elseif(MCU MATCHES "STM32F4") target_link_libraries(BuddyHeaders INTERFACE STM32F4::HAL) endif() -if(BOARD MATCHES "BUDDY") +if(BOARD_IS_MASTER_BOARD) target_include_directories(BuddyHeaders INTERFACE include/buddy) elseif(BOARD MATCHES "DWARF") target_include_directories(BuddyHeaders INTERFACE include/dwarf) @@ -139,7 +143,7 @@ elseif(PRINTER STREQUAL "MK3.5") set(PRINTER_TYPE "1") set(PRINTER_VERSION "3") set(PRINTER_SUBVERSION "5") - set(PRINTER_CODE "20") + set(PRINTER_CODE "23") elseif(PRINTER STREQUAL "MINI") set(PRINTER_TYPE "2") set(PRINTER_CODE "12") @@ -149,6 +153,9 @@ elseif(PRINTER STREQUAL "XL") elseif(PRINTER STREQUAL "iX") set(PRINTER_TYPE "4") set(PRINTER_CODE "16") +elseif(PRINTER STREQUAL "XL_DEV_KIT") + set(PRINTER_TYPE "5") + set(PRINTER_CODE "18") else() message(FATAL_ERROR "Unknown printer \"${PRINTER}\".") endif() @@ -161,7 +168,7 @@ endif() if(BOARD STREQUAL "BUDDY" OR BOARD STREQUAL "XBUDDY") set(MARLIN_BOARD_NUM 1823) -elseif(BOARD STREQUAL "XLBUDDY") +elseif(BOARD STREQUAL "XLBUDDY" OR BOARD STREQUAL "XL_DEV_KIT_XLB") set(MARLIN_BOARD_NUM 1824) elseif(BOARD MATCHES "DWARF") set(MARLIN_BOARD_NUM 1825) @@ -296,9 +303,6 @@ target_link_libraries(tinyusb_dependencies INTERFACE FreeRTOS::FreeRTOS) # Global Compiler & Linker Configuration # -# Thread safe newlib -add_compile_options(-DconfigUSE_NEWLIB_REENTRANT=1) - # include symbols add_compile_options(-g) @@ -353,6 +357,9 @@ if(CMAKE_CROSSCOMPILING) # wrap _dtoa to ensure formatting of floats isn't being called from ISR add_link_options(-Wl,--wrap=_dtoa_r) + + # disable warnings about RWX sections due to CrashCatcher's "safe" page + add_link_options(-Wl,--no-warn-rwx-segments) endif() # support _DEBUG macro (some code uses to recognize debug builds) @@ -480,11 +487,13 @@ target_compile_options( firmware PRIVATE $<$:-Wextra> $<$:-Wno-expansion-to-defined> + $<$:-Wno-format-zero-length> $<$:-Wnon-virtual-dtor> $<$:-Wduplicated-cond> $<$:-Wlogical-op> $<$:-Wnull-dereference> $<$:-Wshadow=compatible-local> + $<$:-Wvla> -Wdouble-promotion ) @@ -521,11 +530,9 @@ objcopy(firmware "binary" ".bin") target_link_options(firmware PUBLIC -Wl,-Map=firmware.map,--print-memory-usage) # link time optimizations -if(CMAKE_BUILD_TYPE STREQUAL "Release") - if(MCU MATCHES "STM32F40") - set_target_properties(firmware PROPERTIES INTERPROCEDURAL_OPTIMIZATION True) - endif() -endif() # "Release" +if(NOT DEVELOPER_MODE) + set_target_properties(firmware PROPERTIES INTERPROCEDURAL_OPTIMIZATION True) +endif() # inform about the firmware's size in terminal report_size(firmware) @@ -651,7 +658,6 @@ if(BOARD MATCHES "BUDDY") Marlin Arduino::Core Arduino::TMCStepper - Arduino::LiquidCrystal LwIP FatFs flasher @@ -677,9 +683,32 @@ if(BOARD MATCHES "BUDDY") heatshrink_decoder ) elseif(BOARD STREQUAL "DWARF") - target_link_libraries(firmware PRIVATE BuddyHeaders Marlin Arduino::Core Arduino::TMCStepper) + target_link_libraries( + firmware PRIVATE BuddyHeaders Marlin Arduino::Core Arduino::TMCStepper error_codes + ) elseif(BOARD STREQUAL "MODULARBED") - target_link_libraries(firmware PRIVATE BuddyHeaders) + target_link_libraries(firmware PRIVATE BuddyHeaders error_codes) +elseif(BOARD STREQUAL "XL_DEV_KIT_XLB") + target_link_libraries( + firmware + PRIVATE BuddyHeaders + Marlin + Arduino::Core + Arduino::TMCStepper + inih::inih + CppStdExtensions + printf::printf + sysbase + Segger + $<$:MMU2::MMU2> + mbedTLS + $<$:lightmodbus> + error_codes + error_codes_mmu # TODO once MMU is not necessary for the build, replace with: + # $<$:error_codes_mmu> + bgcode_core # todo: remove + heatshrink_decoder # todo: remove + ) endif() set_property( diff --git a/CMakePresets.json b/CMakePresets.json index 9a8db8aee..ed160428f 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -2467,7 +2467,7 @@ } }, { - "name": "iX-xBuddy027c-200step_debug_boot", + "name": "ix_debug_boot", "generator": "Ninja", "binaryDir": "build-vscode-buddy", "cacheVariables": { @@ -2530,7 +2530,7 @@ } }, { - "name": "iX-xBuddy027c-200step_debug_noboot", + "name": "ix_debug_noboot", "generator": "Ninja", "binaryDir": "build-vscode-buddy", "cacheVariables": { @@ -2593,7 +2593,7 @@ } }, { - "name": "iX-xBuddy027c-200step_release_boot", + "name": "ix_release_boot", "generator": "Ninja", "binaryDir": "build-vscode-buddy", "cacheVariables": { @@ -2656,7 +2656,7 @@ } }, { - "name": "iX-xBuddy027c-200step_release_noboot", + "name": "ix_release_noboot", "generator": "Ninja", "binaryDir": "build-vscode-buddy", "cacheVariables": { @@ -3018,6 +3018,322 @@ } } }, + { + "name": "xl-burst_debug_boot", + "generator": "Ninja", + "binaryDir": "build-vscode-buddy", + "cacheVariables": { + "CMAKE_MAKE_PROGRAM": { + "type": "FILEPATH", + "value": "${sourceDir}/.dependencies/ninja-1.10.2/ninja" + }, + "CMAKE_EXPORT_COMPILE_COMMANDS": { + "type": "STRING", + "value": "ON" + }, + "PRINTER": { + "type": "STRING", + "value": "XL" + }, + "BOARD": { + "type": "STRING", + "value": "" + }, + "BOARD_VERSION": { + "type": "STRING", + "value": "0.9.0" + }, + "DWARF_BINARY_DIR": { + "type": "FILEPATH", + "value": "${sourceDir}/build-vscode-dwarf" + }, + "MODULARBED_BINARY_DIR": { + "type": "FILEPATH", + "value": "${sourceDir}/build-vscode-modularbed" + }, + "PRESET_COMPILE_OPTIONS": { + "type": "STRING", + "value": "" + }, + "ENABLE_BURST": { + "type": "BOOL", + "value": "YES" + }, + "IS_KNOBLET": { + "type": "STRING", + "value": "FALSE" + }, + "BOOTLOADER": { + "type": "STRING", + "value": "YES" + }, + "GENERATE_BBF": { + "type": "BOOL", + "value": "TRUE" + }, + "GENERATE_DFU": { + "type": "BOOL", + "value": "OFF" + }, + "SIGNING_KEY": { + "type": "FILEPATH", + "value": "" + }, + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "${sourceDir}/cmake/GccArmNoneEabi.cmake" + }, + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Debug" + }, + "PROJECT_VERSION_SUFFIX": { + "type": "STRING", + "value": "" + }, + "PROJECT_VERSION_SUFFIX_SHORT": { + "type": "STRING", + "value": "" + } + } + }, + { + "name": "xl-burst_debug_noboot", + "generator": "Ninja", + "binaryDir": "build-vscode-buddy", + "cacheVariables": { + "CMAKE_MAKE_PROGRAM": { + "type": "FILEPATH", + "value": "${sourceDir}/.dependencies/ninja-1.10.2/ninja" + }, + "CMAKE_EXPORT_COMPILE_COMMANDS": { + "type": "STRING", + "value": "ON" + }, + "PRINTER": { + "type": "STRING", + "value": "XL" + }, + "BOARD": { + "type": "STRING", + "value": "" + }, + "BOARD_VERSION": { + "type": "STRING", + "value": "0.9.0" + }, + "DWARF_BINARY_DIR": { + "type": "FILEPATH", + "value": "${sourceDir}/build-vscode-dwarf" + }, + "MODULARBED_BINARY_DIR": { + "type": "FILEPATH", + "value": "${sourceDir}/build-vscode-modularbed" + }, + "PRESET_COMPILE_OPTIONS": { + "type": "STRING", + "value": "" + }, + "ENABLE_BURST": { + "type": "BOOL", + "value": "YES" + }, + "IS_KNOBLET": { + "type": "STRING", + "value": "FALSE" + }, + "BOOTLOADER": { + "type": "STRING", + "value": "NO" + }, + "GENERATE_BBF": { + "type": "BOOL", + "value": "FALSE" + }, + "GENERATE_DFU": { + "type": "BOOL", + "value": "OFF" + }, + "SIGNING_KEY": { + "type": "FILEPATH", + "value": "" + }, + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "${sourceDir}/cmake/GccArmNoneEabi.cmake" + }, + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Debug" + }, + "PROJECT_VERSION_SUFFIX": { + "type": "STRING", + "value": "" + }, + "PROJECT_VERSION_SUFFIX_SHORT": { + "type": "STRING", + "value": "" + } + } + }, + { + "name": "xl-burst_release_boot", + "generator": "Ninja", + "binaryDir": "build-vscode-buddy", + "cacheVariables": { + "CMAKE_MAKE_PROGRAM": { + "type": "FILEPATH", + "value": "${sourceDir}/.dependencies/ninja-1.10.2/ninja" + }, + "CMAKE_EXPORT_COMPILE_COMMANDS": { + "type": "STRING", + "value": "ON" + }, + "PRINTER": { + "type": "STRING", + "value": "XL" + }, + "BOARD": { + "type": "STRING", + "value": "" + }, + "BOARD_VERSION": { + "type": "STRING", + "value": "0.9.0" + }, + "DWARF_BINARY_DIR": { + "type": "FILEPATH", + "value": "${sourceDir}/build-vscode-dwarf" + }, + "MODULARBED_BINARY_DIR": { + "type": "FILEPATH", + "value": "${sourceDir}/build-vscode-modularbed" + }, + "PRESET_COMPILE_OPTIONS": { + "type": "STRING", + "value": "" + }, + "ENABLE_BURST": { + "type": "BOOL", + "value": "YES" + }, + "IS_KNOBLET": { + "type": "STRING", + "value": "FALSE" + }, + "BOOTLOADER": { + "type": "STRING", + "value": "YES" + }, + "GENERATE_BBF": { + "type": "BOOL", + "value": "TRUE" + }, + "GENERATE_DFU": { + "type": "BOOL", + "value": "OFF" + }, + "SIGNING_KEY": { + "type": "FILEPATH", + "value": "" + }, + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "${sourceDir}/cmake/GccArmNoneEabi.cmake" + }, + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Release" + }, + "PROJECT_VERSION_SUFFIX": { + "type": "STRING", + "value": "" + }, + "PROJECT_VERSION_SUFFIX_SHORT": { + "type": "STRING", + "value": "" + } + } + }, + { + "name": "xl-burst_release_noboot", + "generator": "Ninja", + "binaryDir": "build-vscode-buddy", + "cacheVariables": { + "CMAKE_MAKE_PROGRAM": { + "type": "FILEPATH", + "value": "${sourceDir}/.dependencies/ninja-1.10.2/ninja" + }, + "CMAKE_EXPORT_COMPILE_COMMANDS": { + "type": "STRING", + "value": "ON" + }, + "PRINTER": { + "type": "STRING", + "value": "XL" + }, + "BOARD": { + "type": "STRING", + "value": "" + }, + "BOARD_VERSION": { + "type": "STRING", + "value": "0.9.0" + }, + "DWARF_BINARY_DIR": { + "type": "FILEPATH", + "value": "${sourceDir}/build-vscode-dwarf" + }, + "MODULARBED_BINARY_DIR": { + "type": "FILEPATH", + "value": "${sourceDir}/build-vscode-modularbed" + }, + "PRESET_COMPILE_OPTIONS": { + "type": "STRING", + "value": "" + }, + "ENABLE_BURST": { + "type": "BOOL", + "value": "YES" + }, + "IS_KNOBLET": { + "type": "STRING", + "value": "FALSE" + }, + "BOOTLOADER": { + "type": "STRING", + "value": "NO" + }, + "GENERATE_BBF": { + "type": "BOOL", + "value": "FALSE" + }, + "GENERATE_DFU": { + "type": "BOOL", + "value": "OFF" + }, + "SIGNING_KEY": { + "type": "FILEPATH", + "value": "" + }, + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "${sourceDir}/cmake/GccArmNoneEabi.cmake" + }, + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Release" + }, + "PROJECT_VERSION_SUFFIX": { + "type": "STRING", + "value": "" + }, + "PROJECT_VERSION_SUFFIX_SHORT": { + "type": "STRING", + "value": "" + } + } + }, { "name": "xl-knoblet_debug_boot", "generator": "Ninja", @@ -3618,6 +3934,258 @@ } } }, + { + "name": "xl_dev_kit_debug_boot", + "generator": "Ninja", + "binaryDir": "build-vscode-buddy", + "cacheVariables": { + "CMAKE_MAKE_PROGRAM": { + "type": "FILEPATH", + "value": "${sourceDir}/.dependencies/ninja-1.10.2/ninja" + }, + "CMAKE_EXPORT_COMPILE_COMMANDS": { + "type": "STRING", + "value": "ON" + }, + "PRINTER": { + "type": "STRING", + "value": "XL_DEV_KIT" + }, + "BOARD": { + "type": "STRING", + "value": "XL_DEV_KIT_XLB" + }, + "PRESET_COMPILE_OPTIONS": { + "type": "STRING", + "value": "" + }, + "DEVELOPMENT_ITEMS_ENABLED": { + "type": "BOOL", + "value": "YES" + }, + "BOOTLOADER": { + "type": "STRING", + "value": "YES" + }, + "GENERATE_BBF": { + "type": "BOOL", + "value": "TRUE" + }, + "GENERATE_DFU": { + "type": "BOOL", + "value": "OFF" + }, + "SIGNING_KEY": { + "type": "FILEPATH", + "value": "" + }, + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "${sourceDir}/cmake/GccArmNoneEabi.cmake" + }, + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Debug" + }, + "PROJECT_VERSION_SUFFIX": { + "type": "STRING", + "value": "" + }, + "PROJECT_VERSION_SUFFIX_SHORT": { + "type": "STRING", + "value": "" + } + } + }, + { + "name": "xl_dev_kit_debug_noboot", + "generator": "Ninja", + "binaryDir": "build-vscode-buddy", + "cacheVariables": { + "CMAKE_MAKE_PROGRAM": { + "type": "FILEPATH", + "value": "${sourceDir}/.dependencies/ninja-1.10.2/ninja" + }, + "CMAKE_EXPORT_COMPILE_COMMANDS": { + "type": "STRING", + "value": "ON" + }, + "PRINTER": { + "type": "STRING", + "value": "XL_DEV_KIT" + }, + "BOARD": { + "type": "STRING", + "value": "XL_DEV_KIT_XLB" + }, + "PRESET_COMPILE_OPTIONS": { + "type": "STRING", + "value": "" + }, + "DEVELOPMENT_ITEMS_ENABLED": { + "type": "BOOL", + "value": "YES" + }, + "BOOTLOADER": { + "type": "STRING", + "value": "NO" + }, + "GENERATE_BBF": { + "type": "BOOL", + "value": "FALSE" + }, + "GENERATE_DFU": { + "type": "BOOL", + "value": "OFF" + }, + "SIGNING_KEY": { + "type": "FILEPATH", + "value": "" + }, + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "${sourceDir}/cmake/GccArmNoneEabi.cmake" + }, + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Debug" + }, + "PROJECT_VERSION_SUFFIX": { + "type": "STRING", + "value": "" + }, + "PROJECT_VERSION_SUFFIX_SHORT": { + "type": "STRING", + "value": "" + } + } + }, + { + "name": "xl_dev_kit_release_boot", + "generator": "Ninja", + "binaryDir": "build-vscode-buddy", + "cacheVariables": { + "CMAKE_MAKE_PROGRAM": { + "type": "FILEPATH", + "value": "${sourceDir}/.dependencies/ninja-1.10.2/ninja" + }, + "CMAKE_EXPORT_COMPILE_COMMANDS": { + "type": "STRING", + "value": "ON" + }, + "PRINTER": { + "type": "STRING", + "value": "XL_DEV_KIT" + }, + "BOARD": { + "type": "STRING", + "value": "XL_DEV_KIT_XLB" + }, + "PRESET_COMPILE_OPTIONS": { + "type": "STRING", + "value": "" + }, + "DEVELOPMENT_ITEMS_ENABLED": { + "type": "BOOL", + "value": "YES" + }, + "BOOTLOADER": { + "type": "STRING", + "value": "YES" + }, + "GENERATE_BBF": { + "type": "BOOL", + "value": "TRUE" + }, + "GENERATE_DFU": { + "type": "BOOL", + "value": "OFF" + }, + "SIGNING_KEY": { + "type": "FILEPATH", + "value": "" + }, + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "${sourceDir}/cmake/GccArmNoneEabi.cmake" + }, + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Release" + }, + "PROJECT_VERSION_SUFFIX": { + "type": "STRING", + "value": "" + }, + "PROJECT_VERSION_SUFFIX_SHORT": { + "type": "STRING", + "value": "" + } + } + }, + { + "name": "xl_dev_kit_release_noboot", + "generator": "Ninja", + "binaryDir": "build-vscode-buddy", + "cacheVariables": { + "CMAKE_MAKE_PROGRAM": { + "type": "FILEPATH", + "value": "${sourceDir}/.dependencies/ninja-1.10.2/ninja" + }, + "CMAKE_EXPORT_COMPILE_COMMANDS": { + "type": "STRING", + "value": "ON" + }, + "PRINTER": { + "type": "STRING", + "value": "XL_DEV_KIT" + }, + "BOARD": { + "type": "STRING", + "value": "XL_DEV_KIT_XLB" + }, + "PRESET_COMPILE_OPTIONS": { + "type": "STRING", + "value": "" + }, + "DEVELOPMENT_ITEMS_ENABLED": { + "type": "BOOL", + "value": "YES" + }, + "BOOTLOADER": { + "type": "STRING", + "value": "NO" + }, + "GENERATE_BBF": { + "type": "BOOL", + "value": "FALSE" + }, + "GENERATE_DFU": { + "type": "BOOL", + "value": "OFF" + }, + "SIGNING_KEY": { + "type": "FILEPATH", + "value": "" + }, + "CMAKE_TOOLCHAIN_FILE": { + "type": "FILEPATH", + "value": "${sourceDir}/cmake/GccArmNoneEabi.cmake" + }, + "CMAKE_BUILD_TYPE": { + "type": "STRING", + "value": "Release" + }, + "PROJECT_VERSION_SUFFIX": { + "type": "STRING", + "value": "" + }, + "PROJECT_VERSION_SUFFIX_SHORT": { + "type": "STRING", + "value": "" + } + } + }, { "name": "xl-dwarf_debug_boot", "generator": "Ninja", diff --git a/Doxyfile b/Doxyfile index 19a8589f7..7c6723350 100644 --- a/Doxyfile +++ b/Doxyfile @@ -2053,7 +2053,7 @@ PERLMOD_MAKEVAR_PREFIX = # C-preprocessor directives found in the sources and include files. # The default value is: YES. -ENABLE_PREPROCESSING = YES +ENABLE_PREPROCESSING = NO #YES we are unable to generate documentation for all the build variants at once # If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names # in the source code. If set to NO, only conditional compilation will be diff --git a/LICENSE.md b/LICENSE.md index 2a5a4a6ae..e23ad5a62 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -This firmware for the Original Prusa MINI, Original Prusa MK4 and the Original Prusa XL is distributed under the following licenses: +This firmware is distributed under the following licenses: - The firmware source code is licensed under the GNU General Public License v3.0. Meaning you and your company can use the code both for the commercial and non-commercial activities, but you have to fulfil the requirements of the license. Read more about the permissions and limitations below. - The graphics and design are licensed under Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0). Meaning you and your company are strictly prohibited from using these elements in a commercial product. You have to create your own graphics and design. Read more about the permissions and limitations below. Violating these conditions will lead to a legal dispute. diff --git a/ProjectOptions.cmake b/ProjectOptions.cmake index fd1afed0c..0e29e257c 100644 --- a/ProjectOptions.cmake +++ b/ProjectOptions.cmake @@ -6,8 +6,16 @@ # cmake .. -DPRINTER=MINI # ~~~ -set(PRINTER_VALID_OPTS "MINI" "MK4" "MK3.5" "XL" "iX") -set(BOARD_VALID_OPTS "" "BUDDY" "XBUDDY" "XLBUDDY" "DWARF" "MODULARBED") +set(PRINTER_VALID_OPTS "MINI" "MK4" "MK3.5" "XL" "iX" "XL_DEV_KIT") +set(BOARD_VALID_OPTS + "" + "BUDDY" + "XBUDDY" + "XLBUDDY" + "DWARF" + "MODULARBED" + "XL_DEV_KIT_XLB" + ) set(MCU_VALID_OPTS "" "STM32F407VG" "STM32F429VI" "STM32F427ZI" "STM32G070RBT6") set(BOOTLOADER_VALID_OPTS "NO" "EMPTY" "YES") set(TRANSLATIONS_ENABLED_VALID_OPTS "" "NO" "YES") @@ -75,10 +83,18 @@ set(PRESET_COMPILE_OPTIONS "" CACHE STRING "Allows adding custom C/C++ flags. To be used from preset files." ) -set(WUI - "YES" - CACHE BOOL "Enable Web User Interface" - ) + +if(${BOARD} STREQUAL "XL_DEV_KIT_XLB") + set(WUI + "NO" + CACHE BOOL "Enable Web User Interface" + ) +else() + set(WUI + "YES" + CACHE BOOL "Enable Web User Interface" + ) +endif() define_boolean_option("BUDDY_ENABLE_WUI" ${WUI}) set(RESOURCES "" @@ -111,6 +127,11 @@ set(IS_KNOBLET ) define_boolean_option(IS_KNOBLET ${IS_KNOBLET}) +set(ENABLE_BURST + "NO" + CACHE BOOL "Enable BURST stepping on supported printers." + ) + # Validate options foreach(OPTION "PRINTER" "BOARD" "MCU" "BOOTLOADER" "TRANSLATIONS_ENABLED" "TOUCH_ENABLED") if(NOT ${OPTION} IN_LIST ${OPTION}_VALID_OPTS) @@ -170,11 +191,23 @@ if(${BOARD_VERSION} STREQUAL "") "0.7.0" CACHE STRING "ModularBed board version" FORCE ) + elseif(${BOARD} STREQUAL "XL_DEV_KIT_XLB") + set(BOARD_VERSION + "0.1.0" + CACHE STRING "XL_DEV_KIT_XLB board version" FORCE + ) else() message(FATAL_ERROR "No default board version set for board ${BOARD}") endif() endif() +# Set BOARD_IS_MASTER_BOARD - means main board of entire printer, non-main board are puppies +if(BOARD MATCHES ".*BUDDY" OR BOARD MATCHES "XL_DEV_KIT_XLB") + set(BOARD_IS_MASTER_BOARD true) +else() + set(BOARD_IS_MASTER_BOARD false) +endif() + # set MCU to its default if not specified if(${MCU} STREQUAL "") if(${BOARD} STREQUAL "BUDDY") @@ -187,6 +220,8 @@ if(${MCU} STREQUAL "") set(MCU "STM32F427ZI") elseif(${BOARD} STREQUAL "XLBUDDY") set(MCU "STM32F427ZI") + elseif(${BOARD} STREQUAL "XL_DEV_KIT_XLB") + set(MCU "STM32F427ZI") # todo elseif(${BOARD} STREQUAL "DWARF") set(MCU "STM32G070RBT6") elseif(${BOARD} STREQUAL "MODULARBED") @@ -200,7 +235,10 @@ list(REMOVE_ITEM MCU_VALID_OPTS "") define_enum_option(NAME MCU VALUE ${MCU} ALL_VALUES ${MCU_VALID_OPTS}) # Set connect status/availability -if(${BOARD} STREQUAL "DWARF" OR ${BOARD} STREQUAL "MODULARBED") +if(${BOARD} STREQUAL "DWARF" + OR ${BOARD} STREQUAL "MODULARBED" + OR ${BOARD} STREQUAL "XL_DEV_KIT_XLB" + ) set(CONNECT "NO" CACHE BOOL "Enable Connect client" @@ -244,34 +282,37 @@ message(STATUS "Resources: ${RESOURCES}") # Set printer features set(PRINTERS_WITH_FILAMENT_SENSOR_BINARY "MINI" "MK3.5") -set(PRINTERS_WITH_FILAMENT_SENSOR_ADC "MK4" "XL" "iX") +set(PRINTERS_WITH_FILAMENT_SENSOR_ADC "MK4" "XL" "iX" "XL_DEV_KIT") set(PRINTERS_WITH_INIT_TRINAMIC_FROM_MARLIN_ONLY "MINI" "MK4" "MK3.5" "XL" "iX") -set(PRINTERS_WITH_ADVANCED_PAUSE "MINI" "MK4" "MK3.5" "iX" "XL") +set(PRINTERS_WITH_ADVANCED_PAUSE "MINI" "MK4" "MK3.5" "iX" "XL" "XL_DEV_KIT") set(PRINTERS_WITH_CRASH_DETECTION "MINI" "MK4" "MK3.5" "XL") # this does require selftest to work set(PRINTERS_WITH_POWER_PANIC "MK4" "MK3.5" "XL") # this does require selftest and crash detection # to work -set(PRINTERS_WITH_PRECISE_HOMING "MK4") -set(PRINTERS_WITH_PRECISE_HOMING_COREXY "XL") +set(PRINTERS_WITH_PRECISE_HOMING "MK4" "MK3.5") +set(PRINTERS_WITH_PRECISE_HOMING_COREXY "XL" "XL_DEV_KIT") +set(PRINTERS_WITH_PHASE_STEPPING "XL") +set(PRINTERS_WITH_BURST_STEPPING "XL") # private MINI would not fit to 1MB so it has disabled selftest set(PRINTERS_WITH_SELFTEST "MINI" # "MK4") set(PRINTERS_WITH_SELFTEST "MK4" "MK3.5" "XL" "iX" "MINI") -set(PRINTERS_WITH_SELFTEST_SNAKE "XL" "MK4") +set(PRINTERS_WITH_SELFTEST_SNAKE "XL" "MK4" "MINI" "MK3.5") set(PRINTERS_WITH_HUMAN_INTERACTIONS "MINI" "MK4" "MK3.5" "XL") -set(PRINTERS_WITH_LOADCELL "MK4" "iX" "XL") -set(PRINTERS_WITH_HEATBREAK_TEMP "MK4" "iX" "XL") +set(PRINTERS_WITH_LOADCELL "MK4" "iX" "XL" "XL_DEV_KIT") +set(PRINTERS_WITH_HEATBREAK_TEMP "MK4" "iX" "XL" "XL_DEV_KIT") set(PRINTERS_WITH_RESOURCES "MINI" "MK4" "MK3.5" "XL" "iX") set(PRINTERS_WITH_BOWDEN_EXTRUDER "MINI") -set(PRINTERS_WITH_PUPPIES_BOOTLOADER "XL" "iX") -set(PRINTERS_WITH_DWARF "XL") -set(PRINTERS_WITH_MODULARBED "iX" "XL") -set(PRINTERS_WITH_TOOLCHANGER "XL") -set(PRINTERS_WITH_SIDE_FSENSOR "XL") +set(PRINTERS_WITH_PUPPIES_BOOTLOADER "XL" "iX" "XL_DEV_KIT") +set(PRINTERS_WITH_DWARF "XL" "XL_DEV_KIT") +set(PRINTERS_WITH_MODULARBED "iX" "XL" "XL_DEV_KIT") +set(PRINTERS_WITH_TOOLCHANGER "XL" "XL_DEV_KIT") +set(PRINTERS_WITH_SIDE_FSENSOR "iX" "XL") set(PRINTERS_WITH_EMBEDDED_ESP32 "XL") set(PRINTERS_WITH_SIDE_LEDS "XL" "iX") set(PRINTERS_WITH_TRANSLATIONS "MK4" "MK3.5" "XL" "MINI") set(PRINTERS_WITH_EXTFLASH_TRANSLATIONS "MINI") set(PRINTERS_WITH_LOVE_BOARD "MK4" "iX") set(PRINTERS_WITH_MMU2 "MK4" "MK3.5") +set(PRINTERS_WITH_CONFIG_STORE_WITHOUT_BACKEND "XL_DEV_KIT") # Set GUI settings set(PRINTERS_WITH_GUI "MINI" "MK4" "MK3.5" "XL" "iX") @@ -281,6 +322,14 @@ set(PRINTERS_WITH_LEDS "MK4" "MK3.5" "XL" "iX") # disable serial printing for MINI to save flash set(PRINTERS_WITH_SERIAL_PRINTING "MK4" "MK3.5" "XL" "iX" "MINI") +set(PRINTERS_WITH_LOCAL_ACCELEROMETER "MK3.5" "MK4" "iX") +set(PRINTERS_WITH_REMOTE_ACCELEROMETER "XL" "XL_DEV_KIT") + +set(PRINTERS_WITH_COLDPULL "MK4") + +set(PRINTERS_WITH_BED_LEVEL_CORRECTION "MK3.5" "MINI") + +set(PRINTERS_WITH_SHEET_SUPPORT "MINI" "MK3.5") # Set printer board set(BOARDS_WITH_ADVANCED_POWER "XBUDDY" "XLBUDDY" "DWARF") set(BOARDS_WITH_ILI9488 "XBUDDY" "XLBUDDY") @@ -343,9 +392,9 @@ if(${TOUCH_ENABLED} STREQUAL "") endif() define_boolean_option(HAS_TOUCH ${TOUCH_ENABLED}) -if(${PRINTER} IN_LIST PRINTERS_WITH_FILAMENT_SENSOR_BINARY AND BOARD MATCHES ".*BUDDY") +if(${PRINTER} IN_LIST PRINTERS_WITH_FILAMENT_SENSOR_BINARY AND BOARD_IS_MASTER_BOARD) set(FILAMENT_SENSOR BINARY) -elseif(${PRINTER} IN_LIST PRINTERS_WITH_FILAMENT_SENSOR_ADC AND BOARD MATCHES ".*BUDDY") +elseif(${PRINTER} IN_LIST PRINTERS_WITH_FILAMENT_SENSOR_ADC AND BOARD_IS_MASTER_BOARD) set(FILAMENT_SENSOR ADC) else() set(FILAMENT_SENSOR NO) @@ -353,7 +402,7 @@ endif() define_enum_option(NAME FILAMENT_SENSOR VALUE "${FILAMENT_SENSOR}" ALL_VALUES "BINARY;ADC;NO") if(${RESOURCES} STREQUAL "") - if(${PRINTER} IN_LIST PRINTERS_WITH_RESOURCES AND BOARD MATCHES ".*BUDDY") + if(${PRINTER} IN_LIST PRINTERS_WITH_RESOURCES AND BOARD_IS_MASTER_BOARD) set(RESOURCES "YES") else() set(RESOURCES "NO") @@ -368,11 +417,11 @@ if(GENERATE_DFU ) set(GENERATE_BBF "YES") -elseif(NOT BOARD MATCHES ".*BUDDY") +elseif(NOT BOARD_IS_MASTER_BOARD) set(GENERATE_BBF "NO") endif() -if(${PRINTER} IN_LIST PRINTERS_WITH_GUI AND BOARD MATCHES ".*BUDDY") +if(${PRINTER} IN_LIST PRINTERS_WITH_GUI AND BOARD_IS_MASTER_BOARD) set(GUI YES) if(${PRINTER} IN_LIST PRINTERS_WITH_GUI_W480H320 AND ${PRINTER} IN_LIST @@ -409,20 +458,44 @@ else() endif() define_boolean_option(HAS_SELFTEST ${HAS_SELFTEST}) +if(${PRINTER} IN_LIST PRINTERS_WITH_CONFIG_STORE_WITHOUT_BACKEND) + set(HAS_CONFIG_STORE_WO_BACKEND YES) +else() + set(HAS_CONFIG_STORE_WO_BACKEND NO) +endif() +define_boolean_option(HAS_CONFIG_STORE_WO_BACKEND ${HAS_CONFIG_STORE_WO_BACKEND}) + if(${PRINTER} IN_LIST PRINTERS_WITH_HUMAN_INTERACTIONS) define_boolean_option(HAS_HUMAN_INTERACTIONS YES) else() define_boolean_option(HAS_HUMAN_INTERACTIONS NO) endif() -if(${PRINTER} IN_LIST PRINTERS_WITH_LOADCELL AND BOARD MATCHES ".*BUDDY") +if(${PRINTER} IN_LIST PRINTERS_WITH_PHASE_STEPPING AND BOARD_IS_MASTER_BOARD) + set(HAS_PHASE_STEPPING YES) +else() + set(HAS_PHASE_STEPPING NO) +endif() +define_boolean_option(HAS_PHASE_STEPPING ${HAS_PHASE_STEPPING}) + +if(ENABLE_BURST + AND ${PRINTER} IN_LIST PRINTERS_WITH_BURST_STEPPING + AND BOARD_IS_MASTER_BOARD + ) + set(HAS_BURST_STEPPING YES) +else() + set(HAS_BURST_STEPPING NO) +endif() +define_boolean_option(HAS_BURST_STEPPING ${HAS_BURST_STEPPING}) + +if(${PRINTER} IN_LIST PRINTERS_WITH_LOADCELL AND BOARD_IS_MASTER_BOARD) set(HAS_LOADCELL YES) else() set(HAS_LOADCELL NO) endif() define_boolean_option(HAS_LOADCELL ${HAS_LOADCELL}) -if(${PRINTER} IN_LIST PRINTERS_WITH_HEATBREAK_TEMP AND BOARD MATCHES ".*BUDDY") +if(${PRINTER} IN_LIST PRINTERS_WITH_HEATBREAK_TEMP AND BOARD_IS_MASTER_BOARD) set(HAS_HEATBREAK_TEMP YES) else() set(HAS_HEATBREAK_TEMP NO) @@ -488,7 +561,7 @@ define_boolean_option(HAS_SERIAL_PRINT ${HAS_SERIAL_PRINT}) if(${PRINTER} IN_LIST PRINTERS_WITH_DWARF OR ${PRINTER} IN_LIST PRINTERS_WITH_MODULARBED - AND BOARD MATCHES ".*BUDDY" + AND BOARD_IS_MASTER_BOARD ) set(HAS_PUPPIES YES) else() @@ -496,14 +569,14 @@ else() endif() define_boolean_option(HAS_PUPPIES ${HAS_PUPPIES}) -if(${PRINTER} IN_LIST PRINTERS_WITH_DWARF AND BOARD MATCHES ".*BUDDY") +if(${PRINTER} IN_LIST PRINTERS_WITH_DWARF AND BOARD_IS_MASTER_BOARD) set(HAS_DWARF YES) else() set(HAS_DWARF NO) endif() define_boolean_option(HAS_DWARF ${HAS_DWARF}) -if(${PRINTER} IN_LIST PRINTERS_WITH_MODULARBED AND BOARD MATCHES ".*BUDDY") +if(${PRINTER} IN_LIST PRINTERS_WITH_MODULARBED AND BOARD_IS_MASTER_BOARD) set(HAS_MODULARBED YES) else() set(HAS_MODULARBED NO) @@ -564,9 +637,21 @@ if(ENABLE_PUPPY_BOOTLOAD) set(GENERATE_BBF "YES") endif() +if(BOARD MATCHES "XL_DEV_KIT_XLB") + set(PUPPY_SKIP_FLASH_FW + "ON" + CACHE BOOL "Disable flashing puppies to debug puppy with bootloader." + ) +else() + set(PUPPY_SKIP_FLASH_FW + "OFF" + CACHE BOOL "Disable flashing puppies to debug puppy with bootloader." + ) +endif() + if(${PRINTER} IN_LIST PRINTERS_WITH_PUPPIES_BOOTLOADER - AND BOARD MATCHES ".*BUDDY" - AND RESOURCES + AND BOARD_IS_MASTER_BOARD + AND (RESOURCES OR PUPPY_SKIP_FLASH_FW) AND ENABLE_PUPPY_BOOTLOAD ) set(HAS_PUPPIES_BOOTLOADER YES) @@ -575,10 +660,6 @@ else() endif() define_boolean_option(HAS_PUPPIES_BOOTLOADER ${HAS_PUPPIES_BOOTLOADER}) -set(PUPPY_SKIP_FLASH_FW - "OFF" - CACHE BOOL "Disable flashing puppies to debug puppy with bootloader." - ) if(${HAS_PUPPIES_BOOTLOADER} AND NOT ${PUPPY_SKIP_FLASH_FW}) set(PUPPY_FLASH_FW YES) else() @@ -601,10 +682,11 @@ endif() define_boolean_option(HAS_SELFTEST_SNAKE ${HAS_SELFTEST_SNAKE}) if(${PRINTER} IN_LIST PRINTERS_WITH_SIDE_FSENSOR) - define_boolean_option(HAS_SIDE_FSENSOR YES) + set(HAS_SIDE_FSENSOR YES) else() - define_boolean_option(HAS_SIDE_FSENSOR NO) + set(HAS_SIDE_FSENSOR NO) endif() +define_boolean_option(HAS_SIDE_FSENSOR ${HAS_SIDE_FSENSOR}) if(${PRINTER} IN_LIST PRINTERS_WITH_EMBEDDED_ESP32) define_boolean_option(HAS_EMBEDDED_ESP32 YES) @@ -618,6 +700,37 @@ else() define_boolean_option(HAS_SIDE_LEDS NO) endif() +if(${PRINTER} IN_LIST PRINTERS_WITH_LOCAL_ACCELEROMETER) + define_boolean_option(HAS_LOCAL_ACCELEROMETER YES) +else() + define_boolean_option(HAS_LOCAL_ACCELEROMETER NO) +endif() + +if(${PRINTER} IN_LIST PRINTERS_WITH_REMOTE_ACCELEROMETER) + define_boolean_option(HAS_REMOTE_ACCELEROMETER YES) +else() + define_boolean_option(HAS_REMOTE_ACCELEROMETER NO) +endif() + +if(HAS_TOOLCHANGER) + set(HAS_FILAMENT_SENSORS_MENU YES) +else() + set(HAS_FILAMENT_SENSORS_MENU NO) +endif() +define_boolean_option(HAS_FILAMENT_SENSORS_MENU ${HAS_FILAMENT_SENSORS_MENU}) + +if(${PRINTER} IN_LIST PRINTERS_WITH_COLDPULL) + define_boolean_option(HAS_COLDPULL YES) +else() + define_boolean_option(HAS_COLDPULL NO) +endif() + +if(${PRINTER} IN_LIST PRINTERS_WITH_SHEET_SUPPORT) + define_boolean_option(HAS_SHEET_SUPPORT YES) +else() + define_boolean_option(HAS_SHEET_SUPPORT NO) +endif() + if(CMAKE_BUILD_TYPE STREQUAL "Debug") set(DEBUG YES) define_boolean_option(NETWORKING_BENCHMARK_ENABLED YES) @@ -652,3 +765,22 @@ set(DEBUG_WITH_BEEPS CACHE BOOL "Colleague annoyance: achievement unlocked" ) define_boolean_option(DEBUG_WITH_BEEPS ${DEBUG_WITH_BEEPS}) + +# Use websocket to talk to Connect instead of many http requests. +# +# The server part is not ready and the protocol is in a flux too. For that reason, this is not +# enabled in "real builds", but we need to be able to have the code around and be able to turn it on +# for custom build - to allow debugging the server too. +# +# Eventually, this'll become the only used and supported way to talk to Connect. At that point, both +# this option and the "old" code will be removed. +set(WEBSOCKET + "OFF" + CACHE BOOL "Use websocket to talk to connect. In development" + ) +define_boolean_option(WEBSOCKET ${WEBSOCKET}) +set(MDNS + "ON" + CACHE BOOL "Enable MDNS responder" + ) +define_boolean_option(MDNS ${MDNS}) diff --git a/README.md b/README.md index 8ed2148f0..33cd78f42 100644 --- a/README.md +++ b/README.md @@ -14,25 +14,25 @@ Alternative FW for the Prusa Mini. There's quite few improvements: 2. **Skew compensation**: Turns on skew compensation in Marlin and allows it to be configured with `M852`. 3. ~~**OctoPrint screen**: Adds support for `M73` (print progress) and `M117`~~ ~~(LCD messages).~~ -4. ~~**PID tuning**: Automatically writes PID settings to EEPROM after `M303 U1` (autotune),~~ - ~~`M301` (set hotend PID), and `M304` (set bed PID).~~ +4. ~~**PID tuning**: ~~ 5. **Max Temps**: Raises the maximum bed temperature from 100C to 110C and nozzle temperature from 275C to 285C (use with caution!). -6. ~~**EEPROM upgrade/sidegrade/downgrade**: Saved values (live-z, skew etc.) are kept during upgrade/sidegrade/downgrade.~~ -7. **Settings during print**: You can change Snake settings during printing. -8. **Faster nozzle cooling**: If you wait for nozzle cooling before MBL, you can call `M109 R170 C` +6. **Settings during print**: You can change Snake settings during printing. +7. **Faster nozzle cooling**: If you wait for nozzle cooling before MBL, you can call `M109 R170 C` which uses print fan to speed up cooling. -9. **Game**: Instead of printing you can enjoy simple game. -10. ~~**Bigger time**: Printing and remaining time is now bigger.~~ -11. ~~**Startup wizard**: Now you can select `Ignore` at the wizard start screen to disable starting of the wizard at the printer startup.~~ -12. ~~**Temperature calibration**: You can calibrate PID temperature control for your hotend/bed directly from the menu. Calibration does 5 cycles.~~ -13. ~~**Total time**: Elapsed, Remaining and Total or End time are shown during printing.~~ -14. **Change filament**: Change of filament in Tune menu is moved to submenu to avoid unwanted interruption. -15. **Adjust brightness**: You can change brightness of the display. It does not dim the light but draws darker colors. -16. ~~**Cold mode (min.temp.)**: If you enable Cold Mode, temperatures (once set) won't drop below 30°C. For safety reasons cold mode must be enabled after every start of the printer.~~ -17. ~~**Show MBL and tilt**: After mesh bed leveling (G29) you can go to `Snake Settings` and see the MBL Z levels at the measured points and check the tilt of the axes. Levels are shifted to avoid negative numbers.~~ -18. **Speed up (un)parking**: Parking and unparking is done at the highest speed to shorten maintenance (change filament) time during printing. -19. **Different printers**: Next to a standard version, a coreXY and a long bed version is released. The latter is suited for beds of length 250 mm ([long bed HW](https://www.aliexpress.com/item/1005001632020501.html)). +8. **Game**: Instead of printing you can enjoy simple game. +9. ~~**Bigger time**: Printing and remaining time is now bigger.~~ +10. ~~**Startup wizard**: Now you can select `Ignore` at the wizard start screen to disable starting of the wizard at the printer startup.~~ +11. ~~**Temperature calibration**: You can calibrate PID temperature control for your hotend/bed directly from the menu. Calibration does 5 cycles.~~ +12. ~~**Total time**: Elapsed, Remaining and Total or End time are shown during printing.~~ +13. **Change filament**: Change of filament in Tune menu is moved to submenu to avoid unwanted interruption. +14. **Adjust brightness**: You can change brightness of the display. It does not dim the light but draws darker colors. +15. **Cold mode (min.temp.)**: If you enable Cold Mode, temperatures (once set) won't drop below 30°C. For safety reasons cold mode must be enabled after every start of the printer. +16. ~~**Show MBL and tilt**: After mesh bed leveling (G29) you can go to `Snake Settings` and see the MBL Z levels at the measured points and check the tilt of the axes. Levels are shifted to avoid negative numbers.~~ +17. **Speed up (un)parking**: Parking and unparking is done at the highest speed to shorten maintenance (change filament) time during printing. +18. **Different printers**: Next to a standard version, a coreXY and a long bed version is released. The latter is suited for beds of length 250 mm ([long bed HW](https://www.aliexpress.com/item/1005001632020501.html)). +19. ~~**Different languages**~~ +20. **Avoid display flashing**: Some displays flash with original FW. All settings are automatically saved to EEPROM and loaded on boot. @@ -218,13 +218,16 @@ Precise information of who did what can be obtained by `git blame` command or by Click to expand! # Buddy -[![GitHub release](https://img.shields.io/github/release/prusa3d/Prusa-Firmware-Buddy.svg)](https://github.com/prusa3d/Prusa-Firmware-Buddy/releases) -[![Build Status](https://holly.prusa3d.com/buildStatus/icon?job=Prusa-Firmware-Buddy%2FMultibranch%2Fmaster)](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy/job/Multibranch/job/master/) +[![Build Status]()](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy-Private/job/Multibranch/job/private/) +[![Build Status]()](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy-Private/job/Multibranch/job/master/) +[![Build Status]()](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy-Private/job/Auto-Pull-Master/) +[![Build Status]()](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy-Private/job/Merge-Master-To-Private/) This repository includes source code and firmware releases for the Original Prusa 3D printers based on the 32-bit ARM microcontrollers. The currently supported models are: -- Original Prusa MINI +- Original Prusa MINI/MINI+ +- Original Prusa MK3.9 - Original Prusa MK4 - Original Prusa XL @@ -278,15 +281,9 @@ The build process of this project is driven by CMake and `build.py` is just a hi - [Eclipse, STM32CubeIDE](doc/editor/stm32cubeide.md) - [Other LSP-based IDEs (Atom, Sublime Text, ...)](doc/editor/lsp-based-ides.md) -#### Formatting +#### Contributing -All the source code in this repository is automatically formatted: - -- C/C++ files using [clang-format](https://clang.llvm.org/docs/ClangFormat.html), -- Python files using [yapf](https://github.com/google/yapf), -- and CMake files using [cmake-format](https://github.com/cheshirekow/cmake_format). - -If you want to contribute, make sure to install [pre-commit](https://pre-commit.com) and then run `pre-commit install` within the repository. This makes sure that all your future commits will be formatted appropriately. Our build server automatically rejects improperly formatted pull requests. +If you want to contribute to the codebase, please read the [Contribution Guidelines](doc/contributing.md). #### XL and Puppies diff --git a/cmake/CheckRemotes.cmake b/cmake/CheckRemotes.cmake new file mode 100644 index 000000000..8a6b39678 --- /dev/null +++ b/cmake/CheckRemotes.cmake @@ -0,0 +1,47 @@ +find_package(Git QUIET) + +if(NOT GIT_FOUND) + message(STATUS "Not Git Executable found. Skipping check for dangerous Git remotes.") + return() +endif() + +function(check_git_repo_for_dangerous_remotes repo_dir) + execute_process( + COMMAND "${GIT_EXECUTABLE}" remote + WORKING_DIRECTORY "${repo_dir}" + RESULT_VARIABLE res + OUTPUT_VARIABLE lst + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if(NOT res STREQUAL "0") + message(WARNING "Failed to check dangerousness of your Git remotes!") + return() + endif() + + string(REPLACE "\n" ";" lst ${lst}) + foreach(item ${lst}) + execute_process( + COMMAND "${GIT_EXECUTABLE}" remote get-url --push ${item} + WORKING_DIRECTORY "${repo_dir}" + RESULT_VARIABLE res + OUTPUT_VARIABLE url + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if(NOT res STREQUAL 0) + message(WARNING "Failed to check dangerousness of remote '${item}'!") + endif() + + if(url MATCHES "Prusa\-Firmware\-Buddy.git" OR url MATCHES "Marlin.git") + message( + FATAL_ERROR + "Oh, your remote '${item}' appears to have its push URL set to a public repository! Let me say, that this is a bad, bad idea! You are \"one push\" away from mistakenly publishing private things. Please remove this remote or set its push url to some nonsense (see below).\n git -C \"${repo_dir}\" remote set-url --push ${item} DISABLED\n" + ) + endif() + + endforeach() +endfunction() + +check_git_repo_for_dangerous_remotes("${CMAKE_SOURCE_DIR}") +check_git_repo_for_dangerous_remotes("${CMAKE_SOURCE_DIR}/lib/Marlin") diff --git a/cmake/Utilities.cmake b/cmake/Utilities.cmake index 107736794..db93eb9fb 100644 --- a/cmake/Utilities.cmake +++ b/cmake/Utilities.cmake @@ -9,6 +9,7 @@ set(BUDDY_NO_VIRTUALENV if(NOT Python3_EXECUTABLE) if(NOT ${BUDDY_NO_VIRTUALENV}) set(Python3_ROOT_DIR "${CMAKE_SOURCE_DIR}/.venv") + set(Python3_FIND_VIRTUALENV "ONLY") endif() find_package(Python3 COMPONENTS Interpreter) if(NOT Python3_FOUND) diff --git a/doc/contributing.md b/doc/contributing.md new file mode 100644 index 000000000..56850ee77 --- /dev/null +++ b/doc/contributing.md @@ -0,0 +1,64 @@ +# Contribution Guidelines + +## Git + +### Merging: Use rebase whenever possible + +The goal is to have a simple and linear git history. +It is not always possible; for example when merging master into private. +In such cases, it is ok to use git-merge. + +### Commit: Atomicity + +A commit should be a single complete unit of work. +Every commit should be buildable and follow the rules in this document. + +### Commit: Message + +- Commit message comprises a subject and a body (separated by an empty line). +- Commit message is written in English. +- Subject uses the imperative mood. +- Subject starts with a capital letter and does not end with a period. +- When a commit is relevant to some subset/module of the project (most of the time), use it as a prefix of the subject as follows: + ``` + metrics: Add support for syslog + ``` + or + ``` + gui: Add touch support + ``` +- Write the module in lowercase +- Limit the subject to 72 letters. +- Wrap the body to 72 letters per line. +- Put an issue tracker reference (BFW-xxxx) at the end of the body if you have one. Do not put it in the subject line. + +## Formatting & Code Organization + +### Formatting + +All the source code in this repository is automatically formatted: + +- C/C++ files using [clang-format](https://clang.llvm.org/docs/ClangFormat.html), +- Python files using [yapf](https://github.com/google/yapf), +- and CMake files using [cmake-format](https://github.com/cheshirekow/cmake_format). + +If you want to contribute, make sure to install [pre-commit](https://pre-commit.com) and then run `pre-commit install` within the repository. This makes sure that all your future commits will be formatted appropriately. Our build server automatically rejects improperly formatted pull requests. + +### Files: Include Guards +Use the `#pragma once` as a file guard. +Do not use the `#ifdef FILE_X`, `#define FILE_X`, `#endif` pattern. + +### Files: Author & Copyright + +Do not add file headers with author/creation time/copyright, etc. +Those data are already stored in the commit, and we don't want to duplicate them. + +This does not apply to 3rd party code in our repository. + +### Code Style: C/C++ Naming Conventions + +- Types & Classes are in `PascalCase`. +- Global constants in `SCREAMING_CASE` +- Variables (local, class, etc), class-level constants, `enum class` items, methods and namespaces are in `snake_case`. +- File names are in `snake_case.cpp` (even if the only thing the file contains is a class named in `PascalCase`). +- Types never end with a `'_t'`. diff --git a/doc/editor/vscode.md b/doc/editor/vscode.md index 2d08cc8f3..3b03f5a1e 100644 --- a/doc/editor/vscode.md +++ b/doc/editor/vscode.md @@ -74,7 +74,7 @@ on a newer incarnation of Linux/Ubuntu, it means your libraries (libncurses and The output from `ldd` shows, that the arm-gdb didn't get all its libraries: ```bash -$ ldd PrusaFirmwareBuddy/.dependencies/gcc-arm-none-eabi-10.3.1/bin/arm-none-eabi-gdb +$ ldd PrusaFirmwareBuddy/.dependencies/gcc-arm-none-eabi-13.2.1/bin/arm-none-eabi-gdb linux-vdso.so.1 (0x00007fff072a8000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f900b711000) libncurses.so.5 => not found diff --git a/doc/logging_components.md b/doc/logging_components.md index 9330e55f7..fddcd91da 100644 --- a/doc/logging_components.md +++ b/doc/logging_components.md @@ -1,7 +1,6 @@ # Logging - Defined Components This file is generated automatically so don't edit it directly -- Accel: LOG_SEVERITY_INFO, src/puppy/dwarf/accelerometer.cpp - Bootloader: LOG_SEVERITY_INFO, src/bootloader/bootloader.cpp - Buddy: LOG_SEVERITY_DEBUG, src/common/appmain.cpp - BufferedSerial: LOG_SEVERITY_DEBUG, src/hw/buffered_serial.cpp @@ -18,7 +17,6 @@ This file is generated automatically so don't edit it directly - EEPROM: LOG_SEVERITY_INFO, src/persistent_stores/store_instances/config_store/store_c_api.cpp - ESPIF: LOG_SEVERITY_INFO, lib/WUI/espif.cpp - EspFlash: LOG_SEVERITY_DEBUG, lib/WUI/esp_flash.cpp -- FSM: LOG_SEVERITY_INFO, src/common/fsm_types.cpp - FSensor: LOG_SEVERITY_INFO, src/common/filament_sensors_handler.cpp - FileSystem: LOG_SEVERITY_INFO, src/buddy/filesystem.cpp - GUI: LOG_SEVERITY_DEBUG, src/gui/logger.cpp @@ -38,13 +36,16 @@ This file is generated automatically so don't edit it directly - ModularBed: LOG_SEVERITY_INFO, src/puppies/modular_bed.cpp - Network: LOG_SEVERITY_INFO, lib/WUI/wui.cpp - PRUSA_GCODE: LOG_SEVERITY_INFO, src/marlin_stubs/gcode.cpp +- PhaseStepping: LOG_SEVERITY_DEBUG, lib/Marlin/Marlin/src/feature/phase_stepping/phase_stepping.cpp - PowerPanic: LOG_SEVERITY_INFO, src/common/power_panic.cpp +- PreciseStepping: LOG_SEVERITY_DEBUG, lib/Marlin/Marlin/src/feature/precise_stepping/precise_stepping.cpp - PrusaToolChanger: LOG_SEVERITY_DEBUG, lib/Marlin/Marlin/src/module/prusa/toolchanger_utils.cpp - Puppies: LOG_SEVERITY_DEBUG, src/puppies/puppy_task.cpp - Resources: LOG_SEVERITY_DEBUG, src/resources/bootstrap.cpp - Selftest: LOG_SEVERITY_DEBUG, src/common/selftest/i_selftest.cpp - Syslog: LOG_SEVERITY_INFO, src/syslog/syslog.cpp - Touch: LOG_SEVERITY_INFO, src/hw/GT911.cpp +- Touch: LOG_SEVERITY_INFO, src/hw/touchscreen/touchscreen_common.cpp - USBDevice: LOG_SEVERITY_INFO, src/buddy/usb_device.cpp - USBHost: LOG_SEVERITY_INFO, src/buddy/usbh_conf.cpp - USBMSC: LOG_SEVERITY_DEBUG, src/buddy/usb_device_msc.cpp diff --git a/doc/metrics.md b/doc/metrics.md index d63d7517b..ab4612958 100644 --- a/doc/metrics.md +++ b/doc/metrics.md @@ -10,12 +10,13 @@ in real-time while your algorithm runs on a real printer. 1. Define a metric ```C - static metric_t metric_cpu_usage = METRIC("cpu_usage", METRIC_VALUE_FLOAT, 100, METRIC_HANDLER_DISABLE_ALL); + METRIC_DEF(cpu_usage, "cpu_usage", METRIC_VALUE_FLOAT, 100, METRIC_HANDLER_DISABLE_ALL); ``` - - The first parameter - `cpu_usage` - is the metric's name. Keep it short! - - The second parameter defines the type of data points (values) for this metric. - - The third parameter - `100` - defines the minimal interval between consecutive recorded points in ms. + - The first parameter - `cpu_usage` - is the variable name + - The second parameter - `cpu_usage` - is the metric's name. Keep it short! + - The third parameter defines the type of data points (values) for this metric. + - The fourth parameter - `100` - defines the minimal interval between consecutive recorded points in ms. - E.g., the value 100 ms makes the `cpu_usage` metric being transmitted at a maximum frequency of 10 Hz. - If you want to disable throttling and send the values as fast as possible, set it to 0. - The last parameter is a bitmap specifying which handlers should have this metric enabled after startup. @@ -31,7 +32,6 @@ in real-time while your algorithm runs on a real printer. 3. Enable sending the recorded metrics ```gcode - M330 SYSLOG ; We are using the SYSLOG handler (ethernet, UDP) M334 ; Where to send the metrics M331 cpu_usage ; Enable the metric we just created ``` @@ -42,7 +42,7 @@ in real-time while your algorithm runs on a real printer. Let you configure your metrics at runtime. -- **M330**` ` -- Select `handler` for configuration +- **M330**` ` -- Select `handler` for configuration (`SYSLOG` is selected by default) - Example: `M330 SYSLOG` - **M331**` ` -- Enable `metric` for the currently selected `handler`. - Example: `M331 pos_z` @@ -68,7 +68,7 @@ This works great in most cases. However, sometimes it comes in handy to send mul ```C void record_heap_usage() { - static metric_t heap = METRIC("heap", METRIC_VALUE_INTEGER, ...); + METRIC_DEF(heap, "heap", METRIC_VALUE_INTEGER, ...); metric_record_integer(&heap, GetFreeHeapSize()); } ``` @@ -77,8 +77,8 @@ This will work. But what if you want to add a second piece of information - the ```C void record_heap_usage() { - static metric_t heap_free = METRIC("heap_free", METRIC_VALUE_INTEGER, ...); - static metric_t heap_total = METRIC("heap_total", METRIC_VALUE_INTEGER, ...); + METRIC_DEF(heap_free, "heap_free", METRIC_VALUE_INTEGER, ...); + METRIC_DEF(heap_total, "heap_total", METRIC_VALUE_INTEGER, ...); metric_record_integer(&heap_free, GetFreeHeapSize()); metric_record_integer(&heap_total, GetTotalHeapSize()); } @@ -89,7 +89,7 @@ Can we do better? Sure we can! ```C void record_heap_usage() { - static metric_t heap = METRIC("heap", METRIC_VALUE_CUSTOM, ...); + METRIC_DEF(heap, "heap", METRIC_VALUE_CUSTOM, ...); metric_record_custom(&heap, " free=%ii,total=%ii", GetFreeHeapSize(), GetTotalHeapSize()); } ``` @@ -155,7 +155,6 @@ What are metrics good for, if you have no way to store, view, and process them? - By default, the metrics are stored within a database named `buddy` (no authorization required) 1. A metric-handler service, listening on port 8500 for incoming metrics and storing them to the InfluxDB database. - You can setup your printer to send metrics to this handler using the gcodes below - - `M330 SYSLOG` - `M334 8500` 1. A Grafana instance for viewing the metrics. - Accessible on port 3000 (http://localhost:3000) diff --git a/doc/timers.md b/doc/timers.md index 973549d95..be8e792e5 100644 --- a/doc/timers.md +++ b/doc/timers.md @@ -1,15 +1,54 @@ -ARM-CORE SysTick timer - used by FreeRTOS -TIM1 - hwio - FAN0 and FAN1 PWM - src\main.cpp -TIM2 - hwio - BUZZER - src\main.cpp -TIM3 - hwio - HEAT0 and BED_HEAT PWM - src\main.cpp -TIM4 - reserved for encoder -TIM5 - SystemTimer (~12ns tick, 32bit, 84MHz, 1s period) - src\common\timing_sys.c -TIM6 - Marlin/Temperature - lib\Marlin\Marlin\src\HAL\HAL_STM32_F4_F7\STM32F4\timers.cpp -TIM7 - Marlin/Temperature - lib\Marlin\Marlin\src\HAL\HAL_STM32_F4_F7\STM32F4\timers.cpp -TIM8 - Marlin/Stepper - lib\Marlin\Marlin\src\HAL\HAL_STM32_F4_F7\STM32F4\timers.cpp -TIM9 - -TIM10 - -TIM11 - -TIM12 - -TIM13 - -TIM14 - GUI - jogwheel, hwio - src\main.cpp +SysTick +: used by FreeRTOS + +TIM1 +: hwio - FAN0 and FAN1 PWM +: `src/main.cpp` + +TIM2 +: hwio - BUZZER +: `src/main.cpp` + +TIM3 +: hwio - HEAT0 and BED_HEAT PWM +: `src/main.cpp` + +TIM4 +: reserved for encoder + +TIM5 +: SystemTimer (~12ns tick, 32bit, 84MHz, 1s period) +: `src/common/timing_sys.c` + +TIM6 +: Marlin/Temperature +: `lib/Marlin/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp` + +TIM7 +: Marlin/Temperature +: `lib/Marlin/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp` + +TIM8 +: Burst stepping +: `lib/Marlin/Marlin/src/feature/phase_stepping/burst_stepper.cpp` + +TIM9 +: + +TIM10 +: + +TIM11 +: + +TIM12 +: Marlin/Stepper +: `lib/Marlin/Marlin/src/HAL/HAL_STM32_F4_F7/STM32F4/timers.cpp` + +TIM13 +: Phase stepping +: `lib/Marlin/Marlin/src/feature/phase_stepping/phase_stepping.cpp` + +TIM14 +: GUI - jogwheel, hwio, touch +: `src/main.cpp` diff --git a/include/bootloader/bootloader.hpp b/include/bootloader/bootloader.hpp index fb4c755a6..23126a0ad 100644 --- a/include/bootloader/bootloader.hpp +++ b/include/bootloader/bootloader.hpp @@ -22,9 +22,16 @@ static constexpr const size_t bootloader_sector_count = std::size(bootloader_sec #if BOOTLOADER_UPDATE() -/// Return true if the bootloader needs to be updated/reflashed +/// @returns true if the bootloader needs to be updated/reflashed +/// @param required minimal version +bool needs_update(Version required); + +/// @returns true if the bootloader needs to be updated/reflashed bool needs_update(); +/// @returns true if the pre-boot needs to be updated/reflashed +bool preboot_needs_update(); + enum class UpdateStage { LookingForBbf, PreparingUpdate, diff --git a/include/buddy/ccm_thread.hpp b/include/buddy/ccm_thread.hpp index 3f2c05a22..1b43faa26 100644 --- a/include/buddy/ccm_thread.hpp +++ b/include/buddy/ccm_thread.hpp @@ -38,10 +38,11 @@ inline bool is_ccm_ram(uintptr_t address) { * @brief Check if data can be used by DMA. * CCMRAM cannot be accessed by DMA. * Use as: - * assert("Data for DMA cannot be in CCMRAM" && can_be_used_by_dma(reinterpret_cast(data))); + * assert(can_be_used_by_dma(data)); * @param address address of data * @return true if data can be used by DMA */ -inline bool can_be_used_by_dma(uintptr_t address) { - return !is_ccm_ram(address); +template +FORCE_INLINE bool can_be_used_by_dma(T *address) { + return !is_ccm_ram(reinterpret_cast(address)); } diff --git a/include/buddy/ffconf.h b/include/buddy/ffconf.h index b7b97b221..5c8548575 100644 --- a/include/buddy/ffconf.h +++ b/include/buddy/ffconf.h @@ -1,3 +1,4 @@ +#pragma once /*---------------------------------------------------------------------------/ / FatFs Functional Configurations /---------------------------------------------------------------------------*/ diff --git a/include/buddy/filesystem_semihosting.h b/include/buddy/filesystem_semihosting.h index caaf85e5d..bafad9349 100644 --- a/include/buddy/filesystem_semihosting.h +++ b/include/buddy/filesystem_semihosting.h @@ -6,6 +6,7 @@ extern "C" { int filesystem_semihosting_init(); void filesystem_semihosting_deinit(); +bool filesystem_semihosting_active(); #if defined(__cplusplus) } // extern "C" diff --git a/include/buddy/lwipopts.h b/include/buddy/lwipopts.h index f90af900d..3ee82bca6 100644 --- a/include/buddy/lwipopts.h +++ b/include/buddy/lwipopts.h @@ -8,17 +8,38 @@ extern "C" { #endif #include +#include