nrf51822 Bluetooth protocol stack routine entry lighting

1 Keil compilation

1. Reference documents:
Qingyun Bluetooth CD V4.1\6. Qingyun series tutorials produced by Qingfeng\3: BLE Bluetooth application\2.BLE experiment Section 2: Bluetooth LED task reading and writing instructions.pdf

Qingyun Bluetooth CD V4.1\6. Qingyun series tutorials Qingfeng produced\4: Detailed explanation of Bluetooth principle and teach you how to use Bluetooth: Bluetooth LED task reading and writing principle task detailed explanation.pdf

2. Enter the directory:
Qingyun Bluetooth CD V4.1\5. Qingyun Test Code\
Part 3: BLE Bluetooth Experiment\BLE Experiment 3: Button Bluetooth Notification\Board\pca10001\s110\ble_app_led\arm\ble_app_led.uvproj

3, open the project ble_app_led.uvproj

4. The compilation is successful.

5. Open nRFgo Studio

s110_nrf51822_6.0.0-5.beta_softdevice.hex

write picture description here

(c) Nordic Semiconductor ASA 2008-2013
Erase succeded
Programmed succeccfully softdevice E:/nordic/第三部分:BLE蓝牙实验/BLE实验1:蓝牙工程样例/s110_nrf51822_6.0.0-5.beta/s110_nrf51822_6.0.0-5.beta_softdevice.hex

In the process of debugging the Bluetooth stack, the following operations only need to be performed once.
(1) Erase All - Erase all firmware
(2) Program SoftDevice to program the Bluetooth protocol stack code (non-open source)
(3) Close nRFgo Studio

6. On the ble_app_led.uvproj interface,
click the DownLoad button to program the application code to the board through Jlink.
write picture description here

The following problem occurs:
write picture description here

If you encounter this problem, you need to solve it as follows
(1) Enter option –> Device –>Database:
select Generic CPU Data Base
write picture description here
and restore the previous settings Nordic nRF51 Series Devices
write picture description here
Click OK
(2) Enter option –> Debug
and the following interface will appear :
write picture description here
Change ULINK2./ME Cortex Debugger to:
write picture description here
Then click setting:
write picture description here
Click OK
Now click download again to download correctly:

JLink info:
------------
DLL: V4.60a, compiled Jan 16 2013 17:15:30
Firmware: J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
Hardware: V7.00
S/N : 20090928 
Feature(s) : RDI,FlashDL,FlashBP,JFlash,GDBFull 

* JLink Info: Found SWD-DP with ID 0x0BB11477
* JLink Info: FPUnit: 4 code (BP) slots and 0 literal slots
* JLink Info: Found Cortex-M0 r0p0, Little endian.
ROMTableAddr = 0xE00FF003

Target info:
------------
Device: nRF51822_xxAA
VTarget = 3.300V
State of Pins: 
TCK: 0, TDI: 0, TDO: 1, TMS: 0, TRES: 1, TRST: 1
Hardware-Breakpoints: 4
Software-Breakpoints: 8192
Watchpoints:          2
JTAG speed: 2000 kHz

Erase Done.
Programming Done.
Verify OK.
Application running ...

This problem should be related to the version of
Qingyun Bluetooth CD V4.1\4.Development Tools and Software\Setup_JLinkARM_V460a.exe

write picture description here

Name Start Size
IROM1 0x14000 0x2B000
IRAM1 0x20002000 0x2000

write picture description here

NRF51 DEBUG_NRF_USER BLE_STACK_SUPPORT_REQD BOARD_NRF6310
..;..\..\..\..\..\Include;..\..\..\..\..\Include\app_common;..\..\..\..\..\Include\ble;..\..\..\..\..\Include\ble\ble_services;..\..\..\..\..\Include\s110;..\..\..\..\..\Include\sd_common

write picture description here

write picture description here

2 Mobile phone test

After burning the firmware to the board, power on the board again

To install on an android mobile phone,
Qingyun Bluetooth CD V4.1\8.Mobile app\APK\no.nordicsemi.android.mcp.apk
can also install the app: nRF.Connect.4.19.0.apk
The relationship between the two is the version level , cannot be installed at the same time.
Here we take nRF.Connect.4.19.0.apk as an example. This app requires the location permission of the mobile phone. If it is not allowed, it will not work properly.

1 Turn on Bluetooth:
2 Open the app:

Connect LedButtonDemo
write picture description here

Select Nordic LED Button Service
write picture description here

Select LED
write picture description here
Write Value : On
write picture description here
to see the current state of the LED
write picture description here

At this time, the LD1 on the board should be bright

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325987529&siteId=291194637