Skip to content

Commit

Permalink
add release files
Browse files Browse the repository at this point in the history
  • Loading branch information
estutzenberger committed Apr 7, 2016
1 parent c71538a commit b2ffc62
Show file tree
Hide file tree
Showing 100 changed files with 27,817 additions and 3,440 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ __pycache__
log.txt
datapage.bin
mac.bin
JLinkExe
libjlinkarm.so.*
application.bin
*.sbin
DS_Store
*.pyc
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
# Bootloader Tools
This repository provides access to various tools for using the Rigado Secure Bootloader.

The Rigado Secure Bootloader provides an encryption scheme allowing module users to secure their firmware image during over-the-air and serial-wire transfer. This method works by first installing a private 128-bit key on each device. The update images are then encrypted using the key for the device. After transfer of the encrypyted image, the image is decrypted on the device side and validated using a checksum. If all checks pass, the new firmware image is flashed to the application bank on the device.

The repository is organized in to two distinct support trees.

# SoftDevice S110 7.1.0 Tree (sd71)
This directory contains all files pertaining to the Rigado Secure DFU running on Softdevice S110 7.1.0. The scripts and tools contained within this directory should be used for applications running on Softdevice S110 7.0 and 7.1.

# SoftDevice S110 8.0.0 Tree (sd8)
This directory contains all files pertaining to the Rigado Secure DFU running on SoftDevice S110 8.0.0. The scripts and tools contained within this directory should be used for applications running on SoftDevice S110 8.0.
The Rigado Secure Bootloader provides an encryption scheme allowing module users to secure their
firmware image during over-the-air and serial-wire transfer. This method works by first installing a
private 128-bit key on each device. The update images are then encrypted using the key for the device.
After transfer of the encrypyted image, the image is decrypted on the device side and validated
using a checksum. If all checks pass, the new firmware image is flashed to the application bank on the device.

# Directory Structure
Both the sd71 and sd8 directory trees are very similar. The following information describes each directory and its contents:

- Programming
+ This folder contains tools, scripts, and binaries for programming BMD-200 modules via a connected JLink programmer.
+ This folder contains tools, scripts, and binaries for programming BMD series modules via a connected JLink programmer.

- OTA Image Tools
+ This folder contains tools for generating firmware update images including ecrypting images for secure data transfer.

- Update Tools
+ This folder contains scripts for performing Over-the-air and Serial updates. Over-the-air Updates are currently only available for OS X and Linux systems that can run the Noble module for Node.js.
+ This folder contains scripts for performing Over-the-air and Serial updates.
Over-the-air Updates are currently only available for OS X and Linux systems
that can run the Noble module for Node.js.
59 changes: 59 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Bootloader Tools Version 2.0 Release Candidate 1

## Highlights

### New Bootloader Binaries
This release includes updated bootloader binaires. The SoftDevice S110 version
has received a few changes. In addition, bootloader binaires are now available
for S130 and S132 both version 2.0.0. These are built using the latest SDK
release from Nordic.

### New Service UUID
The S130 and S132 binaries used a different UUID. This is to differentiate
them from the S110 version. Note that the S110, S130, and S132 versions
behave essential the same.

### User Data Location Changed
To ensure default pstorage driver settings can be used, the S130 and S132
versions of the bootloader have had their User storage location moved to
just after the Bootloader swap space. Please see the Memory Layout in the
documentation for further details.

### New Programming Options
The programming script (program.py) has undergone a few significant changes.
It no longer relies on pre-written JLink script files and instead generates
the JLink script files on the fly. This allows us to more easily add support
in the future.

In addition, the `-a` option for programming application binaires now expects
a path. The input file can now be a HEX file or a binary file.

A option, `-r` has been added to program.py to disable readback protection. This
eases debugging efforts. *HOWEVER*, this option should *ONLY* be used for
development purposes. If it is used during factory programming, readback
protection will be disabled and your firmware WILL be a risk for theft. In
addition, the security part of the bootloader will be useless as the private
key can easily be read out of the device. Use at your own *RISK*.

Finally, the SoftDevice version can now be specified with the `-s` option.
The available options are `-s 110`, `-s 130`, and `-s 132`. If this option is
not specified, programming will default to `110` on the BMD-200 and `132` on
the BMD-300. The programming script verifies the IC before starting programming.
If a conflict occurs, the default option will be used.

### New Bootloader Features
Bootloader version information is now available at a static location within
the bootloader binary. See the documentation for more details. The src folder
of this repository contains C files to help in gathering this information.

### Upcoming features
Tired of slow OTA updates? Make a patch! Instead of sending the whole
firmware image, a patch is simply the difference between a previous firmware
version and the latest firmware version. The patch generation tools will
be available on Rigdo's webiste. Rigablue will be updated to support the
patching feature once it is ready.

### SoftDevice S110 7.1 Support removed
SoftDevice S110 7.x support has been removed from this release. It will reamin
available for the previous release of bootloader-tools. Due to this, the
folder structure for bootloader tools has been condensed into one tree.
61 changes: 61 additions & 0 deletions SEGGER_License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Important - Read carefully:

DEFINITIONS:
For the purpose of this agreement, the terms shall have the following meaning when the entire word is marked bold:

The �software� means all J-Link related software components included in the J-Link software & documentation pack provided by SEGGER which can be downloaded at: http://www.segger.com/jlink-software.html

"Licensor" shall mean SEGGER except under the following circumstances:
If Licensee acquired the software as a bundled component of a third party product or service, then such third party shall either include this license terms or be Licensor and provide similar terms which will not exceed those set forth in this agreement.

1. LICENSE AGREEMENT
This license is a legal agreement between YOU (either an individual or a single entity) and SEGGER Microcontroller GmbH & Co. KG (called SEGGER).
By downloading and/or using J-Link software, you agree to be bound by the terms of this agreement.

2. LICENSE GRANT
These terms apply to the entire J-Link software & documentation pack, especially to its software components, developed by SEGGER Microcontroller GmbH & Co. KG, which can be downloaded at: http://www.segger.com/jlink-software.html or as beta version at: http://www.segger.com/jlink-software-beta-version.html.
The software consists of proprietary, unpublished products of SEGGER, protected under copyright and trade secret laws.
All rights, title and interest in the software are and shall remain with SEGGER.
Licensor grants Licensee a non-exclusive and non-transferable License to use the software or parts thereof with SEGGERs J-Link family of debug probes or authorized OEM products only. Additional info on the original SEGGER J-Link family of debug probes or authorized OEM products can be obtained at: http://www.segger.com/terms-of-use.html. Any other use of the software package is prohibited without prior written authorization from SEGGER.
The use of the licensed software to operate J-Link clones is prohibited and illegal; SEGGER may hold Licensee liable, if Licensee fails to comply with this restriction.
Any (re)distribution or shipment of the software requires the prior written authorization from SEGGER in each instance.
Licensee is entitled to make copies of the software for backup purposes only.
All copies of the software, including modifications to the software, must bear all copyright, trademarks and other proprietary notices included thereon by SEGGER.
This License does not entitle Licensee to receive from SEGGER hard-copy documentation, technical support, telephone assistance, or enhancements or updates for the software unless a specific agreement clearly states otherwise.

3. RESTRICTIONS
Licensee may not:
(a) decompile, disassemble, reverse engineer, or otherwise attempt to derive the source code of the software,
(b) redistribute, encumber, sell, rent, lease, sublicense, or otherwise transfer rights of the software,
(c) remove or alter any trademark, logo, copyright or other proprietary notices, legends, symbols or labels of the software,
(d) install or use the software with unauthorized debug probes.

4. FEES
All features of the software which are functional without request for a license key can be used free of charge, at least for evaluation purposes.

5. TERMINATION
Without prejudice to any other rights, Licensor may terminate this agreement if Licensee breaches any term or condition of this agreement. In such event SEGGER is entitled to also claim monetary damages.

6. PROPRIETARY RIGHTS
Title, ownership rights, and intellectual property rights in the software shall remain by SEGGER and/or its suppliers. Licensee acknowledges such ownership and intellectual property rights and will not take any action to jeopardize, limit or interfere in any manner with SEGGER or its suppliers' ownership of or rights with respect to the software. The software is protected by copyright and other intellectual property laws and by international treaties.

7. DISCLAIMER OF WARRANTY
The software is provided on an "as is" basis, without warranty of any kind, including without limitation the warranties that it is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the software is borne by Licensee. Should the software prove defective in any respect, Licensee and not Licensor or its suppliers or resellers assumes the entire cost of any service and repair. In addition Licensee must determine that the software sufficiently meets its requirements. This disclaimer of warranty constitutes an essential part of this agreement. No use of the software is authorized hereunder except under this disclaimer.

8. LIMITATION OF LIABILITY
To the maximum extent permitted by applicable law, in no event will Licensor or its suppliers or resellers be liable for any indirect, special, incidental or consequential damages arising out of the use of or inability to use the software, including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if advised of the possibility thereof, and regardless of the legal or equitable theory (contract, tort or otherwise) upon which the claim is based. In any case, Licensor's entire liability under any provision of this agreement shall not exceed in the aggregate the sum of the fees Licensee paid for this license (if any), with the exception of death or personal injury caused by the negligence of Licensor to the extent applicable law prohibits the limitation of damages in such cases. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not be applicable. SEGGER is not responsible for any liability arising out of content provided by Licensee or a third party that is accessed through the product and/or any material linked through such content.

9. HIGH RISK ACTIVITIES
The software is not designed for use in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines, or weapons systems, in which the failure of the software could lead directly to death, personal injury, or severe physical or environmental damage ("High Risk Activities"). Accordingly, Licensor and its suppliers specifically disclaim any express or implied warranty of fitness for High Risk Activities.

10. MISCELLANEOUS
(a) This agreement constitutes the entire agreement between the parties concerning the subject matter hereof.
(b) This agreement may be changed only by an amendment in writing, signed by both parties.
(c) If any provision in this agreement should be held illegal or unenforceable by a court having jurisdiction, such provision shall be modified to the extent necessary to render it enforceable without losing its intent, or severed from this agreement if no such modification is possible, and other provisions of this agreement shall remain in full force and effect.
(d) This agreement shall be governed by the laws of the Federal Republic of Germany.
(e) This agreement shall be binding upon and shall inure to the benefit of the parties, their successors and permitted assigns.
(f) Neither party shall be in default or be liable for any delay, failure in performance (excepting the obligation to pay) or interruption of service resulting directly or indirectly from any cause beyond its reasonable control.
(g) The relationship between Licensor and Licensee is that of independent contractors and neither Licensee nor its agents shall have any authority to bind Licensor in any way.
(h) If any SEGGER professional services are being provided, then such professional services are provided pursuant to the terms of a separate professional services agreement between the parties. The parties acknowledge that such services are acquired independently of the product licensed hereunder, and that provision of such services is not essential to the functionality of such product.

� 2004-2014 SEGGER Microcontroller GmbH & Co. KG
Binary file removed doc/RIGDFU-DS-V1.0.pdf
Binary file not shown.
Binary file added doc/RIGDFU-DS-V1.2.pdf
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,33 @@ def find_sd(self):

def find_bl(self):
"""Look for a bootloader"""
found = False
max_extent = 0
if self.bl_addr:
return True
# Find valid code at the beginning of a page somewhere between
# 0x30000 and 0x3f800
(minaddr, maxaddr) = self.data.extents(0x30000, 0x3f800, 0x400)
size = 0x1000
(minaddr, maxaddr) = self.data.extents(0x70000, 0x7e000, size)
max_extent = 0x7e000
if minaddr is None:
return False
for addr in range(minaddr, maxaddr, 0x400):
size = 0x400
(minaddr, maxaddr) = self.data.extents(0x37000, 0x3f800, size)
max_extent = 0x3f800
if minaddr is None:
return False

for addr in range(minaddr, maxaddr, size):
if self.valid_code(addr, maxaddr):
found = True
break
else:

if not found:
return False

# Address of BL is the extent of valid code we found
self.bl_addr = self.data.extents(addr, 0x3f800)
self.bl_addr = self.data.extents(addr, max_extent)

return True

def find_app(self):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added jlink/linux/i386/JLinkExe
Binary file not shown.
Binary file added jlink/linux/i386/libjlinkarm.so.5
Binary file not shown.
Binary file added jlink/linux/x86_64/JLinkExe
Binary file not shown.
Binary file added jlink/linux/x86_64/libjlinkarm.so.5
Binary file not shown.
Binary file added jlink/linux/x86_64/libjlinkarm_x86.so.5
Binary file not shown.
Binary file added jlink/osx/JLinkExe
Binary file not shown.
Binary file added jlink/osx/libjlinkarm.5.10.9.dylib
Binary file not shown.
Binary file added jlink/osx/libjlinkarm.5.12.0.dylib
Binary file not shown.
Binary file added jlink/windows/JLink.exe
Binary file not shown.
Binary file added jlink/windows/JLinkARM.dll
Binary file not shown.
79 changes: 79 additions & 0 deletions programming/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Bootloader Programming

This folder contains bootloader binaries, JLink programming scripts, and the main Python programming script, program.py.

## Requirements

The programming script requires Python 3.x and the Segger JLink tools.

## Script Usage

```
usage: program.py [-h] [-m MAC] [-k KEY] [-t TAG] [-sm] [-r] [-v VERBOSE]
[--logfile LOGFILE] [-a APP] [-s SOFTDEVICE]
BMD Series Programmer
optional arguments:
-h, --help show this help message and exit
-m MAC, --mac MAC MAC address (6 octets, big-endian)
-k KEY, --key KEY encryption key (16 bytes, big-endian)
-t TAG, --tag TAG device tag for output log
-sm, --savemac use the MAC written in module
-r, --disablereadback
set to disable readback protection (not typical!)
-v VERBOSE, --verbose VERBOSE
enable verbose output, available options from least to
most are 0, 1, 2, 3, 4, 5
--logfile LOGFILE log file output
-a APP, --app APP program application binary (application.bin)
-s SOFTDEVICE, --softdevice SOFTDEVICE
program specific softdevice, if not specificed, 110
for nrf51 and s132 for nrf52; valid values 110, 130,
132
```

### MAC Address Notes

The nRF series does not have any permanent storage for non-volatile data. However,
the UICR allows for data that can only be changed by performing a
full chip erase. Rigado stores the MAC address in this location. When the
bootloader is programmed a full chip erase must be performed. The programming
script provides a mechanism for either saving the currently programmed MAC
address or writing in a new one. If the current MAC address is saved,
the address will be read from the UICR, saved to disk, and then re-written to
the UICR during programming. If the MAC address in the UICR is set to all 0s
or Fs, then the MAC address will be the factory assigned random public static
address from the factory FICR.

> The Rigado module MAC address is stored at 0x10001080.
### Key Notes

The private key for a device is stored in the Rigado Bootloader storage
data at 0x3FC00 or 0x7F000. This key is used for decryption of application
images during secure firmware updates. If the key is not specified, the
bootloader will behave in an unsecure manner. This means no encryption of the
application image is necessary to use the bootloader. This is equally true if
a key of all 0s or all Fs is specified.

### Application Programming

The device application can be programmed at the same time as the bootloader. This
operation is performed by adding the `-a` option when running program.py. To program
the application, supply the path of the HEX or binary file along with this option.

> IMPORTANT: If using a binary file (*.bin), the binary must come from the
build tools used to compile application firmware and *NOT* the tools used to
generate OTA images. Firmware update images contain extra data used by the
bootloader. If a firmware update image is programmed using program.py,
it will not run.

### Tags

During initial device manufacture, it can be useful to associate a MAC address
to a particular device serial number. This is particularly useful when the
manufacturing process covers the MAC address of the BMD-200 removing the ability
to read it in a physical manner. To create this mapping, the -t or --tag
option is used. When a tag is specified, program.py will output, to log.txt,
the MAC address, the private key, and the provided tag.
Loading

0 comments on commit b2ffc62

Please sign in to comment.