应用开发,与ucos、freeRTOS等完全不一样,看起来更像是linux的方式,os与app独立开发,但是从单片机不具备MMU这一点就能判断出来,假的就是假的,即便是从文件夹结构上看,实现了app和os的分离,实际上已经是个障眼法,大概率是采用了编译技巧,实现了形式上的app和os独立。
下面基于hello创建一个demo。
cp -a apps/examples/hello apps/examples/demo
cd apps/examples/demo;mv hello_main.c demo_main.c
将目录下涉及到的hello/Hello/HELLO,都修改为demo。
cd apps/examples/,修改Kconfig,添加source "/home/farmer/nuttx/apps/examples/hello/Kconfig"
将demo添加到编译系统中。
进入nuttx目录下,执行make menuconfig
Application Configuration/Examples
重新编译,启动nuttx,进入bin目录,执行demo