===to compile a tiny bootloader===
{{ :pasted:20200929-072031.png}}
===TLDR===
on ubuntu (or wsl)
sudo apt-get install avr-libc gcc-avr
git clone git@github.com:idiot-io/TinyAudioBoot.git
cd TinyAudioBoot
sh setup.sh
cd TinyAudioBoot
#build the hex
make
#flash the hex
make upload
we are piggy backing on a windows successful bootloader upload to grab the right fuses everything. \\
just need to adapt
* serial port (if changed from the windows upload sequence.
* full path to HEX file (TinyFlexiAudioBoot_PB0.hex) you got from the make/linux build.\\
if you first had it running from arduino just changing the serial and hex file should have this running from cmd anywhere in your system.
#fuses burn
C:\Users\Admin\AppData\Local\Arduino15\packages\8BitMixtape\hardware\avr\0.0.28/tools/avrdude/windows/avrdude -cstk500v1 -B4 -PCOM8 -b19200 -pattiny85 -CC:\Users\Admin\AppData\Local\Arduino15\packages\8BitMixtape\hardware\avr\0.0.28/tools/avrdude/windows/avrdude.conf -Ulfuse:w:0xE1:m -Uefuse:w:0xFE:m -Uhfuse:w:0xDD:m
#burn the bootloader
C:\Users\Admin\AppData\Local\Arduino15\packages\8BitMixtape\hardware\avr\0.0.28/tools/avrdude/windows/avrdude -cstk500v1 -B4 -PCOM8 -b19200 -b19200 -pattiny85 -CC:\Users\Admin\AppData\Local\Arduino15\packages\8BitMixtape\hardware\avr\0.0.28/tools/avrdude/windows/avrdude.conf -Uflash:w:C:\DEV\GitHub\FlexiATiny85-AudioBoot\code\bootloader\TinyFlexiAudioBoot_PB0.hex:i
=== why===
was asked to compile the [[https://github.com/idiot-io/TinyAudioBoot|TinyAudioBoot]] bootloader.
i couldn't get budi's ''TinyAudioBoot/bootloaderbuild'' to work, must be a typo of mine. \\
yes, recreate the symbolic link for ''bootloaderbuild/main.cpp''
ln -s /where/is/repo/TinyAudioBoot/TinyAudioBoot/TinyAudioBoot.c main.cpp
so decided to make an automated build system that will pull (most) needed dependencies and compile.
[[https://github.com/idiot-io/TinyAudioBoot|here]] is the working repo, ill submit when its done.
the current dependencies are
* arduino software - this you'll have to install yourself. and supply the path to the Makefile. there are instructions below.
* [[https://github.com/sudar/Arduino-Makefile.git|Arduino-Makefile]] - an external build system for arduino (see also arduino-cli)
* [[https://github.com/SpenceKonde/ATTinyCore|ATTinyCore]]
**os support**
for the following i used ubuntu on windows. \\
so get into ubuntu, TLDR: use [[https://code.visualstudio.com/|vscode]] and click the bottom left green button.
\\
this will work also on linux native\\
budi's ''bootloaderbuild'' was tested on mac, so try that.
===install arduino===
TLDR, or see setup script in git folder. \\
to install it inside the project folder.
wget https://downloads.arduino.cc/arduino-1.8.13-linux64.tar.xz
tar -xf arduino-1.8.13-linux64.tar.xz
#just renaming the thing
mv arduino-1.8.13-linux64 arduino/
#and moving to our local user bin folder.
mv arduino-1.8.13-linux64 ~/.local/bin/
if all went well you will have an arduino installed in linux under path ''~/local.bin/arduino''\\
if you're on linux desktop you can run
./install.sh
from the arduino directory to get the icons on desktop, we are not interested.
===get the project===
we will clone the git for tinyaudio and get the two other submodules.
git clone git@github.com:idiot-io/TinyAudioBoot.git
cd TinyAudioBoot
git update submodules --init
cd TinyAudioBoot
#clean the build folder (bin)
make clean
#build the hex
make
#flash the hex
make upload
the output has this flags, broken into lines. because its an automated build system it spits out a few double and empty flags.\\
note the first Capital Letter after a ''-'' is part of the avr flag system. and not part of the variable.
/usr//bin/avr-g++
-MMD
-c
-D__PROG_TYPES_COMPAT__
-g
-Os
-w
-W
-ffunction-sections
-fdata-sections
-MMD
-I.
-DBOOTLOADER_ADDRESS=0x0x1BC0
-I
-I
-I../TinyAudioBoot
-mmcu=attiny85
-DF_CPU=8000000L
-DARDUINO=1813
-DARDUINO_ARCH_AVR
-I/mnt/c/dev/TinyAudioBoot/TinyAudioBoot/../ATTinyCore/avr//cores/tiny
-I/mnt/c/dev/TinyAudioBoot/TinyAudioBoot/../ATTinyCore/avr//cores/tiny/api
-I/mnt/c/dev/TinyAudioBoot/TinyAudioBoot/../ATTinyCore/avr//variants/tinyX5
-Wall
-ffunction-sections
-fdata-sections
-Os
-pedantic
-Wall
-Wextra
-fpermissive
-fno-exceptions
-std=gnu++11
-fno-threadsafe-statics
-flto
-fno-devirtualize
-fdiagnostics-color=always
/mnt/c/dev/TinyAudioBoot/TinyAudioBoot/../ATTinyCore/avr//cores/tiny/new.cpp
-o /mnt/c/dev/TinyAudioBoot/TinyAudioBoot/bin/attinyx5/TinyAudioBoot/core/new.cpp.o