AliOS Things学习笔记(3)——ESP8266编译与烧录

编译:

# 进入`AliOS-Things`顶层目录
cd $AOS_SDK_PATH

# 配置
# 初次使用会显示"kconfig tools missing",并自动下载
aos make helloworld_demo@esp8266 -c config	

# 编译
# 初次编译如果没有 gcc-arm-none-eabi 编译链工具,会自动下载
aos make

烧录:

Linux(推荐):

烧录配置文件在:build/site_scons/upload/esp8266.json,已经配置好
步骤:

  1. 执行烧录命令:aos upload <工程名>@esp8266
  2. 根据列出的端口,选择对应的序号后回车

注意:如果使用NodeMCU开发板,需要修改配置文件,增加烧录模式,否则烧录后会报错无法使用。
参考:【问题解决】NodeMCU(ESP8266)使用aos-cube工具烧录AliOS Things工程时报错

烧录LOG:

$ aos upload helloworld_demo@esp8266
aos-cube version: 0.5.11
[INFO]: Currently in aos_sdk_path: '/home/pjw/ESP8266/AliOS-Things'
[INFO]: Target: helloworld_demo@esp8266
[INFO]: Currently in aos_sdk_path: '/home/pjw/ESP8266/AliOS-Things'


--- Available ports:
---  1: /dev/ttyUSB0         'CP2102 USB to UART Bridge Controller - CP2102 USB to UART Bridge Controller'
--- Enter port index or full name: 1
[INFO]: Running cmd:
	'esptool.py --chip esp8266 --port /dev/ttyUSB0 --baud 921600 write_flash --flash_size detect 0x0 /home/pjw/ESP8266/AliOS-Things/platform/mcu/esp8266/bsp/boot_v1.7_921600.bin 0x3fc000 /home/pjw/ESP8266/AliOS-Things/platform/mcu/esp8266/bsp/esp_init_data_default.bin 0x3fe000 /home/pjw/ESP8266/AliOS-Things/platform/mcu/esp8266/bsp/blank.bin 0x1000 /home/pjw/ESP8266/AliOS-Things/out/helloworld_demo@esp8266/binary/[email protected]'
esptool.py v3.0
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 5c:cf:7f:6c:d9:61
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0040
Compressed 4096 bytes to 2948...
Wrote 4096 bytes (2948 compressed) at 0x00000000 in 0.0 seconds (effective 937.4 kbit/s)...
Hash of data verified.
Compressed 128 bytes to 75...
Wrote 128 bytes (75 compressed) at 0x003fc000 in 0.0 seconds (effective 336.6 kbit/s)...
Hash of data verified.
Compressed 4096 bytes to 26...
Wrote 4096 bytes (26 compressed) at 0x003fe000 in 0.0 seconds (effective 17030.8 kbit/s)...
Hash of data verified.
Compressed 289220 bytes to 204900...
Wrote 289220 bytes (204900 compressed) at 0x00001000 in 3.1 seconds (effective 738.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
---host_os:Linux64
[INFO]: Firmware upload succeed!

windows:

  • 使用ESPFlashDownloadTool.exe工具烧录,该软件只能在windows下运行。
  • 可以使用 RaiDrive 把ubuntu文件夹远程映射到Windows上。
  • RaiDrive配置参考:环境搭建[Windows篇]@映射与烧录
  • app固件在/out/工程名@芯片名/binary/目录下,烧录地址0x1000
  • 其他固件在platform/mcu/esp8266/bsp目录下,如:
    blank.bin:烧录地址0x3FE000
    esp_init_data_default.bin:烧录地址0x3FC000
    boot_v1.7_921600.bin:烧录地址0x0

烧录配置如下:(烧录完成后,打开串口助手,波特率921600,会打印hello world! count *
在这里插入图片描述


LOG:

【问题解决】ESP8266使用AliOS Things上电报错:Fatal exception (0): epc1=0x401000b5…

2nd boot version : 1.7(5d6f877)
SPI Speed : 40MHz
SPI Mode : DIO
SPI Flash Size & Map: 32Mbit(1024KB+1024KB)

[11:20:15.772]收←◆jump to run user1 @ 1000

[11:20:15.916]收←◆OS SDK ver: 2.0-dev(1aa052f) compiled @ Aug 26 2019 13:39:05
             Welcome to AliOS Things           
nano entry here!
hello world! count 0 

[11:20:16.982]收←◆hello world! count 1 

[11:20:17.983]收←◆hello world! count 2 

[11:20:18.983]收←◆hello world! count 3 

[11:20:19.983]收←◆hello world! count 4 

[11:20:20.983]收←◆hello world! count 5 

猜你喜欢

转载自blog.csdn.net/p1279030826/article/details/113576716