Unfortunately, there is no way to differentiate between an optimized gpio write (safe always on the atmega32u4) and an unoptimized write (read-modify-write, dangerous if any other pin on that Port is used in an ISR). While very quickly polling the tmc registers, I noticed that the moving stepper would do some random extra steps. That can only be explained by the following sequence of actions: - the spi code reads the PORT register - ISR toggles the step line, changing the value in the PORT register - the spi code writes the upated PORT back, resetting the step line to the old state After making the writes atomic, the stepping issue disappeared and the driver checks also worked correctly |
||
|---|---|---|
| .vscode | ||
| cmake | ||
| lib | ||
| src | ||
| tests | ||
| utils | ||
| .clang-format | ||
| .cmake-format.py | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| CMakeLists.txt | ||
| Doxyfile | ||
| README.md | ||
| version.cmake | ||
README.md
Prusa-Firmware-MMU-Private
How to prepare build env and tools
Run ./utils/bootstrap.py
bootstrap.py will now download all the "missing" dependencies into the .dependencies folder:
- clang-format-9.0.0-noext
- cmake-3.22.5
- ninja-1.10.2
- avr-gcc-7.3.0
How to build the preliminary project so far:
Now the process is the same as in the Buddy Firmware:
./utils/build.py
builds the firmware.hex in build/mmu_release
In case you'd like to build the project directly via cmake you can use an approach like this:
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=../cmake/AvrGcc.cmake
ninja
It will produce a MMU2SR_<version>.hex file.