Common AT Commands

Note

The common AT commands are enabled by default and cannot be disabled.

AT+TEST

Function Description

  • Test whether the AT commands are ready

  • Test the throughput of the AT underlying peripheral interface

Command Format

AT+TEST=[<mode>, <length>/<string>]

Response Format

Successful Response:

OK

Error Response:

ERROR: <error_no>

Parameters

<mode>:

Test mode

  • 0: Echo test

  • 1: Uplink rate test

  • 2: Downlink rate test

<length>:

Data size for rate testing

<string>:

Input string for the echo test

Error Codes

  • 1: Parameter error

  • 2: Memory allocation error

Note

When <mode> is set to uplink rate test, the module enters Transparent Transmission (TT) Mode mode.

Examples

Test if AT commands are ready:

AT+TEST

OK

Test echo functionality:

AT+TEST=0,echo_test

 arg len = 9

 arg = echo_test

OK

Test uplink rate:

AT+TEST=1, 102400

>>>

upstream test(tt mode): Send 100 KBytes in <time> ms, <throughput> Kbits/sec

OK

Test downlink rate:

AT+TEST=2,102400

//Host calculates the data transmission rate

OK

AT+GMR

Function Description

Output version and related information.

Command Format

AT+GMR

Response Format

Successful Response:

AMEBA-RTOS SDK VERSION: <SDK version number>
ATCMD VERSION: <AT command version number>
IMAGE VERSION: <Current image version number>
<Chip nickname>: <Chip information>
COMPILE TIME: <Compilation time>
COMPILE USER: <Compilation user>
COMPILE ENV : <Compilation environment>

OK

Parameters

None

Example

Get version information:

AT+GMR
AMEBA-RTOS SDK VERSION: 1.1.0
ATCMD VERSION: 2.4.1
IMAGE VERSION: 1.1
amebasmart: e1ffe0ff2504cc5383c030d6ffffff28
COMPILE TIME: 2025-03-26 14:06:55
COMPILE USER: user@linux
COMPILE ENV : arm-none-eabi-gcc

OK

AT+LIST

Function Description

This command is used to list all currently supported AT commands.

Command Format

AT+LIST

Response Format

Successful Response:

Common AT Command:
AT+TEST
// … followed by other common command list.
Wi-Fi AT Command:
AT+WLSOFTAP
// … followed by other Wi-Fi command list.
NETWORK AT command:
AT+SKTGETERR
// … followed by other TCP/IP command list.
BT AT command:
AT+BLECMODE
// … followed by other BT command list.
MQTT AT command:
AT+MQTTOPEN
// … followed by other MQTT command list.

OK

Parameters

None

AT+RST

Function Description

Immediately restart the module.

Command Format

AT+RST

Response Format

Successful Response:

OK

Parameters

None

AT+STATE

Function Description

Get the status of tasks and current heap information.

Command Format

AT+STATE

Response Format

Successful Response:

Task List:
<Thread name> <Status> <Priority> <Available stack watermaker> <Task number>
...

HeapStats:
Total Heap: <Total heap size>
Heap Free Now: <Currently available heap size>
Heap Used Now: <Currently used heap size>
Heap Used Max: <Historical maximum used heap>

OK

Note

In the <Status> field:

  • X indicates running

  • R indicates ready state

  • B indicates blocked

  • S indicates suspended

  • D indicates deleted

Parameters

None

AT+OTACLEAR

Function Description

Clear the signature of the current app image.

Used for switching image during mass production.

Note

This command is only supported in manual test mode.

Command Format

AT+OTACLEAR

Response Format

Successful Response:

OK

Parameters

None

AT+OTARECOVER

Function Description

Recover the signature of the app image cleared by AT+OTACLEAR.

Used for switching image during mass production.

Note

This command is only supported in manual test mode.

Command Format

AT+OTARECOVER

Response Format

Successful Response:

OK

Parameters

None

AT+CPULOAD

Function Description

Get CPU load statistics.

Note

This command is only supported in manual test mode.

Command Format

AT+CPULOAD=<mode>[,<interval>,<count>]

Response Format

Successful Response:

  • For mode == 0:

    +CPULOAD:OK
    current mode: <mode> time: <interval>(s) count: <count>(-1 for infinite)
    task name  state  prio  CPU%
    <cpu_stat_thread>  R  10  99.87
    <task_1>  r  0  0.01
    <task_2>  b  9  0.01
    // Other task lists if exist.
    // Wait for <interval> second, the next output, at most <count> times totally.
    
  • For `mode == 1:

    +CPULOAD:OK
    current mode: <mode> time: <interval>(s) count: <count>(-1 for infinite)
    // Stop here if there is an infinite statistic.
    
  • For mode == 2 or mode == 3:

     +CPULOAD:OK
     current mode: <mode> time: <interval>(s) count: <count>(-1 for infinite)
     task name  state  prio  CPU%
     <cpu_stat_thread>  R  10  99.87
    ...
    

Error Response:

ERROR:<error_no>

Parameters

<mode>:

Mode for reading CPU load

  • 0: Create CPU load statistics task

  • 1: If the task is running, output information immediately and reduce the count; if it’s an infinite statistic, stop immediately

  • 2: Update statistics time

  • 3: Output information from the last statistics time

<interval>:

Interval time (seconds)

  • [1, INT_MAX]

<count>:

Number of statistics, 0 or -1 means infinite times

  • [-1, INT_MAX]

Error Codes

  • 1: Parameter count error

  • 2: Memory allocation error

  • 3: Input mode error

  • 4: The number of tasks exceeds the limit

Example

Using the AT+CPULOAD command:

AT+CPULOAD=0
// Output...
AT+CPULOAD=1
+CPULOAD:OK
// Additional examples...

AT+LOG

Function Description

Get, set, or clear log levels.

Command Format

AT+LOG=<op>[,<module>,<log_level>]

Response Format

Successful Response:

OK

or

<module> level = <log_level>
OK

Error Response:

ERROR:<error_no>

Parameters

<op>:

Operation type

  • 0: Get log level

  • 1: Set log level

  • 2: Output all log levels

  • 3: Clear all log levels

<module>:

Specific module name

  • String, * represents all modules

  • Length should not exceed 9 bytes

<log_level>:

Log level

  • [0,5]

Error Codes

  • 1: Parameter error

  • 2: Setting failed

Example

Log level operations:

AT+LOG=1,module1,3
AT+LOG=0,module1
AT+LOG=2
AT+LOG=3

AT+RREG

Function Description

Read the value of a general register.

Note

This command is only supported in manual test mode.

Command Format

AT+RREG=<address>[,<length>,<in_byte>]

Response Format

Successful Response:

[address] <value at address> <value at address+4> <value at address+8> <value at address+12>

OK

Error Response:

ERROR:<error_no>

Parameters

<address>:

Starting address of the register

  • Ensure the address is 4-byte aligned. If not, it will be automatically aligned.

<length>:

Length to read, unit determined by <in_byte>

<in_byte>:

In word or byte units

  • B or b, indicates in byte units

  • Non-B or b, indicates in word units

Caution

The input address must be valid, otherwise it may cause system crash.

Error Codes

  • 1: Parameter error

Example

  • Read 40 words of data starting from address 0xE000ED00 in word units:

    AT+RREG=0xE000ED00,40
    [e000ed00] 721fd228 00400000 30007000 fa054000 00000008 00030201 00000000 00000000
    [e000ed20] e0e00000 000f0000 00000000 00000000 00000000 00000000 00000000 00000000
    [e000ed40] 20000030 00000230 00200000 00000000 00110040 00000000 01000000 00000011
    [e000ed60] 01103110 02212000 20232232 01111131 01310132 00000000 49200003 8303c003
    [e000ed80] f00fe019 00000000 00f00000 00000c00 00000400 00000005 00000001 20011102
    
    OK
    
  • Read 40 bytes of data starting from address 0xE000ED00 in byte units:

    AT+RREG=0xE000ED00,40,b
    [e000ed00] 28 d2 1f 72 00 00 40 00
    [e000ed08] 00 70 00 30 00 40 05 fa
    [e000ed10] 08 00 00 00 01 02 03 00
    [e000ed18] 00 00 00 00 00 00 00 00
    [e000ed20] 00 00 e0 e0 00 00 0f 00
    
    OK
    

AT+WREG

Function Description

Write a word of data to the corresponding general register.

Note

This command is only supported in manual test mode.

Command Format

AT+WREG=<address>,<data>

Response Format

Successful Response:

OK

Error Response:

ERROR:<error_no>

Parameters

<address>:

Register address

  • Ensure the address is 4-byte aligned. If not, it will be automatically aligned.

<data>:

Word data to be written

Caution

The input address must be valid, otherwise it may cause system crash.

Error Codes

  • 1: Parameter error

Example

Write data 0x12345678 to address 0x420080E0:

AT+WREG=0x420080E0,0x12345678
[420080e0] 12345678

OK

AT+TICKPS

Function Description

System low power consumption test.

Note

This command is only supported in manual test mode.

Command Format

AT+TICKPS=R[,<lock_id>|ALL]
AT+TICKPS=A[,<lock_id>|ALL]
AT+TICKPS=GET
AT+TICKPS=TYPE,<sleep_type>
AT+TICKPS=DSLP[,<max_time>]
AT+TICKPS=DSLP,<min_time>,<max_time>
AT+TICKPS=TIMER[,<max_time>]
AT+TICKPS=TIMER,<min_time>,<max_time>

Parameters

<op>:

Low power operation

  • R: Release the wakelock, allow entering low power mode

  • A: Acquire the wakelock, forbid entering low power mode

  • GET: Query the wakelock and deep wakelock status

  • TYPE: Set the sleep type

  • DSLP: Enter deep-sleep mode, releasing the wakelock and the deep wakelock of PMU_OS

  • TIMER: Enter sleep mode, releasing the wakelock of PMU_OS, timed wakeup supported

<lock_id>:

Optional, only supported by R and A

  • Range [0, 31], default 0 (PMU_OS), corresponding to the PMU_DEVICE bit defined in ameba_pmu.h. IDs no less than PMU_MAX are unoccupied and available for testing

  • ALL: Apply to all 32 bits, no specific ID required. There is no lock owner tracking, for testing only

  • An empty, non-numeric or out-of-range value is rejected, not treated as ID 0

  • The current wakelock bitmap is printed as lockbit:<value> (in hexadecimal) after execution

<sleep_type>:

Only required when <op> is TYPE

  • PG: Power-gating mode

  • CG: Clock-gating mode

<min_time>, <max_time>:

Optional, only supported by DSLP and TIMER

  • Sleep duration in ms. When only one value is given, it is taken as <max_time>

  • Only <max_time> given: wake up once, then no further timed wakeup

  • <min_time> less than <max_time>: wake up at a random value within the range, repeatedly

  • <min_time> equal to <max_time>: wake up periodically at this value

  • If omitted, the previous setting is kept. By default no wakeup timer is set and the device sleeps until woken by another wakeup source

Note

The usage help is printed instead of a response when the parameters are invalid.

Example

  • Set the sleep type to CG mode

    AT+TICKPS=TYPE,CG
    
  • Acquire the wakelock of BIT20 to forbid entering low power mode

    AT+TICKPS=A,20
    lockbit:100001
    
  • Release the wakelock of BIT20

    AT+TICKPS=R,20
    lockbit:1
    
  • Release the default PMU_OS wakelock to allow entering low power mode

    AT+TICKPS=R
    lockbit:0
    
  • Acquire all wakelocks to keep the core awake

    AT+TICKPS=A,ALL
    lockbit:ffffffff
    
  • Release all wakelocks

    AT+TICKPS=R,ALL
    lockbit:0
    
  • Query the wakelock status

    AT+TICKPS=GET
    lockbit:1
    dslp_lockbit:1
    
  • Enter sleep mode and wake up after 5000 ms, then keep sleeping if no action is taken

    AT+TICKPS=TIMER,5000
    
  • Enter sleep mode and wake up at a random point between 1000 ms and 5000 ms, repeating this process

    AT+TICKPS=TIMER,1000,5000
    
  • Enter sleep mode and wake up periodically every 1000 ms

    AT+TICKPS=TIMER,1000,1000
    
  • Enter deep-sleep mode with a wake time range of 1000 ms to 5000 ms

    AT+TICKPS=DSLP,1000,5000
    

AT+UART

Functional Description

Configure UART interface baud rate

Note

This command is only available in Host Control Mode.

Command Format

AT+UART=<store_in_flash>,<baudrate>

Response Format

Success Response:

OK

Error Response:

ERROR:<error_no>

Parameters

<store_in_flash>:

Save parameters to FLASH

  • 0: Do not write to FLASH

  • 1: Write to FLASH

<baudrate>:

Baud rate

  • [4800, 6000000]

Error Codes

  • 1: Invalid parameter

Examples

  • Set temporary runtime parameters:

    AT+UART=0,115200
    
    OK
    
  • Configure and save to FLASH:

    AT+UART=1,1500000
    
    OK
    

Note

When conflicts exist between FLASH parameters and atcmd_config.json, atcmd_config.json takes priority.

AT+GPIOTEST

Function Description

Test the connectivity between two GPIO pins: drive a level on an output pin and read it back from an input pin.

Used for hardware verification during mass production.

Note

This command is only available when CONFIG_MP_INCLUDED (mass production) is enabled.

Command Format

AT+GPIOTEST=<output_pin>,<value>,<input_pin>

Response Format

Successful Response:

OK

Error Response:

ERROR:<error_no>

Parameters

<output_pin>:

Output pin name, e.g. PA5, PB12

<value>:

Level to drive on the output pin

  • 0: Low

  • 1: High

<input_pin>:

Input pin name, e.g. PA6, PB13

Error Codes

  • 1: Parameter count error

  • 2: Invalid pin name or value

  • 3: The level read from <input_pin> does not match <value>

Example

Drive PA5 high and read it back from PB12:

AT+GPIOTEST=PA5,1,PB12

OK

AT+GPIOSTATUS

Function Description

Configure a GPIO pin as an input with the specified pull mode. The configuration is held during the mass production test.

Note

  • This command is only available when CONFIG_MP_INCLUDED (mass production) is enabled.

  • Executing this command turns off JTAG so the pin configuration can be held.

Command Format

AT+GPIOSTATUS=<pin>,<mode>

Response Format

Successful Response:

OK

Error Response:

ERROR:<error_no>

Parameters

<pin>:

Pin name, e.g. PA5, PB12

<mode>:

Input pull mode

  • -1: Pull-down

  • 0: No pull (floating)

  • 1: Pull-up

Error Codes

  • 1: Parameter count error

  • 2: Invalid pin name or mode

Example

Configure PA5 as an input with pull-up:

AT+GPIOSTATUS=PA5,1

OK