Skip to content

Starting point and shared code for Nordic nRF52x Thread/BLE platforms.

License

Notifications You must be signed in to change notification settings

btetz14/nrf52x-base

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nordic nRF52x Support Files

Build Status

This repository is a starting point and shared code for Nordic nRF52x BLE/Thread platforms. This repo is a collection of libraries, SDKs, Softdevices, and Makefiles to be included within other projects using the Nordic platfroms. Pull requests welcome.

The currently supported SDK versions are: 15.3.0, 16.0.0, and the SDK for Thread and Zigbee v3.2.0 and v4.0.0

The currently supported Softdevice versions are: s132_6.1.1, 7.0.1 and s140_6.1.1, 7.0.1

Support for nRF51x devices are deprecated and not maintained. The old version of this repository with support for nRF51x devices can be found in the legacy-nrf51x branch on the original nrf5x-base repo.

Usage

First, add this project as a submodule inside of your repo with your nRF5x code.

git submodule add https://github.com/lab11/nrf52x-base

Then write an application for the nRF5x SoC you are using and include a Makefile that looks like this:

PROJECT_NAME = $(shell basename "$(realpath ./)")

# Configurations
NRF_IC = nrf52832
SDK_VERSION = 15
SOFTDEVICE_MODEL = s132

# Source and header files
APP_HEADER_PATHS += .
APP_SOURCE_PATHS += .
APP_SOURCES = $(notdir $(wildcard ./*.c))

# Include board Makefile (if any)
#include $(NRF_BASE_DIR)/boards/<BOARD_NAME_HERE>

# Include main Makefile
NRF_BASE_DIR ?= ../../
include $(NRF_BASE_DIR)/make/AppMakefile.mk

Generally, the expected directory structure for your project is:

    /apps
        /<application 1>
        /<application 2>
        ...
    /src
        various platform-level code (e.g. functions shared between applications)
    /include
        various platform-level headers (e.g. platform pin mappings)
    /nrf5x-base (submodule)

Example Applications

This repo has several example and test applications. See the apps folder.

Flash an Application

To flash an application, there is some setup you must do.

  1. Install the arm-none-eabi-gcc compiler.

    On Ubuntu:

     sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
     sudo apt-get update
     sudo apt-get install gcc-arm-embedded
    

    On MacOS:

     brew tap ArmMbed/homebrew-formulae
     brew install arm-none-eabi-gcc
    
  2. Install Nordic's command line tools mergehex and nrfjprog. Ensure these tools are extracted and added to your path.

  3. Install the JLink software for your platform. You want the "Software and documentation pack".

  4. Acquire a JLink JTAG programmer. The "EDU" edition works fine.

  5. Program an app! With the JLink box attached to the target board:

     make flash
    

    will write the app and softdevice to the device. You can erase a chip with:

     make erase-all
    

    See the make folder for a complete list of commands.

    Most of our boards use a TagConnect header instead of the way-too-large ARM JTAG header. We use our own adapter, but Segger also makes one.

  6. Upon inital programming of an NRF51822, the nRF will enter debug mode, which will prevent the nRF from sleeping and prevent the reset line from working. To fix this, either perform a powerdown/powerup or download nrfjprog from (https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822) and run nrfjprog --pinreset

Git Submodules

If you're using submodules in your project, you may want to use this to make git automatically update them: https://gist.github.com/brghena/fc4483a2df83c47660a5

BLE Tools for Other Platforms

When developing a BLE application, several tools exist to make your life easier. The easiest option is nRF Connect: for Android and for iOS Alternatively, noble is a NodeJS library for interacting with BLE that can run from a Linux or Mac computer.

License

The files in this repository are licensed under the MIT License unless otherwise noted by the local directory's README and license files.

About

Starting point and shared code for Nordic nRF52x Thread/BLE platforms.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 96.0%
  • C++ 2.4%
  • Assembly 1.5%
  • Makefile 0.1%
  • CSS 0.0%
  • Python 0.0%