NuttX is a mature and secure real-time operating system (RTOS) with an emphasis on technical standards compliance and small size. It is scalable from 8-bit to 64-bit microcontrollers and microprocessors and compliant with the Portable Operating System Interface (POSIX) and the American National Standards Institute (ANSI) standards and with many Linux-like subsystems. The best way to think about NuttX is to think of it as a small Unix/Linux for microcontrollers.
Although NuttX has its own graphic library called NX, LVGL is a good alternative because users could find more eye-candy demos and they can reuse code from previous projects. LVGL is an Object-Oriented Component Based high-level GUI library, that could fit very well for a RTOS with advanced features like NuttX. LVGL is implemented in C and its APIs are in C.
Change code
> Build
> Flash
> Run
.
Using LVGL, Linux and NuttX you can reduce this process and just test everything on your computer and when it is done, compile it on NuttX and that is it.There are many boards in the NuttX mainline with support for LVGL. Let's use the STM32F429IDISCOVERY as an example because it is a very popular board.
Let's use the Windows Subsystem for Linux
$ sudo apt-get install automake bison build-essential flex gcc-arm-none-eabi gperf git libncurses5-dev libtool libusb-dev libusb-1.0.0-dev pkg-config kconfig-frontends openocd
$ mkdir ~/nuttxspace
$ cd ~/nuttxspace
$ git clone https://github.com/apache/incubator-nuttx nuttx
$ git clone https://github.com/apache/incubator-nuttx-apps apps
$ ./tools/configure.sh stm32f429i-disco:lvgl
$ make
If everything went fine you should have now the file nuttx.bin
to flash on your board:
$ ls -l nuttx.bin
-rwxrwxr-x 1 alan alan 287144 Jun 27 09:26 nuttx.bin
$ sudo openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000"
Reset the board and using the 'NSH>' terminal start the LVGL demo:
nsh> lvgldemo