Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added install steps for using the toolchain #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
target
*.code-workspace
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,37 @@ Planned:

## Development

To use `cargo run` below you need to have [rustup](https://rustup.rs/) installed.

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
To build for the nRF52832 install the correct ARM target.

$ rustup target add thumbv7em-none-eabihf

`cargo run` uses `arm-none-eabi-gdb`. Use the [latest version from ARM's website](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). From Ubuntu 18 onwards, the version obtained from `apt-get` is too old and does not work. Make sure to remove the old toolchain version.

$ sudo apt remove binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi

Untar the new package in your home directory (or wherever you like to have it installed):

$ tar -xjvf gcc-arm-none-eabi-x-xxxx-qx-update-linux.tar.bz2

Add the new toolchain to your path:

$ nano ~/.profile

At the bottom of the file add the following line (don't forget to replace xxxx with your version values)
```
export PATH=$PATH:/home/(your user)/gcc-arm-none-eabi-x-xxxx-qx-update/bin/
```

Reboot computer or run in terminal

$ export PATH=$PATH:/home/(your user)/gcc-arm-none-eabi-x-xxxx-qx-update/bin/

Now you are done installing the ARM toolchain and you can use `cargo run`.


### Flashing (cargo-embed)

Install cargo-embed:
Expand Down Expand Up @@ -54,4 +85,16 @@ Run JLinkGDBServer:

Run the code

$ cd pinetime-rtfm
$ cargo run [--release]

gdb might notify you that auto-loading has been declined by some safety settings. To add an exception open your `.gdbinit` file

$ nano ~/.gdbinit

At the bottom of that file add the rule (replace with the location of your own pinetime-rtfm directory location)
Hint: gdb will suggest what line to add to your `~/.gdbinit` file exactly in its warning message.

```
add-auto-load-safe-path /home/(user)/git_repos/pinetime-rtfm/pinetime-rtfm/.gdbinit
```