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) |
Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - lupyuen - 05-16-2023 When we tilt our Smartphone from Portrait to Landscape... How does it know that we're tilting our phone? That's because of the Accelerometer inside our Smartphone! To understand how it works, let's snoop the raw Accelerometer Data from PinePhone with Apache NuttX RTOS (Real-Time Operating System)... Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - WhiteHexagon - 05-17-2023 (05-16-2023, 09:16 PM)lupyuen Wrote: When we tilt our Smartphone from Portrait to Landscape... How does it know that we're tilting our phone? I just started looking at NuttX yesterday I am busy reading all your articles, and so far they have been great, and very educational, thanks! but just to say I very much prefer the github.io format you have been using prior to this article. Yesterday I was trying to setup the build environment for NuttX (I am running an older macos). I had a couple issues with the instructions from the apache site, specifically getting kconfig-frontends installed. (even the original site seemed to be down.) Anyway I seem to have solved that one now, but hit another problem running 'make'. The sub packages need a TOPDIR value that seemed to be blank on macos. I ended up changing Unix.mk with: Code: TOPDIR := $(shell echo "$${PWD// /\\ }") but that just shifted the error: Code: make[1]: *** No rule to make target 'context'. Stop. The good news is I tried another of your tutorial type articles regarding the lvgl patching of 'jumpdrive' and this boots on the PinePhone! and just to say: Wow! it is fast! After holding the power button for a few seconds to turn the PP on, within a second lvgl interface is already up and running. Very impressed, and more like what I was expecting from this hardware. Great work! It crashes after a few clicks, but I know it is early days. Now I want to get the build environment up and running even more So suggestion would be to have each development environment with their own setup instructions. Since in the prerequisites I am currently a bit lost to what tool-chain I need. And the above lvgl sourcecode zip currently fails to build: Code: /bin/bash: aarch64-none-elf-gcc: command not found but maybe the environment got confused trying to build two different downloads of nuttX. Anyway looking forward to seeing more of your articles. Any plans to investigate the OpenGL/OpenVG parts of the SoC? Maybe I can try that when I am up and running. I am also Zig based, so you gave me a good starting point RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - lupyuen - 05-17-2023 Wow thanks @WhiteHexagon , that sounds awesome! I'm also using a very old MacBook Pro, macOS 10.15.7. My Arm64 GCC version is 11.3.1, downloaded from here (look for "AArch64 Bare-Metal Target aarch64-none-elf") Code: → aarch64-none-elf-gcc -v Remember to add Arm64 GCC to the PATH after installing the DMG: Code: export PATH="$PATH:/Applications/ArmGNUToolchain/11.3.rel1/aarch64-none-elf/bin" I used these steps to install kconfig-frontends: https://lupyuen.github.io/articles/nuttx#install-prerequisites Code: ## For macOS: And I'm using a rather old version of Zig: Code: → zig version Lemme know if this works for building NuttX on macOS. Thanks! :-) RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - traut - 05-17-2023 I am glad to see you using something that _isn’t_ github for this article. RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - walter1950 - 05-17-2023 Hello, (05-17-2023, 05:07 AM)lupyuen Wrote: Wow thanks @WhiteHexagon , that sounds awesome! I'm also using a very old MacBook Pro, macOS 10.15.7. https://medium.com/@ly.lee "Error 410 This account is under investigation or was found in violation of the Medium Rules." ;-) Ciao Walter RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - lupyuen - 05-17-2023 Hi @traut : If it helps, my articles are mirrored to GitLab as well: https://gitlab.com/lupyuen/lupyuen-github-io/-/blob/master/src/lte2.md UPDATE: I have mirrored my articles to Codeberg Pages, please use this instead: https://lupyuen.codeberg.page/ RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - WhiteHexagon - 05-18-2023 Thanks @lupyuen so I still managed to download the wrong toolkit two more times, oops! but I think this is the correct one: Code: arm-gnu-toolchain-11.3.rel1-darwin-x86_64-aarch64-none-elf.tar.xz but I get an error with that (added to PATH thanks): Code: dyld: Symbol not found: ____chkstk_darwin I think everything else is now configured correctly, apart from the toolchain. As I mentioned, it is an older macos (10.12.4) and hence my Zig is also older version (0.8.1) not that I got that far yet but just for context. RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - lupyuen - 05-18-2023 Sorry @WhiteHexagon I meant this PKG file: arm-gnu-toolchain-11.3.rel1-darwin-x86_64-aarch64-none-elf.pkg If it doesn't work, try this Arm64 Toolchain that I have zipped from my Mac: https://github.com/lupyuen2/wip-pinephone-nuttx/releases/download/arm/ArmGNUToolchain-backup.zip RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - WhiteHexagon - 05-19-2023 @lupyuen Thanks, I tried both, but same error, so maybe my macos is too old. I tried the 11.2 release and same error. Earlier versions dont seem to support macos. Do you think it is possible to setup a complete build environment on a Raspberry Pi 4? Or maybe I should buy a Pinebook Pro RE: Article: Inside a Smartphone Accelerometer: PinePhone with NuttX RTOS - lupyuen - 05-19-2023 (05-19-2023, 03:14 AM)WhiteHexagon Wrote: @lupyuen Thanks, I tried both, but same error, so maybe my macos is too old. I tried the 11.2 release and same error. Earlier versions dont seem to support macos. Do you think it is possible to setup a complete build environment on a Raspberry Pi 4? Or maybe I should buy a Pinebook Pro Yeah sorry about that. I was able to build NuttX on Pinebook Pro (Manjaro), so the same steps will probably work on any Arm64 SBC: https://gist.github.com/lupyuen/abca4d656ba0c93787e7705eec8707c8 Here's a wild idea: How about building NuttX for PinePhone... On PinePhone? Try the same steps from that link. Or if we're doing a quick test, we could try building with GitHub Actions: https://lupyuen.github.io/articles/auto#appendix-build-nuttx-with-github-actions UPDATE: Here's the GitHub Actions Workflow for building NuttX for PinePhone: https://github.com/lupyuen2/wip-pinephone-nuttx/blob/build/.github/workflows/pinephone.yml I tried building on Android with Termux but it didn't work: https://gist.github.com/lupyuen/f59c681dde9ebac86b331f2577aa04ad |