eefocus_4062187 发表于 2026-10-8 21:04:38

【瑞萨BLE/WIFI模块测评】DA14531 蓝牙模块

本帖最后由 eefocus_4062187 于 2026-10-8 21:17 编辑

# 【瑞萨BLE/WIFI模块测评】DA14531 蓝牙模块

本文介绍了瑞萨 DA14531 蓝牙模块的相关信息,包括外观参数、资源特点、原理图等,并搭建开发环境、结合 RA4M2-Eco 开发板实现蓝牙功能测试。

## 介绍

SmartBond TINY 是世界上体积最小、功耗最低的蓝牙® 5.1 片上系统(SoC),该系统降低了在任何系统中添加低功耗蓝牙(LE)的成本。

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210013scztvct56qw978qo.jpg)

SmartBond TINY 的高度集成降低了系统成本:只需添加六个微小的外部无源元件、一个晶体和电源,即可实现一个完整的蓝牙低功耗系统。

该系统拥有创纪录的低休眠功耗和工作功耗,因此,即使是最小的一次性电池也能实现较长的运行时间和保质期。 SmartBond TINY 基于功能强大的 32 位 Arm® Cortex®-M0+,具有集成存储器和一整套模拟和数字外设,能效极高。

详见:(https://www.renesas.cn/zh/products/da14531) .

### 外观

Top view

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210028gooq4pcqsque26u2.jpg)

Bottom view

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210054sf9wwoiimvoz2a59.jpg)

### 系统框图

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210110a1ol05lgin99g1h0.jpg)

### 特点

- 符合蓝牙 5.1(核心)标准
- 针对互联医疗、互联消费者中的一次性产品进行了优化
- 可使用一次性电池,印刷电池
- 可使用最小容量电池 <30mAh
- 支持多年保质期
- 对于内阻较大的一次性电池,可限制浪涌电流
- 封装设计保证占用空间尽可能小的同时维持了低成本
- 仅需一个 32MHz 的晶振
- 旁路模式下无需 DC/DC 电感器
- 使用 1.5V 电池时无需升压转换器

### 模块

DA14531 SmartBond TINY™ 模块基于世界上最小、最低功耗的蓝牙 5.1 片上系统(SoC),将 SoC DA14531 优势融入集成模块。 只需一个电源和一个印刷电路板即可构建蓝牙应用程序。

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210123u3a055zz4n34o8rm.jpg)

DA14531 模块应用广泛,通过跨地区认证,可显著节省开发成本、缩短上市时间。 搭配集成天线和易上手的软件,低功耗蓝牙开发变得无比轻松。 该组合将移动连接带入全新的应用领域,使以 SmartBond TINY™ 为核心的十亿物联网设备成为可能。

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210144x6gr0urr2rr234r0.jpg)

详见:(https://www.renesas.cn/zh/products/da14531mod) .

### 原理图

模组

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210221qv9ywhiirzwhrfwi.jpg)

外设

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210235z35zlezrla51a33z.jpg)

### 主控板

主控开发板采用 RA-Eco-RA4M2 V2.0 ,搭载 `R7FA4M2AD3CFP` 点点taptap安卓,采用 ARM Cortex-M33 内核。

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210254a2r4vw4c2vgwgpb4.jpg)

板载资源包括:

- 两组 Pmod 接口,可连接 UART、SPI 及 GPIO 类模块;
- Arduino 兼容扩展接口和通用 I/O 排针;
- USB 通信及板载 USB 转串口;
- SWD 调试接口和启动模式配置;
- 用户 LED、用户按键和复位按键;
- 电容触摸按键及 I²C 扩展接口。

## 硬件连接

使用 J-LINK OB 连接 RA4M2-Eco 开发板

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210309dtg0v6vl9jz2gvfq.jpg)

详见:(https://oshwhub.com/jinleili/j-link-ob-gai-jin-ban) .

## 环境搭建

- 下载并安装 (https://www.renesas.cn/zh/software-tool/ra-flexible-software-package-fsp) ;
- [下载](https://gitee.com/jinleili0907/renesas_-ble/blob/master/APK/renesas_smartbond.apk) 并安装 (https://github.com/h2457528767/RenesasProject/blob/main/APK/renesas_smartbond.apk) 手机应用;

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210326mecszhzpy0qpba2h.jpg)

## 工程测试

### 工程配置

- 运行 e2 studio 软件,加载目标示例工程;
- 依次选择 `文件` - `从文件系统打开项目`,选择 RA4M2BLE 工程文件夹,导入;
- 双击 `configuration.xml` ,点击 Continue 更新至当前FSP版本;
- 在 Stacks 标签内,点击 UART 堆栈,配置相关属性,根据原理图可知,PMOD2 串口引脚对应 P410 (RXD0) 和 P411 (TXD0) ;

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210343eerqxqzlm9ql9omb.jpg)

- 点击 `Generate Project Content` ,重新生成代码框架;

详见:[点点互娱官网入口 | RA MCU | RA生态社区](https://www.ramcu.cn/resource/list/) .

### 流程图

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210403yff4l89z4goj66g6.jpg)

### 代码

打开 `hal_entry.c` 文件,添加如下代码

```c++
#include "hal_data.h"
#include "ble_transport.h"
#include <stdbool.h>

/*
* RAECO4M2 V2.0 + DA14531 application bring-up.
*
* LED1:      P405, active high.
* BLE UART:    SCI0, P411/TXD0, P410/RXD0, 115200 8N1.
* BLE LPR:   P609, output high.
* BLE CONNECT: P414, input; high while a phone is connected.
*
* The application echoes every byte received from the phone back through the
* DA14531. Enable notifications for CodeLess Outbound Command in SmartBond.
*/

typedef enum e_diagnostic_reason
{
    DIAGNOSTIC_REASON_NONE          = 0,
    DIAGNOSTIC_REASON_LED_PIN_CFG   = 1,
    DIAGNOSTIC_REASON_CPU_EXCEPTION = 2,
    DIAGNOSTIC_REASON_BLE_INIT      = 3,
} diagnostic_reason_t;

#define APP_ECHO_BUFFER_SIZE (64U)
#define APP_LED_BLINK_MS   (500U)

volatile diagnostic_reason_t g_diagnostic_reason = DIAGNOSTIC_REASON_NONE;
volatile fsp_err_t            g_diagnostic_error= FSP_SUCCESS;
volatile uint32_t             g_fault_exception   = 0U;
volatile uint32_t             g_fault_cfsr      = 0U;
volatile uint32_t             g_fault_hfsr      = 0U;
volatile uint32_t             g_fault_dfsr      = 0U;
volatile uint32_t             g_fault_mmfar       = 0U;
volatile uint32_t             g_fault_bfar      = 0U;

/* Application state intended for debugger inspection. */
volatile bool   g_app_ble_identity_ok       = false;
volatile bool   g_app_ble_connected         = false;
volatile uint8_tg_app_last_rx_data = {0U};
volatile uint32_t g_app_last_rx_length         = 0U;
volatile uint32_t g_app_rx_message_count       = 0U;
volatile uint32_t g_app_echo_queued_total      = 0U;
volatile uint32_t g_app_echo_dropped_total   = 0U;

void HardFault_Handler(void);
void MemManage_Handler(void);
void BusFault_Handler(void);
void UsageFault_Handler(void);
void SecureFault_Handler(void);

static void diagnostic_stop(diagnostic_reason_t reason, fsp_err_t error)
{
    g_diagnostic_reason = reason;
    g_diagnostic_error= error;

    if (0U != (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk))
    {
      __BKPT(0);
    }

    while (1)
    {
      __NOP();
    }
}

static void cpu_exception_stop(void)
{
    g_fault_exception = SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk;
    g_fault_cfsr      = SCB->CFSR;
    g_fault_hfsr      = SCB->HFSR;
    g_fault_dfsr      = SCB->DFSR;
    g_fault_mmfar   = SCB->MMFAR;
    g_fault_bfar      = SCB->BFAR;

    diagnostic_stop(DIAGNOSTIC_REASON_CPU_EXCEPTION, FSP_ERR_ASSERTION);
}

void HardFault_Handler(void)
{
    cpu_exception_stop();
}

void MemManage_Handler(void)
{
    cpu_exception_stop();
}

void BusFault_Handler(void)
{
    cpu_exception_stop();
}

void UsageFault_Handler(void)
{
    cpu_exception_stop();
}

void SecureFault_Handler(void)
{
    cpu_exception_stop();
}

void hal_entry(void)
{
    fsp_err_t err;
    uint8_t   echo_buffer;
    bool      led_level      = false;
    uint32_tled_elapsed_ms = 0U;

    /* IOPORT is opened by R_BSP_WarmStart() before main() is called. */
    err = R_IOPORT_PinCfg(&g_ioport_ctrl,
                        BSP_IO_PORT_04_PIN_05,
                        IOPORT_CFG_PORT_DIRECTION_OUTPUT | IOPORT_CFG_PORT_OUTPUT_LOW);
    if (FSP_SUCCESS != err)
    {
      diagnostic_stop(DIAGNOSTIC_REASON_LED_PIN_CFG, err);
    }

    err = ble_transport_init();
    if (FSP_SUCCESS != err)
    {
      diagnostic_stop(DIAGNOSTIC_REASON_BLE_INIT, err);
    }

    g_app_ble_identity_ok = (BLE_IDENTITY_RESULT_ALL == g_ble_command_success_mask);

    while (1)
    {
      ble_transport_poll();
      g_app_ble_connected = ble_transport_is_connected();

      uint32_t const received = ble_transport_read(echo_buffer, sizeof(echo_buffer));
      if (received > 0U)
      {
            for (uint32_t i = 0U; i < received; i++)
            {
                g_app_last_rx_data = echo_buffer;
            }
            g_app_last_rx_data = 0U;
            g_app_last_rx_length         = received;
            g_app_rx_message_count++;

            uint32_t const queued = ble_transport_write(echo_buffer, received);
            g_app_echo_queued_total+= queued;
            g_app_echo_dropped_total += received - queued;
      }

      if (g_app_ble_connected)
      {
            led_level      = true;
            led_elapsed_ms = 0U;
      }
      else
      {
            led_elapsed_ms++;
            if (led_elapsed_ms >= APP_LED_BLINK_MS)
            {
                led_elapsed_ms = 0U;
                led_level      = !led_level;
            }
      }

      (void) R_IOPORT_PinWrite(&g_ioport_ctrl,
                                 BSP_IO_PORT_04_PIN_05,
                                 led_level ? BSP_IO_LEVEL_HIGH : BSP_IO_LEVEL_LOW);

      R_BSP_SoftwareDelay(1U, BSP_DELAY_UNITS_MILLISECONDS);
    }
}
```

保存代码。

### 编译运行

- 右键工程文件夹,点击构建项目(或点击工具栏小锤子按钮);
- 右键工程文件夹 - 调试/运行项目 - 上传固件至开发板(或点击工具栏小虫子按钮,进入 Debug 模式并运行)。

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/211703ronxsn0ymlyomymo.jpg)



此外可生成 HEX 固件并使用 USB 烧录模式,

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/211328aapppxupwq6uhfrh.jpg)


详见:[【RA-Eco-RA4M2开发板评测】介绍、环境搭建、工程测试](https://bbs.elecfans.com/jishu_2512412_1_1.html) .

## 效果演示

- 打开 SmartBond 应用,扫描周围蓝牙设备,找到 `superflyBLE` 设备,点击连接;
- 在 Client 客户端标签下,展开 CodeLess 选项,点击上传按钮;
- 输入文本 `Hello World` 并发送,可在接收端获取 echo 反馈信息;

!(//m.qjumbo.com/forum/data/attachment/forum/202610/08/210432z6xbyhoxzohhpxk8.jpg)

## 总结

本文介绍了瑞萨 DA14531 蓝牙模块的相关信息,包括外观参数、资源特点、原理图等,并搭建开发环境、结合 RA4M2-Eco 开发板实现蓝牙功能测试,为相关产品的快速开发和应用设计提供了参考。

页: [1]
查看完整版本: 【瑞萨BLE/WIFI模块测评】DA14531 蓝牙模块

Baidu
map