Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save allfake/e1205de15ddeb218fbbda0678ba20ce9 to your computer and use it in GitHub Desktop.
Save allfake/e1205de15ddeb218fbbda0678ba20ce9 to your computer and use it in GitHub Desktop.
If you follow instruction at https://github.com/RAKWireless/RUI_Platform_Firmware_GCC.
And work, that will be fine. For me, that not work well. I feel like i live in space. Yeah!
This because i have no knowlage about nrf52, nordic, rak, microcontroller, c language ... well, i am game developer not expert microcontroller. (I suck at this)
Anyway, let's start.
Install arm-none-eabi
DO NOT USE LASTEST VERSION -> i use version 7.2.1 (GNU Tools for Arm Embedded Processors 7-2017-q4-major)
You can use lower version
- download from here https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads/7-2017-q4-major-1-1
[Check here for more information https://gist.github.com/joegoggins/7763637]
In winodw if you use cygwin that RAKWireless recommended, you NEED to install "make" too. Because "make" not include.
- download and install J-Link Software https://www.segger.com/downloads/jlink/
In mac check nrfjprog is installed.
For me, nrfjprog is installed by nRF5x-Command-Line-Tools.
And add it to ~/.bash_profile
add line this in your "~/.bash_profile"
================================
export PATH="$HOME/[You path]/nRF5x-Command-Line-Tools/nrfjprog:$PATH"
export PATH="$HOME/[You path]/nRF5x-Command-Line-Tools/mergehex:$PATH"
================================
for gcc
=================================
export PATH="$HOME/[You path]/gcc-arm-none-eabi/bin:$PATH"
=================================
--------------------------------------------
This should end step 2 in RAKWireless readme
--------------------------------------------
- download https://github.com/RAKWireless/nRF5SDK15.0.0 and extract it.
- download https://github.com/RAKWireless/RUI_Platform_Firmware_GCC and extract it.
- Put "RUI" folder that inside RUI_Platform_Firmware_GCC to "nRF5_SDK_15.0.0_a53641a" folder
folder structure will be like this
nRF5_SDK_15.0.0_a53641a
- RUI
- components
- config
- ...
For mac
Edit this file "nRF5_SDK_15.0.0_a53641a/components/toolchain/gcc/Makefile.posix
For Window
Edit this file "nRF5_SDK_15.0.0_a53641a/components/toolchain/gcc/Makefile.windows
============================
GNU_INSTALL_ROOT := $(PROGFILES)/GNU Tools ARM Embedded/4.9 2015q3/bin/ -> change to your file path
GNU_VERSION := 4.9.3 -> change to your version
GNU_PREFIX := arm-none-eabi
============================
example
$ which arm-none-eabi-gcc
/Users/admin/CMMC/gcc-arm-none-eabi/bin/arm-none-eabi-gcc
$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
============================
GNU_INSTALL_ROOT := /Users/admin/CMMC/gcc-arm-none-eabi/bin/arm-none-eabi-gcc/
GNU_VERSION := 7.2.1
GNU_PREFIX := arm-none-eabi
============================
---> WARNING in GNU_INSTALL_ROOT, Do not forget to add "/" in the end.
Open terminal and goto your folder /nRF5SDK15.0.0/nRF5_SDK_15.0.0_a53641a/RUI/build
$ make help
If everythings work it will show help.
----------------------------------------
Try make
For me i use RAK8212M
*** To enable log go to "/nRF5SDK15.0.0/nRF5_SDK_15.0.0_a53641a/RUI/Source/sdk_config.h" and find and change "NRF_LOG_ENABLED 0" to "NRF_LOG_ENABLED 1".
$ make P="1 2 4"
you will get "_build" folder
----------------------------------------
To flash code
I use nrfjprog.
$ nrfjprog -f nrf52 --eraseall
$ nrfjprog --program hex/s132_nrf52_6.0.0_softdevice.hex
$ nrfjprog --program _build/nrf52_xxaa.hex --sectorerase
$ nrfjprog -r
In window you have nrfgo studio.
-----------------------------------------
To view data open other 2 terminal
First terminal type
$ JLinkExe -device NRF52 -if SWD -speed 4000 -autoconnect 1
Then, Secoud terminal type
$ JLinkRTTClient
You should get log from secound terminal.
If nothing show up, try unplug and redo this section.
-------------------------------------------
END.
(After this i not know want i can do, i live in speace again)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment