Saturday, February 2, 2019

Using arduino-cli

I missed the arrival of arduino-cli.
This is a great tool as we can finally use arduino libraries and codes without having to use the GUI, which I, personally, can't stand.

As usual my usage is different from the vast majority of people.
In this case I don't burn the bootloader so I can't use the upload functionality of arduino-cli.
Instead I use avrdude.

Everything stays easy though:

1. Follow the instructions here: https://github.com/arduino/arduino-cli


# 2. Install missing core (cf instructions)
nano .cli-config.yml           #add core: https://github.com/MCUdude/MiniCore
arduino-cli core update-index
# 2a. Look for your core
arduino-cli core list
# 2b. install it
arduino-cli core install MiniCore:avr

# 3. search for board name -> MiniCore:avr:328
arduino-cli board listall


# 4. Compile your project
arduino-cli compile --fqbn MiniCore:avr:328 myproject

# 5. Upload .hex file and fuses
sudo avrdude -p m328p -c linuxgpio -e -U flash:w:myproject.MiniCore.avr.328.hex \
       -U lfuse:w:0xe2:m -U hfuse:w:0xd9:m -U efuse:w:0xff:m


I had problems with avr-g++ and other binaries not being found.
I don't have the time to fix this nicely.

I edited ~/.arduino15/packages/MiniCore/hardware/avr/2.0.1/platform.txt


#change this:
#compiler.path={runtime.tools.avr-gcc.path}/bin/
#to this:
compiler.path=/usr/bin/   # or the directory where you have the avr-g++ binary
                          # you can use `whereis avr-g++`



1 comment:

  1. When you call play bazaar a locksmith company, inquire as to how potential employees are vetted by the administration. It is always good to hear that technicians went through a criminal background check prior to being hired. This should provide you with some peace of mind that the technician that comes out to yourSatta Kinglocation is only there to help you.

    ReplyDelete