1376 views|2 replies

82

Posts

0

Resources
The OP
 

【NRF52840】Learning Record [Copy link]

This post was last edited by bitter on 2023-7-3 15:24
  • 【NRF52840】Learning Record

1. Introduction

I recently bought an NRF52840 DK development board and plan to learn some knowledge about Bluetooth. Here is a record of the learning process

2. Chip Introduction

For some information about the NRF52840 chip, you can check it on the official website: nRF52840

3.Bluetooth Engineering Package SDK

Download the relevant SDK package from the official website: https://www.nordicsemi.com/Products/nRF52840/Compatible-downloads?lang=zh-CN

For some introduction to the SDK package, you can refer to this blog: Getting Started with nrf52840 Chip

4. Bluetooth protocol stack sample analysis

There are many routines in the downloaded SDK package. Here we analyze the Bluetooth protocol stack sample. The path is nRF5_SDK_17.1.0_ddde560\examples\ble_peripheral\ble_app_template. For more analysis, you can refer to this blog post: nrf52840 Bluetooth protocol stack sample analysis . I will add some

①Log printing initialization

Enter the log_init() function:

We can see the macro definition of NRF_LOG_LFCLK_FREQ, whose value is 32768. Therefore, when we want to use the log function, there must be a 32.768kHz crystal oscillator on the hardware to complete the corresponding initialization.

——


——

Then, find the UART related initialization related to the log, we can find that it uses UAERT0, the TX pin is P0.06, the RX function is not used, and the baud rate is 115200.

——

——

——

——

——

——

② Protocol stack default configuration settings

Entering the protocol stack configuration function, we find that the sd_ble_cfg_set function is actually used to configure the protocol stack. According to the comments on it, we can find two points: we can call this function to configure the protocol stack anywhere where sd_softdevice_enable is enabled but sd_ble_enable is not enabled; the amount of memory allocated to SoftDevice by app_ram_base should be large enough.

Where the parameter cfg_id is the enumeration BLE_CONN_CFGS, BLE_COMMON_CFGS, BLE_GAP_CFGS or BLE_GATTS_CFGS.

③GAP initialization

There are several types of safe mode configurations:

④ Broadcast initialization

The broadcast name is shown as ble_advdata_name_type_t enumeration.

Broadcast logo

⑤ Update connection parameters

The connection parameter ble_conn_params_init_t structure is

Latest reply

Good information, thanks for sharing it. It's a good opportunity to learn from other people's designs.  Details Published on 2023-7-2 01:03
 
 

1463

Posts

0

Resources
2
 
This is the first time I have heard of this product. I would like to join in the fun and take a look at the learning notes of the OP.
 
 
 

1463

Posts

0

Resources
3
 
Good information, thanks for sharing it. It's a good opportunity to learn from other people's designs.
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Featured Posts
WAN Acceleration - Wide Area Network Optimization Technology and Application Analysis

Wide Area Network ( WAN ) bandwidth is expensive, so most users can only have limited WAN bandwidth. On the contrary ...

Three steps to troubleshoot ADSL

As the most cost-effective and effective means of broadband access, ADSL has become a familiar term to netizens and has ...

Basic knowledge for hardware engineers

Purpose: Based on practical experience and actual projects, you will understand and master the most basic knowledge to b ...

Brief analysis of the functional block diagram of the MSP430 series microcontroller

This post was last edited by tiankai001 on 2018-12-6 16:55 This content is originally created by EEWORLD forum user tian ...

Open Source eBook: Computer Science from the Bottom Up

537107 The philosophy of the book Computer Science from the Bottom Up is: In short, what you are reading is intended to ...

A lightweight and precise positioning algorithm based on multiple inertial measurement units (LSM6DSOX)

552861 552864

Please ask a MicroPython question

This post was last edited by jqn on 2021-10-27 16:10 How do I change the softi2c statement of micropython to i2c? i2c ...

View Circuit-ADC and System (1)

Viewing Circuits - ADC and System (1) There are many ADCs on the market, and the prices of different ADCs vary greatly ...

[BoLiu BL606P audio and video development board] 1. Environment construction and HelloWord Demo operation

Thanks to EEWorld and Pingtou Ge for providing the . I was lucky enough to get the opportunity to review it again. 1. Ha ...

I get off work at 10 o'clock. I am almost autistic.

This post was last edited by Nubility on 2024-4-23 00:11 I get off work at 10 o'clock, get home at 11:30, take a shower ...

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list