初学者
10 分钟

使用Calypso (2610011025000)和STM32F302VC为您的嵌入式应用提供可靠和安全的无线连接

Calypso WLAN模块,符合IEEE 802.11 b/g/n标准,用于无线网络通信

Calypso Click with CLICKER 4 for STM32F302VCT6

已发布 7月 22, 2025

点击板

Calypso Click

开发板

CLICKER 4 for STM32F302VCT6

编译器

NECTO Studio

微控制器单元

STM32F302VC

非常适合需要长期低功耗电池运行的云连接系统

A

A

硬件概览

它是如何工作的?

Calypso Click基于Würth Elektronik的WIRL-WIFS Calypso(2610011025000)WLAN模块,专为嵌入式应用中的无线连接设计。该模块符合IEEE 802.11 b/g/n标准,配备完整集成的TCP/IP协议栈,是WiFi通信的多功能解决方案。Calypso模块通过WiFi认证(ID: WFA81685),确保符合行业标准,提供可靠的应用性能。它采用边缘电镀连接和智能天线配置,易于集成到任何系统中,并具有直观的AT风格命令界面,简化了配置和控制。Calypso模块支持IPv4和IPv6协议,并预装了多种网络协议,如SNTP、DHCPv4、DHCPv6、mDNS、HTTP(S)和MQTT,确保高效、安全的数据交换。其先进的安全功能包括同时处理多达六个安全套接字、支持安全启动、存储和空中(OTA)更新,使其成为需要安全、可靠云连接的物联网应用的理想选择。Calypso模块具备低功耗无线连接,适用于串行电缆替代方案或中等数据吞吐量需求的低功耗物联网设备。该Click板™采用

UART接口与主MCU通信,使用标准的RX和TX引脚,并通过CTS和RTS引脚进行硬件流控制。默认通信速率为921600bps,确保平稳、高效的数据传输。整个模块通过UART接口的AT命令进行配置和控制,配置完成后独立管理WLAN连接,释放主控制器的资源。此外,通过定制固件开发,可实现无需主机的独立应用。Click板™配备USB Type-C连接器,通过PC进行供电和配置。这得益于集成的CP2102N USB到UART桥接芯片和NCP1117 LDO稳压器,它将USB供电转换为模块所需的3.3V。除了这种供电方式,板载还支持背面的纽扣电池备用电源,允许实现前面提到的独立运行。除了UART接口外,该Click板™还使用I2C接口控制I/O扩展器PCA9536,由于mikroBUS™引脚数量有限,该扩展器管理特定模块功能。通过扩展器,可以控制以下功能:AP0和AP1,用于设置应用模式(如AT命令正常模式、OTA、Provisioning或透明模式);BOOT引脚在启动时拉低以启用标准应

用引导;RM2引脚可配置为远程GPIO功能,允许配置和控制GPIO,包括输入、输出和PWM。此外,这些信号可以通过SW1开关手动控制,RM1则通过开关管理,RM0可以通过mikroBUS™插座进行控制。该板还配备了多个额外功能来增强其性能。它包括一个复位引脚(RST)和一个RESET按钮用于模块复位,以及一个唤醒引脚(WUP)用于将模块从睡眠模式中唤醒。板上有两个LED指示灯用于提供视觉反馈:一个绿色(LD2)和一个蓝色(LD3),用于指示模块的操作状态。此外,用户可以选择板载PCB天线(适用于紧凑设计)或通过板载ANT u.Fl连接器连接外部天线,适用于远程应用。此Click板™只能在3.3V逻辑电平下运行。在使用具有不同逻辑电平的MCU之前,必须进行适当的逻辑电平转换。此外,该Click板™还配备了包含易于使用的函数和示例代码的库,可作为进一步开发的参考。

Calypso Click hardware overview image

功能概述

开发板

Clicker 4 for STM32F3 是一款紧凑型开发板,作为完整的解决方案而设计,可帮助用户快速构建具备独特功能的定制设备。该板搭载 STMicroelectronics 的 STM32F302VCT6 微控制器,配备四个 mikroBUS™ 插槽用于连接 Click boards™、完善的电源管理功能以及其他实用资源,是快速开发各类应用的理想平台。其核心 MCU STM32F302VCT6 基于高性能 

Arm® Cortex®-M4 32 位处理器,运行频率高达 168MHz,处理能力强大,能够满足各种高复杂度任务的需求,使 Clicker 4 能灵活适应多种应用场景。除了两个 1x20 引脚排针外,板载最显著的连接特性是四个增强型 mikroBUS™ 插槽,支持接入数量庞大的 Click boards™ 生态系统,该生态每日持续扩展。Clicker 4 各功能区域标识清晰,界面直观简洁,极大

提升使用便捷性和开发效率。Clicker 4 的价值不仅在于加速原型开发与应用构建阶段,更在于其作为独立完整方案可直接集成至实际项目中,无需额外硬件修改。四角各设有直径 4.2mm(0.165")的安装孔,便于通过螺丝轻松固定。对于多数应用,只需配套一个外壳,即可将 Clicker 4 开发板转化为完整、实用且外观精美的定制系统。

CLICKER 4 for STM32F302VCT6 double image

微控制器概述 

MCU卡片 / MCU

STM32F302VC Image

建筑

ARM Cortex-M4

MCU 内存 (KB)

256

硅供应商

STMicroelectronics

引脚数

100

RAM (字节)

40960

使用的MCU引脚

mikroBUS™映射器

General-Purpose I/O 0
PC4
AN
Reset / ID SEL
PC15
RST
UART CTS / ID COMM
PA4
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
Module Wake-Up
PE9
PWM
UART RTS
PD0
INT
UART TX
PA2
TX
UART RX
PA3
RX
I2C Clock
PB10
SCL
I2C Data
PB11
SDA
NC
NC
5V
Ground
GND
GND
1

“仔细看看!”

Click board™ 原理图

Calypso Click Schematic schematic

一步一步来

项目组装

PIC32MZ MXS Data Capture Board front image hardware assembly

从选择您的开发板和Click板™开始。以CLICKER 4 for STM32F302VCT6作为您的开发板开始。

PIC32MZ MXS Data Capture Board front image hardware assembly
Thermo 21 Click front image hardware assembly
Thermo 21 Click complete accessories setup image hardware assembly
Board mapper by product6 hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
Necto image step 5 hardware assembly
Necto image step 6 hardware assembly
PIC32MZ MXS Data Capture Board NECTO MCU Selection Step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Necto image step 11 hardware assembly

软件支持

库描述

该库包含 Calypso Click 驱动程序的 API。

关键功能:

  • calypso_set_app_mode - 此函数用于设置Calypso Click板的选定应用模式。

  • calypso_hw_reset - 此函数用于执行硬件重置。

  • calypso_send_cmd - 此函数用于发送所需的命令。

开源

代码示例

完整的应用程序代码和一个现成的项目可以通过NECTO Studio包管理器直接安装到NECTO Studio 应用程序代码也可以在MIKROE的GitHub账户中找到。

/*!
 * @file main.c
 * @brief Calypso Click Example.
 *
 * # Description
 * This example demonstrates the use of Calypso Click board by processing
 * the incoming data and displaying them on the USB UART.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and places AT command mode, tests the communication, 
 * and after that restarts the device, and performs example configuration.
 *
 * ## Application Task
 * It creates a connection to the TCP-UDP echo server, sends a message to it reads it back, 
 * displaces it on the UART terminal, and then closes the connection.
 *
 * ## Additional Function
 * - static void calypso_clear_app_buf ( void )
 * - static void calypso_log_app_buf ( void )
 * - static err_t calypso_process ( void )
 * - static err_t calypso_rsp_check ( uint8_t *rsp )
 * - static void calypso_error_check ( err_t error_flag )
 * - static void calypso_configure_for_example ( void )
 * - static void calypso_example ( void )
 *
 * @author MikroE Team
 *
 */

#include "board.h"
#include "log.h"
#include "calypso.h"
#include "conversions.h"

// Message content
#define MESSAGE_CONTENT                     "Calypso Click board - demo example."

// TCP/UDP example parameters
#define REMOTE_IP                           "77.46.162.162" // TCP/UDP echo server IP address
#define REMOTE_PORT                         "51111"         // TCP/UDP echo server port

// WiFi parameters
#define WIFI_SSID                           "MikroE Public"
#define WIFI_PWD                            "mikroe.guest"

// Application buffer size
#define APP_BUFFER_SIZE                     256
#define PROCESS_BUFFER_SIZE                 256

static calypso_t calypso;
static log_t logger;
static err_t error_flag;

static uint8_t app_buf[ APP_BUFFER_SIZE ] = { 0 };
static int32_t app_buf_len = 0;

/**
 * @brief Calypso clearing application buffer.
 * @details This function clears memory of application buffer and reset its length.
 * @note None.
 */
static void calypso_clear_app_buf ( void );

/**
 * @brief Calypso log application buffer.
 * @details This function logs data from application buffer to USB UART.
 * @note None.
 */
static void calypso_log_app_buf ( void );

/**
 * @brief Calypso data reading function.
 * @details This function reads data from device and concatenates data to application buffer. 
 * @return @li @c  0 - Read some data.
 *         @li @c -1 - Nothing is read.
 * See #err_t definition for detailed explanation.
 * @note None.
 */
static err_t calypso_process ( void );

/**
 * @brief Response check.
 * @details This function checks for response and
 * returns the status of response.
 * @param[in] rsp : Expected response.
 * @return @li @c  0 - OK response.
 *         @li @c -1 - Error response.
 *         @li @c -2 - Timeout error.
 *         @li @c -3 - Unknown error.
 * See #err_t definition for detailed explanation.
 */
static err_t calypso_rsp_check ( uint8_t *rsp );

/**
 * @brief Check for errors.
 * @details This function checks for different types of
 * errors and logs them on UART or logs the response if no errors occured.
 * @param[in] error_flag : Error flag to check.
 */
static void calypso_error_check ( err_t error_flag );

/**
 * @brief Calypso configure for example function.
 * @details This function is used to configure device for example.
 */
static void calypso_configure_for_example ( void );

/**
 * @brief Calypso execute example function.
 * @details This function executes TCP/UDP Example.
 */
static void calypso_example ( void );

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    calypso_cfg_t calypso_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    calypso_cfg_setup( &calypso_cfg );
    CALYPSO_MAP_MIKROBUS( calypso_cfg, MIKROBUS_1 );
    if ( UART_ERROR == calypso_init( &calypso, &calypso_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    if ( CALYPSO_ERROR == calypso_default_cfg ( &calypso ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    calypso_configure_for_example( );
    
    log_info( &logger, " Application Task " );
}

void application_task ( void ) 
{
    calypso_example( );
}

int main ( void ) 
{
    /* Do not remove this line or clock might not be set correctly. */
    #ifdef PREINIT_SUPPORTED
    preinit();
    #endif
    
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

static void calypso_clear_app_buf ( void ) 
{
    memset( app_buf, 0, app_buf_len );
    app_buf_len = 0;
}

static void calypso_log_app_buf ( void )
{
    for ( int32_t buf_cnt = 0; buf_cnt < app_buf_len; buf_cnt++ )
    {
        log_printf( &logger, "%c", app_buf[ buf_cnt ] );
    }
}

static err_t calypso_process ( void ) 
{
    uint8_t rx_buf[ PROCESS_BUFFER_SIZE ] = { 0 };
    int32_t overflow_bytes = 0;
    int32_t rx_cnt = 0;
    int32_t rx_size = calypso_generic_read( &calypso, rx_buf, PROCESS_BUFFER_SIZE );
    if ( ( rx_size > 0 ) && ( rx_size <= APP_BUFFER_SIZE ) ) 
    {
        if ( ( app_buf_len + rx_size ) > APP_BUFFER_SIZE ) 
        {
            overflow_bytes = ( app_buf_len + rx_size ) - APP_BUFFER_SIZE;
            app_buf_len = APP_BUFFER_SIZE - rx_size;
            memmove ( app_buf, &app_buf[ overflow_bytes ], app_buf_len );
            memset ( &app_buf[ app_buf_len ], 0, overflow_bytes );
        }
        for ( rx_cnt = 0; rx_cnt < rx_size; rx_cnt++ ) 
        {
            if ( rx_buf[ rx_cnt ] ) 
            {
                app_buf[ app_buf_len++ ] = rx_buf[ rx_cnt ];
            }
        }
        return CALYPSO_OK;
    }
    return CALYPSO_ERROR;
}

static err_t calypso_rsp_check ( uint8_t *rsp )
{
    uint32_t timeout_cnt = 0;
    uint32_t timeout = 120000;
    calypso_clear_app_buf( );
    calypso_process( );
    while ( ( 0 == strstr( app_buf, rsp ) ) &&
            ( 0 == strstr( app_buf, CALYPSO_RSP_ERROR ) ) )
    {
        calypso_process( );
        if ( timeout_cnt++ > timeout )
        {
            calypso_clear_app_buf( );
            return CALYPSO_ERROR_TIMEOUT;
        }
        Delay_ms ( 1 );
    }
    Delay_ms ( 100 );
    calypso_process( );
    if ( strstr( app_buf, rsp ) )
    {
        return CALYPSO_OK;
    }
    else if ( strstr( app_buf, CALYPSO_RSP_ERROR ) )
    {
        return CALYPSO_ERROR_CMD;
    }
    else
    {
        return CALYPSO_ERROR_UNKNOWN;
    }
}

static void calypso_error_check ( err_t error_flag )
{    
    switch ( error_flag )
    {
        case CALYPSO_OK:
        {
            calypso_log_app_buf( );
            break;
        }
        case CALYPSO_ERROR:
        {
            log_error( &logger, " Overflow!" );
            break;
        }
        case CALYPSO_ERROR_TIMEOUT:
        {
            log_error( &logger, " Timeout!" );
            break;
        }
        case CALYPSO_ERROR_CMD:
        {
            log_error( &logger, " ERROR Response!" );
            break;
        }
        case CALYPSO_ERROR_UNKNOWN:
        default:
        {
            log_error( &logger, " Unknown!" );
            break;
        }
    }
    log_printf( &logger, "- - - - - - - - - - - - - - - -\r\n" );
    Delay_ms ( 500 );
}

static void calypso_configure_for_example ( void )
{
    uint8_t command_data[ APP_BUFFER_SIZE ] = { 0 };

    log_printf( &logger, " Hardware reset. \r\n" );
    calypso_hw_reset( &calypso );
    error_flag = calypso_rsp_check( CALYPSO_RSP_READY );
    calypso_error_check( error_flag );

    log_printf( &logger, " Performing Test. \r\n" );
    calypso_send_cmd( &calypso, CALYPSO_CMD_AT_TEST );
    error_flag = calypso_rsp_check( CALYPSO_RSP_OK );
    calypso_error_check( error_flag );

    log_printf( &logger, " Setting WLAN Mode. \r\n" );
    calypso_send_cmd_with_par( &calypso, CALYPSO_CMD_AT_WLAN_SET_MODE, "STA" );
    error_flag = calypso_rsp_check( CALYPSO_RSP_OK );
    calypso_error_check( error_flag );

    #define SECURITY_TYPE           "WPA_WPA2" 
    strcpy( command_data, WIFI_SSID );
    strcat( command_data, ",," );
    strcat( command_data, SECURITY_TYPE );
    strcat( command_data, "," );
    strcat( command_data, WIFI_PWD );
    strcat( command_data, ",,," );

    log_printf( &logger, " WLAN Connect. \r\n" );
    calypso_send_cmd_with_par( &calypso, CALYPSO_CMD_AT_WLAN_CONNECT, command_data );
    error_flag = calypso_rsp_check( CALYPSO_RSP_OK );
    calypso_error_check( error_flag );
    error_flag = calypso_rsp_check( CALYPSO_RSP_CONNECTED );
    calypso_error_check( error_flag );
}

static void calypso_example ( void )
{
    uint8_t command_data[ APP_BUFFER_SIZE ] = { 0 };
    uint8_t socket_num[ 4 ] = { 0 };
    uint8_t * __generic_ptr socket_num_buf = 0;
    #define SOCKET_OPEN             "+socket:"
    #define SOCKET_CONNECTED        "+connect:"
    #define SOCKET_FAMILY           "INET"
    #define SOCKET_TYPE             "STREAM"
    #define SOCKET_PROTOCOL_TCP     "TCP"
    #define SOCKET_PROTOCOL_UDP     "UDP"
    #define SOCKET_FORMAT_BINATY    "0"
    
    log_printf( &logger, " Create TCP socket. \r\n" );
    strcpy( command_data, SOCKET_FAMILY );
    strcat( command_data, "," );
    strcat( command_data, SOCKET_TYPE );
    strcat( command_data, "," );
    strcat( command_data, SOCKET_PROTOCOL_TCP );
    calypso_send_cmd_with_par( &calypso, CALYPSO_CMD_AT_SOCKET, command_data );
    error_flag = calypso_rsp_check( SOCKET_OPEN );
    calypso_error_check( error_flag );

    socket_num_buf = strstr( app_buf, SOCKET_OPEN ) + strlen ( SOCKET_OPEN );
    if ( socket_num_buf )
    {
        memcpy ( socket_num, socket_num_buf, 2 );
        if ( socket_num[ 1 ] < '0' || socket_num[ 1 ] > '9' )
        {
            socket_num[ 1 ] = 0;
        }
    }
    
    log_printf( &logger, " Connect to the TCP server. \r\n" );
    strcpy( command_data, socket_num );
    strcat( command_data, "," );
    strcat( command_data, SOCKET_FAMILY );
    strcat( command_data, "," );
    strcat( command_data, REMOTE_PORT );
    strcat( command_data, "," );
    strcat( command_data, REMOTE_IP );

    calypso_send_cmd_with_par( &calypso, CALYPSO_CMD_AT_CONNECT, command_data );
    error_flag = calypso_rsp_check( SOCKET_CONNECTED );
    calypso_error_check( error_flag );
    
    uint8_t message_len_buf[ 10 ] = { 0 };
    uint16_t message_len = strlen( MESSAGE_CONTENT );
    uint16_to_str( message_len, message_len_buf );
    l_trim( message_len_buf );
    r_trim( message_len_buf );

    log_printf( &logger, " Send data to the TCP server. \r\n" );
    strcpy( command_data, socket_num );
    strcat( command_data, "," );
    strcat( command_data, SOCKET_FORMAT_BINATY );
    strcat( command_data, "," );
    strcat( command_data, message_len_buf );
    strcat( command_data, "," );
    strcat( command_data, MESSAGE_CONTENT );
    calypso_send_cmd_with_par( &calypso, CALYPSO_CMD_AT_SEND, command_data );
    error_flag = calypso_rsp_check( CALYPSO_RSP_OK );
    calypso_error_check( error_flag );

    log_printf( &logger, " Read data from the TCP server. \r\n" );
    strcpy( command_data, socket_num );
    strcat( command_data, "," );
    strcat( command_data, SOCKET_FORMAT_BINATY );
    strcat( command_data, "," );
    strcat( command_data, message_len_buf );
    calypso_send_cmd_with_par( &calypso, CALYPSO_CMD_AT_RECV, command_data );
    error_flag = calypso_rsp_check( CALYPSO_RSP_OK );
    calypso_error_check( error_flag );
    
    log_printf( &logger, " Closing the TCP connection. \r\n" );
    strcpy( command_data, socket_num );
    calypso_send_cmd_with_par( &calypso, CALYPSO_CMD_AT_CLOSE, command_data );
    error_flag = calypso_rsp_check( CALYPSO_RSP_OK );
    calypso_error_check( error_flag );

    log_printf( &logger, " Create UDP socket. \r\n" );
    strcpy( command_data, SOCKET_FAMILY );
    strcat( command_data, "," );
    strcat( command_data, SOCKET_TYPE );
    strcat( command_data, "," );
    strcat( command_data, SOCKET_PROTOCOL_UDP );
    calypso_send_cmd_with_par( &calypso, CALYPSO_CMD_AT_SOCKET, command_data );
    error_flag = calypso_rsp_check( SOCKET_OPEN );
    calypso_error_check( error_flag );

    socket_num_buf = strstr( app_buf, SOCKET_OPEN ) + strlen ( SOCKET_OPEN );
    if ( socket_num_buf )
    {
        memcpy ( socket_num, socket_num_buf, 2 );
        if ( socket_num[ 1 ] < '0' || socket_num[ 1 ] > '9' )
        {
            socket_num[ 1 ] = 0;
        }
    }
    
    log_printf( &logger, " Connect to the UDP server. \r\n" );
    strcpy( command_data, socket_num );
    strcat( command_data, "," );
    strcat( command_data, SOCKET_FAMILY );
    strcat( command_data, "," );
    strcat( command_data, REMOTE_PORT );
    strcat( command_data, "," );
    strcat( command_data, REMOTE_IP );
    calypso_send_cmd_with_par( &calypso, CALYPSO_CMD_AT_CONNECT, command_data );
    error_flag = calypso_rsp_check( SOCKET_CONNECTED );
    calypso_error_check( error_flag );
    
    log_printf( &logger, " Send data to the UDP server. \r\n" );
    strcpy( command_data, socket_num );
    strcat( command_data, "," );
    strcat( command_data, SOCKET_FORMAT_BINATY );
    strcat( command_data, "," );
    strcat( command_data, message_len_buf );
    strcat( command_data, "," );
    strcat( command_data, MESSAGE_CONTENT );
    calypso_send_cmd_with_par( &calypso, CALYPSO_CMD_AT_SEND, command_data );
    error_flag = calypso_rsp_check( CALYPSO_RSP_OK );
    calypso_error_check( error_flag );

    log_printf( &logger, " Read data from the UDP server. \r\n" );
    strcpy( command_data, socket_num );
    strcat( command_data, "," );
    strcat( command_data, SOCKET_FORMAT_BINATY );
    strcat( command_data, "," );
    strcat( command_data, message_len_buf );
    calypso_send_cmd_with_par( &calypso, CALYPSO_CMD_AT_RECV, command_data );
    error_flag = calypso_rsp_check( CALYPSO_RSP_OK );
    calypso_error_check( error_flag );
    
    log_printf( &logger, " Closing the UDP connection. \r\n" );
    strcpy( command_data, socket_num );
    calypso_send_cmd_with_par( &calypso, CALYPSO_CMD_AT_CLOSE, command_data );
    error_flag = calypso_rsp_check( CALYPSO_RSP_OK );
    calypso_error_check( error_flag );
    
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

// ------------------------------------------------------------------------ END

额外支持

资源

喜欢这个项目吗?

'购买此套件' 按钮会直接带您进入购物车,您可以在购物车中轻松添加或移除产品。