Skip to content

Commit

Permalink
Release v5.1.0-alpha1 (MINI)
Browse files Browse the repository at this point in the history
  • Loading branch information
Prusa Research authored and dragomirecky committed Sep 18, 2023
1 parent bfb0ffc commit 7508811
Show file tree
Hide file tree
Showing 901 changed files with 196,559 additions and 81,598 deletions.
16 changes: 16 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file contains SHA's of commits that are of no value for git blame
# Please also add the commit message with the SHA for clarity.

79dc0fed7d3b8bd1a15e1f72bcae400be1ca8e41 # Add spaces to comments (clang-format)
ceb06f9952021f0716737d89aeee34da3d5adc79 # Reformat everything with newer clang-format
3ff934005184f6090644e52c97ef3b608c700058 # Enable FixNamespaceComments in clang format
85b4fcf2c9a3517e67f6d1b5d3e8711a71033dbf # XL: Rename kennel to dock
a5f74b76a49ed2ce5a5c1627b749bbcd4a1d3303 # Migrate old eeprom to new config store
3c3dddc42804ab292fc571a0238adc4f7a2ae4c0 # Make marlin server state an enum class
521242f2032019065a82edb2195126612e6e284d # Make marlin_server message an enum class
1daf8c3e0eebc03c4b251e96773ae683cc4fac6d # Marlin server namespace: simple changes
19cfd202e65341df81a546af1e8956fb91d605ac # Marlin server namespace: simplify naming
179611403a7261d2e9b58785f4922f9399de3dfe # Convert marlin_server.h to hpp
54692f0d28cf4cfc007c6b4567193cdc7cfde4cb # Wrap marlin client in marlin_client namespace
aa7bb070e259fb73fba4d8f4ea46abc24abbced9 # Rename marlin_client members
2933bc5568ce0a1fd05e9221c1d8629a5a157329 # xl: Rename Dwarf::set_led() to Dwarf::set_cheese_led()
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ repos:
exclude: |
(?x)(
^tests/unit/lang/translator/(keys|cs|es|fr|de|pl|it)\.txt$|
^tests/unit/common/gcode/.*\.gcode$|
^lib/printf|
^lib/inih/|
^lib/Marlin/(?!
Expand Down Expand Up @@ -81,7 +82,8 @@ exclude: |
^lib/Middlewares/Third_Party/mbedtls/|
^lib/liblightmodbus/|
^lib/QR/|
^lib/cthash/|
^lib/LiquidCrystal_I2C/|
^lib/CrashCatcher/
^lib/CrashCatcher/|
^lib/libbgcode/|
^lib/heatshrink/
)
27 changes: 23 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,23 @@
"executable": "${workspaceRoot}/build-vscode-buddy/firmware",
"request": "launch",
},
{
"name": "Launch Simulator Scripted",
// This is the same as "Launch Simulator", but it also opens TCP port to control hardware
// Use 'telnet localhost 50001' immediatelly after launching this
// List of available commands is at https://github.com/vintagepc/MINI404/wiki/Scripting-Mk4-027
"type": "cortex-debug",
"servertype": "qemu",
"serverpath": "${workspaceRoot}/.venv/bin/simulator_as_qemu",
"serverArgs": ["--scripted"],
"windows": {
"serverpath": "${workspaceRoot}/.venv/Scripts/simulator_as_qemu"
},
"armToolchainPath": "${workspaceRoot}/.dependencies/gcc-arm-none-eabi-10.3.1/bin",
"cwd": "${workspaceFolder}",
"executable": "${workspaceRoot}/build-vscode-buddy/firmware",
"request": "launch",
},
{
"name": "GDB (QEMU)",
"type": "gdb",
Expand All @@ -191,11 +208,13 @@
},
{
"name": "Unit-tests debug",
"type": "cppdbg",
"type": "gdb",
"request": "launch",
"MIMode": "gdb",
"cwd": "${workspaceRoot}",
}
"gdbpath": "gdb",
// Note: replace this with whatever test you want to debug:
"target": "${workspaceRoot}/build_tests/tests/unit/common/your_unitest_executable_goes_here",
"cwd": "${workspaceRoot}/build_tests/tests/unit/common/your_unitest_executable_goes_here",
},
],
"compounds": [
{
Expand Down
17 changes: 14 additions & 3 deletions .vscode/simulator_as_qemu/src/simulator_as_qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ def options(args):

def simulator_args(qemu_args):
for option in options(qemu_args):
if option[0] in ('-machine', '-cpu', '-nographic',
'-semihosting-config', '-kernel'):
if option[0] == '--scripted':
# Open TCP port for scripting the simulator
yield from [
'-chardev',
'socket,id=p404-scriptcon,port=50001,host=localhost,server=on',
'-global', 'p404-scriptcon.no_echo=true'
]
elif option[0] in ('-machine', '-cpu', '-nographic',
'-semihosting-config', '-kernel'):
pass
else:
yield from option
Expand All @@ -26,7 +33,11 @@ def simulator_args(qemu_args):
def main():
project_root = Path(__file__).parent.parent.parent.parent
simulator_path = project_root / 'utils' / 'simulator'
extra_args = [f'-X' + arg for arg in simulator_args(sys.argv[1:])]
extra_args = [
f'-X' + arg for arg in
simulator_args(sys.argv[1:] +
['-netdev', 'user,id=mini-eth,hostfwd=tcp::3333-:80'])
]

os.execv(sys.executable, [sys.executable, (simulator_path)] + extra_args)

Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -49,6 +50,7 @@ set(CMAKE_CXX_STANDARD 20)
add_compile_options(-Wall -Wsign-compare)
add_compile_options(
$<$<COMPILE_LANGUAGE:CXX>:-Wno-register> $<$<COMPILE_LANGUAGE:CXX>:-Wno-volatile>
$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
)

# append custom C/C++ flags
Expand Down Expand Up @@ -620,12 +622,10 @@ if(BOARD MATCHES "BUDDY")
FatFs
flasher
littlefs
lpng
STM32::USBHost
inih::inih
$<$<BOOL:${WUI}>:WUI>
jsmn::jsmn
cthash::cthash
QR
Buddy::Lang
printf::printf
Expand All @@ -638,6 +638,8 @@ if(BOARD MATCHES "BUDDY")
error_codes
error_codes_mmu # TODO once MMU is not necessary for the build, replace with:
# $<$<BOOL:${HAS_MMU2}>:error_codes_mmu>
bgcode_core
heatshrink_decoder
)
elseif(BOARD STREQUAL "DWARF")
target_link_libraries(
Expand Down
8 changes: 4 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"DEVELOPMENT_ITEMS_ENABLED": {
"type": "BOOL",
"value": "YES"
"value": "NO"
},
"BOOTLOADER": {
"type": "STRING",
Expand Down Expand Up @@ -104,7 +104,7 @@
},
"DEVELOPMENT_ITEMS_ENABLED": {
"type": "BOOL",
"value": "YES"
"value": "NO"
},
"BOOTLOADER": {
"type": "STRING",
Expand Down Expand Up @@ -171,7 +171,7 @@
},
"DEVELOPMENT_ITEMS_ENABLED": {
"type": "BOOL",
"value": "YES"
"value": "NO"
},
"BOOTLOADER": {
"type": "STRING",
Expand Down Expand Up @@ -238,7 +238,7 @@
},
"DEVELOPMENT_ITEMS_ENABLED": {
"type": "BOOL",
"value": "YES"
"value": "NO"
},
"BOOTLOADER": {
"type": "STRING",
Expand Down
12 changes: 7 additions & 5 deletions ProjectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ set(WUI
define_boolean_option("BUDDY_ENABLE_WUI" ${WUI})
set(RESOURCES
"<auto>"
CACHE BOOL "Enable resources (managed files on external flash)"
CACHE
STRING
"Enable resources (managed files on external flash). Set to '<auto>' to enable according to 'PRINTERS_WITH_RESOURCES'."
)
set(TRANSLATIONS_ENABLED
"<default>"
Expand Down Expand Up @@ -242,7 +244,7 @@ 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_CRASH_DETECTION "MINI" "MK4" "XL") # this does require selftest to work
set(PRINTERS_WITH_POWER_PANIC "MK4" "XL") # this does require selftest and crash detection to work
set(PRINTERS_WITH_PRECISE_HOMING "MINI" "MK4")
set(PRINTERS_WITH_PRECISE_HOMING "MK4")
set(PRINTERS_WITH_PRECISE_HOMING_COREXY "XL")
# private MINI would not fit to 1MB so it has disabled selftest set(PRINTERS_WITH_SELFTEST "MINI"
# "MK4")
Expand Down Expand Up @@ -271,7 +273,7 @@ set(PRINTERS_WITH_GUI_W240H320 "MINI")
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_CONTROL_MENU "MK4" "MK3.5" "XL")
set(PRINTERS_WITH_CONTROL_MENU "MK4" "MK3.5" "XL" "MINI")

# Set printer board
set(BOARDS_WITH_ADVANCED_POWER "XBUDDY" "XLBUDDY" "DWARF")
Expand Down Expand Up @@ -310,9 +312,9 @@ define_enum_option(NAME FILAMENT_SENSOR VALUE "${FILAMENT_SENSOR}" ALL_VALUES "B

if(${RESOURCES} STREQUAL "<auto>")
if(${PRINTER} IN_LIST PRINTERS_WITH_RESOURCES AND BOARD MATCHES ".*BUDDY")
set(RESOURCES YES)
set(RESOURCES "YES")
else()
set(RESOURCES NO)
set(RESOURCES "NO")
endif()
endif()
define_boolean_option(RESOURCES ${RESOURCES})
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# 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/buildStatus/icon?job=Prusa-Firmware-Buddy-Private%2FMultibranch%2Fprivate&subject=private>)](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy-Private/job/Multibranch/job/private/)
[![Build Status](<https://holly.prusa3d.com/buildStatus/icon?job=Prusa-Firmware-Buddy-Private%2FMultibranch%2Fmaster&subject=master>)](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy-Private/job/Multibranch/job/master/)
[![Build Status](<https://holly.prusa3d.com/buildStatus/icon?job=Prusa-Firmware-Buddy-Private%2FAuto-Pull-Master&subject=auto-update-master>)](https://holly.prusa3d.com/job/Prusa-Firmware-Buddy-Private/job/Auto-Pull-Master/)
[![Build Status](<https://holly.prusa3d.com/buildStatus/icon?job=Prusa-Firmware-Buddy-Private%2FMerge-Master-To-Private&subject=merge-master-to-private-daily>)](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.

Expand All @@ -13,7 +15,7 @@ The currently supported models are:

### Requirements

- Python 3.6 or newer
- Python 3.8 or newer

### Cloning this repository

Expand Down
4 changes: 0 additions & 4 deletions cmake/AnyGccArmNoneEabi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ set(CMAKE_CXX_FLAGS_INIT
"${SPECS}"
CACHE STRING "" FORCE
)
set(CMAKE_EXE_LINKER_FLAGS_INIT
"-u _scanf_float"
CACHE STRING "" FORCE
)

set(CMAKE_ASM_COMPILE_OBJECT
"<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>"
Expand Down
47 changes: 47 additions & 0 deletions cmake/CheckRemotes.cmake
Original file line number Diff line number Diff line change
@@ -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")
7 changes: 6 additions & 1 deletion cmake/Utilities.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
get_filename_component(PROJECT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
get_filename_component(PROJECT_ROOT_DIR "${PROJECT_CMAKE_DIR}" DIRECTORY)

# cache BUDDY_NO_VIRTUALENV across builds
set(BUDDY_NO_VIRTUALENV
$<BOOL:$ENV{BUDDY_NO_VIRTUALENV}>
CACHE BOOL "Disable python virtualenv management"
)
if(NOT Python3_EXECUTABLE)
if(NOT DEFINED ENV{BUDDY_NO_VIRTUALENV})
if(NOT ${BUDDY_NO_VIRTUALENV})
set(Python3_ROOT_DIR "${CMAKE_SOURCE_DIR}/.venv")
endif()
find_package(Python3 COMPONENTS Interpreter)
Expand Down
4 changes: 2 additions & 2 deletions doc/dump.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

offset size content
0x00000000 0x00020000 RAM (0x20000000..0x2001ffff)
0x00020000 0x00010000 CCRAM (0x10000000..0x1000ffff)
0x00020000 0x00010000 CCMRAM (0x10000000..0x1000ffff)
0x00030000 0x00008000 System + OTP (0x1fff0000..0x1fff8000)
0x00038000 0x00100000 Flash (0x08000000..0x080fffff)
planned, not implemented
0x00138000 0x00000800 EEPROM0 (0x0000..0x0800) saved eeprom
0x00138800 0x00000800 EEPROM1 (0x0000..0x0800) current eeprom
0x00139000

##registers - CCRAM (0x1000ff00-0x1000ffff)
##registers - CCMRAM (0x1000ff00-0x1000ffff)
offset size content
0x00 0x60 general registers
0x60 0x8c SCB
Expand Down
5 changes: 4 additions & 1 deletion doc/logging_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ This file is generated automatically so don't edit it directly
- GUI: LOG_SEVERITY_DEBUG, src/gui/logger.cpp
- Led: LOG_SEVERITY_INFO, src/gui/led_animations/printer_animation_state.cpp
- Loadcell: LOG_SEVERITY_INFO, src/common/loadcell.cpp
- LoveBoard: LOG_SEVERITY_INFO, src/gui/guimain.cpp
- MMU2: LOG_SEVERITY_INFO, src/common/appmain.cpp
- Marlin: LOG_SEVERITY_INFO, src/common/marlin_log_component.cpp
- MarlinClient: LOG_SEVERITY_INFO, src/common/marlin_client.cpp
Expand All @@ -49,6 +50,8 @@ This file is generated automatically so don't edit it directly
- USBMSC: LOG_SEVERITY_DEBUG, src/buddy/usb_device_msc.cpp
- W25X: LOG_SEVERITY_DEBUG, src/common/w25x.cpp
- WUI: LOG_SEVERITY_DEBUG, lib/WUI/wui.cpp
- connect: LOG_SEVERITY_DEBUG, src/connect/connect.cpp
- XLCD: LOG_SEVERITY_INFO, src/gui/guimain.cpp
- connect: LOG_SEVERITY_INFO, src/connect/connect.cpp
- httpc: LOG_SEVERITY_DEBUG, src/common/http/httpc.cpp
- socket: LOG_SEVERITY_DEBUG, src/common/http/socket.cpp
- transfers: LOG_SEVERITY_INFO, src/transfers/logging.cpp
2 changes: 1 addition & 1 deletion doc/prusa_printer_settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ psk=SuperSecretWifiPassword
# Same as lan_ip6 but configuration for WIFI.

[service::connect]
hostname = connect.prusa3d.com
hostname = buddy-a.connect.prusa3d.com
token = 1234567890
port = 443
tls = yes
Loading

0 comments on commit 7508811

Please sign in to comment.