[Article] Daily Automated Testing for NuttX on Milk-V Duo S RISC-V SBC (Sophgo SG2000 / IKEA TRETAKT)

2024-06-22 Thread Lee, Lup Yuen
Last week we upstreamed Milk-V Duo S SBC to NuttX Mainline. (Based on
Sophgo SG2000 RISC-V SoC) But NuttX Mainline changes every day. Will Milk-V
Duo S suffer “Software Bit Rot”? And fail to boot NuttX someday?

Let’s do Daily Automated Testing for NuttX on a Milk-V Duo S. Yep on the
Actual Physical SBC! Our script shall:
(1) Download the Daily Automated Build (to our TFTP Server)
(2) Power on our SBC with an IKEA Smart Power Plug (via Home Assistant API)
(3) Which will boot NuttX Mainline on our SBC
(4) And upload the NuttX Test Log as GitHub Release Notes

Read the article: https://lupyuen.codeberg.page/articles/sg2000a.html

Watch the demo: https://youtu.be/iTOwfPCpXDc

Lup


Re: Heap Logging

2024-06-13 Thread Lee, Lup Yuen
Hi Mark: Thanks for watching my presentation! To show the Heap Logs, I
enabled "Build Setup > Debug Options > Enable Debug Features > Memory
Manager Debug Features". Here's the complete definition (I hope it's
applicable to your platform)...

<<
Symbol: DEBUG_MM_INFO
Type  : boolean

Prompt: Memory Manager Informational Output

  Location:

-> Build Setup

  -> Debug Options

-> Enable Debug Features (DEBUG_FEATURES [=y])

(3)   -> Memory Manager Debug Features (DEBUG_MM [=y])

  Defined at Kconfig:980

  Depends on: DEBUG_FEATURES [=y] && DEBUG_MM [=y] && DEBUG_INFO [=y]
>>

Here's how I loaded the Heap Logs into a Google Spreadsheet for analysis:
https://lupyuen.github.io/articles/quickjs#how-small-is-quickjs

Lup

On Thu, Jun 13, 2024 at 7:24 PM Mark Stevens
 wrote:

> I am just catching up with the NuttX workshop presentations and something
> sparked my interest from one of the later presentations.
>
> I am looking at the "Heap Usage for QuickJS” slide from Lup Yuens
> presentation.  There is mention of turning on heap logging and this is
> something I would like to investigate.
>
> I have checked out the releases/12.5 code base and I am trying to work out
> how to turn this feature on.  The presentation talks about turning the
> feature on through logging menus but I cannot seem to find the options
> mentioned.  I have also had a look at the mm_malloc code and nothing jumps
> out as being obvious.
>
> How do I turn this feature on?
>
> Thanks in advance,
> Mark
> —
> Mark Stevens
> mark.stev...@wildernesslabs.co
>
>
>
>
>
>
>


Re: NuttX with rv64ilp32

2024-06-06 Thread Lee, Lup Yuen
Thanks YF! That's a very cool concept for RISC-V code: 64-bit architecture
with 32-bit pointers. In case we need to use RV64ILP32 for NuttX, do you
happen to have the patched source code to support RV64ILP32?

Your recent PRs are very interesting, perhaps other folks here might like
to comment:

Clean up SigAction Objects after OSTest: (Memory leakage might have
security implications?)
https://github.com/apache/nuttx/pull/12406

Configure PID Hash Table length: (For known number of threads)
https://github.com/apache/nuttx/pull/12427

Lup

On Fri, Jun 7, 2024 at 10:07 AM yfliu2008  wrote:

> Dear experts,
>
>
> Sorry for bothering again, as Lup said the hyperlink was missed in my last
> email. Please throw away my last emails with this same subject.
>
>
>
>
> I have some initial results on NuttX with rv64ilp32 (
> https://yf13.github.io/nuttx/nuttx-rv64ilp32), that means running 32-bit
> software on RV64 with full use of the 64-bit CPU. Please give it a check
> when free and let me know if you have comments.
>
>
>
>
> Regards,
>
> yf


Re: [Article] NuttX on Sophgo SG2000 RISC-V SoC (Milk-V Duo S SBC)

2024-05-19 Thread Lee, Lup Yuen
Thanks Alan! I totally agree, Milk-V Duo S is one of the nicest RISC-V
Boards I've worked with: https://milkv.io/duo-s

(1) Super Affordable at only $10 (WiFi + BT version is $13)
(2) Ethernet Port for easy booting and testing of NuttX over TFTP (U-Boot)
(3) No Soldering needed. GPIO Pins are all broken out for easy access.
(4) Reminds me of the good old days of teaching Arduino Uno. Except it's a
64-bit Multi-Core Monster!

Will Milk-V Duo S become the 64-bit RISC-V educational equivalent of
Arduino Uno? Possibly :-)

Lup

On Sun, May 19, 2024 at 11:43 PM Alan C. Assis  wrote:

> Kudos Lup!
>
> Fantastic work! And nice board to run NuttX
>
> On Sat, May 18, 2024 at 7:50 PM Lee, Lup Yuen  wrote:
>
> > Soon we’ll see many new 64-bit RISC-V SBCs based on the Sophgo SG2000
> > RISC-V SoC. Will they boot NuttX? Let’s find out…
> >
> > (1) We boot Linux on Milk-V Duo S (with SG2000)
> >
> > (2) Peek inside SG2000 Linux and observe how it boots
> >
> > (3) Then we take NuttX for RISC-V (Ox64 BL808)
> >
> > (4) Tweak NuttX Kernel to boot on SG2000
> >
> > (5) Fix the (undocumented) Interrupt Controller
> >
> > (6) And Milk-V Duo S boots to a fully-functional NuttX Shell
> >
> > (7) Something strangely satisfying about NuttX on RISC-V… We finished the
> > port in Only 10 Days 
> >
> > Here's how: https://lupyuen.codeberg.page/articles/sg2000.html
> >
> > Lup
> >
>


[Article] NuttX on Sophgo SG2000 RISC-V SoC (Milk-V Duo S SBC)

2024-05-18 Thread Lee, Lup Yuen
Soon we’ll see many new 64-bit RISC-V SBCs based on the Sophgo SG2000
RISC-V SoC. Will they boot NuttX? Let’s find out…

(1) We boot Linux on Milk-V Duo S (with SG2000)

(2) Peek inside SG2000 Linux and observe how it boots

(3) Then we take NuttX for RISC-V (Ox64 BL808)

(4) Tweak NuttX Kernel to boot on SG2000

(5) Fix the (undocumented) Interrupt Controller

(6) And Milk-V Duo S boots to a fully-functional NuttX Shell

(7) Something strangely satisfying about NuttX on RISC-V… We finished the
port in Only 10 Days 

Here's how: https://lupyuen.codeberg.page/articles/sg2000.html

Lup


[Article] Rust Apps on NuttX for Ox64 BL808 RISC-V SBC

2024-05-04 Thread Lee, Lup Yuen
Will Rust Apps run on a 64-bit RISC-V SBC? Like Ox64 BL808 SBC? Let’s find
out!

(1) We take a Barebones Rust App (“Hello World!”)

(2) Compile it for QEMU RISC-V Emulator (64-bit)

(3) Run it on QEMU Emulator with NuttX

(4) Do the same on Ox64 BL808 SBC (via MicroSD)

(5) We’ll discuss the Quirky Workarounds (because NuttX Apps work
differently in Kernel Mode vs Flat Mode)

Here's how: https://lupyuen.codeberg.page/articles/rust5.html

Lup


Re: Help regarding the code formatting

2024-05-03 Thread Lee, Lup Yuen
Thank you so much Greg! I'll copy and paste the relevant sections into the
NuttX Docs.

Lup

On Fri, May 3, 2024 at 10:04 PM Gregory Nutt  wrote:

> On 5/3/2024 2:12 AM, Lee, Lup Yuen wrote:
> > https://lupyuen.github.io/articles/pr#check-coding-style
> Nice article.  This would be good to have in the documentation.
> > I'm not aware of a script that does auto-formatting for NuttX Code. I do
> it
> > manually in VSCode :-)
>
> There used to be a couple of scripts under tools used standard pretty
> printer programs to format NuttX code.  Those were imperfect, however,
> and it appear to have been removed (probably for that reason).
>
> The coding style is similar to the GNU coding style with some extensions
> and differences.  There is an official FSF GNJ coding style document but
> it is universally disliked, not because of the coding style, but because
> it is so long, "preachy", and controversial.. like a political
> manifesto.  The Wikipedia article  is short:
> https://en.wikipedia.org/wiki/GNU_coding_standards
>
>
>


Re: Help regarding the code formatting

2024-05-03 Thread Lee, Lup Yuen
Hi Janardhan: I have an article that explains the "nxstyle" tool, maybe
this will help?

https://lupyuen.github.io/articles/pr#check-coding-style

I'm not aware of a script that does auto-formatting for NuttX Code. I do it
manually in VSCode :-)

Lup

On Fri, May 3, 2024 at 3:24 PM Janardhan Silwal 
wrote:

> Hi,
>
> I am kind of getting started with NuttX and am adding minimalistic
> board/chip already not available in the NuttX repo.
>
> I would like to create a pull request and get help in evaluating the
> additions and support in debugging.
>
> I was looking through the coding standard, and I am kinda confused about
> how to properly run through the necessary checks. Is there some
> documentation regarding how to carry that out?
>
> Or is there a formatting script available which formats, at least,
> indentation, and horizontal/vertical spacing at once, which can be
> integrated into VSCode?
>
> Best Regards,
> Janardhan
>


Welcoming Rushabh Gala to NuttX GSoC

2024-05-01 Thread Lee, Lup Yuen
Please welcome Mr Rushabh Gala to the NuttX Community!

He's a Third-Year Student at Mumbai University (Computer Science and
Engineering). For Google Summer of Code, I'll work with him on Rust Apps
for NuttX.

(Which includes the Rust Wrapper for the POSIX Functions in NuttX)

He's new to NuttX, so he'll seek guidance and feedback from the friendly
folks here :-) We hit a couple of interesting challenges with Rust Apps on
NuttX, we'll work on these issues over the summer:

(1) "Rust Apps on QEMU RISC-V"
https://lupyuen.codeberg.page/articles/rust3.html

(2) "Rust Custom Target for QEMU RISC-V"
https://lupyuen.codeberg.page/articles/rust4.html

(3) "Rust Apps on Ox64 BL808 RISC-V SBC"
(Coming out this weekend)

I believe Alan will be announcing a second GSoC Student Project! More about
the GSoC Projects: https://summerofcode.withgoogle.com/

Lup


Re: [Article] Rust Custom Target for QEMU RISC-V on NuttX

2024-04-20 Thread Lee, Lup Yuen
Thanks Alan! The green phosphor display comes from the "cool-retro-term"
Terminal Emulator, I used the Apple II settings :-)

https://github.com/Swordfish90/cool-retro-term

Lup

On Sun, Apr 21, 2024 at 7:01 AM Alan C. Assis  wrote:

> Hi Lup,
>
> Nice article! I enjoyed that green phosphor effect, how did you do it?
>
> Best Regards,
>
> Alan
>
> On Sat, Apr 20, 2024 at 7:41 PM Lee, Lup Yuen  wrote:
>
> > Last article we were compiling Rust Apps for NuttX QEMU (RISC-V 32-bit).
> > And we hit a baffling error…
> >
> > "Can't link Soft-Float modules with Double-Float modules"
> >
> > Let’s solve the problem! In this article we dive inside the internals of
> > C-to-Rust Interop…
> >
> > (1) Rust compiles for Soft-Float, NuttX expects Double-Float (Software vs
> > Hardware Floating-Point)
> >
> > (2) But Rust doesn’t support Double-Float (by default)
> >
> > (3) So we create a Rust Custom Target for Double-Float
> >
> > (4) Rebuild the Rust Core Library for Double-Float
> >
> > (5) And our Rust App builds OK with NuttX!
> >
> > Here's how: https://lupyuen.codeberg.page/articles/rust4.html
> >
> > Lup
> >
>


[Article] Rust Custom Target for QEMU RISC-V on NuttX

2024-04-20 Thread Lee, Lup Yuen
Last article we were compiling Rust Apps for NuttX QEMU (RISC-V 32-bit).
And we hit a baffling error…

"Can't link Soft-Float modules with Double-Float modules"

Let’s solve the problem! In this article we dive inside the internals of
C-to-Rust Interop…

(1) Rust compiles for Soft-Float, NuttX expects Double-Float (Software vs
Hardware Floating-Point)

(2) But Rust doesn’t support Double-Float (by default)

(3) So we create a Rust Custom Target for Double-Float

(4) Rebuild the Rust Core Library for Double-Float

(5) And our Rust App builds OK with NuttX!

Here's how: https://lupyuen.codeberg.page/articles/rust4.html

Lup


Re: Nano-x porting

2024-04-09 Thread Lee, Lup Yuen
Hi Pavel: I'm sorry the GSoC Proposal Submission has closed last week.
Though Shijo is still keen to do NanoX on NuttX in his spare time.

I asked Shijo to bounce some ideas with you. If you could help him, that
would be great. Thanks :-)

Lup

On Tue, Apr 9, 2024 at 1:48 PM Pavel Pisa  wrote:

> Hello everybody,
>
> On Thursday 28 of March 2024 18:17:24 Shijo George wrote:
> > I was planning to port NanoX to NuttX as part of GSoC. Is anyone familiar
> > with NanoX? Any suggestions and help would be much appreciated.
>
> I have interrest in the project. I am limited by time now but
> I hope to have some over summer.
>
> I can provide support even as co-mentor of the project.
> I would apply for NuttX GSoC mentor role if there is interrest.
> I am already registered as mentor for RTEMS this year,
> so my capacity is and will be limited.
>
> I have sent some more about our offered experience with
> Nano-X, NuttX and RTEMS at the issue page
>
> https://github.com/ghaerr/microwindows/issues/85
>
> By the way, I am at Embedded World in Nuremberg now, so if somebody has
> interest in these and other topic than we can be reached there OSADL has
> kindly provided us space (hall 4, booth 4-168) to present some of our
> university projects.
>
> Best wishes,
>
> Pavel
> --
> Pavel Pisa
>
> phone:  +420 603531357
> e-mail: p...@cmp.felk.cvut.cz
> Department of Control Engineering FEE CVUT
> Karlovo namesti 13, 121 35, Prague 2
> university: http://control.fel.cvut.cz/
> personal:   http://cmp.felk.cvut.cz/~pisa
> company:https://pikron.com/ PiKRON s.r.o.
> Kankovskeho 1235, 182 00 Praha 8, Czech Republic
> projects:   https://www.openhub.net/accounts/ppisa
> social: https://social.kernel.org/ppisa
> CAN related:http://canbus.pages.fel.cvut.cz/
> RISC-V education: https://comparch.edu.cvut.cz/
> Open Technologies Research Education and Exchange Services
> https://gitlab.fel.cvut.cz/otrees/org/-/wikis/home
>


Re: [VOTE] Apache NuttX 12.5.1 RC0 release

2024-04-09 Thread Lee, Lup Yuen
+1 for Ox64, Star64 and PinePhone

= Ox64 Compiler
+ riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/Users/Luppy/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin/bin/../libexec/gcc/riscv64-unknown-elf/10.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with:
/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/build/riscv64-unknown-elf-gcc/riscv-gcc/configure
--target=riscv64-unknown-elf
--prefix=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin
--with-pkgversion='SiFive GCC-Metal 10.2.0-2020.12.8' --with-bugurl=
https://github.com/sifive/freedom-tools/issues --disable-shared
--disable-threads --enable-languages=c,c++ --enable-tls --with-newlib
--with-sysroot=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin/riscv64-unknown-elf
--with-native-system-header-dir=/include --disable-libmudflap
--disable-libssp --disable-libquadmath --disable-libgomp --disable-nls
--disable-tm-clone-registry --src=../riscv-gcc --with-system-zlib
--enable-checking=yes --enable-multilib --with-abi=lp64d
--with-arch=rv64imafdc CFLAGS=-O2 CXXFLAGS=-O2 'CFLAGS_FOR_TARGET=-Os
-mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medany'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (SiFive GCC-Metal 10.2.0-2020.12.8)

= Ox64 Configuration
+ ./tools/configure.sh ox64:nsh

= Ox64 Size
+ riscv64-unknown-elf-size nuttx
   textdata bss dec hex filename
 169273 641   27576  197490   30372 nuttx

= Ox64 NSH Info and Free
NuttShell (NSH) NuttX-12.5.1
nsh> uname -a
NuttX 12.5.1 9e8753d625 Apr  9 2024 16:36:36 risc-v ox64
nsh> free
   total   used   freemaxusedmaxfree  nused
 nfree
Kmem2065400  141522051248  764402049584 36
 3
Page:   20971520  647168   20324352   20324352

= Star64 Compiler
+ riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/Users/Luppy/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin/bin/../libexec/gcc/riscv64-unknown-elf/10.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with:
/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/build/riscv64-unknown-elf-gcc/riscv-gcc/configure
--target=riscv64-unknown-elf
--prefix=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin
--with-pkgversion='SiFive GCC-Metal 10.2.0-2020.12.8' --with-bugurl=
https://github.com/sifive/freedom-tools/issues --disable-shared
--disable-threads --enable-languages=c,c++ --enable-tls --with-newlib
--with-sysroot=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin/riscv64-unknown-elf
--with-native-system-header-dir=/include --disable-libmudflap
--disable-libssp --disable-libquadmath --disable-libgomp --disable-nls
--disable-tm-clone-registry --src=../riscv-gcc --with-system-zlib
--enable-checking=yes --enable-multilib --with-abi=lp64d
--with-arch=rv64imafdc CFLAGS=-O2 CXXFLAGS=-O2 'CFLAGS_FOR_TARGET=-Os
-mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medany'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (SiFive GCC-Metal 10.2.0-2020.12.8)

= Star64 Configuration
+ ./tools/configure.sh star64:nsh

= Star64 Size
+ riscv64-unknown-elf-size nuttx
   text   databssdechex filename
 168398641  24600 193639  2f467 nuttx

= Star64 NSH Info and Free
NuttShell (NSH) NuttX-12.5.1
nsh> uname -a
NuttX 12.5.1 9e8753d625 Apr  9 2024 16:52:17 risc-v star64
nsh> free
total used free maxused maxfree  nused  nfree
Kmem: 2065400 14120 2051280 76408 2049616 35 4
Page:   20971520 647168   20324352   20324352

= PinePhone Compiler
+ aarch64-none-elf-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-none-elf-gcc
COLLECT_LTO_WRAPPER=/Applications/ArmGNUToolchain/11.3.rel1/aarch64-none-elf/bin/../libexec/gcc/aarch64-none-elf/11.3.1/lto-wrapper
Target: aarch64-none-elf
Configured with:
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/gcc/configure
--target=aarch64-none-elf
--prefix=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install
--with-gmp=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-mpfr=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools

Re: [Article] Rust Apps on NuttX with QEMU RISC-V Emulator

2024-04-08 Thread Lee, Lup Yuen
Thank you so much Sebastien! Yep I promise to explain slowly all the Rust
Concepts, sometimes they baffle me too :-)

Lup

On Mon, Apr 8, 2024 at 5:07 PM Sebastien Lorquet 
wrote:

> Hi,
>
> I dont want to have anything serious to do with rust, but I like your
> article, as it gives a kind of rosetta stone to interop basic rust with
> C and the usual toolchains, which I did not see anywhere else (I did not
> search for long).
>
> I'll keep it as a reference doc.
>
> Thanks,
>
> Sebastien
>
> Le 07/04/2024 à 00:56, Lee, Lup Yuen a écrit :
> > This article explains the current steps for running barebones Rust Apps
> on
> > NuttX and the challenges we faced:
> >
> > (1) How we compile Rust Apps for NuttX
> > (2) Running NuttX and Rust Apps on QEMU RISC-V Emulator
> > (3) Console Input and Output for Rust on NuttX
> > (4) Software vs Hardware Floating-Point and why it’s a problem
> > (5) Linking Issues with the Rust Panic Handler
> > (6) Standard vs Embedded Rust and why it matters
> > (7) Why we’re doing all this for Google Summer of Code (GSoC)
> >
> > Here's the article: https://lupyuen.codeberg.page/articles/rust3.html
> >
> > Mr Rushabh Gala is my GSoC Mentee, when the project begins I'll do the
> > proper intro. Stay tuned :-)
> >
> > Lup
> >
>


Re: [Article] Rust Apps on NuttX with QEMU RISC-V Emulator

2024-04-07 Thread Lee, Lup Yuen
Thanks Alan! Yep our GSoC Project will create Rust Wrappers for the NuttX
POSIX API. So we won't need `extern` and `unsafe` in our Rust Apps.

We'll borrow the features from the Rustix Project. Though we'll pick a
smaller subset that's easier to maintain.

Lup

On Sun, Apr 7, 2024 at 8:39 PM Alan C. Assis  wrote:

> Very nice article!
>
> I think it should be nice to take a look at the Rustix project again, it
> will avoid these 'extern "C" ' for each function on NuttX.
>
> BR,
>
> Alan
>
> On Sat, Apr 6, 2024 at 7:57 PM Lee, Lup Yuen  wrote:
>
> > This article explains the current steps for running barebones Rust Apps
> on
> > NuttX and the challenges we faced:
> >
> > (1) How we compile Rust Apps for NuttX
> > (2) Running NuttX and Rust Apps on QEMU RISC-V Emulator
> > (3) Console Input and Output for Rust on NuttX
> > (4) Software vs Hardware Floating-Point and why it’s a problem
> > (5) Linking Issues with the Rust Panic Handler
> > (6) Standard vs Embedded Rust and why it matters
> > (7) Why we’re doing all this for Google Summer of Code (GSoC)
> >
> > Here's the article: https://lupyuen.codeberg.page/articles/rust3.html
> >
> > Mr Rushabh Gala is my GSoC Mentee, when the project begins I'll do the
> > proper intro. Stay tuned :-)
> >
> > Lup
> >
>


[Article] Rust Apps on NuttX with QEMU RISC-V Emulator

2024-04-06 Thread Lee, Lup Yuen
This article explains the current steps for running barebones Rust Apps on
NuttX and the challenges we faced:

(1) How we compile Rust Apps for NuttX
(2) Running NuttX and Rust Apps on QEMU RISC-V Emulator
(3) Console Input and Output for Rust on NuttX
(4) Software vs Hardware Floating-Point and why it’s a problem
(5) Linking Issues with the Rust Panic Handler
(6) Standard vs Embedded Rust and why it matters
(7) Why we’re doing all this for Google Summer of Code (GSoC)

Here's the article: https://lupyuen.codeberg.page/articles/rust3.html

Mr Rushabh Gala is my GSoC Mentee, when the project begins I'll do the
proper intro. Stay tuned :-)

Lup


Re: [VOTE] Apache NuttX 12.5.0 RC0 release

2024-04-01 Thread Lee, Lup Yuen
+1 for Ox64, Star64 and PinePhone

= Ox64 Compiler
+ riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/Users/Luppy/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin/bin/../libexec/gcc/riscv64-unknown-elf/10.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with:
/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/build/riscv64-unknown-elf-gcc/riscv-gcc/configure
--target=riscv64-unknown-elf
--prefix=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin
--with-pkgversion='SiFive GCC-Metal 10.2.0-2020.12.8' --with-bugurl=
https://github.com/sifive/freedom-tools/issues --disable-shared
--disable-threads --enable-languages=c,c++ --enable-tls --with-newlib
--with-sysroot=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin/riscv64-unknown-elf
--with-native-system-header-dir=/include --disable-libmudflap
--disable-libssp --disable-libquadmath --disable-libgomp --disable-nls
--disable-tm-clone-registry --src=../riscv-gcc --with-system-zlib
--enable-checking=yes --enable-multilib --with-abi=lp64d
--with-arch=rv64imafdc CFLAGS=-O2 CXXFLAGS=-O2 'CFLAGS_FOR_TARGET=-Os
-mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medany'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (SiFive GCC-Metal 10.2.0-2020.12.8)

= Ox64 Configuration
+ ./tools/configure.sh ox64:nsh

= Ox64 Size
+ riscv64-unknown-elf-size nuttx
   textdata bss dec hex filename
 169273 641   27576  197490   30372 nuttx

= Ox64 NSH Info and Free
NuttShell (NSH) NuttX-12.5.0
nsh> uname -a
NuttX 12.5.0 34f182c62a Apr  1 2024 16:07:23 risc-v ox64
nsh> free
   total   used   freemaxusedmaxfree  nused
 nfree
Kmem:2065400  141522051248  764402049584 36
 3
Page:   20971520 647168   20324352   20324352

= Star64 Compiler
+ riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/Users/Luppy/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin/bin/../libexec/gcc/riscv64-unknown-elf/10.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with:
/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/build/riscv64-unknown-elf-gcc/riscv-gcc/configure
--target=riscv64-unknown-elf
--prefix=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin
--with-pkgversion='SiFive GCC-Metal 10.2.0-2020.12.8' --with-bugurl=
https://github.com/sifive/freedom-tools/issues --disable-shared
--disable-threads --enable-languages=c,c++ --enable-tls --with-newlib
--with-sysroot=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin/riscv64-unknown-elf
--with-native-system-header-dir=/include --disable-libmudflap
--disable-libssp --disable-libquadmath --disable-libgomp --disable-nls
--disable-tm-clone-registry --src=../riscv-gcc --with-system-zlib
--enable-checking=yes --enable-multilib --with-abi=lp64d
--with-arch=rv64imafdc CFLAGS=-O2 CXXFLAGS=-O2 'CFLAGS_FOR_TARGET=-Os
-mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medany'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (SiFive GCC-Metal 10.2.0-2020.12.8)

= Star64 Configuration
+ ./tools/configure.sh star64:nsh

= Star64 Size
+ riscv64-unknown-elf-size nuttx
   text   databssdechex filename
 168398641  24600 193639  2f467 nuttx

= Star64 NSH Info and Free
NuttShell (NSH) NuttX-12.5.0
nsh> uname -a
NuttX 12.5.0 34f182c62a Apr  1 2024 16:19:40 risc-v star64
nsh> free
   total   used   freemaxusedmaxfree  nused
 nfree
Kmem:2065400  141202051280  764082049616 35
 4
Page:   20971520 647168   20324352   20324352

= PinePhone Compiler
+ aarch64-none-elf-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-none-elf-gcc
COLLECT_LTO_WRAPPER=/Applications/ArmGNUToolchain/11.3.rel1/aarch64-none-elf/bin/../libexec/gcc/aarch64-none-elf/11.3.1/lto-wrapper
Target: aarch64-none-elf
Configured with:
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/gcc/configure
--target=aarch64-none-elf
--prefix=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install
--with-gmp=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools

[OT] PineVox Smart Speaker might boot NuttX (Bouffalo Lab BL606P)

2024-03-23 Thread Lee, Lup Yuen
Pine64's new PineVox Smart Speaker looks interesting, it runs on Bouffalo
Lab's BL606P 64-bit RISC-V SoC. Which is very similar to Ox64 BL808, so it
might boot NuttX!

https://www.hackster.io/news/pine64-enters-the-home-automation-sector-with-the-privacy-preserving-pinevox-smart-speaker-ac4d6e014601

I'll ask Pine64 for a Prototype Unit and test it with NuttX.

Lup


[Article] NuttX Log Parser with PureScript

2024-03-02 Thread Lee, Lup Yuen
While porting QuickJS to Ox64 BL808 SBC, we hit a Baffling Crash Dump on
NuttX. Which made us ponder...

Is there a better way to analyse a NuttX Crash Dump? Without scrolling
pages and pages of logs?

In this article, we create a real-time NuttX Log Parser that will:
(1) Extract the RISC-V Exception Details
(2) Interpret and Explain the RISC-V Exception
(3) Hyperlink the Stack Dump to NuttX Source Code and Disassembly
(4) Implemented in PureScript, the Functional Programming Language that
compiles to JavaScript

This is how we made it:
https://lupyuen.codeberg.page/articles/purescript.html

Lup


Re: [Article] Drag-n-Drop a NuttX App

2024-02-24 Thread Lee, Lup Yuen
Thanks Alan! We're still seeking a quicker way to send JavaScript Files to
NuttX. (Zmodem? ROM FS Injection?)

With NuttX supporting JavaScript (and hopefully MicroPython), we can now do
so many fun things on NuttX :-)

The next article will be about analysing NuttX Crash Dumps with PureScript
(the functional language that compiles to JavaScript). The findings are
recorded here: https://github.com/lupyuen/nuttx-purescript-parser

Lup

On Sun, Feb 25, 2024 at 7:24 AM Alan C. Assis  wrote:

> WOW!!! Really cool project!
>
> Easy way to let people who know how to program using blocky to create NuttX
> applications!
>
> Best Regards,
>
> Alan
>
> On Sat, Feb 24, 2024 at 7:03 PM Lee, Lup Yuen  wrote:
>
> > Remember MakeCode? BBC micro:bit and its Drag-n-Drop App Builder?
> MakeCode
> > for BBC micro:bit is an awesome creation that’s way ahead of its time (7
> > years ago!)
> > - TypeScript Compiler and Arm Assembler in the Web Browser (in
> JavaScript!)
> > - Custom Embedded OS (CODAL + Mbed OS)
> > - micro:bit Simulator in JavaScript
> >
> > Today 7 years later: How would we redo all this? Maybe with...
> > (1) Hardware Device: Ox64 BL808 64-bit RISC-V SBC
> > (2) Embedded OS: Apache NuttX RTOS
> > (3) JavaScript Engine: QuickJS for NuttX
> > (4) Web Emulator: TinyEMU WebAssembly for NuttX
> > (5) C Compiler + Assembler: TCC WebAssembly for NuttX
> > (6) Device Control: Web Serial API with Term.js
> >
> > This article explains how we gave MakeCode a wholesome wholesale makeover
> > with NuttX:
> > https://lupyuen.codeberg.page/articles/quickjs2.html
> >
> > Lup
> >
>


[Article] Drag-n-Drop a NuttX App

2024-02-24 Thread Lee, Lup Yuen
Remember MakeCode? BBC micro:bit and its Drag-n-Drop App Builder? MakeCode
for BBC micro:bit is an awesome creation that’s way ahead of its time (7
years ago!)
- TypeScript Compiler and Arm Assembler in the Web Browser (in JavaScript!)
- Custom Embedded OS (CODAL + Mbed OS)
- micro:bit Simulator in JavaScript

Today 7 years later: How would we redo all this? Maybe with...
(1) Hardware Device: Ox64 BL808 64-bit RISC-V SBC
(2) Embedded OS: Apache NuttX RTOS
(3) JavaScript Engine: QuickJS for NuttX
(4) Web Emulator: TinyEMU WebAssembly for NuttX
(5) C Compiler + Assembler: TCC WebAssembly for NuttX
(6) Device Control: Web Serial API with Term.js

This article explains how we gave MakeCode a wholesome wholesale makeover
with NuttX:
https://lupyuen.codeberg.page/articles/quickjs2.html

Lup


[Article] QuickJS JavaScript Engine on NuttX

2024-02-17 Thread Lee, Lup Yuen
QuickJS is a small JavaScript Engine that supports POSIX Functions. Can we
run QuickJS on NuttX? And Blink the LED in 4 lines of JavaScript?

  const ULEDIOC_SETALL = 0x1d03;
  const fd = os.open("/dev/userleds", os.O_WRONLY);
  os.ioctl(fd, ULEDIOC_SETALL, 1);
  os.ioctl(fd, ULEDIOC_SETALL, 0);

In this article we…
(1) Run QuickJS on NuttX with Ox64 BL808 RISC-V SBC
(2) Blink the LED by adding the ioctl() function
(3) Reconfigure the NuttX App Stack (because it’s too tiny)
(4) Analyse the Memory Footprint of QuickJS (Code + Data + Heap Size)
(5) Test QuickJS in the Web Browser with NuttX Emulator (and a Simulated
LED)

QuickJS is perfect for Iterative, Interactive Experiments on NuttX! Check
out the article:
https://lupyuen.codeberg.page/articles/quickjs.html

Lup


[Article] NuttX ROM FS Driver in the Web Browser

2024-02-10 Thread Lee, Lup Yuen
NuttX has an awesome driver for ROM FS Filesystem. What if we could
transplant the NuttX Driver and run it in a Web Browser, embedded in any
WebAssembly App?

Today we solve a hefty headache in our port of TCC Compiler to WebAssembly:
Missing C Header Files...
(1) We host the C Header Files in a ROM FS Filesystem
(2) Call the NuttX ROM FS Driver (from Zig WebAssembly) to emulate POSIX
File Access
(3) TCC Compiler compiles C Programs with Header Files yay!
(4) We tested the Compiler Output with NuttX Emulator in the Web Browser
(5) Now we can build NuttX Apps in the Web Browser, and test them in the
Web Browser too

NuttX becomes a Triple Treat: In the C Compiler, in the Apps and in the
Emulator!

Here's the article: https://lupyuen.codeberg.page/articles/romfs.html

Lup


Re: [Article] Build & Test NuttX Apps in the Web Browser (TCC RISC-V Compiler)

2024-02-04 Thread Lee, Lup Yuen
<< It would be nice if we could get TCC integrated on apps/ to run inside
MCUs
with much memory (like STM32 with external SDRAM), ESP32, BL808, etc. >>

Thanks Alan! We have a couple of issues that might affect TCC Compiler on
NuttX:

(1) RISC-V Registers are mixed up when TCC emits code for NuttX System
Calls:
https://lupyuen.codeberg.page/articles/tcc.html#appendix-nuttx-system-call

(2) TCC won't link with NuttX Libraries compiled with GCC. We'll have to
recompile the NuttX Libraries with TCC:
https://github.com/lupyuen/tcc-riscv32-wasm#fix-missing-printf-in-nuttx-app

(3) TCC for RISC-V hasn't been updated for the past 8 months:
https://github.com/sellicott/tcc-riscv32/commits/main/

Perhaps our article will revive the TCC project? Let's see what happens :-)

Something interesting popped up: Our NuttX ROM FS Driver works well in
WebAssembly. Which means we can run it to host a ROM FS Filesystem inside a
Web Browser!
https://github.com/lupyuen/tcc-riscv32-wasm#rom-fs-filesystem-for-tcc-webassembly

TCC Compiler in WebAssembly needs a filesystem (inside the Web Browser)
that's preloaded with C Header Files and Library Files. Our NuttX ROM FS
Driver is perfect for that. I'll explain more in the next article.

So cool to have our NuttX Drivers running on new unexpected platforms :-)

Lup

On Mon, Feb 5, 2024 at 1:06 AM Alan C. Assis  wrote:

> Hi Lup,
>
> Congratulations! That was a great achievement!!!
>
> It would be nice if we could get TCC integrated on apps/ to run inside MCUs
> with much memory (like STM32 with external SDRAM), ESP32, BL808, etc.
>
> Best Regards,
>
> Alan
>
> On Sat, Feb 3, 2024 at 8:08 PM Lee, Lup Yuen  wrote:
>
> > Today we're running NuttX Emulator inside a Web Browser. What if we could
> > build and test NuttX Apps in the Web Browser? Learning NuttX becomes so
> > cool!
> >
> > Let's explore with TCC (Tiny C Compiler) for 64-bit RISC-V, compiled to
> > WebAssembly with Zig Compiler...
> >
> > (1) Zig Compiler compiles TCC Compiler to WebAssembly (with one tiny fix)
> > (2) But we hit some Missing POSIX Functions
> > (3) So we built minimal File Input and Output
> > (4) Hacked up a simple workaround for fprintf and friends
> > (5) And TCC produces a RISC-V Binary that runs on NuttX Emulator, in the
> > Web Browser!
> > (6) Though it needs Low-Level NuttX System Calls. We might fix this by
> > porting NuttX ROM FS to Zig and WebAssembly.
> >
> > Here's the article: https://lupyuen.codeberg.page/articles/tcc.html
> >
> > Lup
> >
>


[Article] Build & Test NuttX Apps in the Web Browser (TCC RISC-V Compiler)

2024-02-03 Thread Lee, Lup Yuen
Today we're running NuttX Emulator inside a Web Browser. What if we could
build and test NuttX Apps in the Web Browser? Learning NuttX becomes so
cool!

Let's explore with TCC (Tiny C Compiler) for 64-bit RISC-V, compiled to
WebAssembly with Zig Compiler...

(1) Zig Compiler compiles TCC Compiler to WebAssembly (with one tiny fix)
(2) But we hit some Missing POSIX Functions
(3) So we built minimal File Input and Output
(4) Hacked up a simple workaround for fprintf and friends
(5) And TCC produces a RISC-V Binary that runs on NuttX Emulator, in the
Web Browser!
(6) Though it needs Low-Level NuttX System Calls. We might fix this by
porting NuttX ROM FS to Zig and WebAssembly.

Here's the article: https://lupyuen.codeberg.page/articles/tcc.html

Lup


Re: [Article] NuttX on Ox64 BL808: Automated Testing with Ox64 Emulator

2024-01-27 Thread Lee, Lup Yuen
<< I think it could be very useful if integrated with CI. We could find
many issues that aren't detected currently. >>

Thanks Alan, that's a great idea! Lemme find the best way to integrate
Automated Testing into the CI, without breaking our PR Submissions.

If a PR breaks the CI: Maybe we can run an "Auto Triage" to guess the
Severity of the Breakage? Like:
(1) Code Red: "Most likely the PR Code broke the CI, please fix the PR"
(2) Code Amber: "Maybe the PR Code broke the CI? Needs more investigation"
(3) Code Green: "Probably OK" (e.g. unable to download OpenAMP, automated
test failed)

Right now I'm running the Automated Test every morning (GMT+8). So I have
the rest of the day to figure out what broke, without staying up all night
:-)

Lup

On Sun, Jan 28, 2024 at 7:36 AM Alan C. Assis  wrote:

> Hi Lup,
>
> Congratulations, I think it could be very useful if integrated with CI.
>
> We could find many issues that aren't detected currently.
>
> Best Regards,
>
> Alan
>
> On Sat, Jan 27, 2024 at 8:05 PM Lee, Lup Yuen  wrote:
>
> > Every day we’re auto-building NuttX for Ox64 BL808 RISC-V SBC... Can we
> > test NuttX on Ox64 automatically after building?
> >
> > Yes we can! With a little help from the Ox64 BL808 Emulator that we
> created
> > last week. In this article, we fill in the missing pieces of our Ox64
> > Emulator and run it for Automated Testing...
> >
> > (1) Booting NuttX in Supervisor Mode (instead of Machine Mode)
> > (2) Emulate OpenSBI for setting the System Timer
> > (3) Emulate the UART Interrupts for Console Input
> > (4) Execute everything with Expect Scripting (based on TCL)
> > (5) Which becomes our Daily Automated Testing (triggered every day by
> > GitHub Actions)
> >
> > Here's the article: https://lupyuen.codeberg.page/articles/tinyemu3.html
> >
> > Lup
> >
>


[Article] NuttX on Ox64 BL808: Automated Testing with Ox64 Emulator

2024-01-27 Thread Lee, Lup Yuen
Every day we’re auto-building NuttX for Ox64 BL808 RISC-V SBC... Can we
test NuttX on Ox64 automatically after building?

Yes we can! With a little help from the Ox64 BL808 Emulator that we created
last week. In this article, we fill in the missing pieces of our Ox64
Emulator and run it for Automated Testing...

(1) Booting NuttX in Supervisor Mode (instead of Machine Mode)
(2) Emulate OpenSBI for setting the System Timer
(3) Emulate the UART Interrupts for Console Input
(4) Execute everything with Expect Scripting (based on TCL)
(5) Which becomes our Daily Automated Testing (triggered every day by
GitHub Actions)

Here's the article: https://lupyuen.codeberg.page/articles/tinyemu3.html

Lup


[Article] NuttX on Ox64 BL808 RISC-V SBC: Emulated in the Web Browser

2024-01-20 Thread Lee, Lup Yuen
In olden times we had Computer Games (plus Operating Systems) on 5.25-inch
Floppy Disks. And we’d boot the Floppy Disks (clackety-clack) on Apple II
Computers with 64 KB RAM.

Today (40 years later) we boot microSD Cards (clickety-click) on Ox64 BL808
RISC-V Single-Board Computers with 64 MB RAM.

What if we could turn it into a Virtual Ox64 SBC that boots in our Web
Browser? Exactly like an Emulated Apple II!

In this article we…
(1) Take NuttX precompiled for Ox64 (Without any modifications)
(2) Boot it on the TinyEMU RISC-V Emulator
(3) Create our own Emulator for Ox64 SBC (With minor tweaks to TinyEMU)
(4) And run everything in our Web Browser (Thanks to WebAssembly)

Here's the article: https://lupyuen.codeberg.page/articles/tinyemu2.html

Lup


Re: [Article] NuttX in the Web Browser (TinyEMU + VirtIO)

2024-01-16 Thread Lee, Lup Yuen
Hi Nathan: Yep it's easy to host the NuttX Online Demo on any website, it's
just a bunch of Static HTML, JavaScript and WebAssembly files. Please lemme
know whom I should work with :-)

Meanwhile I'll upstream the TinyEMU RISC-V Port of NuttX. Thanks!

Lup

On Wed, Jan 17, 2024 at 8:40 AM Nathan Hartman 
wrote:

> This is very cool! Could it be possible to put it direct on the NuttX
> website? e.g., "Try NuttX in the browser"
>
> On Mon, Jan 15, 2024 at 5:58 PM Alan C. Assis  wrote:
>
> > Interesting!
> > Thank you very much Lup for investigating it further!
> >
> > BR,
> > Alan
> >
> > On Mon, Jan 15, 2024 at 2:34 AM Lee, Lup Yuen  wrote:
> >
> > > << Do you think it is possible to find an alternative to use the users'
> > > browser connection to communicate to the Internet? This way it avoids
> > > users' consumption of all internet limits on the server side. >>
> > >
> > > Hi Alan: You're right, TinyEMU Emulator talks to a WebSocket VPN hosted
> > at
> > > `
> > > relay.widgetry.org` that's throttled at 40 kB/s (for free, fair use).
> > But
> > > I
> > > don't see a good alternative to this WebSocket VPN:
> > >
> > > (1) Can the Web Browser talk directly to the internet without WebSocket
> > > VPN?
> > >
> > > TinyEMU and VirtIO Networking are sending Ethernet Frames / IP Packets
> > from
> > > the Web Browser to the internet. But Web Browsers are not allowed to
> send
> > > IP Packets directly. That's why we need to tunnel the packets through a
> > > WebSocket VPN.
> > >
> > > (2) Can we host our own WebSocket VPN on our Local Computer?
> > >
> > > Possibly. But then we will have to host the Web Server on our Local
> > > Computer too. Which makes it cumbersome to install.
> > >
> > > (3) Can we host the WebSocket VPN on a server operated by the NuttX
> > > Project?
> > >
> > > Probably not, because we need to throttle the internet traffic for
> free,
> > > fair use. And prevent abuse.
> > >
> > > I've documented my findings on TinyEMU, VirtIO Networking and WebSocket
> > > VPN:
> > >
> > >
> >
> https://github.com/lupyuen/nuttx-tinyemu#tinyemu-networking-in-the-web-browser
> > >
> > > Lup
> > >
> > > On Sun, Jan 14, 2024 at 9:54 PM Alan C. Assis 
> wrote:
> > >
> > > > Hi Lup,
> > > >
> > > > Thank you very much!
> > > >
> > > > Looking at the WebSocket VPN article it said the connection goes
> > through
> > > > the server hosting the emulator.
> > > >
> > > > Do you think it is possible to find an alternative to use the users'
> > > > browser connection to communicate to the Internet?
> > > > This way it avoids users' consumption of all internet limits on the
> > > server
> > > > side.
> > > >
> > > > BR,
> > > >
> > > > Alan
> > > >
> > > > On Sun, Jan 14, 2024 at 4:17 AM Lee, Lup Yuen 
> > wrote:
> > > >
> > > > > Thanks Alan! Yep "The Construct" looks like a cool way to learn ROS
> > > > online,
> > > > > we should do something similar for Teaching NuttX Online!
> > > > >
> > > > > As for Emulated Networking in the Web Browser: TinyEMU Emulator
> > > supports
> > > > > VirtIO Networking. But it's tunnelled through a WebSocket VPN,
> > because
> > > of
> > > > > browser limitations.
> > > > >
> > > > > I might test this with NuttX and see how well it works. (I'm also
> > keen
> > > to
> > > > > emulate Ox64 BL808 RISC-V SBC in the Web Browser)
> > > > >
> > > > > TinyEMU VirtIO Networking: https://bellard.org/jslinux/tech.html
> > > > >
> > > > > WebSocket VPN:
> > > > >
> https://www.benjamincburns.com/2013/11/10/jor1k-ethmac-support.html
> > > > >
> > > > > Lup
> > > > >
> > > > > On Sun, Jan 14, 2024 at 8:10 AM Alan C. Assis 
> > > wrote:
> > > > >
> > > > > > Really cool Lup!
> > > > > >
> > > > > > Maybe it could be used for training and deduction purposes. Do
> you
> > > know
> > > > > > "The Construct" they are using a solution like that to run Linux
> 

Re: [Article] NuttX in the Web Browser (TinyEMU + VirtIO)

2024-01-14 Thread Lee, Lup Yuen
<< Do you think it is possible to find an alternative to use the users'
browser connection to communicate to the Internet? This way it avoids
users' consumption of all internet limits on the server side. >>

Hi Alan: You're right, TinyEMU Emulator talks to a WebSocket VPN hosted at `
relay.widgetry.org` that's throttled at 40 kB/s (for free, fair use). But I
don't see a good alternative to this WebSocket VPN:

(1) Can the Web Browser talk directly to the internet without WebSocket VPN?

TinyEMU and VirtIO Networking are sending Ethernet Frames / IP Packets from
the Web Browser to the internet. But Web Browsers are not allowed to send
IP Packets directly. That's why we need to tunnel the packets through a
WebSocket VPN.

(2) Can we host our own WebSocket VPN on our Local Computer?

Possibly. But then we will have to host the Web Server on our Local
Computer too. Which makes it cumbersome to install.

(3) Can we host the WebSocket VPN on a server operated by the NuttX Project?

Probably not, because we need to throttle the internet traffic for free,
fair use. And prevent abuse.

I've documented my findings on TinyEMU, VirtIO Networking and WebSocket
VPN:
https://github.com/lupyuen/nuttx-tinyemu#tinyemu-networking-in-the-web-browser

Lup

On Sun, Jan 14, 2024 at 9:54 PM Alan C. Assis  wrote:

> Hi Lup,
>
> Thank you very much!
>
> Looking at the WebSocket VPN article it said the connection goes through
> the server hosting the emulator.
>
> Do you think it is possible to find an alternative to use the users'
> browser connection to communicate to the Internet?
> This way it avoids users' consumption of all internet limits on the server
> side.
>
> BR,
>
> Alan
>
> On Sun, Jan 14, 2024 at 4:17 AM Lee, Lup Yuen  wrote:
>
> > Thanks Alan! Yep "The Construct" looks like a cool way to learn ROS
> online,
> > we should do something similar for Teaching NuttX Online!
> >
> > As for Emulated Networking in the Web Browser: TinyEMU Emulator supports
> > VirtIO Networking. But it's tunnelled through a WebSocket VPN, because of
> > browser limitations.
> >
> > I might test this with NuttX and see how well it works. (I'm also keen to
> > emulate Ox64 BL808 RISC-V SBC in the Web Browser)
> >
> > TinyEMU VirtIO Networking: https://bellard.org/jslinux/tech.html
> >
> > WebSocket VPN:
> > https://www.benjamincburns.com/2013/11/10/jor1k-ethmac-support.html
> >
> > Lup
> >
> > On Sun, Jan 14, 2024 at 8:10 AM Alan C. Assis  wrote:
> >
> > > Really cool Lup!
> > >
> > > Maybe it could be used for training and deduction purposes. Do you know
> > > "The Construct" they are using a solution like that to run Linux in the
> > > browser:
> > >
> > > https://app.theconstructsim.com/login/
> > >
> > > Is it possible to get network enabled and use it to communicate? It
> could
> > > open new possibilities!
> > >
> > > BR,
> > >
> > > Alan
> > >
> > >
> > > On Sat, Jan 13, 2024 at 8:30 PM Lee, Lup Yuen 
> wrote:
> > >
> > > > NuttX now boots and runs inside a Web Browser! (With WebAssembly)
> > > >
> > > > Try "ostest" here: https://lupyuen.github.io/nuttx-tinyemu
> > > >
> > > > This article explains how we…
> > > > (1) Boot NuttX in the Web Browser with TinyEMU RISC-V Emulator
> > > > (2) Modify NuttX for HTIF Console (Berkeley Host-Target Interface)
> > > > (3) Explore VirtIO Console with OpenAMP Library
> > > > (4) And how we might use it: Emulate NuttX Gadgets in the Web
> Browser?
> > A
> > > > Real-Time NuttX Dashboard that lights up as the various NuttX Drivers
> > are
> > > > called?
> > > >
> > > > Here's the article:
> > https://lupyuen.codeberg.page/articles/tinyemu.html
> > > >
> > > > How will you use NuttX in a Web Browser? Please lemme know 
> > > >
> > > > Lup
> > > >
> > >
> >
>


Re: Ox64 crash Was: Re: [VOTE] Apache NuttX 12.4.0 RC0 release

2024-01-14 Thread Lee, Lup Yuen
005040b6d0 S2:
> 5040b700 S3: 5040bba0
> up_dump_register: S4: 5040c870 S5: 5040fb50 S6:
>  S7: 0002
> up_dump_register: S8: 0080 S9: 0766 S10:
> 2a2d S11: 0100
> up_dump_register: SP: 5040b030 FP: 802002f8 TP:
>  RA: 50207b9a
>
> Full log:
> https://gist.github.com/juniskane/b9e6a75f389562e8c989ca1f7069054c<
> https://gist.github.com/juniskane/b9e6a75f389562e8c989ca1f7069054c>
> [https://github.githubassets.com/assets/gist-og-image-54fd7dc0713e.png]<
> https://gist.github.com/juniskane/b9e6a75f389562e8c989ca1f7069054c>
> nuttx-ox64-2024-01-11_getprimes_sh_crash.log<
> https://gist.github.com/juniskane/b9e6a75f389562e8c989ca1f7069054c>
> nuttx-ox64-2024-01-11_getprimes_sh_crash.log. GitHub Gist: instantly share
> code, notes, and snippets.
> gist.github.com
>
> Each of "hello", "sh" and "getprime" works correctly in isolation, but not
> so when run after each other without reset. I think the assertion is
> superficial, the load page fault must be underlying, as binload can load
> "sh" when no preceding "getprime" is invoked. Something wrong with our MMU
> support perhaps?
>
> These reproduce with nuttx-ox64-2024-01-11 from
> https://github.com/lupyuen/nuttx-ox64/releases/tag/nuttx-ox64-2024-01-11
> and also with nuttx I compiled myself. The logs are taken using binaries
> from Mr. Lees release. I haven't tracked, if this is a new regression.
>
> I just got this board a few days ago and it is my very first RISC-V
> computer! Still learning, how to run and debug it, but I hope that I can
> contribute something to NuttX for this interesting architecture in future.
>
> [
> https://opengraph.githubassets.com/4259c40e0ffc51679b0d2f48e65e04e9821afb513a3d978f91a3fb2ceb8bb188/lupyuen/nuttx-ox64/releases/tag/nuttx-ox64-2024-01-11
> ]<https://github.com/lupyuen/nuttx-ox64/releases/tag/nuttx-ox64-2024-01-11
> >
> Release nuttx-ox64-2024-01-11 · lupyuen/nuttx-ox64<
> https://github.com/lupyuen/nuttx-ox64/releases/tag/nuttx-ox64-2024-01-11>
> Apache NuttX RTOS for Pine64 Ox64 64-bit RISC-V SBC (BouffaloLab BL808) -
> Release nuttx-ox64-2024-01-11 · lupyuen/nuttx-ox64
> github.com
>
>   *   Juha
>
> 
> From: Lee, Lup Yuen 
> Sent: Wednesday, January 10, 2024 2:15 PM
> To: dev@nuttx.apache.org 
> Subject: Re: [VOTE] Apache NuttX 12.4.0 RC0 release
>
> +1 for Ox64, Star64 and PinePhone
>
> = Ox64 Compiler
> + riscv64-unknown-elf-gcc -v
> Using built-in specs.
> COLLECT_GCC=riscv64-unknown-elf-gcc
>
> COLLECT_LTO_WRAPPER=/Users/Luppy/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin/bin/../libexec/gcc/riscv64-unknown-elf/10.2.0/lto-wrapper
> Target: riscv64-unknown-elf
> Configured with:
>
> /scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/build/riscv64-unknown-elf-gcc/riscv-gcc/configure
> --target=riscv64-unknown-elf
>
> --prefix=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin
> --with-pkgversion='SiFive GCC-Metal 10.2.0-2020.12.8' --with-bugurl=
>
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsifive%2Ffreedom-tools%2Fissues=05%7C02%7Cjuha.niskanen%40haltian.com%7Cbd1dfaf6205c4bb55efe08dc11d5ea6a%7C2f7c629267f24cc582be5d187e289ab2%7C1%7C0%7C638404857656410690%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=UVDY9HiM4o1pM3%2FjYdYaaGQ4cUbGBH55Wl7fSkrwHjM%3D=0
> <https://github.com/sifive/freedom-tools/issues> --disable-shared
> --disable-threads --enable-languages=c,c++ --enable-tls --with-newlib
>
> --with-sysroot=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin/riscv64-unknown-elf
> --with-native-system-header-dir=/include --disable-libmudflap
> --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls
> --disable-tm-clone-registry --src=../riscv-gcc --with-system-zlib
> --enable-checking=yes --enable-multilib --with-abi=lp64d
> --with-arch=rv64imafdc CFLAGS=-O2 CXXFLAGS=-O2 'CFLAGS_FOR_TARGET=-Os
> -mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medany'
> Thread model: single
> Supported LTO compression algorithms: zlib
> gcc version 10.2.0 (SiFive GCC-Metal 10.2.0-2020.12.8)
>
> = Ox64 Configuration
> + ./tools/configure.sh ox64:nsh
>
> = Ox64 Size

Re: [Article] NuttX in the Web Browser (TinyEMU + VirtIO)

2024-01-13 Thread Lee, Lup Yuen
Thanks Alan! Yep "The Construct" looks like a cool way to learn ROS online,
we should do something similar for Teaching NuttX Online!

As for Emulated Networking in the Web Browser: TinyEMU Emulator supports
VirtIO Networking. But it's tunnelled through a WebSocket VPN, because of
browser limitations.

I might test this with NuttX and see how well it works. (I'm also keen to
emulate Ox64 BL808 RISC-V SBC in the Web Browser)

TinyEMU VirtIO Networking: https://bellard.org/jslinux/tech.html

WebSocket VPN:
https://www.benjamincburns.com/2013/11/10/jor1k-ethmac-support.html

Lup

On Sun, Jan 14, 2024 at 8:10 AM Alan C. Assis  wrote:

> Really cool Lup!
>
> Maybe it could be used for training and deduction purposes. Do you know
> "The Construct" they are using a solution like that to run Linux in the
> browser:
>
> https://app.theconstructsim.com/login/
>
> Is it possible to get network enabled and use it to communicate? It could
> open new possibilities!
>
> BR,
>
> Alan
>
>
> On Sat, Jan 13, 2024 at 8:30 PM Lee, Lup Yuen  wrote:
>
> > NuttX now boots and runs inside a Web Browser! (With WebAssembly)
> >
> > Try "ostest" here: https://lupyuen.github.io/nuttx-tinyemu
> >
> > This article explains how we…
> > (1) Boot NuttX in the Web Browser with TinyEMU RISC-V Emulator
> > (2) Modify NuttX for HTIF Console (Berkeley Host-Target Interface)
> > (3) Explore VirtIO Console with OpenAMP Library
> > (4) And how we might use it: Emulate NuttX Gadgets in the Web Browser? A
> > Real-Time NuttX Dashboard that lights up as the various NuttX Drivers are
> > called?
> >
> > Here's the article: https://lupyuen.codeberg.page/articles/tinyemu.html
> >
> > How will you use NuttX in a Web Browser? Please lemme know 
> >
> > Lup
> >
>


[Article] NuttX in the Web Browser (TinyEMU + VirtIO)

2024-01-13 Thread Lee, Lup Yuen
NuttX now boots and runs inside a Web Browser! (With WebAssembly)

Try "ostest" here: https://lupyuen.github.io/nuttx-tinyemu

This article explains how we…
(1) Boot NuttX in the Web Browser with TinyEMU RISC-V Emulator
(2) Modify NuttX for HTIF Console (Berkeley Host-Target Interface)
(3) Explore VirtIO Console with OpenAMP Library
(4) And how we might use it: Emulate NuttX Gadgets in the Web Browser? A
Real-Time NuttX Dashboard that lights up as the various NuttX Drivers are
called?

Here's the article: https://lupyuen.codeberg.page/articles/tinyemu.html

How will you use NuttX in a Web Browser? Please lemme know 

Lup


Re: [VOTE] Apache NuttX 12.4.0 RC0 release

2024-01-10 Thread Lee, Lup Yuen
+1 for Ox64, Star64 and PinePhone

= Ox64 Compiler
+ riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/Users/Luppy/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin/bin/../libexec/gcc/riscv64-unknown-elf/10.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with:
/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/build/riscv64-unknown-elf-gcc/riscv-gcc/configure
--target=riscv64-unknown-elf
--prefix=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin
--with-pkgversion='SiFive GCC-Metal 10.2.0-2020.12.8' --with-bugurl=
https://github.com/sifive/freedom-tools/issues --disable-shared
--disable-threads --enable-languages=c,c++ --enable-tls --with-newlib
--with-sysroot=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin/riscv64-unknown-elf
--with-native-system-header-dir=/include --disable-libmudflap
--disable-libssp --disable-libquadmath --disable-libgomp --disable-nls
--disable-tm-clone-registry --src=../riscv-gcc --with-system-zlib
--enable-checking=yes --enable-multilib --with-abi=lp64d
--with-arch=rv64imafdc CFLAGS=-O2 CXXFLAGS=-O2 'CFLAGS_FOR_TARGET=-Os
-mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medany'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (SiFive GCC-Metal 10.2.0-2020.12.8)

= Ox64 Configuration
+ ./tools/configure.sh ox64:nsh

= Ox64 Size
+ riscv64-unknown-elf-size nuttx
   textdata bss dec hex filename
 168791 641   26960  196392   2ff28 nuttx

= Ox64 NSH Info and Free
NuttShell (NSH) NuttX-12.4.0
nsh> uname -a
NuttX 12.4.0 96c2707737 Jan 10 2024 19:35:30 risc-v ox64
nsh> free
   total   used   freemaxusedmaxfree  nused
 nfree
Kmem:2065400  146322050768  769842049280 49
 4
Page:   20971520 643072   20328448   20328448

= Star64 Compiler
+ riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/Users/Luppy/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin/bin/../libexec/gcc/riscv64-unknown-elf/10.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with:
/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/build/riscv64-unknown-elf-gcc/riscv-gcc/configure
--target=riscv64-unknown-elf
--prefix=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin
--with-pkgversion='SiFive GCC-Metal 10.2.0-2020.12.8' --with-bugurl=
https://github.com/sifive/freedom-tools/issues --disable-shared
--disable-threads --enable-languages=c,c++ --enable-tls --with-newlib
--with-sysroot=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin/riscv64-unknown-elf
--with-native-system-header-dir=/include --disable-libmudflap
--disable-libssp --disable-libquadmath --disable-libgomp --disable-nls
--disable-tm-clone-registry --src=../riscv-gcc --with-system-zlib
--enable-checking=yes --enable-multilib --with-abi=lp64d
--with-arch=rv64imafdc CFLAGS=-O2 CXXFLAGS=-O2 'CFLAGS_FOR_TARGET=-Os
-mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medany'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (SiFive GCC-Metal 10.2.0-2020.12.8)

= Star64 Configuration
+ ./tools/configure.sh star64:nsh

= Star64 Size
+ riscv64-unknown-elf-size nuttx
   textdata bss dec hex filename
 168828 641   23984  193453   2f3ad nuttx

= Star64 NSH Info and Free
NuttShell (NSH) NuttX-12.4.0
nsh> uname -a
NuttX 12.4.0 96c2707737 Jan 10 2024 19:54:54 risc-v star64
nsh> free
   total   used   freemaxusedmaxfree  nused
 nfree
Kmem:2065400  147122050688  770482049200 50
 4
Page:   20971520 643072   20328448   20328448

= PinePhone Compiler
+ aarch64-none-elf-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-none-elf-gcc
COLLECT_LTO_WRAPPER=/Applications/ArmGNUToolchain/11.3.rel1/aarch64-none-elf/bin/../libexec/gcc/aarch64-none-elf/11.3.1/lto-wrapper
Target: aarch64-none-elf
Configured with:
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/gcc/configure
--target=aarch64-none-elf
--prefix=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install
--with-gmp=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools

[Article] NuttX on Ox64 BL808 RISC-V SBC: Nim Programming Language

2023-12-31 Thread Lee, Lup Yuen
Happy New Year! 2024 is here and we’re running NuttX on Single-Board
Computers with plenty of RAM. Like Pine64 Ox64 BL808 SBC with 64 MB RAM!

In this article, we create a Blinky LED app with a Python-like,
Garbage-Collected Language that compiles to C: Nim Programming Language.

Garbage-Collected Languages (like Nim) require a bit more RAM than
Low-Level Languages (like C). Perfect for our roomy (and vroomy) SBC!

(1) We test NuttX + Nim Blinky on QEMU Emulator for 64-bit RISC-V (minus
the blinkenlight)

(2) Then we run NuttX + Nim Blinky on the Ox64 BL808 RISC-V SBC (with a
real LED)

Check out the article here: https://lupyuen.codeberg.page/articles/nim.html

Lup


Re: [Article] NuttX on Ox64 BL808 RISC-V SBC: Bare Metal Experiments

2023-12-17 Thread Lee, Lup Yuen
Thanks Greg, Wireless 802.15.4 on NuttX sounds very interesting!

It might run on Ox64 BL808, but the WiFi / BLE / Zigbee parts of BL808 SoC
are closed source. Hopefully Bouffalo Lab will reveal the wireless
internals someday.

Right now NuttX runs on the 64-bit Core (D0) of the BL808 SoC, and it isn't
connected to WiFi / BLE / Zigbee. In future we might port NuttX to the
32-bit Core (M0), so we can have the wireless features.

Here's a pic of the BL808 Cores:
https://lupyuen.github.io/images/ox64-cores.jpg

Lup

On Sun, Dec 17, 2023 at 7:59 AM Gregory Nutt  wrote:

> The Zigbee support is interesting.  NuttX does not have a Zigbee stack,
> but does have IEEE 802.15.4 which works with the same physical radio.
>
> The IEEE 802.15.4 logic is quite an accomplishment.  The original
> development was done by  Anthony Merlino and Sebasiten Lorquet.  I see
> that there have been many recent commits for Xiaomi folks too.
>
> When Anthony used the xbee which is a native Zigbee radio, he had to
> re-flash the part for use with IEEE 802.14.5
>
> I also ported/re-implemented 6LoWPAN for use with IEEE 802.14.5. That is
> a very powerful solution.
>
> I had intended to support 6LoWPAN with Bluetooth radios too, but never
> got around to it.
>
> On 12/16/2023 5:03 PM, Lee, Lup Yuen wrote:
> > Pine64 Ox64 BL808 (64-bit RISC-V SBC) is now supported in NuttX Mainline!
> > (Many thanks to my reviewers)
> >
> > Ox64 BL808 is an affordable $8 SBC with:
> > - 3 x RISC-V Cores (T-Head 64-bit / 32-bit)
> > - Networking: Ethernet, WiFi, Bluetooth LE, Zigbee
> > - Peripheral Interfaces: UART (Serial), I2C, SPI, USB, MIPI CSI
> > - Interrupt Controller: CLINT and PLIC
> > - Memory Management: Sv39 MMU
> > - OpenSBI Supervisor Binary Interface and U-Boot Bootloader
> > - Bootable microSD: Boot NuttX and Linux
> >
> > But there's a catch:
> > - Limited RAM (64 MB): It's not for gaming and servers
> > - Flash Memory is Empty: Needs a One-Time Flashing (via a USB Serial
> > Adapter)
> > - Barebones Form Factor: Fits on a Breadboard, Ethernet is optional
> >
> > In this article we walk through the steps to:
> > (1) Flash into Ox64 the U-Boot Bootloader and OpenSBI
> > (2) Boot Linux on a microSD Card
> > (3) Do the same to boot NuttX RTOS
> > (4) Run some Bare Metal Experiments inside the NuttX Kernel
> >
> > Check out the article here:
> >
> https://www.hackster.io/lupyuen/8-risc-v-sbc-on-a-real-time-operating-system-ox64-nuttx-474358
> >
> > Lup
> >
>


[Article] NuttX on Ox64 BL808 RISC-V SBC: Bare Metal Experiments

2023-12-16 Thread Lee, Lup Yuen
Pine64 Ox64 BL808 (64-bit RISC-V SBC) is now supported in NuttX Mainline!
(Many thanks to my reviewers)

Ox64 BL808 is an affordable $8 SBC with:
- 3 x RISC-V Cores (T-Head 64-bit / 32-bit)
- Networking: Ethernet, WiFi, Bluetooth LE, Zigbee
- Peripheral Interfaces: UART (Serial), I2C, SPI, USB, MIPI CSI
- Interrupt Controller: CLINT and PLIC
- Memory Management: Sv39 MMU
- OpenSBI Supervisor Binary Interface and U-Boot Bootloader
- Bootable microSD: Boot NuttX and Linux

But there's a catch:
- Limited RAM (64 MB): It's not for gaming and servers
- Flash Memory is Empty: Needs a One-Time Flashing (via a USB Serial
Adapter)
- Barebones Form Factor: Fits on a Breadboard, Ethernet is optional

In this article we walk through the steps to:
(1) Flash into Ox64 the U-Boot Bootloader and OpenSBI
(2) Boot Linux on a microSD Card
(3) Do the same to boot NuttX RTOS
(4) Run some Bare Metal Experiments inside the NuttX Kernel

Check out the article here:
https://www.hackster.io/lupyuen/8-risc-v-sbc-on-a-real-time-operating-system-ox64-nuttx-474358

Lup


Re: Re: minimal funcational acceptance for a new port

2023-12-12 Thread Lee, Lup Yuen
Hi yf: Kendryte K230 sounds really cool! (Dual-core T-Head C908 64-bit
RISC-V with NPU)

I'm now upstreaming to NuttX Mainline a similar board (Pine64 Ox64 SBC with
Bouffalo Lab BL808 SoC and T-Head C906). These links might be helpful:

PR for BL808 SoC: https://github.com/apache/nuttx/pull/11371

PR for Ox64 Board: https://github.com/apache/nuttx/pull/11377

T-Head C9xx might need Supervisor-Mode MMU Flags for Strongly-Ordered
Memory Type: https://github.com/apache/nuttx/pull/11365

Adding a new SoC and Board:
https://lupyuen.github.io/articles/release#add-the-nuttx-arch-and-board

PR Tips: https://lupyuen.github.io/articles/pr

Please drop me a note if you have any questions. Thanks! :-)

Lup

On Tue, Dec 12, 2023 at 10:03 PM yfliu2008  wrote:

> Alan,
>
>
> Thanks for the advices.
>
>
> I just have ostest passed after minor tweak in
> 'risc-v/src/common/riscv_mtimer.c' with a new case bring by this SoC. So I
> think it is better to discuss using a PR.
>
>
> Regards,
>
> yf
>
>
>
>
>
>
>
>
>
>
> Original
>
>
>
> From:"Alan C. Assis"< acas...@gmail.com ;
>
> Date:2023/12/12 21:42
>
> To:"dev"< dev@nuttx.apache.org ;
>
> Subject:Re: minimal funcational acceptance for a new port
>
>
> Hi yf,
> Since you already got the nsh working and even some applications running,
> it is fine to submit to the mainline.
>
> About these issues, please include that information in your board
> documentation (just below the picture and the features of the board) in an
> section like: "Known issues".
>
> Best Regards,
>
> Alan
>
> On Tue, Dec 12, 2023 at 2:25 AM yfliu2008  wrote:
>
>  Hi,
> 
> 
> 
> 
>  I am trying NuttX with a CanMV board based on Kendryte K230
>  SoC.
> 
> 
> 
> 
>  So far I can use the nsh and a few simple apps (like hello). The
> ostest
>  still isn't fully working, probably due to time related details.
> 
> 
> 
> 
>  as a NuttX newbie, there must be a lot learning that takes time, also
> the
>  k230 SoC has many features and there will be a long way to support
> more of
>  it. So I guess it will be a long journey.
> 
> 
> 
> 
>  I am wondering if I should submit PR now or wait until some
>  functional acceptance are passed?
> 
> 
> 
> 
>  Regards,
> 
>  yf


Re: [Article] NuttX on Ox64 BL808 RISC-V SBC: Fixed the UART Interruptand Platform-Level Interrupt Controller

2023-12-11 Thread Lee, Lup Yuen
Thanks yf! I believe T-Head C908 and other C9xx RISC-V Cores will need the
T-Head Errata for Strongly-Ordered Memory Type, according to this Linux
Patch:

https://patchwork.kernel.org/project/linux-riscv/patch/20210911092139.79607-3-guo...@kernel.org/#24450685

The post suggests that T-Head will switch to the new RISC-V Svpbmt
Extension for newer RISC-V Cores. But I don't believe Svpbmt is used by any
RISC-V Core yet.

Lup

On Mon, Dec 11, 2023 at 8:30 PM yfliu2008  wrote:

> Congratulations!
>
>
> Do you know if T-Head C908 needs the errata?
>
>
>
> Regards,
> yf
>
>
>
>
> Original
>
>
>
> From:"Lee, Lup Yuen"< lu...@appkaki.com ;
>
> Date:2023/12/10 7:11
>
> To:"dev"< dev@nuttx.apache.org ;
>
> Subject:[Article] NuttX on Ox64 BL808 RISC-V SBC: Fixed the UART
> Interruptand Platform-Level Interrupt Controller
>
>
> Last week we walked through the Serial Console for Pine64 Ox64 BL808 64-bit
> RISC-V Single-Board Computer. And we hit some illogical impossible problems
> on NuttX for Ox64:
>
> (1) Console Input is always empty. (Can’t enter any Console Commands)
> (2) Interrupt Claim is forever 0. (Ox64 won’t tell us which Interrupt was
> fired!)
> (3) Leaky Writes are mushing up adjacent Interrupt Registers. (Or maybe
> Leaky Reads?)
>
> Today we discover the One Single Culprit behind all this rowdy mischief:
> Weak Ordering in the MMU! (Memory Management Unit)
>
> Here’s how we solved the baffling mystery:
> https://lupyuen.codeberg.page/articles/plic3.html
>
> Lup


Re: [Article] NuttX on Ox64 BL808 RISC-V SBC: Fixed the UART Interrupt and Platform-Level Interrupt Controller

2023-12-10 Thread Lee, Lup Yuen
Thanks Alan! Nope sorry I haven't tested on Sipeed M1s, I should get it
someday.

I'm preparing a PR that will extend the RISC-V MMU Flags from 32-bit to
64-bit, because:

(1) T-Head C906 (BL808) needs us to set Bits 59 to 63 in a Leaf Page Table
Entry to configure the Memory Type: Cacheable / Bufferable /
Strongly-Ordered

(2) Newer RISC-V Cores will use the Svpbmt Extension (Bits 61 to 62) to
configure the Memory Type (Cacheable / Strongly-Ordered)

More about Svpbmt:
https://github.com/riscv/riscv-isa-manual/blob/main/src/supervisor.adoc#svpbmt

Lup

On Sun, Dec 10, 2023 at 10:04 PM Alan C. Assis  wrote:

> Hi Lup,
>
> Nice to know you found the issue (and Linux errata for T-Head C906 helped),
> that BUG is really strange.
>
> Probably a similar issue could exist on MILK-V board too.
>
> Did you test NuttX on Sipeed M1s Dock AI + IoT BL808 RISC-V?
>
> Unfortunately Pine 0x64 doesn't ship to Brazil (probably many buyers let
> the boards return after getting notified of higher taxes from Brazilian
> Customs).
>
> Best Regards,
>
> Alan
>
> On Sat, Dec 9, 2023 at 8:11 PM Lee, Lup Yuen  wrote:
>
> > Last week we walked through the Serial Console for Pine64 Ox64 BL808
> 64-bit
> > RISC-V Single-Board Computer. And we hit some illogical impossible
> problems
> > on NuttX for Ox64:
> >
> > (1) Console Input is always empty. (Can’t enter any Console Commands)
> > (2) Interrupt Claim is forever 0. (Ox64 won’t tell us which Interrupt was
> > fired!)
> > (3) Leaky Writes are mushing up adjacent Interrupt Registers. (Or maybe
> > Leaky Reads?)
> >
> > Today we discover the One Single Culprit behind all this rowdy mischief:
> > Weak Ordering in the MMU! (Memory Management Unit)
> >
> > Here’s how we solved the baffling mystery:
> > https://lupyuen.codeberg.page/articles/plic3.html
> >
> > Lup
> >
>


[Article] NuttX on Ox64 BL808 RISC-V SBC: Fixed the UART Interrupt and Platform-Level Interrupt Controller

2023-12-09 Thread Lee, Lup Yuen
Last week we walked through the Serial Console for Pine64 Ox64 BL808 64-bit
RISC-V Single-Board Computer. And we hit some illogical impossible problems
on NuttX for Ox64:

(1) Console Input is always empty. (Can’t enter any Console Commands)
(2) Interrupt Claim is forever 0. (Ox64 won’t tell us which Interrupt was
fired!)
(3) Leaky Writes are mushing up adjacent Interrupt Registers. (Or maybe
Leaky Reads?)

Today we discover the One Single Culprit behind all this rowdy mischief:
Weak Ordering in the MMU! (Memory Management Unit)

Here’s how we solved the baffling mystery:
https://lupyuen.codeberg.page/articles/plic3.html

Lup


[Article] NuttX on Ox64 BL808 RISC-V SBC: UART Interrupt and Platform-Level Interrupt Controller (PLIC)

2023-12-02 Thread Lee, Lup Yuen
Our article today is all about RISC-V Interrupts on the tiny adorable
Pine64 Ox64 BL808 64-bit Single-Board Computer (based on Bouffalo Lab BL808
SoC)…

(1) What’s inside the Platform-Level Interrupt Controller (PLIC)
(2) Setting up the PLIC at startup
(3) Enabling the PLIC Interrupt for Serial Console
(4) Handling PLIC Interrupts for UART Input

We’ll walk through the steps with our work-in-progress NuttX on Ox64. But
we’ll hit a bumpy journey…

(5) Leaky Writes seem to affect adjacent PLIC Registers
(6) Interrupt Claim doesn’t seem to work right

Check out the article: https://lupyuen.codeberg.page/articles/plic2.html

Lup


[Article] NuttX on Ox64 BL808 RISC-V SBC: NuttX Apps and Initial RAM Disk

2023-11-25 Thread Lee, Lup Yuen
In Asia the wise folks say: “One can hide on a certain day but cannot hide
for a long time / 躲过初一,躲不过十五”

In other words: “Transformers? More than meets the eye!”

In this article, we go behind the shadow puppetry (wayang kulit) and
deceptive simplicity of NuttX Applications inside Apache NuttX RTOS for
Pine64 Ox64 BL808 64-bit RISC-V SBC:

(1) What’s inside the simplest NuttX App
(2) How NuttX Apps make RISC-V System Calls to NuttX Kernel
(3) Virtual Memory for NuttX Apps
(4) Loading of ELF Executables by NuttX Kernel
(5) Bundling of NuttX Apps into the Initial RAM Disk
(6) How we found the right spot to park our Initial RAM Disk

Check out the article: https://lupyuen.codeberg.page/articles/app.html

Lup


Re: [Article] NuttX on Ox64 BL808 RISC-V SBC: Sv39 Memory Management Unit

2023-11-19 Thread Lee, Lup Yuen
Thanks Ken! Yep you read my mind, I'll write about NuttX Apps in the next
article:

(1) What's inside the simplest "Hello World" app
(2) How NuttX Apps call NuttX Kernel with "ecall"
(3) Bundling the NuttX Apps into the Initial RAM Disk (initrd) for Ox64
BL808 SBC. (We'll append the initrd to the NuttX Kernel for easier booting
with U-Boot. It's kinda messy right now for Star64 JH7110, as you have
discovered)

Stay tuned :-)

Lup

On Mon, Nov 20, 2023 at 2:47 AM  wrote:

> Lup,
>
> Another great article!
>
>
> One suggestion.
>
> In section 10 "Swap the SATP Register"
>
> You mention:
>
> "Huh? Our Applications can meddle with the I/O Memory?
>
> Nope they can’t, because the “U” User Permission is denied. Therefore
> we’re all safe and well protected!
> "
>
> I may have missed the reference, but this might be a place to introduce
> the idea that Kernel trampoline, eCalls, and so forth make use of kernel
> memory being mapped and available in all User address spaces so the
> Kernel's handling code does not have to immediately swap SATP to access
> its data structures.
>
> I know this is a large topic on its own, but am important trick to
> learn.
>
> Again, great article!  Thanks!!
> -KenD
>


[Article] NuttX on Ox64 BL808 RISC-V SBC: Sv39 Memory Management Unit

2023-11-18 Thread Lee, Lup Yuen
Memory Management Unit (MMU) is the hardware inside our Single-Board
Computer (SBC) that implements Memory Protection and Virtual Memory.

Sv39 is the RISC-V MMU inside the Pine64 Ox64 SBC, based on Bouffalo Lab
BL808 SoC.

In this article, we boot NuttX on Ox64 SBC to find out how Sv39 MMU works
with:
(1) Memory Protection (for our Kernel)
(2) Virtual Memory (for the Applications)
As we record everything that happens when NuttX configures the Sv39 MMU.

Check out the article: https://lupyuen.codeberg.page/articles/mmu.html

Lup


Re: [Article] Starting NuttX on Ox64 BL808 RISC-V SBC

2023-11-11 Thread Lee, Lup Yuen
Thanks Tomek! Yep NuttX for Star64 JH7110 (SiFive Cores) will boot OK on
Ox64 BL808 (T-Head Core) with some minor changes to the Memory Map and UART
Driver.

I'm now making proper fixes to the Ox64 Memory Map, UART Driver and
Interrupt Controller, before submitting the Pull Request :-)

Lup

On Sun, Nov 12, 2023 at 7:37 AM Tomek CEDRO  wrote:

> On Sun, Nov 12, 2023 at 12:18 AM Lee, Lup Yuen wrote:
> > Last week we booted Linux on the Pine64 Ox64 64-bit RISC-V SBC, powered
> by
> > Bouffalo Lab BL808 SoC. And we wondered if a tiny 64-bit RTOS like NuttX
> > might run more efficiently on Ox64. (With only 64 MB of RAM)
> >
> > Let’s make it happen! In this article we...
> > (1) Begin with NuttX for Star64 JH7110 RISC-V SBC
> > (2) Boot it unmodified (!) on our Ox64 BL808 RISC-V SBC
> > (3) Add Debug Logs in RISC-V Assembly
> > (4) Tweak the NuttX UART Driver to print on Ox64
> > (5) Fix the Platform-Level Interrupt Controller
> > (6) Track down why RISC-V Exceptions aren’t dumped correctly
> > (7) And plan for the upcoming Initial RAM Disk
> >
> > Check out the article: https://lupyuen.codeberg.page/articles/ox2.html
>
> Congratulations Lup! So the same code from 1 and 2 worked fine??? Is
> RISC-V generic enough among different CPU/MCU/SoC implementations??
> :-)
>
> --
> CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
>


[Article] Starting NuttX on Ox64 BL808 RISC-V SBC

2023-11-11 Thread Lee, Lup Yuen
Last week we booted Linux on the Pine64 Ox64 64-bit RISC-V SBC, powered by
Bouffalo Lab BL808 SoC. And we wondered if a tiny 64-bit RTOS like NuttX
might run more efficiently on Ox64. (With only 64 MB of RAM)

Let’s make it happen! In this article we...
(1) Begin with NuttX for Star64 JH7110 RISC-V SBC
(2) Boot it unmodified (!) on our Ox64 BL808 RISC-V SBC
(3) Add Debug Logs in RISC-V Assembly
(4) Tweak the NuttX UART Driver to print on Ox64
(5) Fix the Platform-Level Interrupt Controller
(6) Track down why RISC-V Exceptions aren’t dumped correctly
(7) And plan for the upcoming Initial RAM Disk

Check out the article: https://lupyuen.codeberg.page/articles/ox2.html

Lup


[Article] NuttX on Ox64 BL808 RISC-V SBC

2023-11-04 Thread Lee, Lup Yuen
Pine64 Ox64 is an affordable RISC-V SBC ($8) based on Bouffalo Lab BL808
SoC with 3 (Asymmetric) RISC-V Cores:

(1) D0 Multimedia Core: 64-bit T-Head C906 with MIPI CSI, Neural Processing
Unit
(2) M0 Wireless Core: 32-bit T-Head E907 with WiFi, Bluetooth LE, Zigbee,
Audio, USB, Ethernet
(3) Low Power Core: 32-bit T-Head E902

In this article we explore how NuttX might run on Ox64 (with OpenSBI and
U-Boot Bootloader).

Check out the article: https://lupyuen.codeberg.page/articles/ox64.html

Lup


[Article] NuttX on Star64 JH7110: OpenSBI (Supervisor Binary Interface)

2023-10-28 Thread Lee, Lup Yuen
Bare Metal Programming on a RISC-V SBC (Single-Board Computer) sounds
difficult. Thankfully we can get help from the OpenSBI Supervisor Binary
Interface! (A little like BIOS, but for RISC-V)

In this article, we boot NuttX on Star64 JH7110 RISC-V SBC (and
VisionFive2) to experiment with OpenSBI:

(1) Print to the Serial Console
(2) Set a System Timer
(3) Query the RISC-V CPUs
(4) Fetch the System Information
(5) And Shutdown / Reboot our SBC

Check out the article: https://lupyuen.codeberg.page/articles/sbi.html

Lup


Re: [VOTE] Apache NuttX 12.3.0 RC1 release

2023-10-18 Thread Lee, Lup Yuen
+1 for PinePhone and Star64

Minor Issue: Building PinePhone on macOS shows the message "sed: illegal
option -- r" and still builds OK. The patch has been merged, we can add
this to the next release: https://github.com/apache/nuttx/pull/10881

= PinePhone Compiler
+ aarch64-none-elf-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-none-elf-gcc
COLLECT_LTO_WRAPPER=/Applications/ArmGNUToolchain/11.3.rel1/aarch64-none-elf/bin/../libexec/gcc/aarch64-none-elf/11.3.1/lto-wrapper
Target: aarch64-none-elf
Configured with:
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/gcc/configure
--target=aarch64-none-elf
--prefix=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install
--with-gmp=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-mpfr=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-mpc=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-isl=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--disable-shared --disable-nls --disable-threads --disable-tls
--enable-checking=release --enable-languages=c,c++,fortran --with-newlib
--with-gnu-as --with-gnu-ld
--with-sysroot=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install/aarch64-none-elf
--with-pkgversion='Arm GNU Toolchain 11.3.Rel1' --with-bugurl=
https://bugs.linaro.org/
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 11.3.1 20220712 (Arm GNU Toolchain 11.3.Rel1)

= PinePhone Configuration
+ ./tools/configure.sh pinephone:nsh

= PinePhone Size
+ aarch64-none-elf-size nuttx
   text   databssdechex filename
 223903  12913  41612 278428  43f9c nuttx

= PinePhone NSH Info and Free
NuttShell (NSH) NuttX-12.3.0
nsh> uname -a
NuttX 12.3.0 8fdb56b5f2 Oct 18 2023 16:04:29 arm64 pinephone
nsh> free
   total   used   freelargest  nused  nfree
Umem:  133406712 551512  132855200  132855104 58  2

= Star64 Compiler
+ riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/Users/Luppy/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin/bin/../libexec/gcc/riscv64-unknown-elf/10.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with:
/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/build/riscv64-unknown-elf-gcc/riscv-gcc/configure
--target=riscv64-unknown-elf
--prefix=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin
--with-pkgversion='SiFive GCC-Metal 10.2.0-2020.12.8' --with-bugurl=
https://github.com/sifive/freedom-tools/issues --disable-shared
--disable-threads --enable-languages=c,c++ --enable-tls --with-newlib
--with-sysroot=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin/riscv64-unknown-elf
--with-native-system-header-dir=/include --disable-libmudflap
--disable-libssp --disable-libquadmath --disable-libgomp --disable-nls
--disable-tm-clone-registry --src=../riscv-gcc --with-system-zlib
--enable-checking=yes --enable-multilib --with-abi=lp64d
--with-arch=rv64imafdc CFLAGS=-O2 CXXFLAGS=-O2 'CFLAGS_FOR_TARGET=-Os
-mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medany'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (SiFive GCC-Metal 10.2.0-2020.12.8)

= Star64 Configuration
+ ./tools/configure.sh star64:nsh

= Star64 Size
+ riscv64-unknown-elf-size nuttx
   text   databssdechex filename
 168996641  23984 193621  2f455 nuttx

= Star64 NSH Info and Free
NuttShell (NSH) NuttX-12.3.0
nsh> uname -a
NuttX 12.3.0 8fdb56b5f2 Oct 18 2023 16:09:46 risc-v star64
nsh> free
   total   used   freelargest  nused  nfree
Kmem:2065400  1460020508002049440 50  3
Page:   20971520 643072   20328448   20328448

PinePhone Script:
https://gist.github.com/lupyuen/cdd99bf29ac039b1d8ba185beb4aba00

PinePhone Log:
https://gist.github.com/lupyuen/34078e968667c9daff76843d0ef2745c

Star64 Script:
https://gist.github.com/lupyuen/6003914adc6473922712acb7fa9cad17

Star64 Log: https://gist.github.com/lupyuen/9c7f6e332045323134d2f34a586fea5d

Lup

On Wed, Oct 18, 2023 at 3:18 PM Alin Jerpelea  wrote:

> Hello all,
> Apache NuttX 12.3.0 RC1 has been staged under [1] and it's
> time to vote on accepting it for release. Voting will be open for 72hr.
>
> A minimum of 3 binding +1 votes and more binding +1 than binding -1 are
> required to pass.
>
> The Apache requirements for approving a release can be found here [3]
> "Before voting +1 PMC members 

Re: [VOTE] Apache NuttX 12.3.0 RC0 release

2023-10-09 Thread Lee, Lup Yuen
+1 for PinePhone and Star64

Minor Issue: Building on macOS shows "sed: illegal option -- r", probably
because macOS sed works differently from Linux. I'll track down the PR that
caused this.

Here are the sed messages:
https://gist.github.com/lupyuen/1c3f1f1d71993609bed3b31767595beb#file-pinephone-release-log-L282-L512

= PinePhone Compiler
+ aarch64-none-elf-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-none-elf-gcc
COLLECT_LTO_WRAPPER=/Applications/ArmGNUToolchain/11.3.rel1/aarch64-none-elf/bin/../libexec/gcc/aarch64-none-elf/11.3.1/lto-wrapper
Target: aarch64-none-elf
Configured with:
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/gcc/configure
--target=aarch64-none-elf
--prefix=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install
--with-gmp=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-mpfr=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-mpc=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-isl=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--disable-shared --disable-nls --disable-threads --disable-tls
--enable-checking=release --enable-languages=c,c++,fortran --with-newlib
--with-gnu-as --with-gnu-ld
--with-sysroot=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install/aarch64-none-elf
--with-pkgversion='Arm GNU Toolchain 11.3.Rel1' --with-bugurl=
https://bugs.linaro.org/
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 11.3.1 20220712 (Arm GNU Toolchain 11.3.Rel1)

= PinePhone Configuration
+ ./tools/configure.sh pinephone:nsh

= PinePhone Size
+ aarch64-none-elf-size nuttx
   text   databssdechex filename
 223895  12913  41612 278420  43f94 nuttx

= PinePhone NSH Info and Free
NuttShell (NSH) NuttX-12.3.0
nsh> uname -a
NuttX 12.3.0 1d349a2a32 Oct  9 2023 16:15:01 arm64 pinephone
nsh> free
   total   used   freelargest  nused  nfree
Umem:  133406712 551512  132855200  132855104 58  2

= Star64 Compiler
+ riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/Users/Luppy/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-apple-darwin/bin/../libexec/gcc/riscv64-unknown-elf/10.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with:
/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/build/riscv64-unknown-elf-gcc/riscv-gcc/configure
--target=riscv64-unknown-elf
--prefix=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin
--with-pkgversion='SiFive GCC-Metal 10.2.0-2020.12.8' --with-bugurl=
https://github.com/sifive/freedom-tools/issues --disable-shared
--disable-threads --enable-languages=c,c++ --enable-tls --with-newlib
--with-sysroot=/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--build-binary-packages--parameterized/obj/x86_64-apple-darwin/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-apple-darwin/riscv64-unknown-elf
--with-native-system-header-dir=/include --disable-libmudflap
--disable-libssp --disable-libquadmath --disable-libgomp --disable-nls
--disable-tm-clone-registry --src=../riscv-gcc --with-system-zlib
--enable-checking=yes --enable-multilib --with-abi=lp64d
--with-arch=rv64imafdc CFLAGS=-O2 CXXFLAGS=-O2 'CFLAGS_FOR_TARGET=-Os
-mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medany'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (SiFive GCC-Metal 10.2.0-2020.12.8)

= Star64 Configuration
+ ./tools/configure.sh star64:nsh

= Star64 Size
+ riscv64-unknown-elf-size nuttx
   text   databssdechex filename
 168996641  23984 193621  2f455 nuttx

= Star64 NSH Info and Free
NuttShell (NSH) NuttX-12.3.0
nsh> uname -a
NuttX 12.3.0 1d349a2a32 Oct  9 2023 17:08:13 risc-v star64
nsh> free
   total   used   freelargest  nused  nfree
Kmem:2065400  1460020508002049440 50  3
Page:   20971520 643072   20328448   20328448

PinePhone Release Script:
https://gist.github.com/lupyuen/fbc2d0b7fb5dfbc62b4f9b3aae8626ea

PinePhone Release Log:
https://gist.github.com/lupyuen/1c3f1f1d71993609bed3b31767595beb

Star64 Release Script:
https://gist.github.com/lupyuen/f19eb54140a1d09811d42ed143810b36

Star64 Release Log:
https://gist.github.com/lupyuen/0ea8f3ac61e07d8b6e308e31ed5f7734

Lup

On Mon, Oct 9, 2023 at 3:27 PM Alin Jerpelea  wrote:

> Hello all,
> Apache NuttX 12.3.0 RC0 has been staged under [1] and it's
> time to vote on accepting it for release. Voting will be open for 72hr.
>
> A minimum of 3 binding +1 votes and more binding +1 than binding -1 are
> required to 

Re: riscv64 libm link question

2023-09-17 Thread Lee, Lup Yuen
Here's what Ken and I have tried for the riscv64 libm linking problem:

(1) The recommended toolchain for NuttX on riscv64 is SiFive Freedom Tools.
But it doesn't support Raspberry Pi OS (64-bit Debian).

(2) So we used Debian gcc-riscv64-unknown-elf instead. Which shows the
missing libm error that Ken described.

(3) We're trying an alternative toolchain: xPack GNU RISC-V Embedded GCC.
Which might fix the libm problem, but we're not sure if it's supported for
NuttX.

Wonder if anyone has tried building riscv64 NuttX on Raspberry Pi OS /
Arm64 Linux? More details below. Thanks!

https://lupyuen.github.io/articles/riscv#appendix-xpack-gnu-risc-v-embedded-gcc-toolchain-for-64-bit-risc-v

https://lupyuen.github.io/articles/release#appendix-missing-mathh

Lup

On Mon, Sep 18, 2023 at 4:15 AM  wrote:

> On 2023-09-17 12:47, Petro Karashchenko wrote:
> > Hi,
> >
> > What kind of RISC-V toolchain are you using?
>
> Raspian:RasPi4:~/RISCV/NuttX/apps >>> apt search riscv64-unknown
> Sorting... Done
> Full Text Search... Done
> binutils-riscv64-unknown-elf/oldstable,now 2.32.2020.04+dfsg-2 arm64
> [installed]
>GNU assembler, linker and binary utilities for RISC-V processors
>
> gcc-riscv64-unknown-elf/oldstable,now 8.3.0.2019.08+dfsg-1 arm64
> [installed]
>GCC compiler for embedded RISC-V chips
>
> picolibc-riscv64-unknown-elf/oldstable,oldstable,now 1.5.1-2 all
> [installed]
>Smaller embedded C library for RISC-V development
>
> So just `sudo apt-get install ...` of the above.
>
> > Please try to remove  "CFLAGS += -lm " and feedback if that helps.
>
> No change.
>
> The problem is not that I am trying to use some released libm library
> but that the NuttX nuttx/libs/libm/libm.a is not being linked into the
> scheme binary file.
>
> I have not used other than trivial makefiles in a couple of decades,
> never used `make menuconfig`, which allows one to specify many
> non-bootable systems, and so have little clue how to specify linking the
> NuttX libm into the scheme executable or alternately getting nuttx to
> dynamically load the libm library.
>
> Note that there is no file 'kconfig-language.txt' in the NuttX tools
> repository.
>
> I am kinda stuck.  Thanks for any help!
> -KenD
>
>


[Article] NuttX on Star64 JH7110: Power Up the Display Controller with U-Boot Bootloader

2023-09-02 Thread Lee, Lup Yuen
In olden days we’d "peek" and "poke" the Display Controller, to see weird
and wonderful displays. Today (46 years later), we poke around the Display
Controller of Star64 JH7110 RISC-V SBC with a modern tool (not BASIC):
U-Boot Bootloader!

In this article we discover…
(1) U-Boot Commands "md" and "mw" for Dumping and Writing Memory
(2) That we use to power up the Video Output and Display Controller on the
StarFive JH7110 SoC
(3) By modding the JH7110 Registers for Power Management Unit, Clock and
Reset
(4) Also how we’ll create our NuttX Display Driver for JH7110
(5) In spite of the Missing and Incorrect Docs

Here's the article: https://lupyuen.codeberg.page/articles/display3.html

Lup


[Article] NuttX on Star64 JH7110: Inside the Display Controller

2023-08-22 Thread Lee, Lup Yuen
We’re building a HDMI Display Driver for NuttX on Star64 SBC, but the
JH7110 Display Controller isn't documented!

In this article, we decipher the Official Driver for JH7110 Display
Controller and figure out how it works...

(1) What’s inside the Direct Rendering Manager (DRM) Driver for JH7110
(2) How it controls the Display Registers
(3) To handle the Display Pipeline, Display Planes and Framebuffers
(4) And how it talks to HDMI and MIPI DSI (Display Serial Interface)
(5) How we might implement our NuttX Driver

Here's the article: https://lupyuen.codeberg.page/articles/display2.html

Lup


[Article] NuttX on Star64 JH7110: Creating the First Release

2023-08-07 Thread Lee, Lup Yuen
Good News! NuttX now officially supports the Pine64 Star64 64-bit RISC-V
SBC, based on the StarFive JH7110 SoC.

(StarFive VisionFive 2 SBC will probably work too, anyone would like to
test?)

In this article we explain how we created the First Release of NuttX for
Star64 JH7110…
(1) Building NuttX for Star64
(2) Creating a Bootable microSD with NuttX Kernel and Initial RAM Disk
(3) What happens during NuttX Startup
(4) Adding the NuttX Arch (JH7110) and NuttX Board (Star64)
(5) Upcoming Features for NuttX on Star64

Which is probably helpful for folks who wish to…
- Add a new NuttX Arch (SoC) or NuttX Board
- Create NuttX Drivers (or NuttX Apps) for Star64 (or VisionFive2)
- Or simply understand how we boot a Modern SBC from scratch!

Check out the article: https://lupyuen.codeberg.page/articles/release.html

Lup


Re: [Article] NuttX on Star64 JH7110: RISC-V PLIC Interrupts and Serial I/O

2023-08-01 Thread Lee, Lup Yuen
Thanks Tomek! Here's the backup link for the article (since Codeberg is
down): https://lupyuen.github.io/articles/plic

I found out (from Hacker News) that JH7110 uses a Synopsys DesignWare 8250
UART that has a peculiar problem with the Line Control Register (LCR)... If
we write to LCR while the UART is busy, it will trigger spurious UART
Interrupts.

The fix is to wait for the UART to be not busy before writing to LCR.
Here's my proposed patch for the NuttX 16550 UART Driver
(drivers/serial/uart_16550.c):
https://github.com/lupyuen2/wip-pinephone-nuttx/pull/36/files#diff-f208234edbfb636de240a0fef1c85f9cecb37876d5bc91ffb759f70a1e96b1d1

We're all ready to merge NuttX for JH7110! :-)

Lup

On Wed, Aug 2, 2023 at 7:19 AM Tomek CEDRO  wrote:

> On Wed, Aug 2, 2023 at 1:14 AM Lee, Lup Yuen  wrote:
> > NuttX on Star64 JH7110 RISC-V SBC is almost ready! But we're stuck with
> > 16550 UART Controller firing too many Spurious Interrupts.
>
> Good luck Lup! IRQ storm is (was?) known problem on a desktop machines
> too! I hope you fight that beast soon :-) :-)
>
> --
> CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
>


[Article] NuttX on Star64 JH7110: RISC-V PLIC Interrupts and Serial I/O

2023-08-01 Thread Lee, Lup Yuen
NuttX on Star64 JH7110 RISC-V SBC is almost ready! But we're stuck with
16550 UART Controller firing too many Spurious Interrupts.

In this article, we explain…
(1) Why there’s No Console Output from NuttX Apps
(2) How Serial I/O works in NuttX QEMU
(3) How UART I/O differs for Star64 vs QEMU
(4) What’s the RISC-V Platform-Level Interrupt Controller (PLIC)
(5) Why we delegate RISC-V Machine-Mode Interrupts to Supervisor-Mode
(6) How NuttX Star64 handles UART Interrupts
(7) Which leads to a new problem: 16550 UART Controller fires too many
Spurious Interrupts!

Check out the article: https://lupyuen.codeberg.page/articles/plic.html

Lup


[Article] NuttX on Star64 JH7110: RISC-V Semihosting and Initial RAM Disk

2023-07-27 Thread Lee, Lup Yuen
NuttX crashes on Star64 JH7110 RISC-V SBC because there's no Semihosting.
But no worries! We modified NuttX to boot with an Initial RAM Disk instead
(initrd).

In this article, we find out…
(1) What’s RISC-V Semihosting
(2) Why it crashes NuttX on Star64
(3) How it affects the Apps Filesystem in NuttX
(4) How we replaced Semihosting by Initial RAM Disk “initrd”
(5) After testing on QEMU Emulator
(6) Thanks to NuttX on LiteX Arty-A7 for the guidance!

Check out the article: https://lupyuen.codeberg.page/articles/semihost.html

Lup


Re: Raspberry pi 4 Support

2023-07-19 Thread Lee, Lup Yuen
Hi Joseph: I think we could follow the same porting steps as I did for
PinePhone? (Allwinner A64 / Cortex-A53)

We started by booting NuttX with the U-Boot Bootloader:
https://lupyuen.github.io/articles/uboot

Then we built up the NuttX Drivers. Check out the articles here:
https://github.com/lupyuen/pinephone-nuttx#apache-nuttx-rtos-for-pinephone

Lup

On Thu, Jul 20, 2023 at 7:18 AM Joseph Gonzalez  wrote:

> Thanks for the info, this seems like a great side project. I am new into
> BSP development. What steps do you think are necessary to bring support to
> the RPi 4?
>
> > El 19 jul. 2023, a las 12:13, Gregory Nutt 
> escribió:
> >
> > Support for the RPi zero with the BCM2708 was started and was partially
> functional, but was never finished:
> >>
> >>  *
> https://bitbucket.org/patacongo/obsoleted/src/master/nuttx/arch/arm/src/bcm2708/
> >>  *
> https://bitbucket.org/patacongo/obsoleted/src/master/nuttx/configs/pizero/
> >>
> > This is, of course, all available in GIT as well.  Commits
> a0a537a9f0b8acb04c9d4873612d38c9ad35c6d3 and
> f50ff845108bbe182e5255b3d723f925cb560c30
> >
>
>


Re: [Article] NuttX on Star64 JH7110: RISC-V Privilege Levels and UART Registers

2023-07-18 Thread Lee, Lup Yuen
Thanks Nathan! I'm still getting used to NuttX Kernel Mode and RISC-V
Machine / Supervisor Modes, so I thought I might stick with QEMU Kernel
Mode and make it work on Star64.

But you're right, when I'm more familiar with Star64, I ought to explore
more of CONFIG_ARCH_USE_S_MODE and RISC-V Machine Mode :-)

Lup

On Wed, Jul 19, 2023 at 10:25 AM Nathan Hartman 
wrote:

> On Tue, Jul 18, 2023 at 7:33 PM Lee, Lup Yuen  wrote:
>
> > We’re in the super-early stage of porting NuttX to the Pine64 Star64
> 64-bit
> > RISC-V SBC. (Based on StarFive JH7110 SoC)
> >
> > In this article we’ll talk about the interesting things that we learnt
> > about RISC-V and Star64 JH7110…
> >
> > (1) What are RISC-V Privilege Levels
> >  (And why they make NuttX a little more complicated)
> >
> > (2) What is NuttX Kernel Mode
> >  (And how it differs from Flat Mode)
> >
> > (3) All about JH7110’s UART Registers
> >  (And how they are different from other 16550 UARTs)
> >
> > (4) Why (naively) porting NuttX from QEMU to Star64 might become really
> > challenging!
> >  (Thankfully we have the LiteX Arty-A7 and PolarFire Icicle ports)
> >
> > https://lupyuen.codeberg.page/articles/privilege.html
> >
> > Lup
> >
>
> Beautiful article!
>
> Question: In section 6, "NuttX flat mode becomes kernel mode," isn't it
> possible to set CONFIG_ARCH_USE_S_MODE for the FLAT build as well? Since
> the board's built-in firmware switches from Machine Mode to Supervisor Mode
> before calling U-Boot -> NuttX, I think that all configurations running on
> this board should select CONFIG_ARCH_USE_S_MODE by default. This can be set
> in Kconfig by default whenever this board is selected, so there is no need
> to remember and add it in multiple places/configs; however if someone
> figures out an alternative firmware that lets us boot NuttX on this board
> in Machine Mode, it will be easy to override. Just a thought...
>
> Thanks for a great article as always!
>
> Cheers,
> Nathan
>


[Article] NuttX on Star64 JH7110: RISC-V Privilege Levels and UART Registers

2023-07-18 Thread Lee, Lup Yuen
We’re in the super-early stage of porting NuttX to the Pine64 Star64 64-bit
RISC-V SBC. (Based on StarFive JH7110 SoC)

In this article we’ll talk about the interesting things that we learnt
about RISC-V and Star64 JH7110…

(1) What are RISC-V Privilege Levels
 (And why they make NuttX a little more complicated)

(2) What is NuttX Kernel Mode
 (And how it differs from Flat Mode)

(3) All about JH7110’s UART Registers
 (And how they are different from other 16550 UARTs)

(4) Why (naively) porting NuttX from QEMU to Star64 might become really
challenging!
 (Thankfully we have the LiteX Arty-A7 and PolarFire Icicle ports)

https://lupyuen.codeberg.page/articles/privilege.html

Lup


Re: adding a new board - files?

2023-07-18 Thread Lee, Lup Yuen
Hi Krasimir: I wrote an article about submitting a NuttX Pull Request on
GitHub, I hope this helps :-)

https://lupyuen.codeberg.page/articles/pr.html

Lup

On Tue, Jul 18, 2023 at 6:44 PM Krasimir Cheshmedzhiev <
cheshmedzh...@gmail.com> wrote:

> Hi all,
>
> I added the support of nucleo-u5a5zj-q
> I made steps described in
> https://nuttx.apache.org/docs/latest/contributing/index.html
>
> There is a button on the branch page who says "Compare & pull request"
> Do I need to push it?
> or
> Do I need to do any additional steps?
>
> Sory for dumb questions but I have never used git.
>
> Best regards
>
> -Original Message-
> From: Alan C. Assis 
> Sent: Monday, July 10, 2023 9:24 PM
> To: dev@nuttx.apache.org
> Subject: Re: adding a new board - files?
>
> Hi Krasimir,
>
> On 7/10/23, Krasimir Cheshmedzhiev  wrote:
> > Hi all,
> >
> >
> >
> > I am working on adding a nucleo-u5a5zj-q to nuttx supported boards.
> > How (where I can read) to prepare files - those which I created and
> > those which I changed, to make them part of main source tree?
> >
>
> Please follow the contribution steps:
>
> https://nuttx.apache.org/docs/latest/contributing/index.html
>
> Any issue, please let us to know.
>
> BR,
>
> Alan
>
>


[Article] Boot NuttX from Network with U-Boot and TFTP

2023-07-12 Thread Lee, Lup Yuen
Testing NuttX can get painfully tedious on a Single-Board Computer...
Swapping, reflashing and rebooting a MicroSD Card, again and again and
again! (Like how we tested NuttX on PinePhone)

Thankfully there’s a better way: Booting NuttX over the Local Network, with
U-Boot Bootloader and TFTP! In this article we’ll configure TFTP Network
Boot for testing NuttX on the new Star64 JH7110 RISC-V SBC...

https://lupyuen.codeberg.page/articles/tftp.html

Lup


Re: [VOTE] Apache NuttX 12.2.1 RC0 release

2023-07-10 Thread Lee, Lup Yuen
+1 for PinePhone

= Compiler
+ aarch64-none-elf-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-none-elf-gcc
COLLECT_LTO_WRAPPER=/Applications/ArmGNUToolchain/11.3.rel1/aarch64-none-elf/bin/../libexec/gcc/aarch64-none-elf/11.3.1/lto-wrapper
Target: aarch64-none-elf
Configured with:
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/gcc/configure
--target=aarch64-none-elf
--prefix=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install
--with-gmp=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-mpfr=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-mpc=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-isl=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--disable-shared --disable-nls --disable-threads --disable-tls
--enable-checking=release --enable-languages=c,c++,fortran --with-newlib
--with-gnu-as --with-gnu-ld
--with-sysroot=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install/aarch64-none-elf
--with-pkgversion='Arm GNU Toolchain 11.3.Rel1' --with-bugurl=
https://bugs.linaro.org/
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 11.3.1 20220712 (Arm GNU Toolchain 11.3.Rel1)

= Configuration
+ ./tools/configure.sh pinephone:nsh

= Size
+ aarch64-none-elf-size nuttx
   text   databssdechex filename
 221404  12921  41615 275940  435e4 nuttx

= NSH Info and Free
NuttShell (NSH) NuttX-12.2.1
nsh> uname -a
NuttX 12.2.1 148c631a2d Jul 11 2023 09:07:11 arm64 pinephone
nsh> free
   total   used   freelargest  nused  nfree
Umem:  133410808 551480  132859328  132859232 58  2

Complete Log:
https://gist.github.com/lupyuen/8ffc4633da0d5a22885e1ab51753f1f9

Validation Script:
https://gist.github.com/lupyuen/78238b05b94f3140a83ae187f6df4c98

Lup

On Mon, Jul 10, 2023 at 10:46 PM Alin Jerpelea  wrote:

> Hello all,
>
> Apache NuttX 12.2.1 RC0 has been staged under [1] and it's time to vote on
> accepting it for release. Voting will be open for 72hr.
>
>
>
> A minimum of 3 binding +1 votes and more binding +1 than binding -1 are
> required to pass.
>
>
>
> The Apache requirements for approving a release can be found here [3]
> "Before voting +1 [P]PMC members are required to download the signed source
> code package, compile it as provided, and test the resulting executable on
> their own platform, along with also verifying that the package meets the
> requirements of the ASF policy on releases."
>
>
>
> A document to walk through some of this process has been published on our
> project wiki and can be found here [4].
>
>
>
> [ ] +1 accept (indicate what you validated - e.g. performed the non-RM
> items in [4])
>
> [ ] -1 reject (explanation required)
>
>
>
> Thank you all,
>
> Alin Jerpelea
>
>
>
> SCM Information:
>
>   Release tag: nuttx-12.2.1-RC0
>
>   Hash for the release nuttx tag: 148c631a2d252d4d59ae4cd90d1890d2daed381d
>
>   Hash for the release nuttx-apps tag:
> 86efbcbee77bc0a29af07807080f4804a37f46a3
>
>
> [1] https://dist.apache.org/repos/dist/dev/nuttx/12.2.1-RC0/
> [2]
> https://raw.githubusercontent.com/apache/nuttx/nuttx-12.2.1-RC0/ReleaseNotes
> [3] https://www.apache.org/dev/release.html#approving-a-release
> [4]
> https://cwiki.apache.org/confluence/display/NUTTX/Validating+a+staged+Release
>


[Article] NuttX on RISC-V: Star64 JH7110 SBC

2023-07-08 Thread Lee, Lup Yuen
In this article we’ll boot a tiny bit of NuttX on the Pine64 Star64 64-bit
RISC-V Single-Board Computer. (Based on StarFive JH7110 SoC)

(1) Migrate NuttX from QEMU Emulator to Star64
(2) Print to the Serial Console in RISC-V Assembly
(3) Trick U-Boot Bootloader into thinking we’re Linux
(4) Downgrade from Machine to Supervisor Privilege Level
(5) Helped by OpenSBI Supervisor Interface

Check out the article:
https://lupyuen.codeberg.page/articles/nuttx2.html

Lup


[Article] Booting on RISC-V Star64 JH7110 SBC

2023-07-03 Thread Lee, Lup Yuen
We managed to boot a tiny bit of NuttX on the RISC-V Star64 JH7110 SBC!
(Before crashing with a Privileged Instruction Exception)

This article explains how we patched a Linux Image to boot NuttX on Star64:
https://lupyuen.codeberg.page/articles/linux.html

Lup


Re: [VOTE] Apache NuttX 12.2.0 RC0 release

2023-06-30 Thread Lee, Lup Yuen
+1 for PinePhone

= Compiler
+ aarch64-none-elf-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-none-elf-gcc
COLLECT_LTO_WRAPPER=/Applications/ArmGNUToolchain/11.3.rel1/aarch64-none-elf/bin/../libexec/gcc/aarch64-none-elf/11.3.1/lto-wrapper
Target: aarch64-none-elf
Configured with:
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/gcc/configure
--target=aarch64-none-elf
--prefix=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install
--with-gmp=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-mpfr=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-mpc=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-isl=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--disable-shared --disable-nls --disable-threads --disable-tls
--enable-checking=release --enable-languages=c,c++,fortran --with-newlib
--with-gnu-as --with-gnu-ld
--with-sysroot=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install/aarch64-none-elf
--with-pkgversion='Arm GNU Toolchain 11.3.Rel1' --with-bugurl=
https://bugs.linaro.org/
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 11.3.1 20220712 (Arm GNU Toolchain 11.3.Rel1)

= Configuration
+ ./tools/configure.sh pinephone:nsh

= Size
+ aarch64-none-elf-size nuttx
   text   databssdechex filename
 221412  12921  41615 275948  435ec nuttx

= NSH Info and Free
NuttShell (NSH) NuttX-12.2.0
nsh> uname -a
NuttX 12.2.0 26f5e973f6 Jun 30 2023 18:41:32 arm64 pinephone
nsh> free
   total   used   freelargest  nused  nfree
Umem:  133410808 551480  132859328  132859232 58  2

Complete Log:
https://gist.github.com/lupyuen/3b6f7ab19e687e5d9ca57b85df36de2a

Validation Script:
https://gist.github.com/lupyuen/73bab36c5d9fa0ccd94fefe8ea1a7195

Lup


On Fri, Jun 30, 2023 at 4:48 PM Alin Jerpelea  wrote:

> Hello all,
>
> Apache NuttX 12.2.0 RC0 has been staged under [1] and it's time to vote on
> accepting it for release. Voting will be open for 72hr.
>
>
>
> A minimum of 3 binding +1 votes and more binding +1 than binding -1 are
> required to pass.
>
>
>
> The Apache requirements for approving a release can be found here [3]
> "Before voting +1 [P]PMC members are required to download the signed source
> code package, compile it as provided, and test the resulting executable on
> their own platform, along with also verifying that the package meets the
> requirements of the ASF policy on releases."
>
>
>
> A document to walk through some of this process has been published on our
> project wiki and can be found here [4].
>
>
>
> [ ] +1 accept (indicate what you validated - e.g. performed the non-RM
> items in [4])
>
> [ ] -1 reject (explanation required)
>
>
>
> Thank you all,
>
> Alin Jerpelea
>
>
>
> SCM Information:
>
>   Release tag: nuttx-12.2.0-RC0
>
>   Hash for the release nuttx tag: 26f5e973f68a7bb4ee66915fce2c723641d5e045
>
>   Hash for the release nuttx-apps tag:
> 86efbcbee77bc0a29af07807080f4804a37f46a3
>
>
> [1] https://dist.apache.org/repos/dist/dev/nuttx/12.2.0-RC0/
> [2]
> https://raw.githubusercontent.com/apache/nuttx/nuttx-12.2.0-RC0/ReleaseNotes
> [3] https://www.apache.org/dev/release.html#approving-a-release
> [4]
> https://cwiki.apache.org/confluence/display/NUTTX/Validating+a+staged+Release
>


[Article] Inspecting the Star64 RISC-V SBC

2023-06-28 Thread Lee, Lup Yuen
Pine64 Star64 is a new 64-bit RISC-V Single-Board Computer, based on the
StarFive JH7110 SoC.

In this article we’ll…
(1) Look inside the brand new Linux Images for Star64
(2) Decompile (with Ghidra) the RISC-V Linux Kernel
(3) Figure out how NuttX might run on Star64

Check out the article here:
https://lupyuen.codeberg.page/articles/star64.html

Lup


Re: Article: 64-bit RISC-V with NuttX

2023-06-23 Thread Lee, Lup Yuen
Thanks Tomek! Yep I'm starting to port NuttX to the StarFive JH7110 SoC
(64-bit RISC-V) and Pine64 Star64 SBC. Should be really interesting :-)

https://doc-en.rvspace.org/Doc_Center/jh7110.html

https://wiki.pine64.org/wiki/STAR64

Lup

On Sat, Jun 24, 2023 at 8:05 AM Tomek CEDRO  wrote:

> VERY COOL!! :-)
>
> I have VisionFive2 SBC to play with.. would be nice to run NuttX on it :-)
>
> I made run Linux (available images) and FreeBSD (no drivers yet on BSD only
> kernel + apps over uart) on it already :-)
>
> --
> CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
>


Article: 64-bit RISC-V with NuttX

2023-06-23 Thread Lee, Lup Yuen
In this article we explore NuttX on 64-bit RISC-V...

(1) Boot NuttX on the QEMU Emulator for 64-bit RISC-V
(2) Study the Boot Code that starts NuttX on RISC-V
(3) And learn a little RISC-V Assembly!

Check out the article here:

https://lupyuen.codeberg.page/articles/riscv.html

Lup


Re: Article: NuttX for PinePhone: The First Year

2023-06-20 Thread Lee, Lup Yuen
Thanks Alan and Tomek! I had lots of fun proving that NuttX runs really
well on an Arm64 consumer gadget, now I'll do the same for NuttX on 64-bit
RISC-V :-)

Lup

On Tue, Jun 20, 2023 at 8:41 PM Alan C. Assis  wrote:

> Congratulations Lup!
>
> I think your work on PinePhone is an evolution of what people did with
> OsmocomBB and Fernvale many year ago:
>
> https://osmocom.org/projects/baseband/wiki/Fernvale
>
> I think this time we are near to get a usable feature phone running NuttX.
>
> BR,
>
> Alan
>
> On 6/19/23, Lee, Lup Yuen  wrote:
> > One year ago we started porting NuttX to PinePhone. Let’s look back and
> > talk about…
> >
> > 1. The Features that we’ve implemented
> > 2. Our Plans for the future
> > 3. Why we might move to a RISC-V Tablet!
> >
> > Check out the article here...
> >
> > https://lupyuen.codeberg.page/articles/pinephone2.html
> >
> > Lup
> >
>


Article: NuttX for PinePhone: The First Year

2023-06-19 Thread Lee, Lup Yuen
One year ago we started porting NuttX to PinePhone. Let’s look back and
talk about…

1. The Features that we’ve implemented
2. Our Plans for the future
3. Why we might move to a RISC-V Tablet!

Check out the article here...

https://lupyuen.codeberg.page/articles/pinephone2.html

Lup


Article: NuttX for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly

2023-06-09 Thread Lee, Lup Yuen
We have created an LVGL App that runs in a Web Browser and on NuttX for
PinePhone…

- We compiled LVGL Library from C to WebAssembly with Zig Compiler

- We wrote our LVGL App in the Zig Programming Language (instead of C)

- Exact same code runs in a Web Browser and on NuttX for PinePhone

Which is super helpful for prototyping LVGL Apps! Check out the details in
this article:

https://lupyuen.codeberg.page/articles/lvgl4.html

Lup


Article: LVGL in WebAssembly with Zig Compiler

2023-05-30 Thread Lee, Lup Yuen
Right now we’re creating a Feature Phone UI (in LVGL and Zig) for PinePhone
on NuttX. Would be awesome if we could prototype the Feature Phone UI in
our Web Browser… To make the UI Coding a little easier!

In this article we’ll talk about porting LVGL from PinePhone to WebAssembly…
(1) Run a Zig LVGL App on PinePhone (with NuttX)
(2) How Zig works with WebAssembly (and C Libraries)
(3) Compile LVGL Library from C to WebAssembly (with Zig Compiler)
(4) Test it with our LVGL App (in Zig)
(5) Render Simple LVGL UIs (in Web Browser)

https://lupyuen.codeberg.page/articles/lvgl3.html

Lup


Re: CI tests (was: Re: [OT] Learning Makefiles)

2023-05-23 Thread Lee, Lup Yuen
Maybe we can run the CI Tests once a day, so it's easier to backtrack? FYI
I've run Automated Tests on BL602 NuttX over the past 365 days (except for
the brief Makefile outage last week):

https://github.com/lupyuen/nuttx/tags

Here's how it works:

https://lupyuen.github.io/articles/auto

Lup

On Tue, May 23, 2023 at 3:33 PM Sebastien Lorquet 
wrote:

> Hello,
>
> even if theoretically nice to do, do we really, actually, need to do
> that for the purpose of checking *every* pull request, which are quite
> numerous?
>
> Could that not be done once before a release?
>
> Sebastien
>
> Le 22/05/2023 à 22:31, Maciej Wójcik a écrit :
> > Checking different configurations is an academic problem, I think they
> call
> > it configuration sampling and it is part of variability modelling. There
> > were some papers about sampling of Linux configurations.
> >
> > The simplest approach is to enable all possible, disable all possible,
> but
> > it is not trivial. Each selection multiplies the number of configurations
> > by the number of available options. That has very bad complexity.
> >
> > They use SAT solvers to generate many configurations instead of brute
> > force. The goal is to sample configuration space in a uniform way.
> >
> > Am Mo., 22. Mai 2023 um 21:14 Uhr schrieb Nathan Hartman <
> > hartman.nat...@gmail.com>:
> >
> >> On Mon, May 22, 2023 at 9:29 AM Sebastien Lorquet  >
> >> wrote:
> >>
> >>> If the untold reason is to speed up github tests, then run less tests.
> >>> Do we really need to test build on 13 or 20 arm platforms when only one
> >>> config of the other architectures is tested, and the actual value of
> >>> these build test is dubious?
> >>
> >>
> >> This is an interesting point. It reminds me that (at least in the old
> days,
> >> I don't know now) FreeBSD had a build config that basically enabled all
> >> options, even if that's impossible for actually running, for build
> testing.
> >> I don't know if we can do that but maybe we need one ARM config that
> >> enables as many options as possible and then use other archs for other
> >> tests.
> >>
> >> Just a thought
> >>
> >> Nathan
> >>
>


Article: PinePhone Accelerometer with NuttX (InvenSense MPU-6050)

2023-05-17 Thread Lee, Lup Yuen
When we tilt our Smartphone from Portrait to Landscape... How does it know
that we're tilting our phone? Watch what happens when we snoop the
Accelerometer Data from PinePhone's MPU-6050 Accelerometer...

https://www.hackster.io/lupyuen/inside-a-smartphone-accelerometer-pinephone-with-nuttx-rtos-b92b58

Thanks to Filipe Cavalcanti for inspiring this tutorial! :-)

BTW Hackster.io has problems for me, it got stuck at "Saving..." and lost
my edits a few times. Remember to copy and paste your Article Text into
another Backup Project at Hackster.io! :-)

Lup


Re: Article: NuttX for PinePhone: Phone Calls and Text Messages

2023-05-03 Thread Lee, Lup Yuen
Thanks Alan! Yep an LVGL GUI for Feature Phone will be super helpful for
testing Phone Calls and SMS Messages on PinePhone.

First I need to figure out how to parse AT Command Responses reliably on
NuttX :-)

https://lupyuen.github.io/articles/lte2#at-modem-api

Lup

On Wed, May 3, 2023 at 8:08 PM Alan C. Assis  wrote:

> Hi Lup,
>
> Very nice!
>
> Are you planing to create FeaturePhone interface for PinePhone?
>
> BR,
>
> Alan
>
> On 5/3/23, Lee, Lup Yuen  wrote:
> > What makes PinePhone a phone? Because it will make Phone Calls and send
> > Text Messages! Today we turn NuttX on PinePhone into a Feature Phone…
> >
> > 1. Outgoing and Incoming Phone Calls over 4G
> >
> > 2. Send and receive SMS Text Messages
> >
> > 3. Why we prefer Encoded PDU Messages for SMS
> >
> > 4. Programming the 4G LTE Modem with NuttX
> >
> > 5. Doing all these over UART vs USB
> >
> > 6. Upcoming AT Modem API for robust parsing, graceful timeout (plus
> retry)
> > and notification callbacks
> >
> > Read about it here...
> >
> > https://lupyuen.github.io/articles/lte2
> >
> > Lup
> >
>


Article: NuttX for PinePhone: Phone Calls and Text Messages

2023-05-02 Thread Lee, Lup Yuen
What makes PinePhone a phone? Because it will make Phone Calls and send
Text Messages! Today we turn NuttX on PinePhone into a Feature Phone…

1. Outgoing and Incoming Phone Calls over 4G

2. Send and receive SMS Text Messages

3. Why we prefer Encoded PDU Messages for SMS

4. Programming the 4G LTE Modem with NuttX

5. Doing all these over UART vs USB

6. Upcoming AT Modem API for robust parsing, graceful timeout (plus retry)
and notification callbacks

Read about it here...

https://lupyuen.github.io/articles/lte2

Lup


Re: How ro re-trigger CI workflow?

2023-04-22 Thread Lee, Lup Yuen
Hi Zou: Usually I rebase my branch with the Master Branch to re-trigger the
CI Workflow...

https://lupyuen.github.io/articles/pr#submit-the-pull-request

Hope this helps :-)

Lup

On Sat, Apr 22, 2023 at 4:25 PM fft  wrote:

> Hello,
>
>
> Two weeks ago, i created a PR #8999 to fix an issue of mpu60x0 drivers in
> SPI mode, but the PR was hanged due to nuttx's CI broken. it seems that the
> nuttx's CI was fixed by #9036 recently, but i don't know how to re-trigger
> CI workflow of PR #8999, I checked Github webpage, there's no button to
> re-trigger CI workflow, I searched online and there no answer as well.
> anyone who can give me some suggestion?
>
>
>
> Best regards,
> Zou


Re: MCU/Board with WiFi, BT and USB Host

2023-04-20 Thread Lee, Lup Yuen
That's correct, NuttX on PinePhone doesn't support WiFi and BT yet.

We're still working on USB Host for PinePhone:
https://lupyuen.github.io/articles/usb3

Lup

On Thu, Apr 20, 2023 at 11:07 PM Alan C. Assis  wrote:

> Hi Mr. Zou,
>
> PinePhone is a nice idea, but I'm afraid that WiFi is not supported yet
> too.
>
> Mr. Lup, could you please confirm/deny my suspect?
>
> BR,
>
> Alan
>
> On 4/20/23, fft  wrote:
> > I think PinePhone is a great choice
> >
> >
> >
> > --Original--
> > From: "PetroKarashchenko" > Date: Thu, Apr 20, 2023 09:25 PM
> > To: "dev" >
> > Subject: MCU/Board with WiFi, BT and USB Host
> >
> > 
> >
> > Hello,
> >
> > I'm looking for an MCU or better a development board that has WiFi, BT
> and
> > USB host capabilities. Can anybody give me advice for that? I need to
> > connect a CDC ACM device to that USB, so maybe there are some
> alternatives
> > that can be used (there is a device that exposes its functionality via
> USB
> > to serial), so I need to communicate with that from my device.
> > If that MCU is supported by NuttX then it would be super fantastic!
> >
> > Best regards,
> > Petro
>


Re: [VOTE] Apache NuttX 12.1.0 RC0 release

2023-04-11 Thread Lee, Lup Yuen
+1 for PinePhone

= Compiler
+ aarch64-none-elf-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-none-elf-gcc
COLLECT_LTO_WRAPPER=/Applications/ArmGNUToolchain/11.3.rel1/aarch64-none-elf/bin/../libexec/gcc/aarch64-none-elf/11.3.1/lto-wrapper
Target: aarch64-none-elf
Configured with:
/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/src/gcc/configure
--target=aarch64-none-elf
--prefix=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install
--with-gmp=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-mpfr=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-mpc=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--with-isl=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/host-tools
--disable-shared --disable-nls --disable-threads --disable-tls
--enable-checking=release --enable-languages=c,c++,fortran --with-newlib
--with-gnu-as --with-gnu-ld
--with-sysroot=/Volumes/data/jenkins/workspace/GNU-toolchain/arm-11/build-aarch64-none-elf/install/aarch64-none-elf
--with-pkgversion='Arm GNU Toolchain 11.3.Rel1' --with-bugurl=
https://bugs.linaro.org/
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 11.3.1 20220712 (Arm GNU Toolchain 11.3.Rel1)

= Configuration
+ ./tools/configure.sh pinephone:nsh

= Size
+ aarch64-none-elf-size nuttx
   text   databssdechex filename
 218576  12897  41575 273048  42a98 nuttx

= NSH Info and Free
NuttShell (NSH) NuttX-12.1.0
nsh> name -a
NuttX 12.1.0 d40f4032fc Apr 12 2023 07:11:20 arm64 pinephone
nsh> free
   total   used   freelargest  nused  nfree
Umem:  133414240 550768  132863472  132863376 56  2

Complete Log:
https://gist.github.com/lupyuen/5760e0375d44a06b3c730a10614e4d24

Validation Script:
https://gist.github.com/lupyuen/a08d3d478beefc5a492ed2dae39438f3

Lup

On Tue, Apr 11, 2023 at 4:52 PM Alin Jerpelea  wrote:

> Hello all,
> Apache NuttX 12.1.0 RC0 has been staged under [1] and it's
> time to vote on accepting it for release. Voting will be open for 72hr.
>
> A minimum of 3 binding +1 votes and more binding +1 than binding -1 are
> required to pass.
>
> The Apache requirements for approving a release can be found here [3]
> "Before voting +1 [P]PMC members are required to download the signed
> source code package, compile it as provided, and test the resulting
> executable on their own platform, along with also verifying that the
> package meets the requirements of the ASF policy on releases."
>
> A document to walk through some of this process has been published on
> our project wiki and can be found here [4].
>
> [ ] +1 accept (indicate what you validated - e.g. performed the non-RM
> items in [4])
> [ ] -1 reject (explanation required)
>
> Thank you all,
> Alin Jerpelea
>
> SCM Information:
>   Release tag: nuttx-12.1.0-RC0
>   Hash for the release nuttx tag: d40f4032fc5491d2aeb9fde37042a5be9eabeb15
>   Hash for the release nuttx-apps tag:
> 125cf7abe2d7f345c3bc58c0bdea2360fdefa170
>
> [1] https://dist.apache.org/repos/dist/dev/nuttx/12.1.0-RC0/
> [2]
> https://raw.githubusercontent.com/apache/nuttx/nuttx-12.1.0-RC0/ReleaseNotes
> [3] https://www.apache.org/dev/release.html#approving-a-release
> [4]
> https://cwiki.apache.org/confluence/display/NUTTX/Validating+a+staged+Release
>


Article: NuttX for PinePhone: 4G LTE Modem

2023-04-10 Thread Lee, Lup Yuen
Right now we’re building a Feature Phone with NuttX on PinePhone. To make
things simpler, we’re writing down everything we know about the 4G LTE
Modem, and how it works inside PinePhone…

1. What’s the Quectel EG25-G LTE Modem

2. How it’s connected inside PinePhone

3. How we make Phone Calls and send Text Messages

4. How we power up the LTE Modem

5. Programming the LTE Modem with UART, USB and NuttX

Read on to learn all about PinePhone’s 4G LTE Modem…

https://lupyuen.github.io/articles/lte

Lup


Article: NuttX for PinePhone: Simpler USB with EHCI

2023-03-23 Thread Lee, Lup Yuen
Weeks ago we talked about porting NuttX to PinePhone, and how we might turn
it into a Feature Phone.

But to make phone calls and send text messages, we need to control the LTE
Modem over USB. Thus today we’ll build a USB Driver for NuttX on PinePhone…

1. What’s USB Enhanced Host Controller Interface (EHCI)

2. Why it’s simpler than USB On-The-Go (OTG)

3. How we ported the USB EHCI Driver from NuttX to PinePhone

4. Handling USB Clocks and USB Resets on PinePhone (with tips from U-Boot
Bootloader)

5. And the NuttX EHCI Driver boots OK on PinePhone! 

https://lupyuen.github.io/articles/usb3

Lup


Article: (Clickable) Call Graph for NuttX on PinePhone

2023-03-04 Thread Lee, Lup Yuen
Last week we ran NuttX on Unicorn Emulator and we hit a baffling Arm64
Exception. In this article we’ll create some tools to troubleshoot the
exception…

1.  Render the Dynamic Call Graph for NuttX, to understand how it boots

2.  Make it Clickable, so we can browse the NuttX Source Code as we explore
the Call Graph

3.  We’ll use a Block Execution Hook in Unicorn Emulator to generate the
Call Graph with Rust

4.  And call the Rust Libraries addr2line and gimli to map the Code
Addresses to NuttX Kernel Functions

5.  Thanks to the (Clickable) Call Graph, we’ll describe the complete Boot
Sequence of NuttX on PinePhone

6.  And explain how we might do Automated Daily Build and Test for NuttX on
PinePhone

https://lupyuen.github.io/articles/unicorn2

Lup


Article: Emulate NuttX on PinePhone with Unicorn Emulator

2023-02-23 Thread Lee, Lup Yuen
Unicorn is a lightweight CPU Emulator Framework based on QEMU.

To make PinePhone testing easier, can we emulate NuttX on PinePhone with
Unicorn Emulator? In this article we’ll call Unicorn Emulator to…

1. Emulate Arm64 Machine Code

2. Attach Hooks to intercept Memory Access and Code Execution

3. Boot NuttX in the emulator

4. Simulate the UART Controller for PinePhone

5. Track an Exception in Arm64 Memory Management

https://lupyuen.github.io/articles/unicorn

Lup


Article: NuttX for PinePhone: Exploring USB

2023-02-17 Thread Lee, Lup Yuen
We're about to turn PinePhone on NuttX into a Feature Phone... But to talk
to PinePhone's LTE Modem, we need a NuttX Driver for Allwinner A64 USB
Controller.

In this article we’ll dive into PinePhone’s USB Controller…

1. Why PinePhone needs USB for Voice Calls and SMS

2. What’s inside PinePhone’s Allwinner A64 USB Controller

3. Which is actually a Mentor Graphics Inventra USB Controller

4. We’ll study the FreeBSD Driver for the USB Controller

5. And how we might port the USB Driver to NuttX

6. By comparing with the STM32 USB Driver for NuttX

https://lupyuen.github.io/articles/usb2

Lup


Re: Video: NuttX for PinePhone

2023-02-07 Thread Lee, Lup Yuen
Thanks Tomek! The video was shot in 4K on a Pixel 7 phone (the non-pro
version). The post-processing (colour grading) really helps to improve the
contrast and bring out the colours.

The "Subscribe" button appears on my computer, lemme figure out why it's
not showing on yours :-)

Lup

On Wed, Feb 8, 2023 at 8:26 AM Tomek CEDRO  wrote:

> On Wed, Feb 8, 2023 at 1:10 AM Lee, Lup Yuen wrote:
> > If we're curious how we download and boot NuttX on PinePhone, this video
> > explains the steps...
> >
> > Watch on YouTube: https://youtu.be/kGI_0yK1vws
>
> Nice video Lup! What camera do you use? Very nice sharp and colorful
> picture :-)
>
> I also noticed that there is no SUBSCRIBE button on your channel?? Is
> it on purpose?? Here is the screenshot: https://ibb.co/WsYxNvj
>
> --
> CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
>


Video: NuttX for PinePhone

2023-02-07 Thread Lee, Lup Yuen
If we're curious how we download and boot NuttX on PinePhone, this video
explains the steps...

Watch on YouTube: https://youtu.be/kGI_0yK1vws

Download the video (1.4 GB):
https://github.com/lupyuen2/wip-pinephone-nuttx/releases/tag/nuttx-12.0.3

(Sorry some bits look murky, this is my first time shooting in 4K)

Lup


Re: Article: NuttX for PinePhone: LVGL Terminal for NSH Shell

2023-02-02 Thread Lee, Lup Yuen
Thanks Alan! Handling keypresses directly in the LVGL Terminal text box
might get complicated, lemme think about it. Right now the app waits for
the Enter Key and sends the entire command to NSH, which is a lot easier.

LVGL Terminal was inspired by nxterm, so yep I must try nxterm soon :-)

Lup

On Thu, Feb 2, 2023 at 8:28 PM Alan C. Assis  wrote:

> Hi Lup,
>
> Very nice article! Kudos!!!
>
> Is it possible to modify the demo to type direclty inside the "LVGL
> terminal" screen?
>
> Did you test PinePhone nxterm too?
>
> BR,
>
> Alan
>
> On 2/2/23, Lee, Lup Yuen  wrote:
> > Now we can run NuttX Console Apps on PinePhone, without a Serial Cable!
> >
> > This article explains how we call the LVGL GUI Library to create a
> > Touchscreen Terminal App that runs NSH Commands...
> >
> > https://lupyuen.github.io/articles/terminal
> >
> > Lup
> >
>


Article: NuttX for PinePhone: LVGL Terminal for NSH Shell

2023-02-01 Thread Lee, Lup Yuen
Now we can run NuttX Console Apps on PinePhone, without a Serial Cable!

This article explains how we call the LVGL GUI Library to create a
Touchscreen Terminal App that runs NSH Commands...

https://lupyuen.github.io/articles/terminal

Lup


Article: NuttX trips ChatGPT

2023-01-28 Thread Lee, Lup Yuen
ChatGPT (the AI chatbot) will gladly answer questions about NuttX! But the
answers aren't always correct.

Let's turn this into a learning opportunity, and understand why ChatGPT's
answers are incorrect...

https://lupyuen.github.io/articles/chatgpt

Lup


Article: NuttX for PinePhone: Boot to LVGL

2023-01-21 Thread Lee, Lup Yuen
NuttX now boots with an LVGL Touchscreen App on PinePhone! (Without a
Serial Cable)

This article explains how we configured NuttX to boot LVGL, and how we
tweaked LVGL to be more Touch-Friendly on PinePhone...

https://lupyuen.github.io/articles/lvgl2

Lup


Re: Article: NuttX for PinePhone: Touch Panel

2023-01-12 Thread Lee, Lup Yuen
Yep the NuttX Driver is actually designed for Goodix GT911. But it works
great with PinePhone's GT917S :-)

We're merging the Goodix GT9XX driver to NuttX Mainline now:
https://github.com/apache/nuttx/pull/8101

Lup

On Fri, Jan 13, 2023 at 7:41 AM Bernd Walter 
wrote:

> On Fri, Jan 13, 2023 at 07:12:37AM +0800, Lee, Lup Yuen wrote:
> > PinePhone on NuttX will soon support LVGL Touchscreen Apps! This article
> > explains how we created the NuttX Driver for PinePhone's I2C Touch
> Panel...
> >
> > https://lupyuen.github.io/articles/touch2
>
> Wow - this is quite interesting.
> There are quite a few touchpanel using GT911 controllers and so far
> there is no NuttX-driver for that chip.
> I don't know the GT917 and how similar it is, but I imagine they have
> a lot in common and you even mention the GT911 in that article.
>
> --
> B.Walter  https://www.bwct.de
> Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
>


Article: NuttX for PinePhone: Touch Panel

2023-01-12 Thread Lee, Lup Yuen
PinePhone on NuttX will soon support LVGL Touchscreen Apps! This article
explains how we created the NuttX Driver for PinePhone's I2C Touch Panel...

https://lupyuen.github.io/articles/touch2

Lup


Article: NuttX for PinePhone: What is it?

2023-01-01 Thread Lee, Lup Yuen
People often ask why we're porting NuttX to Pine64 PinePhone (Arm64 /
Allwinner A64 SoC). So I wrote an FAQ about NuttX for PinePhone. Have an
Awesome 2023 everyone! :-)

https://lupyuen.github.io/articles/what

Lup


Article: NuttX for PinePhone: Framebuffer

2022-12-30 Thread Lee, Lup Yuen
LVGL now renders OK on Pine64 PinePhone with NuttX Mainline! (No Touch
Input yet though)

This article explains what's inside our new Framebuffer Driver for
PinePhone, plus a mysterious problem of missing pixels...

https://lupyuen.github.io/articles/fb

The article was "leaked" earlier to Hacker News, we have some helpful
comments on the missing pixels...

https://news.ycombinator.com/item?id=34186806

Lup


Re: Article: NuttX for PinePhone: LCD Panel

2022-12-27 Thread Lee, Lup Yuen
Yep we should show our own logo! Anyone got an SVG file? I'll turn it into
the Startup Image for PinePhone :-)

Lup

On Wed, Dec 28, 2022 at 9:21 AM Nathan Hartman 
wrote:

> On Tue, Dec 27, 2022 at 8:06 PM Alan C. Assis  wrote:
>
> > Very nice Lup! Kudos!!!
> >
> > I think we need a drivers/video/logo/ like the Linux kernel to display
> > the NuttX logo.
> >
> >
> That's a fantastic idea! Shown by default on all video-enabled devices
> unless user provides their own.
>
> Cheers,
> Nathan
>


Article: NuttX for PinePhone: LCD Panel

2022-12-27 Thread Lee, Lup Yuen
NuttX Mainline now boots with a Test Pattern on Pine64 PinePhone! (Arm64 /
Allwinner A64 SoC)

This article explains what's inside our new NuttX Driver for PinePhone's
LCD Panel...

https://lupyuen.github.io/articles/lcd

Lup


Re: Article: NuttX for PinePhone: Display Engine

2022-12-22 Thread Lee, Lup Yuen
Thanks everyone! The article landed on the front page of Hacker News,
there's a discussion about NuttX:

https://news.ycombinator.com/item?id=34100614

Lup

On Fri, Dec 23, 2022 at 8:35 AM Alan C. Assis  wrote:

> We all that need to talk you, not only for that driver, but also for
> these amazing documentation!
>
> Thank you Lup!
>
> On 12/22/22, Lee, Lup Yuen  wrote:
> > NuttX Mainline now supports the Display Engine for Allwinner A64 SoC
> > (Arm64). Many thanks to my patient reviewers for wading through a
> thousand
> > lines of code :-)
> >
> > This article explains how the A64 Display Engine will be called by the
> > upcoming LCD Driver for Pine64 PinePhone...
> >
> > https://lupyuen.github.io/articles/de3
> >
> > Lup
> >
>


Article: NuttX for PinePhone: Display Engine

2022-12-22 Thread Lee, Lup Yuen
NuttX Mainline now supports the Display Engine for Allwinner A64 SoC
(Arm64). Many thanks to my patient reviewers for wading through a thousand
lines of code :-)

This article explains how the A64 Display Engine will be called by the
upcoming LCD Driver for Pine64 PinePhone...

https://lupyuen.github.io/articles/de3

Lup


  1   2   >