![]() |
Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120) +--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121) +--- Thread: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS (/showthread.php?tid=18236) |
RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - WhiteHexagon - 05-21-2023 wow, you have been busy busy! ![]() ![]() ![]() ![]() So first I tried the pinephone:lvgl and writing that build artifact over the jump drive image, and booting the PP. I see the blue/green/red bars and a circle, yay! ![]() Somehow I was expecting the lvgl widget demo, but no problem, at least it works hehe ![]() So is there some info about where the source code is for that demo please? [edit: sorry, I missed the apps folder, so seems like a cmd line util to pick the lvgl demo] I also tried using the 'make menuconfig' to try and switch the demo, but selecting the widget demo didnt seem to change anything, do I need to clear the previous config somehow? 'make' also seemed to do a complete rebuild after using menuconfig, is that normal? and my main interest would be setting up my own small widget demo clone project, and gradually porting it to Zig. Any guidelines for setting up the clone LVGL project please? I have Zig installed and ready ![]() btw it looks like you are using vscodium on Manjaro? maybe this MBP is not supported but I didnt find it using pamac or pacman (sorry I am new to linux). Apologies for lots of questions, and thanks again for helping me get this far. RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - Kevin Kofler - 05-21-2023 What I am curious about is how a Mac user who is new to GNU/Linux ends up with a PinePhone rather than an iPhone. ![]() ![]() RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - lupyuen - 05-22-2023 That's awesome @WhiteHexagon ! And thank you so much for bearing with me :-) (1) The Colour Bars is actually a Test Pattern that's rendered by the Display Driver in C, not in LVGL. (Source Code) (Explained here) (2) I realise you don't have a Serial Debug Cable, so let's configure NuttX to start the LVGL Demo automatically (as explained here): Code: make menuconfig (3) NuttX should now boot to the LVGL Demo App automatically (Like this) (4) The source code for the LVGL Demo is at apps/graphics/lvgl/lvgl/demos/widgets/lv_demo_widgets.c (Repo is here) (5) To build our own LVGL Demo, edit lv_demo_widgets.c, look for the function lv_demo_widgets, and change the code inside to: Code: // Create a Button, set the Width and Height (Explained here) (6) Yeah the LVGL code looks quite messy in C. In the next article, I'll use Zig to build a Feature Phone UI for NuttX on PinePhone. So stay tuned! :-) UPDATE: I just remembered that I created a simple Zig LVGL App for PinePhone: pinephone-lvgl-zig UPDATE: To fix the Arm64 / Zig toolchain on macOS, we could run a Linux Container like Rancher Desktop RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - WhiteHexagon - 05-22-2023 (05-21-2023, 06:58 PM)Kevin Kofler Wrote: What I am curious about is how a Mac user who is new to GNU/Linux ends up with a PinePhone rather than an iPhone. Indeed ![]() ![]() RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - Kevin Kofler - 05-23-2023 GNU/Linux has served me well on the desktop. I have been using it exclusively for almost 2 decades now (and at that point I had already been using it in dual-boot with Windows for a few years). So I am surprised by your negative experiences (but all the more positively surprised that you are not letting that stop you from trying out the PinePhone, though I see you have now found a non-Linux OS to play with on it ![]() Looks like the NuttX port is going to have two developers now. Good luck! RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - WhiteHexagon - 05-24-2023 Impressive! so have you developed some wayland apps during that time? I struggled to find even a simple OpenGL ES example... Nuttx has a lot of appeal, since it should allow us to extract a lot more performance out of the device. I have been porting some of my old apps from objective-c to Zig/Wasm (with Go backends). So porting to wayland, nuttx, or just keeping them within the browser are all options at this point. I have a lot to learn switching away from Android/iOS were mostly it is just a 'click to generate template app', but that is also part of the enjoyment ![]() ![]() ![]() RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - WhiteHexagon - 05-24-2023 @lupyuen good news, I got the LVGL widgets demo running just now, thank you for the extra tips! It is not quite clear how the entry point works. So I can see on the nuttx project the CONFIG_INIT_ENTRYPOINT got set with 'lvgldemo_main' vis the menuconfig. But then in the 'apps' project, there is only a comment in lvgldemo.c mentioning 'lvgldemo_main', but seems like the entry point is 'main' and the parameter is 'widgets' (CONFIG_INIT_ARGS), what am I missing please? ie what does setting that entry point do? ie. how does it map to the lvgldemo.c 'main' function? btw I found using the PP without battery seems to be the optimal way to develop? ie constantly swapping SD cards and rebooting. And in this case the widgets demo boots up in within 2 seconds! amazing ![]() RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - Kevin Kofler - 05-24-2023 Keep in mind though that neither the modem (including GPS) nor the WiFi chip (including Bluetooth) will work without a battery plugged in, because they are connected directly to the battery, not to the main power circuit. (05-24-2023, 03:21 AM)WhiteHexagon Wrote: Impressive! so have you developed some wayland apps during that time? I struggled to find even a simple OpenGL ES example...Raw Wayland? No. Why would I? That is what GUI toolkits such as Qt are for. Heck, I run X11 on the desktop and the notebook, not Wayland. Only the PinePhone runs Wayland because Plasma Mobile supports only Wayland. But I am not writing raw X11 apps either. (05-24-2023, 03:21 AM)WhiteHexagon Wrote: I have a lot to learn switching away from Android/iOS were mostly it is just a 'click to generate template app'Well, you cannot compare developing using mainstream technologies with developing using niche tools (in an even more unlikely combination). It is really comparing apples to oranges. If you write a Qt application in C++ and/or QML using KDevelop or Qt Creator, you will find templates and other convenience features. RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - lupyuen - 05-24-2023 (05-24-2023, 04:49 AM)WhiteHexagon Wrote: how does it map to the lvgldemo.c 'main' function? Let's walk through the steps from NuttX Startup to our LVGL Demo (lvgldemo_main)... NuttX Boot Sequence: Part 1 NuttX Boot Sequence: Part 2 Then nx_bringup calls... - nx_create_initthread, which calls... - nx_start_application, which calls... - CONFIG_INIT_ENTRYNAME, which maps to... - lvgldemo_main Which starts our LVGL Demo App. Yeah sorry for the long call chain :-) (05-24-2023, 04:49 AM)WhiteHexagon Wrote: btw I found using the PP without battery seems to be the optimal way to develop? Yep it probably works fine for LVGL Apps. But later when we test the LTE Modem, it won't work because the LTE Modem is powered directly by the battery :-) RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - WhiteHexagon - 05-25-2023 @lupyuen Thanks! and now I see that there is a '_main' appended to the demo name, which explains how 'lvgldemo_main' is used, rather than just 'lvgldemo' . And because vscodium was confused, or not setup correctly by me ![]() ![]() |