EasyManua.ls Logo

Espressif Systems ESP8266EX - How to Read the ID of the Chip

Espressif Systems ESP8266EX
41 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
!
3. Sample Codes
󰲧󰲧󰲧󰲧UART_SetPrintPort(UART0);
󰲧󰲧󰲧󰲧UART_intr_handler_register(uart0_rx_intr_handler);
󰲧󰲧󰲧󰲧ETS_UART_INTR_ENABLE();
3. ESP8266_RTOS_SDK supports multi-threading, therefore, multiple tasks can be
created. The interface xTaskCreate used to create tasks is a self-contained interface
owned by freeRTOS. When using xTaskCreate to create a new task, the range of the
task stack should be [176, 512].
󰲧󰲧󰲧󰲧xTaskCreate(task2,󰲧"tsk2",󰲧256,󰲧NULL,󰲧2,󰲧NULL);
󰲧󰲧󰲧󰲧xTaskCreate(task3,󰲧"tsk3",󰲧256,󰲧NULL,󰲧2,󰲧NULL);
Register the task and execute the function. Take the execution of task 2 as an example:
void󰲧task2(void󰲧*pvParameters)
{
󰲧󰲧󰲧󰲧printf("Hello,󰲧welcome󰲧to󰲧task2!\r\n");
󰲧󰲧󰲧󰲧while󰲧(1)󰲧{
󰲧󰲧󰲧󰲧󰲧󰲧󰲧󰲧……
󰲧󰲧󰲧󰲧}
󰲧󰲧󰲧󰲧vTaskDelete(NULL);
}
4. Compile the application program, generate firmware and download it into the ESP8266
module.
5. Power off the module, and change it to operation mode; then power on the module and
run the program.
Result:
SDK󰲧version:1.0.3(601f5cd)
mode󰲧:󰲧sta(18:fe:34:97:f7:40)󰲧+󰲧softAP(1a:fe:34:97:f7:40)
Hello,󰲧welcome󰲧to󰲧task2!
Hello,󰲧welcome󰲧to󰲧task3!
3.2.2. How to Read the ID of the Chip
1. Introduction of the Software Interface:
system_get_chip_id returns the value signifying the chip ID of the module. Every chip has
one exclusive ID.
󰲧󰲧󰲧󰲧printf("ESP8266󰲧chip󰲧ID:0x%x\n",󰲧system_get_chip_id());
2. Compile the application program, generate firmware and download it into the ESP8266
module.
3. Power off the module, and change it to operation mode; then power on the module and
run the program.
Espressif
! /!6 37
2017.05

Other manuals for Espressif Systems ESP8266EX

Related product manuals