graphics/NxWidgets: Fix some issues foundin build testing.

This commit is contained in:
Gregory Nutt 2018-09-16 09:25:32 -06:00
parent 2de0a78202
commit cd06134557
24 changed files with 62 additions and 237 deletions

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -35,8 +35,8 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}

View file

@ -6,7 +6,7 @@ NXWidgets.:
Contents
========
o Installing and Building the Unit Tests
o Building the Unit Tests
1. Setup NuttX
a) Configure NuttX
b) Enable C++ Support
@ -18,9 +18,7 @@ Contents
o Work-Arounds
1. Build Issues
2. Stack Size Issues with the X11 Simulation
o Theory of Operation
o Unit Test Directories
o Example
Installing and Building the Unit Tests
======================================
@ -130,62 +128,14 @@ Installing and Building the Unit Tests
CONFIG_EXAMPLES_TOUSCHCREEN=y ## REMOVE (provided "tc_main")
The following step will then install the new, correct directory containing
the user_start function for the selected unit test. If you see that NSH
is configured:
CONFIG_EXAMPLES_NSH=y ## DO NOT REMOVE
Then go back and re-read e) above.
sim/nsh2 and stm3210e-eval/nsh2 are both NSH configurations. You do not need
to change anything further in the .config file for any NSH configuration.
2. Configure/Install the Selected Unit Test
Then reconfigure that to use the Unit Test of your choice:
cd <nxwidgets-directory>/tools
./install.sh <apps-directory-path> <test-sub-directory>
Where:
<apps-directory-path> is the full, absolute path to the NuttX apps/ directory
<test-sub-directory> is the name of a sub-directory in the UnitTests directory
3. Instantiate the Configuration
Before we can make the NXWidgets Library, we have to instantiate the NuttX
configuration with the installed unit test:
cd <nuttx-directory-path>
. ./setenv.sh
make context
This will create auto-generated files and will setup symbolic links needed
in order to build the NXWidgets Library.
4. Adjust the Stack Size
2. Adjust the Stack Size
If using an simulation configuration (like sim/nsh2) and your unit test
uses X11 as its display device, then you would have to increase the size
of unit test stack as described below under "Stack Size Issues with the
X11 Simulation."
5. Build the NXWidgets Library
cd <nxwidgets-directory>/libnxwidgets
make TOPDIR=<nuttx-directory-path>
6. Build the NxWM library.
The NxWM library (libnxwm.a) is required only for the NxWM unit test at
apps/graphics/NxWidgets/UnitTests/nxwm. For other unit tests, skip to step 7.
cd <nxwidgets-directory>/nxwm
make TOPDIR=<nuttx-directory-path>
7. Build NuttX including the unit test and the NXWidgets library
3. Build NuttX including the unit test and the NXWidgets library
cd <nuttx-directory-path>
. ./setenv.sh
@ -236,21 +186,6 @@ Build Issues
vi namedapps_list.h # Edit this file and increase the stack size of the add-on
rm .built *.o # This will force the namedapps logic to rebuild
Theory Of Operation
===================
The NuttX application Makefile at apps/Makefile has some special hooks for
building "external" applications. In particular, it will automatically
build in the contents any directory call "external/" that may appear in the
apps/ directory. There is no external/ directory in the repository. Rather,
this directory may be provided by the user (possibly as a symbolic link) to
add libraries and applications to the standard build from the repository.
The script at tools/install.sh, then, just does a lot of careful validation and
sanity checking. Then it installs the UnitTest test sub-directory in the apps/
directory by creating a symbolic link in the apps/ directory call "external".
That symbolic link will refer to the selected UnitTest sub-directory.
UnitTests
=========
@ -310,130 +245,3 @@ nxwm
Exercises the NxWM window manager.
Use the special configurations nuttx/configs/sim/nxwm or nuttx/configs/stm3240g-eval/nxwm.
Example
=======
1. Configure sim/nsh2
Where: nuttx and nuttx/tools directory
$ cd tools/
$ ./configure.sh sim/nsh2
$ cd -
2. Edit the NuttX .config file to enable C++ support
Do nothing... sim/nsh2 already has C++ support enabled.
Since this is an NSH configuration, the entry point does not need to be
changed.
3. Install the CButton C++ application (for example)
Where: <nxwidgets-directory>/tool
$ ./install.sh ~/projects/nuttx/nuttx/trunk/apps/ CButton
/home/patacongo/projects/nuttx/nuttx/trunk/apps//external already exists...
Removing the old symbolic link.
Creating symbolic link
- To /home/patacongo/projects/nuttx/nuttx/trunk/NxWidgets/UnitTests/CButton
- At /home/patacongo/projects/nuttx/nuttx/trunk/apps//external
4. Instantiate the Configuration
Where: nuttx directory
$ cd /home/patacongo/projects/nuttx/nuttx/trunk/nuttx
$ . ./setenv.sh
$ make context
This will create auto-generated files and will setup symbolic links needed
in order to build the NXWidgets Library.
6. Adjust the Stack Size
If using an simulation configuration (like sim/nsh2) and your unit test
uses X11 as its display device, then you would have to increase the size
of unit test stack as described above under "Stack Size Issues."
7. Build the NXWdigets Library
Where <nxwidgets-directory>/libnxwidgets
$ cd /home/patacongo/projects/nuttx/nuttx/trunk/NxWidgets/libnxwidgets
$ make TOPDIR=/home/patacongo/projects/nuttx/nuttx/trunk/nuttx
8. Build NuttX
Where: nuttx directory
$ cd /home/patacongo/projects/nuttx/nuttx/trunk/nuttx
$ make
...
8. Run the "bringup" task:
a. Start NuttX
Where: nuttx directory
./nuttx
NuttShell (NSH) NuttX-6.9
nsh>
b. Execute NuttX
Where: NSH command prompt
NOTE that when you run NSH as a simulation, the commands are echoed
twice -- once by Linux/Cygwin and once by NuttX:
nsh> help
help
...
Builtin Apps:
nx
nxhello
tc
bringup
nsh> bringup
bringup
bringup [2:128]
c. Then do a kludgy thing
Where: NSH command prompt
The I/O with the Linux/Cygwin simulation is blocking. So while NSH is
waiting for input nothing can run (see configs/sim/README.txt for more info).
One way to make NSH stop asking for input is to sleep.
nsh> sleep 10
sleep 10
NOTE 1: This is not a problem if CONFIG_SCHED_WAITPID is defined in the
configuration file. If CONFIG_SCHED_WAITPID is defined, NSH will wait
for the unit test to complete and it will not be necessary to sleep.
NOTE 2: CONFIG_SCHED_WAITPID is defined in the sim/nsh2 configuration
so you can probably ignore this kludgy thing.
d. The Unit Test runs
As soon as NSH sleeps, the unit test will run:
bringup_main: Saying hello from the dynamically constructed instance
CHelloWorld::HelloWorld: Hello, World!!
bringup_main: Saying hello from the instance constructed on the stack
CHelloWorld::HelloWorld: Hello, World!!
bringup_main: Saying hello from the statically constructed instance
CHelloWorld::HelloWorld: Hello, World!!
8. Debugging
Where: nuttx directory
In the simulation (only) you can use GDB or, better, the graphic
front-end DDD to debug the code. Most embedded targets do not
have good debugging capabilities.
In order to debug, you have to have build with CONFIG_DEBUG_SYMBOLS=y.
This setting is preselected in the sim/nsh2 configuration so that
you don't have to do anything.
Then under Linux or in a Cygwin X11 window, you can start the graphic
debugger like:
ddd nuttx &

View file

@ -35,15 +35,22 @@
-include $(TOPDIR)/Make.defs
NXWIDGETS_DIR="$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include"
NXWIDGETS_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)libnxwidgets"
NXWIDGETS_INC = "$(NXWIDGETS_DIR)$(DELIM)include"
NXWM_DIR = "$(APPDIR)$(DELIM)graphics$(DELIM)NxWidgets$(DELIM)nxwm"
NXWM_INC = "$(NXWM_DIR)$(DELIM)include"
ifeq ($(WINTOOL),y)
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"}
CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWM_INC)"}
CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"}
CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWM_INC)"}
else
CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"}
CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWM_INC)"}
CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"}
CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWM_INC)"}
endif
# NxWM unit test

View file

@ -0,0 +1,6 @@
/.built
/.depend
/Make.dep
/*.src
/*.obj
/*.lst

View file

@ -78,7 +78,7 @@ CXXSRCS += glyph_checkboxoff.cxx glyph_screendepthdown.cxx
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include}
CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include}
VPATH = $(NXWIDGETDIR)$(DELIM)src
VPATH = src
include $(APPDIR)/Application.mk

View file

@ -1,2 +1,6 @@
/nxwm-export.zip
/.built
/.depend
/Make.dep
/*.src
/*.obj
/*.lst

View file

@ -92,6 +92,6 @@ CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include
CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)$(DELIM)include}
CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include}
VPATH = $(NXWIDGETDIR)$(DELIM)src
VPATH = src
include $(APPDIR)/Application.mk