Skip to content

Commit

Permalink
add instructions for using edbg to program FLASH
Browse files Browse the repository at this point in the history
  • Loading branch information
evq committed Nov 5, 2018
1 parent 7021b27 commit ef8ea3a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[target.thumbv8m.base-none-eabi]
runner = 'arm-none-eabi-gdb'
rustflags = [
"-C", "link-arg=-Tram.x",
"-C", "link-arg=-Tlink.x",
]

[build]
Expand Down
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,37 @@ naming convention used.

https://github.com/japaric/xargo/pull/226

It makes use of changes to `cortex-m-rt` and `cortex-m-semihosting`
which have not yet been merged upstream.
## Usage

By default the linker is configured to run everything out of RAM,
I have not yet managed to program the flash on this chip.
### Building the blink example

For help enabling executable RAM or more hints at how to program the flash see:
```
RUST_TARGET_PATH=`pwd` xargo build --release --target thumbv8m.base-none-eabi --example blink
```

https://github.com/dwelch67/atsaml11_samples/tree/master/ATSAML11
### Programming blink example to FLASH on the SAM L11 XPLAINED dev board

## Usage
First build and install [edbg](https://github.com/ataradov/edbg), SAM L11
support was recently added.

### Building the blink example
After building per the above section:

```
RUST_TARGET_PATH=`pwd` xargo build --release --target thumbv8m.base-none-eabi --example blink
arm-none-eabi-objcopy target/thumbv8m.base-none-eabi/release/examples/blink target/thumbv8m.base-none-eabi/release/examples/blink.bin -O binary
edbg -t mchp_cm23 -e -p -f target/thumbv8m.base-none-eabi/release/examples/blink.bin
```

### Running blink example on the SAM L11 XPLAINED dev board
### Running blink example out of RAM on the SAM L11 XPLAINED dev board

This requires RAM to be marked as executable, for help doing this see:
https://github.com/dwelch67/atsaml11_samples/tree/master/ATSAML11

You will want to edit `.cargo/config`, change `rustflags` as follows, then rebuild.
```
rustflags = [
"-C", "link-arg=-Tram.x",
]
```

This seems to only work with openocd 0.9, in one window run:
```
Expand Down
2 changes: 1 addition & 1 deletion memory.x
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* atsaml11e16 */
MEMORY
{
FLASH : ORIGIN = 0x08000000, LENGTH = 64K
FLASH : ORIGIN = 0x00000000, LENGTH = 64K
RAM : ORIGIN = 0x20000000, LENGTH = 16K
}

0 comments on commit ef8ea3a

Please sign in to comment.