当前文档版本为 v0.4.0,您可以访问当前页面的 开发中 版本以获取最近可能的更新。

Basic: Hello World

1 功能概述

此sample为基础hello_world的演示sample,其中可编译基础hello_world程序和供mcuboot使用参考的 hello_world_with_boot(不能单独使用)。

2 环境要求

  • board: pan1080a_afld_evb

  • uart (option): 显示串口log

3 编译和烧录

项目位置:zephyr\samples_panchip\hello_world

目前可使用ZAL工具或quick build脚本进行编译和下载。

脚本位置(脚本分为四种,分别配置了节点的不同模式):

  1. quick_build_samples\hello_world.bat

  2. quick_build_samples\hello_world_with_boot.bat

打开脚本后默认会编译项目,编译完成时,可输入字符进行后续下载等操作:

Input the keyword to continue:
  'b' build                         编译项目
  'r' make clean and rebuild        重新编译项目
  'f' flash download                下载
  'e' erase chip                    擦除芯片
  'o' open project by VS Code       打开 `VS Code`,可查看源码,执行编译下载等
  others exit                       退出
wait input:

4 演示说明

4.1 测试hello_world流程

运行脚本quick_build_samples\hello_world.bat,编译后进行烧录至 pan1080a_afld_evb

复位后通过串口921600波特率打印log:

*** Booting Zephyr OS build zephyr-v2.7.0-300-g2b224e899a36  ***
Hello World from Zephyr on pan1080a_afld_evb without boot!

4.2 测试hello_world_with_boot流程

运行脚本quick_build_samples\hello_world_with_boot.bat,获得编译后的工程源文件,供后续带boot的操作使用

之后配合\04_dev_guides\Zephyr Mcuboot Guidance.md内的介绍测试,使用。