Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NuttX integration #6

Open
kisvegabor opened this issue Sep 9, 2024 · 8 comments
Open

NuttX integration #6

kisvegabor opened this issue Sep 9, 2024 · 8 comments

Comments

@kisvegabor
Copy link
Member

kisvegabor commented Sep 9, 2024

Hi,

The project creator has been released and now we are eager to add external boards. 🙂

How could it work in case of NuttX?

The goal is to create a manifest file (similar to this) for each board. Probably an lv_nuttx repo could be created to store all these manifests.

I'm about to extend the manifest with a "getStartedInstructions" field which will be displayed when the project is created and can be used to orient the users to make the first steps.

@acassis
Copy link

acassis commented Sep 9, 2024

@kisvegabor maybe we can start creating that manifest file to use with the generic simulator with LVGL FB (https://github.com/apache/nuttx/tree/master/boards/sim/sim/sim/configs/lvgl_fb) or LVLG LCD(https://github.com/apache/nuttx/tree/master/boards/sim/sim/sim/configs/lvgl_lcd).

This way it could be used as reference for someone willing to use it with other real board

@cederom
Copy link

cederom commented Sep 9, 2024

Whoah! Congratulations! Will take a look in a free moment :-)

@kisvegabor
Copy link
Member Author

kisvegabor commented Sep 10, 2024

Thanks for joining! 🤗

Correct me if I'm wrong, but as far as know to build an LVGL demo for a different target, you just need to type something different into the terminal. If it's true, and if we can write a script to parse some board descriptors (maybe the rst file of the docs?) we can easily generate many manifests where only the "getStartedInstructions" and the hardware specs are different.

For example:

"getStartedInstructions": "
Setup NuttX as described [here](https://docs.lvgl.io/master/integration/os/nuttx.html)
And run:
$ ./tools/configure.sh stm32f429i-disco:lvgl
$ make 
$ ... flashing instructions... "

It would be also great make it clear how to add new files and start creating your custom app.

What do you think?

@acassis
Copy link

acassis commented Sep 10, 2024

@kisvegabor that is correct, all we need is an existing board config to support LVGL in the board XYZ

@kisvegabor
Copy link
Member Author

Great! Do you have a machine parsable list about the currently supported lvgl-ready boards? Including some specs too?

Creating it by hand is also an option and it's more flexible too. I believe in 8 hours someone can create ~30 manifests as they are very similar. Just need to Google the specs.

Are there any config options the we shall add during project generation? E.g. buffering modes or so?

Could you also link me some docs about adding custom C files to a NuttX project/build? I mean not using an example but start creating a real life app. Sorry, if it's something trivial.

@cederom
Copy link

cederom commented Sep 10, 2024

I think NuttX simulator would be best first target because you can run and test it directly on your local computer :-)

There is already LVGL 9 demo running on bare X11 window as display. You can fetch all sources, build, and run as simply as:

git clone https://github.com/apache/nuttx.git
git clone https://github.com/apache/nuttx-apps.git
cd nuttx
./tools/configure.sh -l sim:lvgl_fb
make -j8
./nuttx

Note: -l means Linux build host, adjust if necessary, use -h for help.

I guess that would be the simplest way to start and test things even without specific hardware. I am thinking for some time to add SDL support so there is no dependency on X11 and we could run even on bare video console one day :-)

Demos for various boards can be built exactly the same way (just cross-compile toolchain must be installed on the build host for given target CPU architecture). Dependencies are downloaded by the build scripts during compilation.

The convention here is <board> : <config> and that defines the resulting firmware bundle so people can build it in seconds.

To quickly see what boards already support LVGL grep over a list of all available configurations (-L switch), for example:

 ./tools/configure.sh -L | grep lvgl
  sim:lvgl_lcd
  sim:lvgl_fb
  esp32c3-devkit:lvgl
  stm32f746g-disco:lvgl
  imxrt1060-evk:lvgl
  imxrt1064-evk:lvgl
  stm32h745i-disco:lvgl
  stm32f429i-disco:lvgl
  waveshare-rp2040-lcd-1.28:lvgl
  lpcxpresso-lpc54628:lvgl
  esp32-wrover-kit:lvgl
  ttgo_t_display_esp32:lvgl_fb
  ttgo_t_display_esp32:lvgl_lcd
  esp32-2432S028:lvgl
  esp32s3-box:lvgl
  esp32s3-box:lvgl-3
  esp32s3-lcd-ev:lvgl
  esp32s2-kaluga-1:lvgl_ili9341
  esp32s2-kaluga-1:lvgl_st7789
  pinephone:lvgl

More information about The NuttX Simulator:

https://nuttx.apache.org/docs/latest/guides/simulator.html

If you want to create a custom board here is the tutorial:

https://nuttx.apache.org/docs/latest/guides/customboards.html

If you want to create a custom app here is the tutorial:

https://nuttx.apache.org/docs/latest/guides/customapps.html

Custom Board and App is best choice when you want to keep out-of-tree code and then use nuttx and nuttx-apps code with minimal modifications. In any other case you can play inside source tree, make renamed copies, modify to see what happens, and code to get what you need :-)

@kisvegabor
Copy link
Member Author

Thank you!

cc @liamHowatt Next week can you take look at these?

@liamHowatt liamHowatt mentioned this issue Oct 2, 2024
@liamHowatt
Copy link
Contributor

Hi @acassis and @cederom,

I have created this repo: https://github.com/lvgl/lv_nuttx

For now, it has a manifest for the simulator and for esp32s3-lcd-ev. A future version of the project creator will be able to clone lv_nuttx and then patch setup.sh depending on the chosen project/manifest (sim, esp32s3-lcd-ev, etc.). Next, the user will run ./setup.sh which will simply add a symbolic link to the user's custom app template, load a defconfig, and then set some kconfig options. If you look at the manifest JSONs, you can see how they will patch the setup.sh.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants