arduino-bsd-mk vs. an arduino nano

I ran into a few small-but-important issues doing the "hello world" equivalent on an arduino nano after installing the arduio-bsk-mk tools.

First part was getting the Makefile correct.

Code:
ARDUINO_DIR=    /usr/local/arduino
ARDUINO_MK_DIR= /usr/local/arduino-bsd-mk
#ARDUINO_LIBS=
AVRDUDE_PORT=   /dev/ttyU0
AVRDUDE_SPEED=  115200
ARDUINO_BOARD=  nano
MCU=            atmega328p
TARGET=         arduino1

include /usr/local/arduino-bsd-mk/bsd.arduino.mk

First thing I did was set the ARDUINO_BOARD. That led me to an error with a missing -mmcu parameter from GCC. Setting MCU fixed that. One other trick was making the main source file name the same as the project eg. 'arduino1.ino'.

That was enough do to a 'make' from the shell. Running 'make install' to program the nano came with some issues too. Setting port permissions was easy enough. However, I was seeing errors related to include baud rate for '-P'. Took me a while to realize the baud rate parameter '-b' appeared just before the '-P' parameter. The '-b' argument ate the next argument. Setting ARDUINO_SPEED fixed that.

Next up was an error from avrdude complaining of a lack of a /usr/local/etc/avrdude.conf file. I ran a search using find, and found an avrdude.conf file under /usr/local/arduino/hardware/arduino/avr/bootloaders/gemma/avrdude.conf. I copied this to /usr/local/etc/ and now ...

Code:
~/arduino1 $ make install
avrdude  -V  -p atmega328p  -c arduino  -b 115200 -P /dev/ttyU0  -U flash:w:~/arduino1/arduino1.hex:i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "/usr/home/unitrunker/arduino1/arduino1.hex"
avrdude: writing flash (1118 bytes):

Writing | ################################################## | 100% 0.21s

avrdude: 1118 bytes of flash written

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done.  Thank you.

Now the nano blinks as expected.

I'm currently stuck getting the Arduino 1.8.5 IDE to recognize my ttyU0 port but at least the hardware is confirmed working from a shell prompt.
 
To get the IDE working (well it compiles but I can't push the code to the nano), I consulted this:


These steps yielded no improvement.
 
Back
Top