Module firmware development: avr32 toolchain

I can’t remember exactly, but think it’s one of those daft things where one fork works on OSX and one works on Linux/WSL. It might be something to do with differing versions of gperf and/or texinfo on each OS. But again, I can’t remember now.

It’s also not helped by the fact that it takes hours and hours to test each change.

looks like everything worked fine - set up the toolchain on my windows 10 laptop following your instructions above and was able to successfully build teletype firmware. missed the step to install gperf and unzip first, recompiled the toolchain again after installing them and everything went smoothly.

thanks again for your help with this! i’ll add a section for windows setup to the repo (and will add instructions to install WSL and clang-format for completeness).

edit: updated the readme: https://github.com/monome/libavr32

2 Likes

ran into several issues…

it loses path to avr32-tools each time i close bash. is there a way to make export PATH="$HOME/avr32-tools/bin:$PATH" permanent?


running op_enum.py i get the following error:

` File “op_enums.py”, line 36
output += f" {prefix}{e},\n"
^
SyntaxError: invalid syntax```

(^ above is actually pointing at the closing ")
this is only from bash, if i run windows version of python it runs successfully and generates op_enum.h.


another problem is not being able to use my regular editor - it appears there is a known issue where editing ubuntu files externally makes them invisible to bash. i’ll play some more but it might be just easier to switch to pure windows workflow, i’d just need to build ragel for windows (which is the only part i don’t have working without using bash).

Sorry for missing this, I don’t always seem to get notifications in this topic…


If you add the line to your .bash_profile it will run it on every shell startup, but please read up on the .bash_profile and .bashrc files.

Yep, WSL python is 3.5, we need 3.6. I’ve updated the script to do the version check properly now, so it should at least spit out a more useful error message.

I’ll update the docs thread with potential workarounds if you don’t have python 3.6 as your default.

1 Like

thanks @sam!

i also found a workaround for files becoming invisible if edited in windows - i checked out the repository into a non bash folder and i do all the editing and git work there, and use bash only to build - it doesn’t have these issues with external files.

1 Like

I’d like to see if I can compile/modify the Teletype firmware before I buy one because I’ll need to make some modifications to it at least for Japanese keyboard support.

From what I’ve understood (and what’s in the github help), most people here are on either Mac or Linux, but I’m using Windows and I’m much more used to environments like Visual Studio (though I can manage working with other IDEs if needed). I think it was mentioned that at least one person is doing Teletype/Monome dev on Windows, so if that person reads this and can give pointers/info about what works and what doesn’t in terms of setup/etc., that would be awesome :slight_smile:.

Thanks in advance…

Replying to myself as my thread/question was moved here, where it probably belongs :slight_smile:.

I’ve quickly read the doc at https://github.com/monome/libavr32 and I’ll try to do this at home when I have some time.

I forked the Teletype project, but I don’t need to do that for AVR32, right ? I can just use github.com/scanner-darkly/avr32-toolchain ?

I need to familiarize myself a bit more with Git though, Perforce and other source control tools I’m used to behave in a quite different way it seems…

Is it possible to compile using an IDE on Windows or is commandline the only option ?

@scanner_darkly can advise you as to the best way to develop on Windows.

Options are:

  • Try to use Atmel’s Windows version of GCC, plus you’ll need to bring in your own Rygel and Python
  • Use WSL (as suggested in the libavr32 readme)
  • Use a virtual machine running Linux

Correct. Just git clone it.

Command line only if going via WSL or on Linux. Probably the same for the first option too.


FYI @scanner_darkly in the edit you made to the libavr32 readme you’ve moved the word “bash” onto a new line for several of the code examples, that’s supposed to be on the same line as the backticks as it’s a syntax highlighting hint.

if you don’t plan to add new ops, you don’t need python / ragel bits. however you would still need to get the toolchain set up. i successfully set it up on my desktop computer but unfortunately didn’t take notes, and couldn’t get it going on my laptop, so bash was the only option (although it’s probably possible to have it set up on windows without using bash, which is really my preference, but i didn’t want to spend too much time fighting it, and i needed ragel anyway).

never tried setting up an IDE, would be nice, but notepad++ is sufficient for me. would be nice to have this option though…

if you put it on the same line bash doesn’t show up at all (tried it in firefox and chrome).

It’s not supposed to show up (you’re not supposed to type in bash). It just tells the Markdown processor what syntax highlighting to use…

https://help.github.com/articles/creating-and-highlighting-code-blocks/

Same thing works on here:

def this_is_python():
    print "hello"

Is done using

    ```python
    def this_is_python():
        print "hello"
    ```
1 Like

it’s fixed.
20 characters

1 Like

Thanks!

(20 characters)

Thanks for all the info :slight_smile: .

I will very likely want to add some operators so I guess I’ll have to install everything.
I’ll update this thread if/when I run into any issue.

1 Like

Hi,

I have tried getting the development environment working on OS X (I’m on 10.11.6). I have fixed a few errors but still can’t get it to fully build and install. I followed the instructions in the readme:

To install on OSX in ~/avr32-tools:

brew install mpfr gmp libmpc texinfo dfu-programmer
git clone https://github.com/monome/avr32-toolchain.git
cd avr32-toolchain
PREFIX=$HOME/avr32-tools make install-cross

I think it would be helpful if there were a pre-built OS X version.

What were the errors? Let’s see if we can get them sorted.

And do you have have the Xcode command line tools installed?

If you encounter an error make sure you have the Xcode command line tools installed. They can be installed by typing xcode-select --install (if they are already installed it will print an error message).

Mostly path errors. It couldn’t find gmp and mpfr after using brew to install, so I added things like --with-gmp="/usr/local" and that got me a bit farther.

I have tried the xcode-select command line install, but I keep getting an error that says

Can't install the software because it is not currently available from the Software Update server.

(??). I have xcode installed though, so I’m not sure if I’m missing stuff.

Have you got the latest Xcode installed via the Mac App Store? If not, do that before trying xcode-select --install again.

Also, running brew doctor might get you some info.

I think we need the command line tools installed as the install script uses pkg-config to locate libraries. So we should solve that issue first.

Ok. So brew doctor says I don’t have the CLTs installed. Still cannot install them though, not sure why.

There’s a new version of Xcode available now, so maybe you need to update that first?

I don’t think it’s letting me because I’m still on el capitan? I downloaded the command line tools for Xcode 8.2 via developer.apple.com and they are installing now.