Skip to content

boards: Add Nano-X Default Configs and Documents for Nuttx - #19912

Open
Acfboy wants to merge 6 commits into
apache:masterfrom
Acfboy:add-microwindows-doc
Open

boards: Add Nano-X Default Configs and Documents for Nuttx#19912
Acfboy wants to merge 6 commits into
apache:masterfrom
Acfboy:add-microwindows-doc

Conversation

@Acfboy

@Acfboy Acfboy commented Aug 20, 2026

Copy link
Copy Markdown

Summary

This PR provides documentation and defconfigs for apache/nuttx-apps#3689 in nuttx-apps, and will be converted into an official PR after the previous documentation changes #19572 are merged.

Acfboy added 5 commits August 20, 2026 22:09
Add the sim:mw defconfig and board documentation entry for the
Microwindows demo.  This configuration uses the virtual keyboard
(event mode), touchscreen, and X11-based framebuffer.

Signed-off-by: Acfboy <AcfboyU@outlook.com>
Assisted-by: Opencode/Deepseek-V4-pro
Add the qemu-intel64:mw defconfig and board documentation entry. This configuration uses the Multiboot2 framebuffer, USB HID keyboard event input at /dev/kbda, and USB HID mouse.

Signed-off-by: Acfboy <AcfboyU@outlook.com>

Assisted-by: Opencode/Deepseek-V4-pro
This page covers the Microwindows integration, quick start for both
sim:mw and qemu-intel64:mw configurations, available Kconfig options
for keyboard/mouse/framebuffer drivers, the mwdemo demo application,
and porting guidance for new hardware.

Signed-off-by: Acfboy <AcfboyU@outlook.com>
Assisted-by:  Opencode/Deepseek-V4-pro
Add sim:nanox and qemu-intel64:nanox defconfigs for the Nano-X terminal and calculator examples.

Signed-off-by: Acfboy <AcfboyU@outlook.com>
Assisted-by: Opencode/Deepseek-V4-pro
Document Nano-X client/server support, quick-start instructions, board configurations, terminal and calculator examples, and the simulator screenshot.

Signed-off-by: Acfboy <AcfboyU@outlook.com>
Assisted-by: Opencode/Deepseek-V4-pro
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@acassis

acassis commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

@Acfboy please rebase your nuttx-apps now that microwindow/nano-x was merged and please fix the errors reported here in our CI:

"Configuration/Tool: qemu-intel64/mw
2026-08-20 18:10:44

Cleaning...
Configuring...
Building NuttX...
/github/workspace/sources/apps/graphics/microwindows/microwindows/src/images/tools/convbmp.c: In function 'ConvBMP':
Warning: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/images/tools/convbmp.c:379:32: warning: declaration of 'p' shadows a previous local [-Wshadow]
379 | unsigned char p = imagebits + ipitch;
| ^
/github/workspace/sources/apps/graphics/microwindows/microwindows/src/images/tools/convbmp.c:255:8: note: shadowed declaration is here
255 | UCHAR *p = (UCHAR *)&l;
| ^
Warning: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/images/tools/convbmp.c:404:32: warning: declaration of 'p' shadows a previous local [-Wshadow]
404 | unsigned char p = imagebits + ipitch;
| ^
/github/workspace/sources/apps/graphics/microwindows/microwindows/src/images/tools/convbmp.c:255:8: note: shadowed declaration is here
255 | UCHAR *p = (UCHAR *)&l;
| ^
/github/workspace/sources/apps/graphics/microwindows/microwindows/src/images/tools/convbmp.c: In function 'DecodeRLE4':
Warning: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/images/tools/convbmp.c:577:66: warning: 'c1' may be used uninitialized [-Wmaybe-uninitialized]
577 | put4((c1 >> 4) & 0x0f);
| ~~~~^~~~~
/github/workspace/sources/apps/graphics/microwindows/microwindows/src/images/tools/convbmp.c:549:23: note: 'c1' was declared here
549 | int c, n, c1, c2;
| ^~
In file included from /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windows.h:21,
from mwdemo.c:20:
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:168:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
168 | typedef int (FAR *FARPROC)();
| ^~~~~~~
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:169:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
169 | typedef int (NEAR *NEARPROC)();
| ^~~~~~~
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:170:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
170 | typedef int (*PROC)();
| ^~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [/github/workspace/sources/apps/Application.mk:257: mwdemo.c.github.workspace.sources.apps.examples.microwindows.o] Error 1
In file included from /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windows.h:21,
from mwdemo_main.c:31:
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:168:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
168 | typedef int (FAR *FARPROC)();
| ^~~~~~~
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:169:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
169 | typedef int (NEAR *NEARPROC)();
| ^~~~~~~
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:170:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
170 | typedef int (*PROC)();
| ^~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [/github/workspace/sources/apps/Application.mk:348: mwdemo_main.c.github.workspace.sources.apps.examples.microwindows.o] Error 1
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:54: /github/workspace/sources/apps/examples/microwindows_all] Error 2
/github/workspace/sources/apps/graphics/microwindows/microwindows/src/drivers/fb.c: In function 'select_fb_subdriver':
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/drivers/fb.c:108:27: error: unused variable 'memplan4' [-Werror=unused-variable]
108 | extern PSUBDRIVER memplan4[4];
| ^~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [/github/workspace/sources/apps/Application.mk:257: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/drivers/fb.c.github.workspace.sources.apps.graphics.microwindows.o] Error 1
make[2]: *** [/github/workspace/sources/apps/Application.mk:257: microwindows/src/mwin/winuser.c.github.workspace.sources.apps.graphics.microwindows.o] Error 1
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:54: /github/workspace/sources/apps/graphics/microwindows_all] Error 2
make[1]: Target 'all' not remade because of errors.
make: *** [tools/LibTargets.mk:248: /github/workspace/sources/apps/libapps.a] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 397: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
[1/1] Normalize qemu-intel64/mw
7a8

CONFIG_ARCH_INTEL64_HAVE_PCID is not set

26a28

CONFIG_DEBUG_SYMBOLS=y
27a30
CONFIG_DEV_SIMPLE_ADDRENV=y
32,35c35,38
< CONFIG_MICROWINDOWS_KBD_EVENT=y
< CONFIG_MICROWINDOWS_KBD_EVENT_PATH="/dev/kbda"
< CONFIG_MICROWINDOWS_MOUSE_RELATIVE=y
< CONFIG_MICROWINDOWS_MWIN=y


CONFIG_HIDKBD_STACKSIZE=10240
CONFIG_HIDMOUSE_STACKSIZE=10240
CONFIG_HIDMOUSE_XMAX=1024
CONFIG_HIDMOUSE_YMAX=768
37a41,44
CONFIG_INIT_PRIORITY=20
CONFIG_LIBM=y
CONFIG_MICROWINDOWS_KBD_EVENT_PATH="/dev/kbda"
CONFIG_MICROWINDOWS_MWIN=y
39a47
CONFIG_PCI_MSIX=y
55,64d62
< CONFIG_PCI_MSIX=y
< CONFIG_HIDKBD_STACKSIZE=10240
< CONFIG_HIDMOUSE_STACKSIZE=10240
< CONFIG_HIDMOUSE_XMAX=1024
< CONFIG_HIDMOUSE_YMAX=768
< CONFIG_DEV_SIMPLE_ADDRENV=y
< CONFIG_LIBM=y
< CONFIG_DEBUG_SYMBOLS=y
< CONFIG_INIT_PRIORITY=20
< # CONFIG_ARCH_INTEL64_HAVE_PCID is not set
Saving the new configuration file
HEAD detached at pull/19912/merge
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes in working directory)
modified: boards/x86_64/qemu/qemu-intel64/configs/mw/defconfig
modified: boards/x86_64/qemu/qemu-intel64/configs/nanox/defconfig

no changes added to commit (use "git add" and/or "git commit -a")
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
(use "git add ..." to include in what will be committed)
examples/microwindows/convbmp
examples/microwindows/images/

nothing added to commit but untracked files present (use "git add" to track)
/github/workspace/sources/nuttx /github/workspace/sources/nuttx
HEAD detached at pull/19912/merge
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes in working directory)
modified: boards/x86_64/qemu/qemu-intel64/configs/mw/defconfig
modified: boards/x86_64/qemu/qemu-intel64/configs/nanox/defconfig"

@Acfboy

Acfboy commented Aug 22, 2026

Copy link
Copy Markdown
Author

please fix the errors reported here in our CI:

@acassis It looks like all the problems are in the microwindows code itself. Should I add a patch in the nuttx-apps repo to fix them?

@xiaoxiang781216

Copy link
Copy Markdown
Contributor

please fix the errors reported here in our CI:

@acassis It looks like all the problems are in the microwindows code itself. Should I add a patch in the nuttx-apps repo to fix them?

the most error come from microwindows self, it's better to upstream the fix to microwindows directly as much as possible.

@Acfboy

Acfboy commented Aug 24, 2026

Copy link
Copy Markdown
Author

@acassis, what do you think about also adding nano-X.h to the g_white_headers list in nxstyle.c to suppress the “Mixed case identifier found” warnings in the nuttx-apps CI?

@acassis

acassis commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@acassis, what do you think about also adding nano-X.h to the g_white_headers list in nxstyle.c to suppress the “Mixed case identifier found” warnings in the nuttx-apps CI?

@Acfboy the issue with the current whitelist is it bloating the nxstyle C file. See about the proposal to add a .nxstyleignore here: #19050

@ arjav1528 is planing to work on it.

@acassis

acassis commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@Acfboy please take a look at these errors:

Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:168:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
  168 | typedef int (FAR *FARPROC)();
      | ^~~~~~~
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:169:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
  169 | typedef int (NEAR *NEARPROC)();
      | ^~~~~~~
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:170:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
  170 | typedef int (*PROC)();
      | ^~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [/github/workspace/sources/apps/Application.mk:257: mwdemo.c.github.workspace.sources.apps.examples.microwindows.o] Error 1
In file included from /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windows.h:21,
                 from mwdemo_main.c:31:
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:168:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
  168 | typedef int (FAR *FARPROC)();
      | ^~~~~~~
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:169:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
  169 | typedef int (NEAR *NEARPROC)();
      | ^~~~~~~
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:170:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
  170 | typedef int (*PROC)();
      | ^~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [/github/workspace/sources/apps/Application.mk:348: mwdemo_main.c.github.workspace.sources.apps.examples.microwindows.o] Error 1
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:54: /github/workspace/sources/apps/examples/microwindows_all] Error 2
/github/workspace/sources/apps/graphics/microwindows/microwindows/src/drivers/fb.c: In function 'select_fb_subdriver':
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/drivers/fb.c:108:27: error: unused variable 'memplan4' [-Werror=unused-variable]
  108 |         extern PSUBDRIVER memplan4[4];
      |                           ^~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [/github/workspace/sources/apps/Application.mk:257: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/drivers/fb.c.github.workspace.sources.apps.graphics.microwindows.o] Error 1
                 from microwindows/src/mwin/winuser.c:20:
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:168:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
  168 | typedef int (FAR *FARPROC)();
      | ^~~~~~~
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:169:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
  169 | typedef int (NEAR *NEARPROC)();
      | ^~~~~~~
Error: /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:170:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
  170 | typedef int (*PROC)();
      | ^~~~~~~
microwindows/src/mwin/winuser.c: In function 'CreateWindowEx':
Error: microwindows/src/mwin/winuser.c:492:18: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  492 |         wp->id = (int)hMenu;                            // OK: Not pointer. Menu id always passed as int.
      |                  ^
microwindows/src/mwin/winuser.c: In function 'GetClassLong':
Error: microwindows/src/mwin/winuser.c:1304:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
 1304 |                 return (DWORD)hwnd->pClass->hbrBackground;              // OK: Pointer size checked above and is 32 bit.
      |                        ^
microwindows/src/mwin/winuser.c: In function 'SetProp':
Error: microwindows/src/mwin/winuser.c:1517:38: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
 1517 |                 pProp->Atom = LOWORD((DWORD)lpString);                  // OK: Not pointer. Atom passed in low 16 bits.
      |                                      ^
/github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:174:37: note: in definition of macro 'LOWORD'
  174 | #define LOWORD(l)           ((WORD)(l))
      |                                     ^
microwindows/src/mwin/winuser.c: In function 'GetProp':
Error: microwindows/src/mwin/winuser.c:1535:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
 1535 |                 Atom = LOWORD((DWORD)lpString);                         // OK: Not pointer. Atom passed in low 16 bits.
      |                               ^
/github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:174:37: note: in definition of macro 'LOWORD'
  174 | #define LOWORD(l)           ((WORD)(l))
      |                                     ^
microwindows/src/mwin/winuser.c: In function 'RemoveProp':
Error: microwindows/src/mwin/winuser.c:1557:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
 1557 |                 Atom = LOWORD((DWORD)lpString);                         // OK: Not pointer. Atom passed in low 16 bits.
      |                               ^
/github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windef.h:174:37: note: in definition of macro 'LOWORD'
  174 | #define LOWORD(l)           ((WORD)(l))
      |                                     ^
microwindows/src/mwin/winuser.c: In function 'SetWindowPos':
Error: microwindows/src/mwin/winuser.c:1659:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
 1659 |                 switch((int)hwndInsertAfter) {                  // OK: intentional HWND to int cast
      |                        ^
Error: microwindows/src/mwin/winuser.c:1660:22: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
 1660 |                 case (int)(HWND)HWND_TOP:                               // OK: intentional HWND to int cast
      |                      ^
Error: microwindows/src/mwin/winuser.c:1663:22: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
 1663 |                 case (int)(HWND)HWND_BOTTOM:                    // OK: intentional HWND to int cast
      |                      ^
cc1: all warnings being treated as errors
make[2]: *** [/github/workspace/sources/apps/Application.mk:257: microwindows/src/mwin/winuser.c.github.workspace.sources.apps.graphics.microwindows.o] Error 1
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:54: /github/workspace/sources/apps/graphics/microwindows_all] Error 2
make[1]: Target 'all' not remade because of errors.
make: *** [tools/LibTargets.mk:248: /github/workspace/sources/apps/libapps.a] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 397: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
  [1/1] Normalize qemu-intel64/mw

@Acfboy
Acfboy marked this pull request as ready for review September 6, 2026 13:51
@Acfboy

Acfboy commented Sep 6, 2026

Copy link
Copy Markdown
Author

@acassis The ci issue was fixed by ppsia in apache/nuttx-apps#3770 . It's now ready for reveiw.

@ppisa

ppisa commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

OK,so it seems we have move forward a little. There seems to be next problem

microwindows/src/mwin/winlib/windlg.c: In function 'CreateDialogIndirectParam':
Error: microwindows/src/mwin/winlib/windlg.c:1003:9: error: converting a packed 'DLGTEMPLATE' pointer (alignment 1) to a 'struct tagMWDLGTEMPLATE' pointer (alignment 4) may result in an unaligned pointer value [-Werror=address-of-packed-member]
 1003 |         PMWDLGTEMPLATE pDlg = (PMWDLGTEMPLATE)lpTemplate;
      |         ^~~~~~~~~~~~~~
In file included from /github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/windows.h:26,
                 from microwindows/src/mwin/winlib/windlg.c:18:
/github/workspace/sources/apps/graphics/microwindows/microwindows/src/include/winres.h:104:16: note: defined here
  104 | typedef struct tagMWDLGTEMPLATE
      |                ^~~~~~~~~~~~~~~~

I try to look at it.

@Acfboy Please, rebase your branch intended for merge do not merge master into it. It would keep final history cleaner and is most probably what is mandated by NuttX maintainers.

@ppisa

ppisa commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

It is interesting, that my local build of the current mainline is without any warning with my local defconfig and even with qemu-intel64:mw defconfig. So it is probably specific for given GCC version.

lpTemplate argument is of LPCDLGTEMPLATE type which is defined with

#pragma pack(2)

to match real MS Windows DLGTEMPLATE defined in windlg.h (and in WINUSER.H on MS Windows) which has to be aligned to WORD/16-bits and its size is unfortunately unaligned to 32-bits. It is only 16-bit aligned. Matching MWDLGTEMPLATE defined in include/winres.h is structure aligned regular way and solves continuation at right offset by char extraData field.

It seems that affected pDlg pointer in CreateDialogIndirectParam is not stored for future use, it is really only source of parameters there and in resGetDlgTemplExtra function.

So the state is, the problematic packing has to be kept for MS Windows compatibility, it originates in their 16-bit word. The access through MWDLGTEMPLATE is correct but the pointer can be unaligned (16-bi aligned). The data are used only to read parameters inside given function. There is no problem with the code on architectures which support unaligned access natively. There could be problem on more and more seldom architectures, i.e. Cortex-M0/M+/M1, all higher are OK. Te correct solution is to mark pointer to MWDLGTEMPLATE in CreateDialogIndirectParam and resGetDlgTemplExtra as unaligned or aligned to 16-bits to provide full guidance for C compiler how to deal with these on architectures not supporting unaligned data natively.

Another easy solution is to define MWDLGTEMPLATE with pack(2) as well.

It is possible that there are little more similar problems which are given by providing Win API as one of the APIs variants.

@ghaerr, please, do you have some opinion or preference there? It is no problem on any x86. It could be problem on some PowerPC, MIPS or old ARMs in past.

@ghaerr

ghaerr commented Sep 6, 2026

Copy link
Copy Markdown

Hello @ppisa,

Another easy solution is to define MWDLGTEMPLATE with pack(2) as well.

I don't yet have much time to fully look into this, but given that structure DLGTEMPLATE and MWDLGTEMPLATE have the same members in the same order, then using #pragma pack(2) with MWDLGTEMPLATE may indeed be the best solution here.

I haven't checked whether the MWDLGTEMPLATE extraData[] member would be offset differently using this, but the FIXSZ_MWDLGTEMPLATE define to 18 corresponds to actually requiring that MWDLGTEMPLATE be packed to 16-bits.

There is a demo that reads Windows .res files directly that may be of use to testing this: mwdvetest, whose source is in src/mwin/demos/mwdvetest.c.

It is possible that there are little more similar problems which are given by providing Win API as one of the APIs variants.

Yes, although in years past I did take the trouble to ensure that Microwindows ran on CPUs that did not support unaligned access... so this particular issue may be one that slipped through the cracks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Board: simulator Board: x86_64 Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants