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.
Modify reason:
When build Nuttx SIM, in x86_64 system:
Compile with gcc option '-m64' (default):
sizeof(double_t) = 8
sizeof(double) = 8
Compile with gcc option '-mx32':
sizeof(double_t) = 8
sizeof(double) = 8
Compile with gcc option '-m32':
sizeof(double_t) = 12 // long double
sizeof(double) = 8
When use '-m32', and print sth. like this:
printf("%f\n", (double)3.0);
SIM will print out: nan
This is because sizeof(double_t) is not equal with double.
Resolve:
replace all double_t to double in libs/libc/stdio.
As a user of '-m32', you should know double_t is one type
long double, and len is 12. And you use use '%lf' to print.
like:
printf("%lf\n", (double_t)3.0);
Currently we don't support '%lf'.
Change-Id: I9b9d11853140d5296dd80416c8ed6a260a9d2d9c
Signed-off-by: ligd <liguiding1@xiaomi.com>
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.
The current EasyDMA implementation will fail if a transfer of over
255 bytes is requested with no warning.
Also we do not set the RX and TX transfer lengths to 0 if the
buffer is NULL which can cause data to be written to the old
address as well as cause unexpected transaction lenghts.
Example:
transfer 1:
rx_len = 10
rx_buff != NULL
tx_len = 10
tx_buff != NULL
transfer 2:
rx_len = 2
rx_buff != NULL
tx_buff == NULL
Total transaction length for the second would be 10 because it
would still be using the old rx length of 10 and would
corrupt data in the old rx buffer.
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
EXTRAFLAGS is already applied to *FLAGS in board's Make.defs (and
it applies to whole build, not just arch-code). EXTRAFLAGS is passed
around each make call to the complete build.
KDEFINE is already added to EXTRAFLAGS in main Makefile so no need
to add it again in arch-level Makefile