[klipper] Re: Arduino Nano as a secondary MCU

  • From: "Jeffrey B. Rogers" <sgtnoodle@xxxxxxxxx>
  • To: klipper@xxxxxxxxxxxxx
  • Date: Sat, 13 Mar 2021 18:30:44 -0800

Hi Tomáš,

Compiling the code for the atmega2560 isn't going to work on an atmega328p.
Even though you were able to flash the nano with the firmware, it's
effectively going to be gibberish to the microcontroller's CPU.

If there's an option to compile the code for an atmega328p, then it might
work. I suspect that it won't be an option, though, because the atmega328p
most certainly lacks enough flash and ram to run klipper's firmware.

You might still be able to achieve what you want to do, but it will likely
take getting your hands dirty with the firmware. It may be too much work to
be worth doing, vs. getting a supported microcontroller to use instead.

Cheers,

Jeff

On Sat, Mar 13, 2021, 5:40 PM Tomáš Fúdor <tomas.fudor@xxxxxxxxx> wrote:

Hi.
I hope this is right place to ask questions like this.
Please, help me with this.
 I want to use Arduino Nano as a secondary MCU, only for the ADXL345.
 Dont want to connect that accelerometer to RPi, because i have display
connected in RPi's GPIO.
I am not very familiar with Raspbian and things around.
Have installed FluiddPi and Klipperscreen.

Used this procedure:


cd ~/klipper
git pull
~/klipper/scripts/install-octopi.sh

make menuconfig   (dont have changed nothing - leaving Mega2560)
make clean
make

sudo service klipper stop
make flash
FLASH_DEVICE=Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0
avrdude -carduino -patmega328p
-P/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A50285BI-if00-port0 -b115200
-D -Uflash:w:out/klipper.elf.hex:i
sudo service klipper start


After that, i have added this to my printer.cfg :


[mcu nano]
serial = /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A50285BI-if00-port0



But there are problems with connection.


Unable to connect
Once the underlying issue is corrected, use the
"FIRMWARE_RESTART" command to reset the firmware, reload the
config, and restart the host software.
Error configuring printer


Please, help me with this.
Possibly, i dont understand how to use that Nano.
Do i need some alternative bootloader or something?
I am lost here.
Both boards seems to be flashed properly.
.log files are attached

Thank you for any advices.

[klippy.log](
https://github.com/KevinOConnor/klipper/files/6135808/klippy.log)
[moonraker.log](
https://github.com/KevinOConnor/klipper/files/6135809/moonraker.log)



Other related posts: