nuttx project management tool unofficial, opinionated · why do we need cli tool? web frameworks...
TRANSCRIPT
![Page 1: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/1.jpg)
upmUnofficial, opinionated
NuttX project management tool
python scriptsthey don't alter build process
![Page 2: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/2.jpg)
Goals– Simplify NuttX setup tasks
– Lead the user by suggesting next steps
– Change folder structure to keep project-dedicated code together
– Group configuration options into project-related, logical modules
slightly
![Page 3: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/3.jpg)
Short command list
No need to be in nuttx directory.
![Page 4: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/4.jpg)
Desired project structure/apps – just custom apps/libs – just custom libs/boards – just custom board code/os – upstream bundle /nuttx /apps (custom_apps → ../../../apps, custom_libs → ../../../libs)
![Page 5: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/5.jpg)
Why do we need CLI tool? Usual tasks.– How to clone repositories and build the firmware?
– How to add a new app?
– How to add a custom board?
– How to add some library?
– How to use Git for new app, custom board and custom library?
![Page 6: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/6.jpg)
How to clone, build, flash?$ mkdir firmware$ cd firmware$ git clone https://bitbucket.org/nuttx/nuttx.git nuttx$ git clone https://bitbucket.org/nuttx/apps.git apps$ cd nuttx$ tools/configure.sh hymini-stm32v/usbnsh$ make$ st-flash write nuttx.bin 0x8000000
![Page 7: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/7.jpg)
How to add a new app?$ cd firmware$ cd apps/examples$ cp -r hello myapp$ cd ../../nuttx$ make
$ cd ../../apps/examples/myapp$ find . -type f -exec sed -i "s/hello/myapp/g" {} \;$ find . -type f -exec sed -i "s/HELLO/mypapp/g" {} \;$ mv hello_main.c myapp.cxx$ make
crash during linking because of duplicate names
![Page 8: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/8.jpg)
How to add a custom board code?$ cd nuttx/configs$ cp -r stm32f4discovery custom_board
nuttx/configs/Kconfig...+ config ARCH_BOARD_CUSTOM_BOARD+ bool "Custom board"+ depends on ARCH_CHIP_STM32F407VG || ARCH_CHIP_STM32F407ZG...+ default "custom_board" if ARCH_BOARD_CUSTOM_BOARD...+ if ARCH_BOARD_CUSTOM_BOARD+ source "configs/custom_board/Kconfig"+ endif...
![Page 9: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/9.jpg)
Why do we need CLI tool?Web frameworks
React.js – $ reactVue.js – $ vueEmber.js – $ ember
EmbeddedZephyr – $ westESP32 – $ idf.py
NuttX currently relies on simplicityMake, nuttx/toolsKconfig-frontendsC/C++ preprocessorA few symlinks
Tool is not necessary+ Simplicity+ Full control over the process
But we could use one+ Provides some guidance+ Easier entry for new people+ What is logically one thing should be one command
NuttX is a framework
nuttx/tools
![Page 10: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/10.jpg)
What CLI tools do in frameworks?– Simplification of common tasks, like – starting new projects – building – versioning and distribution – handling updates – deploying
– Generation of boilerplate code– Warning about issues, suggesting solutions
– They include some know-how which user don't need to remember
![Page 11: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/11.jpg)
Example upm usagefw $ upm init .fw $ upm generate --app rest_api --app-template webserverfw $ upm use --board stm32f4discoveryfw $ upm runfw $ upm console(enter)nsh>
– Generates directory structure– Clones NuttX repositories– Copies selected example app– Links selected board– Builds and flashes, connects to NuttX console
one task, one command
![Page 12: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/12.jpg)
Configuration protection
![Page 13: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/13.jpg)
Configuration modules – Kconfiglibconfig/atoms/enc28j60.kconfig config/modules/webserver
![Page 14: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/14.jpg)
Philosophy– Do not perform actions, just suggest them, be verbose
– Stay simple– Always ask before doing intrusive change– Accept commands from any subdirectory (similar to git)– Show state when asked (similar to git)
– Tries to get a bit bigger picture than scripts in nuttx/tools
![Page 15: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/15.jpg)
How upm could handle Spresense™?– suggest cloning of SDK and cloning it for user– suggest downloading of firmware, flash_writer – ask user to accept licenses and download files to some folder – say where to find them – warn if something is still missing– etc. – warn if module is missing
Maybe some plugin approach for platforms with extra requirements.
![Page 16: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/16.jpg)
Challenges?– some part still work in progress– maybe disabling what is not polished would be a way to go
– dependency management?– plugins– git submodule management
![Page 17: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/17.jpg)
REST APIsExpress-like + UI synchronization
![Page 18: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/18.jpg)
REST APIs – Node.js Express
Sinatra, Flask
![Page 19: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/19.jpg)
REST APIs – same route in NuttX webserver
![Page 20: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/20.jpg)
REST APIs – Express-like list of routes
Simple helpers:– https://gitlab.com/w8jcik/upm/snippets/1876008 (http.cxx)– https://gitlab.com/w8jcik/upm/snippets/1876010 (http.h)
![Page 21: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/21.jpg)
Reaching µc from JavaScript framework
React, Vue, Ember
![Page 22: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/22.jpg)
What with two windows open?
Polling
![Page 23: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/23.jpg)
Reporting only changed state
Variable.get_changed_time()Variable.get_name()Variable.get()
A lot of variables.
![Page 24: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/24.jpg)
Two different browser windows synchronize
![Page 25: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/25.jpg)
More efficient than polling
NuttX 2019experience exchange :) →
![Page 26: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/26.jpg)
LittlevGLSmall UI apps and emulation
![Page 27: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/27.jpg)
LittlevGL 6.0 released this weekScreen rotationMultiple displays
![Page 28: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/28.jpg)
LittlevGL 5.3– Present in apps/examples– Example board configuration for /dev/fb0
– But can be also used without framebuffer – External RAM not required – Display connected in any way (SPI, FSMC)
Is it recognized enough?
![Page 29: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/29.jpg)
Running in emulator – Mocks
Makefile
…
![Page 30: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/30.jpg)
Emulator
![Page 31: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/31.jpg)
Microapps
lvgl initialization
monolythic lvgl app(not easily reusable)
lvgl deinitialization
screen calibrationapp
network configuration
app
time/date configuration app
assets copying app
business logic(not reusable)
/mnt/flash
Slight analogy to microservices and android intentions
nsh> tcal
nsh> tconf
nsh> nconf
nsh> loader
lvgl initialization
lvgl deinitialization
Microservices
Letting projects grow
![Page 32: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/32.jpg)
Development UI development stages
InVision LittlevGL Emulator
MicrocontrollerNuttX
UI prototyping tool
(visually correct prototype)
(discussion and review)
![Page 33: NuttX project management tool Unofficial, opinionated · Why do we need CLI tool? Web frameworks React.js – $ react Vue.js – $ vue Ember.js – $ ember Embedded Zephyr – $ west](https://reader030.vdocuments.net/reader030/viewer/2022040608/5ec97c0b0b155a264d70ee93/html5/thumbnails/33.jpg)
Challenges?– integration of LittlevGL emulator with upm
/oses/default (/nuttx, /apps)/lvgl_emulator
– lack of libraries for UI prototyping software– check the process