This document describes the AT command interface exposed externally by the SF32LB57 dual-mode Bluetooth module (SIFLI_AT) V1.2.1 release. Commands and response strings are marked in monospace, where \r denotes carriage return (0x0D) and \n denotes line feed (0x0A). AT commands are transmitted as ASCII text; binary fields inside PDU frames are laid out in little-endian byte order.
This page is the AT Command Set referenced throughout the Bluetooth AT Command Module product definition, and is the authoritative specification for that module's AT interface.
Table: Revision History
Version
Changes
Date
V1.2.1
SF32LB57 V1.2.1 release: added AT+CFGRESET; updated Classic Bluetooth name boot-time sync, CLEARLINKKEY, connection handle, and PDU documentation; BQB build configuration enabled.
This module is an SF32LB57 dual-mode Bluetooth module that exposes a UART-based AT command interface to the host, supporting both BLE and Classic Bluetooth (BR/EDR). The host uses AT commands to configure device parameters, manage connections, send and receive data, and receive status indications the module reports on its own.
AT commands are transmitted as ASCII text, terminated by a carriage return \r (0x0D). The command prefix is AT+ (AT-format commands) or AT> (PDU-format commands). On SF32LB57, the AT port is USART1, using 8N1 framing with no hardware flow control, at a default baud rate of 460800 bps. A single AT frame is limited to 512 bytes.
PDU commands carry binary payloads in command mode. Unless otherwise noted, numeric fields within a frame are little-endian, and data is raw binary data.
Device name: a string 1–29 bytes long; empty or over 29 bytes returns ERROR. Default SIFLI_AT.
Notes
Updates the device name configuration and synchronizes it into the local name and the BLE scan-response name. The final displayed name is also affected by MACNAME (see below).
Value: 0 = displayed name is the device name as-is; 1 = appends a -XXXX suffix to the device name (XXXX is the uppercase hex of the last two bytes of the local BD_ADDR). Range 0–1. Default 0.
Notes
Updates the configuration. When on, if the device name plus suffix exceeds the 29-byte display-name limit, the device name portion is truncated to fit the 5-byte suffix.
Success: \r\nOK\r\n; query form (AT+RESET?\r): \r\nERROR\r\n
Parameters
None
Notes
On receiving the command, the module saves the current AT configuration, replies OK, then stops advertising, drops connections, and performs a soft reset. This command does not itself modify the configuration.
Success: \r\nOK\r\n; query form (AT+FACTORYRESET?\r): \r\nERROR\r\n
Parameters
None
Notes
Restores AT configuration to defaults, clears custom GATT service configuration, BLE bonding, Classic Bluetooth (BR/EDR) pairing bonds, and the BLE static random address, then replies OK and resets. The host should wait for IM_READY after the reset.
Success: \r\nOK\r\n; out-of-range value or calibration interface failure: \r\nERROR\r\n
Parameters
freq_off: frequency-offset calibration value, in Hz, range -120000 to 120000, default 0. A value of 0 performs a calibration reset (restores the hardware/factory-line original value); a non-zero value sets that value directly.
Notes
Setting it modifies the HXT capacitor bank register and writes to the FACTORY_CFG_ID_CRYSTAL partition. After a successful calibration, the echo value in the AT configuration is updated and marked for saving.
Success: \r\nOK\r\n; query form (AT+DUT?\r): \r\nERROR\r\n
Parameters
None
Notes
Sets the BR/EDR Classic Bluetooth DUT-enable bit and replies OK, then waits for test equipment to trigger signaling test over the air via LMP_test_control. The AT UART (USART1) remains available. Entering DUT mode is irreversible — it can only be exited by resetting.
addr: the Bluetooth address to set, must be 12 hex characters (no separators), most-significant byte first, e.g. 001583112233. Length must be exactly 12 hex characters.
Notes
The address is written to configuration and saved. Takes effect after a reset. The factory default is all-zero, meaning the address is auto-generated from the chip UID.
addr: returns the address currently used by BLE, 12 hex characters (uppercase, no separators), most-significant byte first.
Notes
If a BLE-specific static random address has been generated via AT+RANDOMADDR=1, that static random address is returned; otherwise the same public address as the Bluetooth address is returned. Returns ERROR on read failure.
This command does not accept directly setting the BLE address — calling it always returns ERROR. A BLE static random address is generated via AT+RANDOMADDR=1.
n: 0 or 1. 1 = enable a BLE static random address, derived from the public address (setting the top two bits of the public address's most-significant byte to 1 — e.g. public 001583112233 derives BLE C01583112233); 0 = BLE reverts to the public address. Other values or extra characters return ERROR. Default 0.
Notes
The switch state updates the configuration. If set to 1 and reading the public address fails, the switch falls back to 0 and returns ERROR. The address change is written to NVDS and takes effect after a reset. Running AT+RANDOMADDR=1 again re-derives the same random address from the (unchanged) public address.
state: current discoverable state. 0 = not discoverable, 1 = discoverable, 2 = partially discoverable (mixed state). The value depends on the operating mode: in BLE mode (BTMODE=1), it reflects BLE advertising intent — 1 = advertising on, 0 = advertising off; in BT mode (BTMODE=2), it reflects inquiry/page scan — 1 if both are on, 0 if both are off, 2 otherwise; in dual-mode (BTMODE=0), 1 if BLE advertising, inquiry, and page scan are all on, 0 if all off, 2 otherwise.
Notes
Only queries the current discoverable state — does not change device state.
mode: 0 = turn discoverability off, 1 = turn discoverability on. See Parameters for the value range.
Notes
Acts according to the current operating mode: in BLE mode (BTMODE=1), turns BLE advertising on/off; in BT mode (BTMODE=2), turns inquiry and page scan on/off; in dual-mode (BTMODE=0), acts on BLE advertising as well as inquiry and page scan simultaneously.
mode: operating mode. 0 = pass-through mode, 1 = command mode; see Parameters for the value range. Defaults to pass-through mode on power-up.
Notes
Takes effect immediately, not persisted — returns to pass-through mode on reset. In pass-through mode, data received on the serial port is forwarded as-is to the connected peer; in command mode, serial data is parsed as AT commands.
Success: \r\nOK\r\n; query form AT+CLEARLINKKEY?\r: \r\nERROR\r\n
Parameters
No parameters.
Notes
Clears BLE bonding information and the Classic Bluetooth link key. After success, the device resets; AT configuration such as device name, baud rate, and COD is retained. The host should wait for IM_READY after the reset. The query form is not supported.
evt_silent: event-reporting switch. 0 = normally report IM_CONN/IM_DISCONN/IM_READY and other events, 1 = silence all of them (do not report). Default 0 (normal reporting).
Notes
Setting updates the configuration. When set to 1, connection-established, disconnect, and ready events are not output over the serial port.
idle_ms: pass-through idle-disconnect timeout, in milliseconds, range 0–65535; over 65535 returns ERROR. 0 disables the idle-disconnect feature. Default 0 (off).
Notes
Setting updates the configuration. Only takes effect in pass-through mode: while in pass-through mode, if more than idle_ms milliseconds have elapsed since the serial port last received data, all connections (if any) are disconnected; idle_ms = 0 never triggers this.
<n>: 0 = disable multi-connection; 1 = enable multi-connection. Value is 0 or 1. Default 1.
Notes
Setting updates the configuration. When multi-connection is off, concurrent connection capability is restricted; when on, it operates according to the AT+BLEMULTICONN and AT+BTMULTICONN settings.
<n>: maximum number of concurrent BLE connections, decimal, range 1–6. Default 3.
Notes
Can only be set when the multi-connection switch is on (AT+MULTICONN=1). Setting updates the configuration; once the connection count hits the limit, advertising stops (no longer connectable), and automatically resumes once a link drops back below the limit.
Query Maximum Classic Bluetooth Concurrent Connections¶
Table: Query Maximum Classic Bluetooth Concurrent Connections
Item
Content
Command
AT+BTMULTICONN?\r
Response
Success: \r\n+BTMULTICONN:<n>\r\n\r\nOK\r\n; when multi-connection is off: \r\nERROR\r\n
Parameters
<n>: the currently configured maximum number of concurrent Classic Bluetooth (BR/EDR) connections, decimal.
Notes
Can only be queried when the multi-connection switch is on (AT+MULTICONN=1); returns ERROR when off.
Set Maximum Classic Bluetooth Concurrent Connections¶
Table: Set Maximum Classic Bluetooth Concurrent Connections
Item
Content
Command
AT+BTMULTICONN=<n>\r
Response
Success: \r\nOK\r\n; failure: \r\nERROR\r\n
Parameters
<n>: maximum number of concurrent Classic Bluetooth connections, decimal, range 1–7. Default 7.
Notes
Can only be set when the multi-connection switch is on (AT+MULTICONN=1). Setting updates the configuration; once the connection count hits the limit, the module stops page scan, and automatically resumes once a link drops back below the limit.
Success: \r\nOK\r\n; failure or not found: \r\nERROR\r\n
Parameters
<conn_hdl>: connection handle, hex. BLE connection handles are 1-based external handles (matching what AT+CONNLIST returns); BT connections use their ACL handle. <conn_hdl> = 0 is treated as invalid input and returns ERROR.
Notes
With no parameter (or an empty parameter), all active links (BLE and BR/EDR) are disconnected and OK is returned. With a parameter, the handle is looked up: first matched against the BLE external handle (internal handle = <conn_hdl> - 1); if not found, matched against the raw BT ACL handle; if no matching connection is found, returns ERROR. The query form AT+DISCONN? returns ERROR.
Each active connection is output as one line: \r\n+CONNLIST:<conn_hdl>,<type>,<addr>,<extra>\r\n; followed by \r\nOK\r\n after all lines; \r\nOK\r\n alone if there are no active connections; a non-empty parameter: \r\nERROR\r\n
Parameters
Output fields: <conn_hdl> — connection handle, 4 hex digits, BLE uses a 1-based external handle; <type> — connection type, BLE or BT; <addr> — the peer's Bluetooth address, 12 hex digits (most-significant byte first); <extra> — the current MTU for BLE connections, or the service channel for BT connections, decimal.
Notes
The set form returns ERROR if given a non-empty parameter. Iterates through every connection slot and outputs the active ones.
AT+SPPSEND=<conn_hdl>,<data>\r or AT+SPPSEND=,<data>\r
Response
Success: \r\nOK\r\n; failure: \r\nERROR\r\n
Parameters
conn_hdl: target BT connection handle, hex. May be omitted or set to 0, in which case the currently first active BT connection is used. data: the data to send, a hex string, each two characters representing one byte; cannot be empty and the character count must be even. The actual data length carried in an ASCII AT frame is also bounded by the single-AT-frame limit.
Notes
conn_hdl and data are separated by a comma; the comma must still be present even when conn_hdl is omitted. The query form is not supported.
For each configured service, returns one line \r\n+GATTSRV:<idx>,<char_count>,<state>\r\n, followed by \r\nOK\r\n. If no services are configured, only \r\nOK\r\n is returned
Parameters
idx: service slot number, 0–5. char_count: the number of characteristics configured for that service. state: REG means registered with the protocol stack, CFG means configured in RAM only and not yet registered
idx: service slot number, 0–5. uuid: the service UUID, entered as a hex string with the MSB first — 4 characters for a 16-bit UUID, 32 characters for a 128-bit UUID
Notes
idx must be a single digit immediately followed by a comma. UUID length must be exactly 4 or 32 characters — any other length returns ERROR. If the slot is already registered with the protocol stack it cannot be reconfigured, and creation returns ERROR. Creating a service clears any previous configuration in that slot
Clears that slot's configuration in RAM. A service already registered with the protocol stack cannot be revoked at runtime — this command only clears the RAM configuration
For each characteristic of that service, returns one line \r\n+GATTCHAR:<svc>,<chr>,prop=0x<prop>,len=<max_len>\r\n, followed by \r\nOK\r\n; if the service does not exist: \r\nERROR\r\n
Parameters
svc: service slot number, 0–5. chr: characteristic index. prop: the characteristic's property bits, in hex. max_len: maximum characteristic value length
svc: service slot number, 0–5. chr: characteristic index, 0–7. uuid: characteristic UUID, MSB first, 4 characters for 16-bit, 32 characters for 128-bit. prop: a property string composed of the characters R (read), W (write with response), w (write without response), N (notify), I (indicate). len: maximum characteristic value length, 1–512
Notes
All five parameters are required — omitting any returns ERROR. UUID length must be exactly 4 or 32 characters. prop must contain at least one recognized property character; if none is recognized, returns ERROR — unrecognized characters within prop are simply ignored. len of 0 or over 512 returns ERROR. The parent service must already be created and not yet registered with the protocol stack
\r\n+GATTSTART:<count>\r\n followed by \r\nOK\r\n; query form AT+GATTSTART?\r: \r\nERROR\r\n
Parameters
count: the number of services successfully registered with the protocol stack in this call
Notes
Registers with the protocol stack every service that is in use, not yet registered, and has at least one characteristic. Once registered, a service can no longer be revoked or reconfigured at runtime. The query form is not supported
Table: Send GATT Characteristic Data (Notify/Indicate)
Item
Content
Command
AT+GATTSEND=<svc>,<chr>,<conn_hdl>,<hex>\r; omitting the connection handle: AT+GATTSEND=<svc>,<chr>,,<hex>\r
Response
Success: \r\nOK\r\n; failure: \r\nERROR\r\n; query form AT+GATTSEND?\r: \r\nERROR\r\n
Parameters
svc: service slot number. chr: characteristic index. conn_hdl: BLE connection handle, hex, 1-based, may be omitted. hex: the data to send, a hex string with an even character count; the actual data length carried in an ASCII AT frame is also bounded by the single-AT-frame limit.
Notes
When conn_hdl is omitted, the current first BLE connection is used. The target service must already be registered and the characteristic index must be valid; if the characteristic's properties include Indicate (I), an indication is used, otherwise a notification.
Success: \r\nOK\r\n; failure: \r\nERROR\r\n; query form AT+GATTSTORE?\r: \r\nERROR\r\n
Parameters
None
Notes
Persists the current configuration of all services and characteristics to flash. Only configuration data is saved — runtime information such as registration state is not saved. Returns ERROR if KVDB is not ready or the write fails. The query form is not supported
v: switch value, 0 or 1, 0 = off, 1 = on. Default 1
Notes
See Parameters for the value range. Setting updates the configuration. When on, the device automatically loads the saved GATT service configuration on power-up
The following are status indications the module reports on its own — the host does not send a command to receive them. Reporting is controlled by the event-reporting switch (AT+EVT); nothing is reported while silent mode is on.
None (reported by the firmware on its own, not sent by the user)
Response
Report string: \r\nIM_READY\r\n
Parameters
None
Notes
Reported once when the module finishes initialization and enters an available state; also reported again once all connections have dropped and the connection count returns to zero. Reporting is controlled by the event-silence switch; nothing is reported while silent mode is on.
hdl: connection handle, 4 hex digits (uppercase, fixed 4 digits, zero-padded). BLE connections display a 1-based handle (the internal handle plus 1); other types display the raw value. addr: the peer's address, 12 hex digits, MSB first. mtu: the current connection's MTU, decimal.
Notes
In command mode, each connection established is reported once, carrying the handle, peer address, and MTU. In pass-through mode, this is reported only when the connection count is 1 (the first connection), and carries no parameters. Reporting is controlled by the event-silence switch; nothing is reported while silent mode is on.
None (reported by the firmware on its own when a connection is dropped)
Response
Command mode: \r\nIM_DISCONN:<hdl>\r\n
Parameters
hdl: the disconnected connection's handle, 4 hex digits (uppercase, fixed 4 digits, zero-padded). BLE connections display a 1-based handle (the raw handle plus 1); others display the raw value.
Notes
Only carries a handle and is reported in command mode; not reported in pass-through mode. Regardless of mode, once all connections have dropped and the connection count returns to zero, \r\nIM_READY\r\n is additionally reported. Reporting is controlled by the event-silence switch; nothing is reported while silent mode is on.
opcode is fixed at 0x0101; body = conn_hdl (2-byte little-endian) + data. BLE connection handles use the 1-based external value; SPP connections use the raw ACL handle.
Notes
In command mode, when data is written to a custom BLE characteristic or received over Classic Bluetooth SPP, the module reports it to the host in the format above; in pass-through mode, the data is output directly.
PDU Mode Send Data (Auto-Select Notify Characteristic, opcode 0x0101)¶
Table: PDU Mode Send Data (Auto-Select Notify Characteristic, opcode 0x0101)
Item
Content
Command
A binary frame (not a text AT line): AT> + opcode(2-byte little-endian) + len(2-byte little-endian) + body + \r. Here opcode = 0x0101 (byte sequence 01 01); len is the byte count of body; body = conn_hdl(2-byte little-endian) + data. data is the payload to send.
Response
No text response string. The firmware forwards data to the peer according to the connection type, without replying OK/ERROR.
Parameters
opcode: fixed 0x0101. len: body length, range 2–508 (frames under 2 or over AT_RX_BUF_SIZE-4 are dropped; AT_RX_BUF_SIZE = 512). conn_hdl: target connection handle; 1-based (external display value) for BLE connections, raw ACL handle for SPP connections. data: payload bytes, length = len-2, may be 0.
Notes
conn_hdl resolution order: first matched against the BLE 1-based handle (i.e., conn_hdl-1 hits a BLE slot); if not found, matched against the raw value for an SPP slot; if no connection is found, the frame is dropped. For a BLE target, the firmware iterates the custom GATT services and automatically selects the first characteristic with a Notify or Indicate property to send on; if no such characteristic exists, nothing is sent. For an SPP (BR/EDR) target, data is sent over the SPP channel. The frame must be immediately followed by \r; if missing, the current frame is dropped. If no new bytes arrive within the PDU timeout threshold between frames, the PDU receive state is reset.
PDU Mode Send Data (Specify Service and Characteristic, opcode 0x0102)¶
Table: PDU Mode Send Data (Specify Service and Characteristic, opcode 0x0102)
Item
Content
Command
A binary frame (not a text AT line): AT> + opcode(2-byte little-endian) + len(2-byte little-endian) + body + \r. Here opcode = 0x0102 (byte sequence 02 01); len is the byte count of body; body = conn_hdl(2-byte little-endian) + svc_idx(1 byte) + char_idx(1 byte) + data.
Response
No text response string. The firmware sends data to the peer via the specified service/characteristic, without replying OK/ERROR.
Parameters
opcode: fixed 0x0102. len: body length, range 4–508 (the receive layer's general floor is 2, but this opcode requires the body to be at least 4 bytes, covering svc_idx+char_idx) — otherwise dropped. conn_hdl: target BLE connection handle, 1-based (external display value). svc_idx: the custom GATT service index. char_idx: the characteristic index within that service. data: payload bytes, length = len-4, may be 0.
Notes
BLE connections only; if the resolved connection is of SPP type, the frame is dropped. svc_idx must correspond to a registered custom service, and char_idx must be less than that service's characteristic count, otherwise dropped. The specified characteristic must have a Notify or Indicate property, otherwise dropped. conn_hdl resolution follows the same rule as 0x0101 (1-based BLE handle first, then the raw value). The frame must be immediately followed by \r.
AT+DISCONN\r (no parameter) or AT+DISCONN=<conn_hdl>\r
Response
Success: \r\nOK\r\n; failure: \r\nERROR\r\n
Parameters
conn_hdl: the connection handle to disconnect, hex. BLE connections are 1-based (external display value); the value must not be 0 (0 is treated as invalid input and returns ERROR). SPP connections use the raw ACL handle.
Notes
With no parameter, all current connections are disconnected and OK is returned. With a parameter, resolution order: first matched against the BLE 1-based handle (conn_hdl-1 hits a BLE slot); if not found, matched against the raw value for an SPP slot; if no connection is found, returns ERROR. For BLE connections, disconnection is initiated with reason code 0x13; for SPP connections, disconnection is initiated by the peer address. The query form AT+DISCONN? returns ERROR.
PDU Connection Status Indication (IM_CONN / IM_DISCONN)¶
Table: PDU Connection Status Indication (IM_CONN / IM_DISCONN)
Item
Content
Command
Reported by the module on its own — no command needed from the host. IM_CONN is reported when a connection is established, IM_DISCONN when one is dropped.
Response
Command mode, connection established: \r\nIM_CONN <hdl>,<mac>,<mtu>\r\n, where <hdl> is a 4-digit hex handle, <mac> is a 12-digit hex address (most-significant byte first), and <mtu> is a decimal MTU. Command mode, connection dropped: \r\nIM_DISCONN:<hdl>\r\n (<hdl> is 4 hex digits). Pass-through mode reports \r\nIM_CONN\r\n (no parameters) only when the first connection is established, and does not report IM_DISCONN on disconnect. Both modes report \r\nIM_READY\r\n once all connections have dropped.
Parameters
<hdl>: connection handle; BLE connections display as 1-based (internal 0-based plus 1), SPP connections display the raw handle. <mac>: the peer's Bluetooth address. <mtu>: the negotiated MTU.
Notes
Reporting is controlled by the event-silence switch: with the switch at 0 (default), reporting is normal; once set, none of IM_READY/IM_CONN/IM_DISCONN are reported. The reporting format and content differ by current operating mode (command mode / pass-through mode), as described above.