Need some help with compiling hex file [SOLVED]

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Kent, luketeaford, lisa, Joe.

Post Reply
User avatar
batchas
Super Deluxe Wiggler
Posts: 4747
Joined: Wed Nov 09, 2011 2:51 pm

Need some help with compiling hex file [SOLVED]

Post by batchas » Thu Sep 19, 2019 8:11 am

Here is my question explained in 1:17 minutes:
[video][/video]
Link:

----

Here if more details are needed:
When I compile to a hex file from a Mutable Instrument code, like braids for instance, I have in my GitHub directory, then I open the Terminal under OS X.
I paste:
cd /Users/batchas/Documents/GitHub/mutable-dev-environment
to go to the directory, then I paste:
vagrant up
which is mounting the Ubuntu machine I have in VirtualBox.
Then I paste:
vagrant ssh
And then these lines to compile the code and generate braids_bootloader.hex and braids.hex files.
make -f braids/bootloader/makefile hex
make -f braids/makefile hex
All ok.

Now when I have for instance Penrose-master in my GitHub directory and I want to compile to a hex file, how do I do?


I spent a lot of time trying all kind of things.
If I write this in the terminal,
cd /Users/batchas/Documents/GitHub/Penrose-master/Firmware
vagrant up
then a lot of errors would come up, I guess because there’s no vagrant file there.

If I put the Penrose-master into the mutable-dev-environment/eurorack-modules like where braids directory is, or any other Mutable directory, then a lot of files will be compiled, but not the hex file, as some errors will stop the process at some point, as a few includes are not found (like <avr/io.h> for instance in adc.h just to name one). Then I tried changing paths to these include files, but it all seems like an avalanche of never-ending things to change.
pld commented in another thread that I didn't want to hijack:
pld wrote:<avr/io.h> should be part of the compiler package (it's been years, so I'm not sure if that's avr-gcc or crosspack-avr, but they can be installed with brew on OS X) and everything gets compiled on command line (make avr).
And normally you shouldn't have to change the makefile, anything settable can be set from the command line also.
As avr-gcc and crosspack-avr are installed, I decided to ask here what is the right method for compiling code for AVR which are not Mutable Instruments codes.
I thought I should put them in the mutable-dev-environment/eurorack-modules directory, but it does not seem to be the solution.
Last edited by batchas on Thu Sep 19, 2019 9:59 am, edited 1 time in total.
-----------------------------------
Batchas website
Bandcamp page

User avatar
pld
Ultra Wiggler
Posts: 989
Joined: Thu Mar 05, 2015 5:15 am
Location: Germany
Contact:

Post by pld » Thu Sep 19, 2019 9:12 am

You seem to be taking a convoluted path and mixing & matching things. There is no one-size-fits-all approach since each project may have it's own dependencies and specifics.

Here's what I did to compile Penrose (on OS X):
cd ~/dev # or wherever you keep things
git clone <penrose repo>
cd Penrose/Firmware
make avr

...
Linking build/quantizer.elf...
Creating binary quantizer.hex...


In my case, there's an avr-gcc in /usr/local/CrossPack-AVR/ and /usr/local/CrossPack-AVR/bin is on the path. That may depend on how you installed yours, mine's been there since probably 2014 so I can't remember :)
If it's somewhere else, or not in the path, you can set the AVR_TOOLKIT_ROOT environment variable to point somewhere else (export ...) or pass it along to the makefile:
make avr AVR_TOOLKIT_ROOT=/usr/local/CrossPack-AVR/

Any error messages usually say what's going wrong.

You can put the source files where vagrant can find them, then after `vagrant ssh` you should be able to compile it in there also, assuming the avr-gcc in the Linux environment is correctly configured.

User avatar
batchas
Super Deluxe Wiggler
Posts: 4747
Joined: Wed Nov 09, 2011 2:51 pm

Post by batchas » Thu Sep 19, 2019 9:59 am

pld wrote:You seem to be taking a convoluted path and mixing & matching things.
Obviously. I would not ask here if I didn't 8-)
pld wrote:Here's what I did to compile Penrose (on OS X)
Thanx a lot pld. Worked like a charm (lucky I have also AVR/CrossPack also in /usr/local/) :tu:


In my notes I noticed 2 years ago that the command "make avr" was not working when I tried, that's why since then I was taking another route, but it looks like back then something was not installed the right way. Since then I used avrdude, vagrant etc. Anyway, all fine now (except Ubuntu/Vagrant after I updated Ubuntu!!! But that's a different story).
-----------------------------------
Batchas website
Bandcamp page

User avatar
Staticcharge
Common Wiggler
Posts: 225
Joined: Tue May 05, 2015 2:02 pm
Location: Somewhere between yesterday and tomorrow.

Re: Need some help with compiling hex file [SOLVED]

Post by Staticcharge » Fri Feb 21, 2020 11:50 am

I need help with compiling a HEX if help is available?
I have all the requested requirements found here: https://github.com/pichenettes/mutable- ... /README.md
I'm using a windows 10 machine and when I enter vagrant up into the terminal I get this:
C:\Users\Phil\.vagrant.d>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'base' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'base' (v0) for provider: virtualbox
default: Downloading: base
default:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

The box folder is empty, how do I create "base" ?
I'm trying the create a HEX from the Plaits script and I've never done it before so I'm just following the info found on the Mutable-dev-env link above.
any directions would be a great help but remember I've not tried it before and I'm determined to learn how to compile it myself so please be gentle.
Thank you for your time in advance.

User avatar
Staticcharge
Common Wiggler
Posts: 225
Joined: Tue May 05, 2015 2:02 pm
Location: Somewhere between yesterday and tomorrow.

Re: Need some help with compiling hex file [SOLVED]

Post by Staticcharge » Fri Feb 21, 2020 12:58 pm

I managed to get everything working but I don't seem to be able to find the HEX file i've made. I guess I'll need to spend a little more time to figure out where it puts things. It would be nice if it put the HEX files in the same place it found the make files.

Post Reply

Return to “Music Tech DIY”