This is a tentative/crude implementation of an Init and ISR for the MMU in order to check the motion API. We remove the "extern void Isr", declaring it "static inline" instead. We need to inline the ISR here in order to avoid the function call. Include the missing speed_table data in the executable. This bumps the code size to ~60% of the flash. Implemement motion::Init to setup the ISR and timers, and replace the call in main from tmc::Init to motion::Init. Motion will init each driver every time the axis is enabled, so there should be no need for a global module initialization (we need SPI, but this is initialized earlier on by it's own module anyway). The timer is currently setup without any HAL or proper TIMER1 wrapper. This is to be improved later. The real MMU unit seems to slow down quite a bit during acceleration. At this point we need to inline some methods in PulseGen to avoid overhead, however this breaks the stubs. |
||
|---|---|---|
| .vscode | ||
| cmake | ||
| lib | ||
| src | ||
| tests | ||
| utils | ||
| .clang-format | ||
| .cmake-format.py | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| CMakeLists.txt | ||
| Doxyfile | ||
| README.md | ||
| version.txt | ||
README.md
Prusa-Firmware-MMU-Private
How to prepare build env and tools
As the first step extract the AVR-GCC to some dir, e.g. /home/user/AVRToolchainMMU/avr8-gnu-toolchain-5.4.0
Add /home/user/AVRToolchainMMU/avr8-gnu-toolchain-5.4.0/bin to your PATH.
mkdir .dependencies
cd .dependencies
mkdir gcc-avr-5.4.0
cd ..
utils/bootstrap.py
bootstrap.py will now download all the "missing" dependencies into the .dependencies folder:
- clang-format-9.0.0-noext
- cmake-3.15.5
- ninja-1.9.0
Note: bootstrap.py will not try to download the AVR-GCC as there is already a directory called
gcc-avr-5.4.0. This will be fixed when we find out where to download the correct packages reliably.
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/AnyAvrGcc.cmake
ninja
Should produce a firmware.hex file as well.