1. Don't use the bootloader and partition-table
binaries from a hello-world example. Rather the ESPTOOL_BINDIR variable
can be used to give a user-defined location.
2. The ESPTOOL_BINDIR variable has to be as generic as possible. Don't
assume any board configuration.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
NUTTXNAME is used only as an alias for "nuttx", not actually a
configuration property. Its definition might erroneously imply that the
name of binary image may be configurable, which is not the case.
Redirect the first check of esptool to /dev/null as it will be printed
twice when esptool is called to convert the binary.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This checks if the required function is defined (when stack coloration
is enabled) and, if so, calls it to get used stack. Otherwise it just
reports zero used stack.
An empty extension for sed -i is not widely available.
* Where it isn't available (eg. macOS's sed) "sed -i -e" will
create a backup file with the "-e" suffix.
* Even GNU sed documentation says it's "not recommended".
This commit deals with it by:
* Replace it with a more appropriate tool (kconfig-tweak)
* Or, specify the extension (.bak)
If boardconfig changed, '/configure.sh -e board:config menuconfig'
would finally call 'make distclean menuconfig' which results in
build break. It also applies to nconfig and qconfig.
Change-Id: I44c06718cbda948932c667b9f2d1339913c9ba37
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Summary:
- The latest version.sh retrieves version information from git tag
- However, if a repository contains private tags, it will fail
- This commit fixes this issue
Impact:
- version.sh only
Testing:
- Tested with https://github.com/masayuki2009/incubator-nuttx
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>>
Also add custom board build with absolute path support in addtion
to relative path.
Change-Id: I01bcb0b79db9e245484540c714036c64234b3656
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Summary:
- The NuttX sim SMP uses SIGUSR1 for IPI
- However, gdb traps the signal by default
- With this commit, gdb just ignores this signal
Impact:
- NuttX sim SMP only
Testing:
- Tested with sim:smp
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- Brennan reported the script does not work with nucleo-h743zi:otg_fs_host
- Actually, the config uses FPU but the script did not detect it
- The script assumed that the nuttx contains fpuconfig symbol
- However, this assumption was incorrect
- This commit fixes this issue by detecting FPU with tcb->xcp.regs
Impact:
- Cortex-M targets
Testing:
- Tested with lm3s6965-ek:discover (Cortex-M3)
- Tested with spresense:wifi_smp (Cortex-M4F)
- Tested with sim:smp (x86_64)
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
xargs for macOS does not support the '-a/--file-arg' flag so
build artifacts were not getting stored. This change passes it in
via stdin which is more portable.
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
Add new option -A is added to tools/testbuild.sh that will take the
created build executable and store it in a folder for the config
that generated it under $ARTIFACTDIR which can be set via an
environment variable or defaulted to $(TOPDIR)/buildartifacts
This is also helpful for local testing because you can now run
tools/testbuild.sh -A sim.dat and have all of the simulation
targets generated without having to rebuild along the way.
In the GitHub Actions workflow the artifacs are uploaded
two two bundles one for macOS and one for Linux
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
the mkspk tool will automaticaly be built if CONFIG_CXD56_BINARY
is set.
Test:
nuttx.spk was succesfully generated
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
since it doesn't need anymore with the follow patch:
commit e7d9260014
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Mon Feb 17 20:19:25 2020 +0800
arch: Customize the typedef of size_t instead of intptr_t
To ensure size_t same as toolchain definition in the first place and
rename CXX_NEWLONG to ARCH_SIZET_LONG. The change also check whether
__SIZE_TYPE__ exist before CONFIG_ARCH_SIZET_LONG so our definition
can align with toolchain(gcc/clang) definition automatically.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
by define _FILE_OFFSET_BITS to 64 described here:
https://man7.org/linux/man-pages/man2/stat.2.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I19c079294b79a541fbcc0bf5acbf7377067acf98
Summary:
- I noticed that call stack for Cortex-M3 was incorrect
- This commit fixes this issue
Impact:
- Affects nuttx-gdbinit for armv7-m without FPU
Testing:
- Tested with lm3s6965-ek:discover (qemu)
- Tested with spresense:wifi
- Tested with sim
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Commit 34b34e2d45 uses the full path to libapps.a and introduced the use of the Make notdir command. That command breaks the Cygwin build because when a native Windows toolchain is used, the full path to libapps.a is a Windows-sytle path and the Make notdir command (like most other GNU Make commands) fails if it is passed a Windows-style path. This commit replaces the Make notdir command with the Bash basename command which can handle Windows paths.
This works by having the build system look for nuttx/external/Kconfig
to determine whether this directory is present or not. nuttx/external
is gitignored in order to be added by the final user but not to be
commited into the repo. Tipically this will by a symbolic link, just like
apps/external.
Inside external/ a Makefile should be placed with the same structure
than any nuttx/ subdirectory (eg: nuttx/drivers/). The
nuttx/external/Kconfig will be sourced and any options defined there will
appear at the bottom of menuconfig (unless options are conditioned on
menus, in which case they will appear accordingly).
The purpose is to allow arch/board independent code, which for any
reason is not to be upstreamed (propietary, not relevant for mainline,
testing, etc), to be built into the OS during OS building stage. This
way the user does not need to fork the NuttX repo to do so. This feature
complements well with external apps and custom board support.
In some cases, when NuttX configuration changes and this makes the
object list used to build one of the .a libraries change as well,
since the command used to build it is "ar crs" and this simply appends
the list of object files, the library could still include object
files from prior builds. This commit modifies the ARCHIVE macro to
erase the .a file if it already exists.
Since in some cases this behavior was actually expected (object
files from a subdirectory were appended to a library created one
level above) I added a ARCHIVE_ADD which works as ARCHIVE did.
This change should greatly improve behavior of building after
configuration changes.
1.Reduce the default size of task_group_s(~512B each task)
2.Scale better between simple and complex application
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia872137504fddcf64d89c48d6f0593d76d582710
Summary:
- This commit enables nuttx thread debugging without openocd-nuttx
- To use this script, gdb must support python
- To show all thread, use 'info_nxthreads'
- To switch thread, use 'nxthread pid'
- To continue, use 'nxcontinue'
Impact:
- No impact
Testing:
- Tested with spresense (Cortex-M4F), sim (x86_64), lm3s6965-ek (Cortex-M3)
- Tested with GNU Tools for Arm Embedded Processors 9-2019-q4-major
- Tested with GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
since it isn't used anymore after:
commit bd656888f2
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Mon May 18 22:18:15 2020 +0800
build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig
so the correct value can be determinated by Kconfig system automatically
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
configuration changes
According to the usage documentation, [-e] option should "enforce
distclean if already configured". This behavior was broken due to the -e
option being evaluated only if the current defconfig is different from
the backup defconfig. The new -E command inherits this behavior.
it is useful to pass the nonempty argument to change the init task behaviour
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I684e9c76b9eac54404d0e4e63ab78e51e039c9a8
This will resolve numerous problems with the way that hard links, in particular "." and ".." are handled. Instead of trying to fudge the stat flags, the correct implementation is to follow the hard link to the final link target node. That is what must determine the attributes of the directory entry.
PR 1372 vfs/stat: Make the flag defintion more confirm POSIX
standard. Silently broke the cromfs. This was due to the
necessary replication of the S_xxxx flags of the NuttX
sys/stat.h. The unfortunate outcome was most likely caused by
fact, that a grep of S_xxxx did not match the tools/gencromfs.c
To insure this sort of thing does not happen again, comments
have been added the will match search.
custom board.
Custom boards don't set CONFIG_ARCH_BOARD since the full path is given
during configuration.
Furthermore this creates problems when when referencing other
folders using BOARD_DIR because a trailing DELIM will be present.
Since testbuild.sh called by nightly build and check build, it should
suppress logs from configure stage to keep all output clean.
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Make.defs under board folder can still overwrite the default as needed
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I1c300a8ace4b54d475ef8d398661ed65ca273a2e
so all boards support uClibc++/libc++ automatically
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ibe6fafbec57f7acb26ea6188a3e9923ea82295c5
Squashed commit of the following:
commit 40b788f8a0e79aa90734813a557c17f90fb9cdbe
Author: Adam Feuer <adam@adamfeuer.com>
Date: Sat Jul 4 14:45:13 2020 -0700
updated license header to APL 2.0; updated usage
commit 81984aeeb503d90f30cb1d0c62a888e2a23235ed
Author: Adam Feuer <adam@adamfeuer.com>
Date: Thu Jul 2 18:32:05 2020 -0700
move tar.gz files to current dir
- for convenience, so user can untar them and build
commit e1a3100402e39703ea08daa16e2388d4572413dc
Author: Adam Feuer <adam@adamfeuer.com>
Date: Wed Jul 1 13:17:37 2020 -0700
added trap; copyright header; can take release name
- instead of URL, optionally
commit e0109214c5b887b4b662120ce59c59520d8a5918
Author: Adam Feuer <adam@adamfeuer.com>
Date: Wed Jul 1 12:54:54 2020 -0700
trap and remove tempfile; set -e to catch errors
commit 196dc4ca4285b821cce644561296a2034e9a671e
Author: Adam Feuer <adam@adamfeuer.com>
Date: Wed Jul 1 12:15:01 2020 -0700
using wget recursive and cut-dir to download files
- as per PR feedback
commit 127c22bbc14cabe2a59b238b75c21711b000e41b
Author: Adam Feuer <adam@adamfeuer.com>
Date: Wed Jul 1 11:35:01 2020 -0700
intial addition
enhance the post build can support configurable BIN directory
Change-Id: I64f286b6eb5ed77e91b67a27d815d62c345ac589
Signed-off-by: chao.an <anchao@xiaomi.com>
post build processing is also necessary for import compilation
Change-Id: Ie27e25b84e2212e9c86358c30ca1a5b7c2adffc5
Signed-off-by: chao.an <anchao@xiaomi.com>
use LDNAME instead of LDSCRIPT to avoid invalid native path
exported to the import build
Change-Id: I1ba3cfdbfca02447941dc32a292fe4d76c1ced04
Signed-off-by: chao.an <anchao@xiaomi.com>
To avoid overriding of objects with duplicate file name
Change-Id: I83c964d161d23942cd3fc29eb738da44775cfc10
Signed-off-by: chao.an <anchao@xiaomi.com>
mkdeps uses system() thus a shell to execute cc.
it doesn't work if you have something like
CFLAGS += -DMBEDTLS_USER_CONFIG_FILE="<mbedtls/user_config.h>"
because the shell interprets "<" as a redirect.
to fix it, we should do either
* make it shell-quote arguments
* or, stop using system()
this commit implements the former.
some platforms provide easy ways to do the former.
eg. https://netbsd.gw.com/cgi-bin/man-cgi?shquote++NetBSD-current
but unfortunately none of them seems available widely.
i guess the latter approach is more common.
eg. 4464250282/usr.bin/mkdep/mkdep.c (L137-L154)
but i might be a burden for windows. (i don't know)
arch/z80/src/Makefile: Correct inclusion of non-existent file. This was not a problem before because there was '-' before the include. Problem revealed with '-' removed.
arch/z80/src/ez80/Toolchain.defs: Apparently there are not too many '"' in path definition.
tools/incdir.c: No space between -usrinc: or -sysinc: and the list of paths.
Before any other Make logic can be used, we must immediately build the tools/incdir binary. It will be used as soon as Make.defs is included and will generate errors otherwise.
Remove the other locations in the tools/incdir binary was being build from tools/Makefile.unix and tools/Makefile.win
1. If config.c is compiled on any platform other than Cygwin, then the variable wintools is not used.
2. Add more debug output so we can see what is going on in the PR checks.
Also call configure.sh with JOPTION to enable parallel build
Change-Id: I32c4e77fb30c40d8d424159cc0871b8c3e3f10b6
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
As in https://github.com/apache/incubator-nuttx/issues/1114 discuss, let
EXTRA_FLAGS="EXTRAFLAGS=" defaultly to avoid testbuild.sh called without
-e option fail issue. It also works well with -e "-Wno-cpp -Werror".
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Use absolute path for APPDIR which could be used by apps clean
and distclean subdir build. Parallel clean and distclean subdir
could save more build time.
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
In the past a very low effort interface was used:
- All parmeters were treated as though they were type uinptr_t, and
- The maximum number of parmeters (6) was passed in all cases.
The first is potentially wrong and the second is very inefficient. This commit improves this by:
- Making tools/mksyscall.c more intelligent, and
- Extending the syntax for variadic functions.
For example, in syscall.cvs, the open() API was represened like this:
"open","fcntl.h","","int","const char*","int","..."
In reality, open may take only a single optional argument of type mode_t which is not the same size as uintptr_t. And there is not reason to pass 6 parameters in that case.
And this has been extended to:
"open","fcntl.h","","int","const char*","int","...","mode_t"
The existence of the "mode_t" tells tools/mksyscall that there is at most one optional parameter and, if present, it is of type mode_t.
There is case as below:
When do testbuild under Linux host, such as './tools/configure.sh stmf4discovery:nsh',
arch/arm/src/board is a symlink to boards/arm/stm32/stm32f3discovery/src. Then do
'./tools/refresh.sh --silent stmf4discovery:nsh' after build, it would break the board
symlink with copydir.sh instead of link.sh since defconfig with Windows host config.
So call sethost.sh to restore BOARD_DIR. Or it results in 'make distclean' not correctly.
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
In an older PR, the standard kconfig-tweak calls were replaced with sed edit. This is an incorrect change and results in invalid configurations. This change restores the use of kconfig-tweak and always generates correct configurations.
This change resolves issue #386
sed edits do not handle all of the dependencies correct and generates invalid configurations. Most defconfig files specify Linux by default, so you will only see the effect of the corruped configuration when sethost changes changes to a different configuration. Then, when 'make olddefconfig' is subsequentyly run, the corruption in the defconfig file is reflected by warnings such as:
$ tools/configure.sh -c stm32f4discovery:nsh
Copy files
Select CONFIG_HOST_WINDOWS=y
Select CONFIG_WINDOWS_CYGWIN=y
Refreshing...
.config:62:warning: override: reassigning to symbol HOST_WINDOWS
.config:62:warning: override: HOST_WINDOWS changes choice state
Those warnings are eliminated by this changed.
Tested by repeatedly doing:
tools/configure.sh -c stm32f4discovery:nsh
Commit 3b9efc95a2 introduced an error in the generation of include file paths. The logic that determined if cygpath should be called to create a Windows native path for the case of Cygwin using a native toolchain was incorrect. This corrects this warning:
./tools/configure.sh -c sim:nsh
$ make
<CUT>
make[1]: Entering directory '/home/btashton/apache/apps'
make[2]: Entering directory '/home/btashton/apache/apps/builtin'
./exec_builtin.c:54:10: fatal error: builtin/builtin.h: No such file or directory
54 | #include "builtin/builtin.h"
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
ERROR: cc failed: 1
command: cc -MT ./exec_builtin.home.btashton.apache.apps.builtin.o -M -Wall -Wstrict-prototypes -Wshadow -Wundef -g -fno-builtin -fno-common -I. -isystem /home/btashton/apache/nuttx/include -D__KERNEL__ -pipe -I C:\cygwin64\home\btashton\apache\apps\include ./exec_builtin.c
make[2]: *** [/home/btashton/apache/apps/Application.mk:224: .depend] Error 1
make[2]: Leaving directory '/home/btashton/apache/apps/builtin'
make[1]: *** [Makefile:67: /home/btashton/apache/apps/builtin_depend] Error 2
In this case a Cygwin POSIX toolchain is being used by the path in the CFLAGS to apps/include is incorrectly a Windows native path. This error is corrected by this change to tools/incdir.sh
Remove tools/logparser.c. This tool converted 'git log' output into the format used by the obsoleted ChangeLog files. Since the ChangeLog files are obsoleted, the tool servers no purpose.
Since littlefs is in active development, it's not a good idea to use its
source code files directly. So upgrade littlefs v2.2.1 by using the littlefs
tar.gz release package instead.
Change-Id: I16d9cf0b6bca700a54ca86ed11d7c8c7f27a898f
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
since source code use these config as string constant not as variable name
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iaee3d32b100beb8b77d68711728a1e874b45ae3a
In https://github.com/apache/incubator-nuttx-apps/pull/179, there is a
removed graphics/littlevgl/lv_symbol_def.patch file whose content would be
treated abnormally and results in errors.
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Aim to let makefunc caller just pass in the target. So update makefunc to hardcode make/extra
flags options and redirection, meanwhile avoid the case in which makefunc would remove the quotes
for EXTRAFLAGS. Note that JOPTIONS should also hardcode once parallel build break finally fixed.
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Call 'tools/testbuild.sh -e -Wno-cpp testlist' would pass "EXTRAFLAGS=-Wno-cpp"
to make command line. Then it could suppress the warnings with pre-processor
directive #warning in GCC.
Change-Id: I61e5f9b3774149f64bdd625677cc9aabaa2fea90
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
So call 'make EXTRAFLAGS=-Wno-cpp' could suppress the warnings with pre-processor
directive #warning in GCC.
Change-Id: Iaa618238924c9969bf91db22117b39e6d2fc9bb6
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
and for future Apache releases.
- Rename the final tarball to add incubating and apache to their names
- Make the tool usuable from a development repo.
- Add a list of patterns(files and folders) to exclude and
a command line argument to pass aditional patterns.
- Add a command to run silently.
- If the build number was not provided let version.sh figure it out.
This resolves issue 718: nxstyle line width check was ignoring the line width check for single line comments.
This turned out to be an artifact in parsing. Usually when parsing character by character, the file character to be parsed was '/n'. Howefver, in the case of parsing single line comments, the final character was the NUL terminator. This means that the lenth check was not being performed in the case of single line comments.
NOTE: Currently, I have suppressed error reports for single line right-hand comments. My fear is that this will unmask more standard violations than we can cope with. It is easy to re-enable and perhaps we should do that in the future:
/* Check for long lines
*
* REVISIT: Long line checks suppressed on right hand comments
* for now. This just prevents a large number of difficult-to-
* fix complaints that we would have otherwise.
*/
if (m > g_maxline && !rhcomment) <-- remote the second condition
The sub-string MHz is used frequently is pre-processor variable definitions. The section "Lowercase Exceptions" permits reasonable use of lowercase characters in pre-processor variable names and, given the frequency of the use of MHz (no pun intended), it certainly should qualify.
Allow "Public Function Prototypes" sections in .c files. Per the coding standard, all public function prototypes belong in .c files. However, there are some situations when the public function prototype is needed in a .c file and it shoudld, most correctly, be placed in a "Public Function Prototypes" section.
Checking for white-listed prefixes is also simpler now because the check is table driver. New data structure: g_white_prefix[] and new function white_prefix().
In some cases, a separate toolchain is necessary to
build modules.
E.g. the sim on macOS, where the native format is Mach-O.
By default, just use CC/LD, which is appropriate for
the most of platforms.
This reverts commit b9ace36fcc.
This change was added by PR 625 but has a serious logic flaw. It removes all occurrences of INCDIROPT and replaces it with a definition in tools/Config.mk:
else ifeq ($(WINTOOL),y)
DEFINE = "$(TOPDIR)/tools/define.sh"
INCDIR = "$(TOPDIR)/tools/incdir.sh" -w
This logic flaw is the Config.mk is included in all Make.defs files BEFORE WINTOOL is defined. As a result, the definition is wrong in many places when building under Cygwin with a Windows native toolchain.
Redirect configure.sh stdout to /dev/null to suppress lots of log
since configure.sh behaviour updated.
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
and fix the typo error and remove if/else nesting
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ife0c80d396417e8eb37e43d0883f272d4b9247a0