Module firmware development: avr32 toolchain

I made a GitHub repo with the Linux toolchain in it (so that we can use it with travis-ci).

git clone https://github.com/samdoshi/avr32-toolchain-linux.git
cd avr32-toolchain-linux
tar xvfz avr32-gnu-toolchain-3.4.3.820-linux.any.x86_64.tar.gz
mv avr32-gnu-toolchain-linux_x86_64 $HOME/avr32-tools
unzip avr32-headers-6.2.0.742.zip -d $HOME/avr32-tools/avr32/include
1 Like

this is a great idea - i should do the same for the windows toolchain. are there any licensing issues with hosting those files in a personal github repo? could we perhaps add this to monome github?

1 Like

I have no idea about licensing really… I just don’t like the idea of Microchip (nĆ©e Atmel) making life difficult or worse down the line. Certainly much of it (all?) is licensed under the GPL, but to what extent that allows me to redistribute their binaries and header files is another matter.

And yes, it really needs to be moved to the monome org. We just need to update all the .travis.yml files once it has.

@tehn shall I open a repo transfer request?

(edit: I’m wondering if recommending the WSL approach on Windows might be the way to go with regards to firmware compiling?)

1 Like

would WSL provide any benefit over just running natively?

At least for Teletype there are more dependencies now. Ragel, as well as some more complex ones to generate the PDF documentation. It’s very hard for me to test how that works under Windows, whereas I have easy access to both Linux and OSX.

This is the latest README.md for Teletype, you can see all the things that need installing…

I think you’re the only main developer that uses Windows. Given that Linux and OSX play nicely with each other, and that now Windows 10 can be made to behave like Linux, I think it’s worth exploring as the ā€˜recommended’ way to develop on Windows.

you’d still need to install dependencies either way though. but you’d gain the benefit of having one set of instructions and make files - i’ll give this a try (need to set up the toolchains on new laptop), if it doesn’t complicate things greatly :slight_smile:

1 Like

sorry - need further hand holding - so i enabled WSL, installed bash/ragel/make and trying to build teletype (your 2.0 branch) and getting this: ../module/main.d:1: *** multiple target patterns. Stop..

same if i do make clean…

*,d files are used by make to track header dependencies. My guess is that they’ve got line ending issues now. Either, use the non-WSL tools and run make clean to clean them up. Or just delete all the *.d files.

1 Like

thanks! that worked, but getting a different error now:

make: uname: Command not found
make: uname: Command not found
make: uname: Command not found
make: uname: Command not found
make: cmd: Command not found
make: *** [../module/main.o] Error 127```

Can you try the following:

apt install build-essentials

E: Unable to locate package build-essentials

Type apt update first

It’s possible that both commands might need a sudo

sudo apt update
sudo apt install build-essentials

executed sudo apt update but still getting the same E: Unable to locate package build-essentials error when doing sudo apt install build-essentials

My bad. It’s:

apt install build-essential

(no ā€œsā€)

that worked! but ran into a different issue, it says it can’t find avr-gcc even though this part worked previously. i’ll try redoing the toolchain setup using the instructions tonight and see if that helps (for now just wanted to try it quickly so simply pointed PATH to my existing toolchain).

You need the Linux version installed though!

You can use the .travis.yml file to crib the instructions for getting it set up (plus you can download the tools from my GitHub repo, rather than Microchip).

1 Like

thanks, will give it a try tonight! once i have it set up on my desktop successfully i’ll go through it again on my laptop, taking notes in the process and then we can add a section on windows toolchain set up.

1 Like

installed the toolchain (linux one from your repo) and now it finds avr-gcc but it just outputs CC ../module/main.o and then nothing happens.

i was able to build the firmware by just manually running ragel in bash and then using the old makefile so not blocked for now. if i can’t get bash to work i’ll have to try building ragel for windows - looks like there is no precompiled version available anymore (somebody has it in their repo but i’d rather build it myself)

I take it you mean avr32-gcc right?

Hmmmm, that’s a mystery.

Looks like there is a Rainmaker firmware update coming soon. Once that’s out I’ll need a Windows VM to install it (might as well go Windows 10). I’ll see if I can have a go at setting WSL up.


Just seen that Microsoft have evaluation VirtualBox images of Windows 10 Enterprise. 12.9gb download here we go! (It even includes Bash on Windows installed, how nice of them.)

1 Like

Success!

It’s made overly complicated by these 2 issues: #1048 and #1462.

So you need to compile you’re own toolchain. Which needs 8gb of free RAM due to Windows Defender going crazy. Also, it takes hours to build (which made the repeated out of memory errors even more fun).

I need to make some changes to the instructions and possibly patch one of the files before it will be ready for you.

The changes aren’t particularly hard, but given how long it takes to compile (about 4 hours in VM), it might take 24 to 48 hours to finish.

1 Like