Skip to content
Permalink
Browse files

Merge branch 'master' of https://github.com/monome/libavr32

  • Loading branch information
tehn committed Oct 18, 2016
2 parents 954dd9e + 7a3f152 commit aaf4b7075846de5c8758260adfb54d2ececc1122
Showing with 40 additions and 6 deletions.
  1. +37 −4 README.md
  2. +1 −0 src/adc.h
  3. +2 −2 src/usb/ftdi/ftdi.h
@@ -4,6 +4,7 @@

Common code shared between Monome Eurorack firmwares:

* [ansible][]
* [earthsea][]
* [kria][]
* [meadowphysics][]
@@ -24,7 +25,7 @@ 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
PREFIX=$HOME/avr32-tools make install-cross
# go make a cup of tea, this will take a while...
```

@@ -33,7 +34,7 @@ PREFIX=$HOME/avr32-tools make install-cross
If you're on Linux, download the toolchain and the headers from [Atmel][atmellinux]. You need to dowload:
- Atmel AVR 32-bit Toolchain 3.4.3 - Linux 64-bit (`avr32-gnu-toolchain-3.4.3.820-linux.any.x86_64.tar.gz`)
- Atmel 32-bit Toolchain (3.4.3) 6.2.0.742 - Header Files (`avr32-headers-6.2.0.742.zip`)

The headers need to be installed in the correct location.

To install on Linux in `~/avr32-tools`:
@@ -60,7 +61,7 @@ cd teletype
Let's build it, we need to make sure that `avr32-gcc` and company are available on our path. Assuming they are installed in `~/avr32-tools`:
```bash
export PATH="$HOME/avr32-tools/bin:$PATH"
cd src
cd module
make
```

@@ -70,7 +71,7 @@ To upload it, you'll need a [USB A-A][digikey] cable, then:

1. Power on your module with no USB cables attached, while holding down the front panel button
2. Connect the USB A-A cable to your computer and the module
3. Run `./flash.sh` in the `src` directory
3. Run `./flash.sh` in the `module` directory
4. The firmware should upload and verify itself. If it can't find the device, try repeating the steps.
5. Disconnect the USB A-A and power cycle the module to re-enable normal USB mode (otherwise your grid or keyboard will not be detected)

@@ -80,6 +81,35 @@ To upload it, you'll need a [USB A-A][digikey] cable, then:

This folder contains the Atmel software framework, if you wish to make changes here, please make them using the [diet-asf][] repo.

## AVR32 development

The modules use AVR32 MCUs from Atmel, either the [AT32UC3B0512][] or the [AT32UC3B0256][].

| module | MCU | RAM | ROM | default stack size | default NVRAM size |
|-------------------------------------------------|------------------|------|-------|--------------------|--------------------|
| [ansible][], [teletype][] | [AT32UC3B0512][] | 96kb | 512kb | 8kb | 256kb |
| [earthsea][], [meadowphysics][], [whitewhale][] | [AT32UC3B0256][] | 32kb | 256kb | 4kb | 128kb |

### Useful AVR32 documents

- [AVR32006: Getting started with GCC for AVR32](http://www.atmel.com/Images/doc32074.pdf): useful information on GCC flags and speed and size optimisation.
- [AVR32795: Using the GNU Linker Scripts on AVR UC3 Devices](http://www.atmel.com/images/doc32158.pdf): detailed instructions on controlling memory layout.
- [AT08569: Optimizing ASF Code Size to Minimize Flash and RAM Usage](http://www.atmel.com/Images/Atmel-42370-Optimizing-ASF-Code-Size-to-Minimize-Flash-and-RAM-Usage_ApplicationNote_AT08569.pdf).

### (very) In depth AVR32 documentation

There is a lot of overlap between these documents, the table of contents is at the back.

- [AT32UC3B Series Complete](http://www.atmel.com/Images/doc32059.pdf)
- [AVR32 Architecture Manual](http://www.atmel.com/Images/doc32000.pdf)
- [AVR32UC Technical Reference Manual](http://www.atmel.com/Images/doc32000.pdf)

### RAM and ROM usage

In short run `avr32-size -A <module name>.elf`. All free RAM is allocated to the `.heap`. ROM size is approximately `.data` + `.rodata` + `.text`. NVRAM is given by `.flash_nvram`. See [here][avr32-ram-and-rom-usage] for a more in depth discussion.


[ansible]: https://github.com/monome/ansible
[earthsea]: https://github.com/monome/earthsea
[kria]: https://github.com/monome/kria
[meadowphysics]: https://github.com/monome/meadowphysics
@@ -90,3 +120,6 @@ This folder contains the Atmel software framework, if you wish to make changes h
[atmellinux]: http://www.atmel.com/tools/atmelavrtoolchainforlinux.aspx
[homebrew]: http://brew.sh/
[digikey]: http://www.digikey.com/product-detail/en/101-1020-BE-00100/1175-1035-ND/3064766
[AT32UC3B0256]: http://www.atmel.com/devices/AT32UC3B0256.aspx
[AT32UC3B0512]: http://www.atmel.com/devices/AT32UC3B0512.aspx
[avr32-ram-and-rom-usage]: http://samdoshi.com/post/2016/10/avr32-ram-and-rom-usage/
@@ -2,6 +2,7 @@
#define _ADC_H_

#include "compiler.h"
#include "types.h"

// setup ad7923
extern void init_adc(void);
@@ -1,9 +1,9 @@
/* ftdi.h
ftdi driver for monome aleph
*/

#ifndef _ALEPH_FTD_H_
#ifndef _ALEPH_FTDI_H_
#define _ALEPH_FTDI_H_

#include "types.h"

0 comments on commit aaf4b70

Please sign in to comment.