Skip to content

Commit

Permalink
add changes for nRF52840-DK
Browse files Browse the repository at this point in the history
  • Loading branch information
fhars committed Oct 14, 2019
1 parent 70791a3 commit 7b50f07
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ to use:
./run_example.sh blink
```

This should work if you are using the nRF52-DK platform. For other platforms,
you will end up with a TAB file in `target/tab` that you can program onto your
Tock board (e.g. with `tockloader install target/tab/blink.tab`).
Due to bug #28 this will currently only work if you are using the nRF52-DK platform.

If you have a nRF52840-DK you must change `link-arg=-Tnrf52_layout.ld` in
`.cargo/config` to `link-arg=-Tnrf52840_layout.ld`

If you have a hail board you can flash your device as follows:
- set the environment variable `hail` to `1`
- set `link-arg=-Tnrf52_layout.ld` in `.cargo/config` to `link-arg=-Thail_layout.ld`
- change `link-arg=-Tnrf52_layout.ld` in `.cargo/config` to `link-arg=-Thail_layout.ld`
- run `run_example.sh` as above.

For other platforms, you may have to create your own memory layout definition.

## Using libtock-rs

The easiest way to start using libtock-rs is adding an example to the examples folder.
Expand Down
17 changes: 17 additions & 0 deletions nrf52840_layout.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* Layout for the nRF52840-DK, usable by the examples in this repository. */

MEMORY {
/* The application region is 64 bytes (0x40) */
FLASH (rx) : ORIGIN = 0x00030040, LENGTH = 0x0005FFC0
SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 62K
}

/*
* Any change to STACK_SIZE should be accompanied by a corresponding change to
* `elf2tab`'s `--stack` option
*/
STACK_SIZE = 2048;

MPU_MIN_ALIGN = 8K;

INCLUDE layout.ld

0 comments on commit 7b50f07

Please sign in to comment.