nordic semiconductor workshop 2016 - meetupfiles.meetup.com/17189512/nordic workshop 2016 -...
TRANSCRIPT
Nordic Semiconductor - Workshop 2016
The leader in BLE– now and into the future
NORDIC SEMICONDUCTOR ‐
WORKSHOP 2016
Scott Bland [email protected]
AbstractThis workshop contains a short presentation covering Nordic Semiconductor and the
nRF52 SoC BLE solution. The presentation is followed by three nRF52‐based hands‐on labs covering the heart rate, UART and Beacon applications.
1
Agenda © NORDIC SEMICONDUCTOR
Nordic Overview
nRF52 Details
Software, Development Tools & Support
Hands-on Workshop Tools Installation Guide (to be completed beforehand)
BLE Heart Rate Monitor Steps
BLE UART Steps
BLE Beacon Steps
Agenda
2
Nordic Overview © NORDIC SEMICONDUCTOR
Nordic Semiconductor
> 1 billion Nordic ICs shipped450+ employees
$193M US revenue in 2015
Founded 1983
On stock exchange OSE since 1996 (NOD)
First 2.4GHz IC 2004
First BLE IC 2011
R&D design centers
• Norway
• Finland
• Poland
Global sales & support offices
© NORDIC SEMICONDUCTOR
Partnered with world-class suppliers • Dual sourced for capacity assurance
• ISO9001/14001 certified company
Quality centered assembly and test • 15 year partnership
• Nordic owns the test equipment with a monthly capacity of >30 million devices
Reliable, high volume supply• Logistics handled by distribution partners
Nordic Semiconductor
3
© NORDIC SEMICONDUCTOR
Nordic 2.4GHz Transceivers and SoCsYears of leadership in ultra low power wireless
nRF24 and nRF24L SeriesSupports ESB protocol
nRF24LE and nRF24LU SeriesSupports ESB and Gazelle protocols
nRF8000 SeriesIndustry’s 1st BLE transceiver
nRF51 Series SoCs1st complete BLE SoC; also supports ANT+, ESB, Gazelle
nRF52 Series SoCsIndustry-leading performance and feature set
2003
2006
2010
2012
2015
* ESB (Enhanced ShockBurst) - Nordic proprietary protocol
* Gazelle – Nordic proprietary protocol
© NORDIC SEMICONDUCTOR
SoC Offering from NordicnRF52 Series nRF51 Series
CPU Cortex M4-F @ 64 MHz Cortex M0 @ 16 MHz
Memory Flash/RAM Up to 512kB / 64kB Up to 256kB / 32kB
Security AES CCM ECB AES CCM ECB
Multi-Protocol SupportBluetooth® Smart (v4.2)
ProprietaryANT™
Bluetooth® Smart (v4.2)Proprietary
ANT™
EasyDMA Peripherals, Radio Radio
Low power comparator Yes (15 levels) Yes (8 levels)
General purpose comparator
Yes (64 levels) No
Interfaces SPI(3xM/S), I2C(2xM/S), UART,QDEC PDM, I2S
SPI(2xM/1xS), I2C(2xM), UART, QDEC
NFC Yes No
4
© NORDIC SEMICONDUCTOR
• Remote controls• Game controllers• Audio solutions• Toys• 3D glasses• Home automation
• Fitness sensors• Medical monitors• RFID/Keys• Watches • Wireless charging• Other local sensors
Mobile devices Home electronic devices
• Remote controls• Environmental sensors• RFID/Security• Operation monitors• Smart energy
• Mice• Keyboards• Game controllers• Presentation remotes• Security solutions
Personal computers Other sensor networks
New wireless products continue to emerge, as more devices connect wirelessly with other devices, mobile handsets, PC’s and home media devices.
Of the ~300M single mode BLE devices produced in 2015, Nordic was used in ~50%
Ultra Low Power BLE
5
nRF52 Details © NORDIC SEMICONDUCTOR
Architected for Speed
• 64MHz Cortex-M4F with DSP and
Floating Point
• Embedded Flash and Multi-Segment
RAM
• Multi-layer Advanced High-Speed
Bus and EasyDMA
• 2Mbps 2.4GHz GFSK Radio
64MHz ARM® Cortex®-M4F
Up to 512kB Flash w.Cache
Up to 64kB RAM
UART 3×SPI
Digital, Analog I/F and IO Ports
2×I2C
PDM I2S QDEC
2×ACMP 3×PWM 12-bit ADC
AH
B / A
PB
/ Easy D
MA
/ PP
I
System Peripherals
5×TIMER
DEBUG
3×RTC WDT
Power Supply
LDO
Buck DC/DC
POR BOD
Multi-Protocol2.4GHz Radio
NFC-A Tag
Oscillators
32kHz RC/XO
32MHz RC/XO
Crypto Accel
32-GPIO Crossbar
nRF52832
© NORDIC SEMICONDUCTOR
Built for Power Efficiency
Low Radio and Processor Active
Currents
Low System Sleep
Currents
Processor offload with Programmable Peripheral
Interconnect
Processor offload with EasyDMA
Automatic Adaptive Regulator Control
Automatic Power Management
6
© NORDIC SEMICONDUCTOR
CPU, Memory and Peripherals• 64MHz ARM® Cortex® M4F
• 215 EEMBC Coremark® score• 58µA/MHz running from Flash (3.7mA)• 51.6µA/MHz running from RAM (3.3mA)
• 512kB Flash / 64kB RAM or 256kB Flash / 32kB RAM• 3SPI, 2I2C and UART• I2S and PDM for audio• 8-channel, 12-bit, 200ksps ADC with programmable gain• 3 4-channel PWMs• Analog comparators• Quadrature decoder• 32 configurable, remappable GPIOs • Programmable Peripheral Interconnect system (PPI)• EasyDMA support for all peripherals• Serial Wire Debug
© NORDIC SEMICONDUCTOR
Radio Performance Redefined
• Multi-protocol 2.4GHz radio (BLE, ESB, Gazell, ANT® )• On-chip Balun with Single wire antenna connection• 1 and 2 Mbps supported data rates• -96dB RX sensitivity• -20 to +4dBm TX output in 4dB steps• -42dBm selectivity • 5.3mA peak current in TX @ 0dBm• 7.5mA peak current in TX @ +4dBm• 5.4mA peak current in RX• 1dB resolution RSSI• Fast 40µs RX and TX startup
7
© NORDIC SEMICONDUCTOR
Touch-to-Pair with NFC™
• On-chip NFC™-A tag support• 13.56MHz input frequency• AM receiver and load modulator• 106kbps bit rate
• “Touch to Pair” BLE Out-Of-Band (OOB) pairing• Easy, fast and secure• Proximity detection• Wake-on-field low-power field detection mode (adds +100nA)• Other NFC-A tag operations possible with S/W support
© NORDIC SEMICONDUCTOR
Fully Automated Power Management
• Two power modes: System ON and System OFF• Multiple on-chip regulators• Hardware modules request power as required• nRF52 System monitors total current & supply level• Automatic selection of optimal regulator type and mode• Supply voltage range 1.7V – 3.6V• Fully automatic LDO and DC/DC regulator system• 64MHz internal RC oscillator precedes external crystal for fast start-up
• 0.3µA at 3V in OFF mode• 0.78µA at 3V in OFF mode with 64kB RAM retention• 2.03µA at 3V in ON mode, 64kB RAM retention, wake on RTC (32kHz crystal running)
8
© NORDIC SEMICONDUCTOR
Clocking
High Frequency Clock options• 64MHz crystal oscillator, using external 32MHz crystal• 64MHz on-chip oscillator (for low-latency start-up)
Low Frequency Clock options• 32.768kHz +/-250 ppm RC oscillator (meets BLE specs)• 32.768kHz crystal oscillator, using external 32.768kHz crystal
(minimum power)• 32.768kHz oscillator synthesized from 64MHz oscillator
• Automatic oscillator, clock control and distribution for ultra-low power
© NORDIC SEMICONDUCTOR
nRF52832 Package Options and BOM• QFN48 6mm x 6mm x 0.8mm 48 pins• WLCSP 3.0mm x 3.2mm x 0.4mm 53 balls
3.0 x 3.2mm
6 x 6
mmExternal BOM
• 14 passives
• 32MHz crystal
• 2.4GHz antenna (Chip, PCB or other)
• 32kHz crystal + 2 caps (optional)
• NFC antenna + 2 caps (optional)
• < 8mm x 9mm PCB area (WLCSP)
9
Software, Development Tools & Support © NORDIC SEMICONDUCTOR
Clean software architecture model• Pre-compiled BLE stack• Event-driven API set, no RTOS requirement• No link or run time dependencies• Run-time Protection of Stack
Support for Secure Over-the-Air Device Firmware Update (DFU)
S132 supports concurrent operation as Central, Peripheral, Advertiser or Observer
Now supports long/variable MTU size, data packet length extension, privacy 1.2 and LL ping (maximum 800kbps throughput)
S132 code size: 124kB, including 8kB Master Boot Record
S332 supports concurrent BLE and ANT® operation
SoftDevices support concurrent operation with ESB and Gazellproprietary protocols
S132 SoftDevice v3.0 BLE Stack
Application
S132 SoftDevice
© NORDIC SEMICONDUCTOR
Development Tools
Development Kits
Single board dev kit for nRF51 and nRF52 Series
Arduino UNO shield compatible
DEBUG_OUT connector for debugging your target board
Complete IO/Peripheral access
ARM mbed support
nRF5 SDK
Peripheral libraries, application
examples, OTA-DFU
Support for Keil, IAR and GCC
Integrated Development
Environments (IDEs)
PC and Mobile Tools
Wide set of tools for different platforms
Control panels, Sniffers, Toolbox etc
PC serializer
10
© NORDIC SEMICONDUCTOR
Targeted SDKs
HomeKit
nRF5 SDK for HomeKit3.0
Apple approved solution for HomeKit accessories
IoT
nRF5 SDK for IOT
Full solution for IPv6 over BLE
AirFuel
nRF5 SDK for Air Fuel
Complete Solution for wireless charging
Mesh
Proprietary Mesh over Bluetooth
Bluetooth SIG Mesh available later in 2016
© NORDIC SEMICONDUCTOR
Nordic Reference Designs
BeaconsnRF51 Beacon
Complete reference design of a small form-
factor beacon
HW+FW
Smart RemotenRFready Smart Remote 3
Complete reference design of a voice remote control based on the nRF51 Series
HW+FW+Host drivers
DesktopnRFready Desktop 2
Complete reference design for keyboard and mouse based on
the nRF51 Series
HW+FW
Solar BeaconnRF52 Beacon
Complete design schematics and layout
package. Completely solar powered, uses caps for
storage, no external energy harvesting IC. Advertises temperature and pressure
HW+FW
11
© NORDIC SEMICONDUCTOR
Power Profiler Kit AirFuel Demo
Plugs onto DK. Accurately measures nRF5 current Plugs onto DK. Measures wireless charging parameters
© NORDIC SEMICONDUCTOR
Unmatched Module PartnershipsWide variety of forms, fits and functions
• nRF52 & nRF51 series available• 50+ Module partners• Modules + sensors variants available
Module solutions:• Minimize development efforts• Are pre-qualified• Are price competitive even in medium level volumes
Key module vendors on Arrow’s line card:• Fujitsu• Rigado• RF Digital• Dynastream• Laird / LSR• Telit (formerly Stollman)
12
© NORDIC SEMICONDUCTOR
Support and Community
Online Technical Support Center and
FAEs
Nordic Developer Zone
Nordic GitHub
https://www.nordicsemi.com/ https://devzone.nordicsemi.com/ https://github.com/NordicSemiconductor
Targeted 24 hour
response time
11k+ Users, 12k+ Posts
1.3 million page visits last 6 months
69 Repositories
© NORDIC SEMICONDUCTOR
Design Support
Nordic offers the following support to help insure that our customers pass FCC/ARIB/ETSI certification testing the first time:
1) Customers can pass their schematic and layout files to the support portal for review. Our RF engineers will make improvement suggestions.
2) After this review, customers can send their prototype to Norway support for RF characterization and antenna tuning.
These services are free.
13
Hands-on Labs The following sections will step you through the process of loading and testing three different BLE applications. These are the most widely used as templates for customer designs
Heart Rate Application – where the BLE device sends data to the phone UART Application – where the phone sends data to the BLE device Beacon Application – where the device acts as a non-connectable advertiser
NOTE: If you are attending a workshop, sections 2 and 3 must be completed before the workshop begins. There will not be enough time to complete these steps during the workshop itself.
1.0 Requirements
The following hardware is required:
1. A laptop/PC running Windows© XP SP3 or higher, with at least one free USB port, and knowledge of whether Windows is 32-bit or 64-bit.
2. An nRF52 development kit.
3. A recent version Android or iOS device with BLE support.
14
2.0 Download Software Tools
1. Download the latest nRF5 Software Development Kit (SDK) zip file (currently version 12.1) from: http://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v12.x.x/nRF5_SDK_12.1.0_0d23e2a.zip
2. You will need a terminal program. You can use your own, but the steps in the lab are for puTTY. Download puTTY from here:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
3. On your Android or iOS device, go to the Play Store or App Store and download/install nRF Toolbox (v1.17.0 or later), nRF Beacon (1.4.3) and nRF Connect (v4.3.2 or later).
15
3.0 Install Software Tools
1. Extract the nRF52 SDK installation file into C:\Nordic on your hard drive (this is a recommended location that will be used in the remainder of this document).
2. puTTY doesn’t need to be installed. Drop it into a C:\Nordic\puTTY folder and place a shortcut to the .exe file on your desktop.
16
4.0 Programming the Heart Rate BLE Peripheral Application on the nRF52 DK
The HRS application implements the Heart Rate Services profile as defined by the Bluetooth Special Interest Group. This profile exposes heart rate and location from a heart rate sensor for transmission over a BLE link. The nRF52 DK will act as a BLE peripheral device sending heart rate data to an application on your Android or iOS device acting as a BLE central. This example is commonly used as a template for applications that send data from the peripheral to a phone or other device.
1. Open Windows Explorer and browse to: C:\Nordic\nRF5_SDK_12.1.0_0d23e2a\examples\ble_peripheral\ble_app_hrs\hex
2. Right-click on the file named ble_app_hrs_pca10040_s132.hex and select Copy. This file contains the heart rate application and the S132 SoftDevice (BLE stack software) merged into a single hex file.
3. Plug the nRF52 DK into a spare USB port on the laptop with the micro-USB cable. You do not need to install the NFC antenna on the DK. Make sure the power switch on the DK is in the ON position. The LED nearest the part with the white decal on it will light and an Autoplay window will appear on your screen.
Click the Open folder to view files option.
4. Right-click anywhere inside the opened folder and select Paste. This will use the mBed method to completely erase the part and install both the application software and the SoftDevice. LED1 on the nRF52 DK will start blinking, indicating the BLE advertising is taking place.
17
5.0 Testing the Heart Rate BLE Peripheral Application on the nRF52 DK
1. Make sure that LED1 on your nRF52 DK is blinking. If it isn’t, press the Reset button near the power switch to re-enable the timeout. On your Android or iOS device, make sure that Bluetooth is enabled and then run nRF Connect. Tap Scan and make sure that the Scanner tab is open. Hold your device close to the nRF52 DK. Look for Nordic_HRM … if there are more than one, yours should be the strongest signal. If you are using an Android device, write your address down for future reference. Otherwise you will need to find the strongest signal. ____:____:____:____:____:____
2. Stop scanning in nRF Connect and then run nRF Toolbox. Find and tap the HRM button. This program simply displays the data transmitted by the program on the screen. Make sure that LED1 on the DK is blinking and tap the CONNECT button at the bottom of the HRM screen.
3. Under AVAILABLE DEVICES at the bottom of the screen you should see Nordic_HRM. If you don’t, try tapping SCAN. Tap Nordic_HRM to connect to the BLE peripheral. Make sure that the device is yours … otherwise you may connect to someone else’s DK (if you are in a workshop with other people).
18
4. After a moment, the screen will begin to fill with data. Since there is no actual heart being monitored, the data is being generated by a simple simulation and transmitted to your device via the bonded BLE link.
5. When you are done, you can tap DISCONNECT. Close the Keil IDE.
19
6.0 Programming the UART BLE Peripheral Application on the nRF52 DK
The UART application implements the Nordic UART custom profile. This profile allows for the easy transfer of data between nodes and is a template for many designs that transfer data between the phone and peripheral device. In the example, your device running nRF Toolbox will send data over the bonded BLE link to the nRF52 DK.
1. Open Windows Explorer and browse to: C:\Nordic\nRF5_SDK_12.1.0_0d23e2a\examples\ble_peripheral\ble_app_uart\hex
2. Right-click on the file named ble_app_uart_pca10040_s132.hex and select Copy. This file contains the BLE UART application and the S132 SoftDevice (BLE stack software) merged into a single hex file.
3. Cycle power on the nRF52 DK and make sure the power switch is in the ON position. The LED nearest the part with the white decal on it will light and an Autoplay window will appear on your screen.
Click the Open folder to view files option.
4. Right-click anywhere inside the opened folder and select Paste. LED1 on the nRF52 DK will start blinking, indicating the BLE advertising is taking place.
20
7.0 Testing the UART BLE Peripheral Application on the nRF52 DK
1. Click on your Windows Start button and type device into the search box (don’t hit Enter). Click on Device Manager when it appears in the results display. When the Device Manager opens, expand the Ports (COM and LPT) section and find the JLink CDC UART Port entry. Write down your COM number: COM: _____
2. When data is received from the BLE link, it will be output on the nRF52 UART port for viewing. Start puTTY or your favorite terminal program. In puTTY, click the Serial button, then select Serial in the category. Then make the setting shown and click OK to open the session.
21
3. On your Android or iOS device, run nRF Toolbox and tap the UART button. When the UART screen appears, tap EDIT. When the red First configuration screen appears, tap the top left button. (you can create multiple configurations) When the Configure button screen appears, make the settings shown and tap OK. We’ll configure the top row of buttons as if we are controlling a device to pan a camera over BLE.
4. Configure the top middle and top right buttons as shown. When all three buttons are configured, tap the DONE button.
22
5. Rearrange Your PC’s screen so that you can see the puTTY (or your terminal program’s) display. Make sure that LED1 on your nRF52 DK is blinking. If it isn’t, press the Reset button near the power switch to re-enable the timeout. On pressing the Reset button you will see UART Start! Appear in the terminal display.
Tap the CONNECT button on your device and tap Nordic_UART under AVAILABLE DEVICES to connect. Tap SCAN if you don’t see it. Make sure that the Nordic_UART is yours by signal strength or address.
6. Tap the LEFT, STOP and RIGHT buttons on your device and watch the text appear in your terminal display. Tap DISCONNECT when you’re done experimenting. This application is typically used as a template when customers want to control a BLE enabled device from their phone. Source code for nRF Toolbox is available for iOS, Android and Windows platforms on GitHub as shown here.
7. Close puTTY and any open nRF apps on your phone or device.
23
8.0 Programming the Beacon Application on the nRF52 DK
The beacon application implements a non-connectable advertiser as defined by the Bluetooth Special Interest Group. The advantage that a beacon has is that any BLE receiver has access to the transmitted data without going through the pairing process. There are iBeacons, EddyStone beacons, beacons that transmit manufacturer specific data, measurements or URLs. They can also be used to determine distance or assist in locationing.
1. Open Windows Explorer and browse to: C:\Nordic\nRF5_SDK_12.1.0_0d23e2a\examples\ble_peripheral\ble_app_beacon\hex
2. Right-click on the file named ble_app_beacon_pca10040_s132.hex and select Copy. This file contains the beacon application and the S132 SoftDevice (BLE stack software) merged into a single hex file.
3. Cycle power on the nRF52 DK and make sure the power switch is in the ON position. The LED nearest the part with the white decal on it will light and an Autoplay window will appear on your screen.
Click the Open folder to view files option.
4. Right-click anywhere inside the opened folder and select Paste. LED1 on the nRF52 DK will start blinking, indicating the BLE advertising is taking place.
24
9.0 Testing the Beacon Application on the nRF52 DK
It’s possible for a BLE enabled app on a phone to perform a specific action when it comes within a certain distance of a given beacon. The nRF Beacon app does just that.
1. Run nRF Toolbox on your device and tap the BEACONS button. If you are in a workshop with lots of other people, you’ll likely see quite a few beacons. Yours should be the strongest signal and should be at the top.
2. As you bring your device near the nRF52 DK, it will display an image of the Mona Lisa along with a description. This is an action taken by the BEACON tool for this specific beacon. Tap your Back button to remove the image from your display.
3. Touch the nRF Beacon button shown here to access its settings. If you were to look back in the code, you’d see that the UUID and Major and Minor values match those in the beacon app. Try changing the EVENT to At beacon. Now you’ll have to position the phone very near the nRF52 DK. Change the ACTION too if you like. When you’re done experimenting, you can shut down the nRF Toolbox. You’re done