Compare commits

..

3335 commits

Author SHA1 Message Date
Marco Casaroli
37a1f0e068 audioutils/lame: pin the checkout and build its AVX-512 sources
The bundled encoder was checked out from lame's trunk with no revision, so
every build took whatever trunk happened to be at that moment.  lame's trunk
grows vector tiers over time, and each one adds sources that the two build
files have to name:  r6655 offered AVX2 to the vector routines on 2026-07-25,
and r6718 and r6720 added an AVX-512 tier on 2026-07-30.  The AVX-512 sources
were never listed, so sim:alsa stopped linking on x86 hosts:

  takehiro.c:332:    undefined reference to `quantize_lines_xrpow_avx512'
  takehiro.c:533:    undefined reference to `ix_max_avx512'
  takehiro.c:569:    undefined reference to `count_bit_esc_avx512'
  vbrquantize.c:261: undefined reference to `calc_sfb_noise_x34_avx512'

Pin the checkout to r6720 through a LAME_VERSION variable, as the rest of
apps/ pins its third-party sources, and list the three AVX-512 files that
revision provides.  The pin is what keeps the two in step:  the source list is
maintained by hand, so it can only be correct for a known revision.

The checkout is also only performed when lame/configure is absent and is never
updated afterwards, so before this an unpinned tree was frozen at whatever
trunk was on the day it was first built.  Anyone who checked out before
2026-07-30 still links and cannot reproduce the failure, which is why this
surfaced only in CI.

Makefile named just vector/xmm_quantize_sub.c and none of the other vector
sources, so a Make build on an x86 host fails the same way with a longer list
of symbols, from SSE2 upwards.  CI builds sim:alsa through CMake only, so that
half was latent rather than visible.  Both files now list the same nine
sources under the same host condition.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 19:44:51 -03:00
Marco Casaroli
20dc5e5167 testing/fs/xipfs: Cover the FDPIC module loader.
Adds two sections to the xipfs suite, guarded by CONFIG_FDPIC so a build
without the loader is unaffected.  They belong here rather than in their own
test because what they exercise is modules loaded *out of the filesystem* --
the pin, the in-place mapping and the loader are one path.

'fdpic' asserts on the loader properties that otherwise fail *quietly*: a
loader that skips DT_INIT_ARRAY runs a C++ module happily with every global
left zero, one that skips DT_JMPREL loads a module that hard-faults only
once it calls out, and one that mis-sizes the descriptor pool corrupts the
heap.  None of those announce themselves.  The module exit status is the
channel -- each module checks its own invariants and reports a bitmask.  It
also covers shared libraries across concurrent instances, per-instance data,
the leaf-library GOT fallback, the R_ARM_FUNCDESC descriptor pool, and every
firmware entry point that has to resolve a module callback, including
mq_notify and timer_create with SIGEV_THREAD.

'reject' mutates a known-good module byte by byte and asserts the loader
refuses it rather than loading something broken: a missing import, and more
DT_NEEDED entries than the walk will follow.

The modules are embedded as headers, for the same reason as in
examples/fdpicxip, and built for cortex-m3 for the same reason: one set of
blobs then runs on both the v7-M and v8-M targets.  Their sources and the
makefile that regenerates these headers live in
apps/examples/fdpicxip/modules, so the copies the two apps carry are built
from the same sources in the same way.

Verified on a Pimoroni Pico Plus 2: fdpic 33/33, reject 7/7, and the whole
suite 130/130 with them included.  The same three numbers on mps2-an500 under
QEMU, which is a Cortex-M7 rather than the RP2350's Cortex-M33.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-07-31 18:47:17 -03:00
Marco Casaroli
859c014d4d examples/fdpicxip: Demonstrate FDPIC modules executed in place.
The FDPIC counterpart of examples/nxflatxip, kept separate from it: that
example is about NXFLAT, and mixing the two module formats into one program
would leave neither demonstrating anything clearly.

Four subcommands, each showing one property of the loader.  'qsort' is the
simplest case it has -- one self-contained module, two concurrent instances,
one shared copy of the text in flash and a private copy of the data each,
with the pin count showing the extent held in place while they run and
released after.  'solib' adds a shared library, so two objects are mapped
and each instance still gets its own copy of both objects' data.  'cxx' is
the same in C++, which additionally requires global constructors to have run
in dependency order before main.  'jmprel' is a module whose imports are all
in DT_JMPREL rather than DT_REL.

The modules are embedded as headers rather than built as part of the app:
linking one needs arm-uclinuxfdpiceabi binutils, which the tree does not
require, so the headers are committed and both this example and
testing/fs/xipfs build with a plain toolchain.

Their sources are in modules/, with a makefile that rebuilds every header
from them on an explicit 'make regen NUTTX_DIR=...' and is never invoked by
the application build.  It drives nuttx/tools/fdpic and writes the headers
this example needs alongside the ones testing/fs/xipfs needs, so one source
tree serves both and the two cannot drift apart.  CPU is cortex-m3 there
deliberately: a v7-M module runs on the v8-M targets too, so one set of blobs
serves both the RP2350 and mps2-an500, while a cortex-m33 build produces
blobs the Cortex-M7 cannot execute at all.

This demonstrates; it does not assert.  The assertions are in the fdpic and
reject sections of apps/testing/fs/xipfs.

Verified on a Pimoroni Pico Plus 2: all four subcommands, and nxflatxip
unaffected alongside them.  Also verified on mps2-an500 under QEMU, which is
a Cortex-M7 -- a different core generation from the RP2350's Cortex-M33.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-07-31 18:47:17 -03:00
tuansuper
5f286fc924 flashtool: Fix compile error due to missing statement after default label
In flashtool_main.c, the 'default:' label in a switch statement was
followed directly by '}', which is invalid in C.
This commit adds a 'break;' statement after the default label to
resolve the error.

Signed-off-by: tuansuper <tunainnet@tutanota.com>
2026-07-31 10:32:58 -03:00
Marco Casaroli
2631d3e59a testing/ostest: build the perf test only where it can link
perf_gettime() and perf_getfreq() are kernel functions, defined in
sched/clock/clock_perf.c.  Neither appears in syscall.csv, and libc supplies
only perf_gettime(), under CONFIG_ARCH_HAVE_PERF_EVENTS_USER_ACCESS.  So a
protected or kernel build cannot resolve either of them from user space:

  ostest/perf_gettime.c:91:  undefined reference to `perf_gettime'
  ostest/perf_gettime.c:184: undefined reference to `perf_getfreq'
  make[1]: *** [nuttx_user.elf] Error 1

The call in user_main() is guarded by CONFIG_ARCH_PERF_EVENTS &&
!CONFIG_ARCH_PERF_EVENTS_USER_ACCESS -- which is exactly the case where the
symbols are kernel-only -- so every such configuration fails to link.
mps3-an547:knsh is one: it sets CONFIG_SCHED_IRQMONITOR, which makes
ARCH_PERF_EVENTS default y.  mps2-an521:knsh escapes only because it sets
neither monitor, leaving ARCH_PERF_EVENTS off, so the call compiles out and
the archive member is never pulled in.

Require CONFIG_BUILD_FLAT, where ostest links against the kernel's own copy.
No configuration that runs the test today stops running it.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 09:49:59 -03:00
Ricard Rosson
be43888aa5 netutils/mdns: raise responder stack size default to 8KiB
CONFIG_NETUTILS_MDNS_STACKSIZE defaulted to DEFAULT_TASK_STACKSIZE,
which resolves to as little as 2KiB on some targets.  The bundled
mjansson responder uses a deeper stack than that (DNS record parsing
with name decompression, plus the send/receive buffers) and overflows
on startup, taking the board down with a hardfault before it answers a
single query.

Default to 8KiB, the value that reliably runs the responder, and
correct the help text, which previously claimed a 4KiB default that did
not match DEFAULT_TASK_STACKSIZE.

Assisted-by: Claude (Anthropic Claude Code)
Signed-off-by: Ricard Rosson <ricard@groundbits.com>
2026-07-31 15:19:31 +08:00
Abhishek Mishra
fc14d02ae0 nshlib,fsutils: add Kconfig deps for NSH console login with PBKDF2
Require a cryptodev backend for FSUTILS_PASSWD and tie NSH console/telnet
login to ROMFS passwd generation when ETC_ROMFS is enabled.

Fixes #19573

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-31 10:20:23 +08:00
Abhishek Mishra
917e2e860b testing/ostest: create temp passwd file for multiuser test
Install a minimal passwd file at CONFIG_LIBC_PASSWD_FILEPATH before
getpwnam() checks so sim:ostest does not require a pre-built /etc/passwd.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-31 01:14:30 +08:00
Abhishek Mishra
484474bbbe testing/ostest: extend multiuser credential and IPC tests
Add getresuid/setreuid coverage plus ownership and permission checks
for message queues, named semaphores, shared memory, and FIFOs.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-31 01:14:30 +08:00
Abhishek Mishra
92c3b6446d nsh: show real, effective, and saved IDs in id command
Use getresuid() and getresgid() for Linux-style id output with name
resolution and a groups= list based on the effective GID.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-31 01:14:30 +08:00
Jorge Guzman
07c1234372 games/NXDoom: draw in the pixel format of the frame buffer
The blit assumed a 32-bit frame buffer:  it wrote a uint32_t per pixel
and converted the palette with ARGBTO32 as it went, so the image came
out wrong anywhere else.  It also drew at the origin, leaving the image
in a corner of a display it does not fill, and indexed the source by the
output column, which costs a division for every pixel of every frame.

Convert the palette once per palette change into the format the frame
buffer actually uses, map output columns to source columns through a
table built at startup, and centre the result.  Output rows that come
from the same source row are copied rather than converted again.

Four options are added, all off by default, so that a board can trade
memory for speed where it pays:

  GAMES_NXDOOM_FB_CMAP blits palette indices and lets a frame buffer
  that has a colour map do the conversion in hardware.

  GAMES_NXDOOM_FILLSCREEN stretches the image over the whole display
  rather than scaling it by a whole number.

  GAMES_NXDOOM_ROWSTAGE builds each row in a staging buffer so that the
  frame buffer only sees burst-friendly copies.

  GAMES_NXDOOM_STATIC_SCRNBUF places the render target in .bss, which
  keeps it out of external memory on a board whose heap is mostly that.

On an STM32H753 driving a 1024x600 panel from SDRAM, the last two are
worth 2.7x together.

Also open the frame buffer with O_CLOEXEC.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-31 01:07:59 +08:00
Acfboy
6870186707 graphics/microwindows: fix missing HAVE_FNT_SUPPORT in Makefile
Without this Make variable, Objects.rules does not add font_fnt.o
to the build, causing undefined reference to fnt_createfont at link time.

Signed-off-by: Acfboy <AcfboyU@outlook.com>
2026-07-30 09:42:18 +02:00
Marco Casaroli
2492317f15 examples/nxflatxip: Run an NXFLAT module in place out of xipfs.
The point of a writable execute-in-place file system is that a module can
arrive after the firmware was built and still run without being copied into
RAM.  This demonstrates exactly that, end to end: it writes an NXFLAT module
into xipfs the way a download would, declaring the size up front so the
extent is exact, checks the file system can hand out a real flash pointer
for it, and runs two instances concurrently.

Both instances report the address of their own text and of their stack.  The
text address is the same in both and is inside the flash window -- it is the
address the file occupies on the media -- while the stacks differ.  While
they run, the extent carries one pin per instance, which is what stops the
defragmenter relocating code that is executing.

Two subcommands cover the file system rather than the module.  bench times a
bulk read out of the mapped flash before and after a write, which on the
RP2350 is the cost of whichever path the driver used to restore XIP.  defrag
fills the volume, deletes every other file until an allocation genuinely
cannot be satisfied, compacts, retries the same allocation, then verifies
every relocated file byte for byte and again after a remount, printing a
block map at each step.

The module has neither static data nor string constants, and reports through
a callback into the firmware instead of formatting its own output.  That is
not stylistic: the ldnxflat in circulation resolves the GOT entries for .bss
objects into the import table, and drops the addend when it resolves the
PC-relative references to .rodata, so a module using either quietly computes
wrong addresses.  The comment in module/xipmod.c records both.  The callback
also exercises the other direction of the interface, firmware code entered
with the module's data base still live in r10.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-07-28 16:47:49 +08:00
Marco Casaroli
3a03552c6a testing/fs/xipfs: Add a test suite for the xipfs file system.
Twelve sections, selected by name on the command line because the power loss
sweeps run for minutes while everything else runs in seconds.

The routine part covers the VFS paths, the write-once rules (reopen for
write, append, seek during write, truncate of a written file are all refused)
and both mmap variants: that a plain mapping lands inside the media window
with no heap growth, that MAP_XIP_STRICT fails with ENXIO rather than
copying, and that N mappings of one file produce N pins on one extent.

The rest is aimed at the two properties that are easy to get wrong and quiet
when they are:

Pin release.  A pin taken by one task and a task that dies with a mapping
still live both have to end with the extent movable again -- the second
without the task ever calling munmap, since a module that faults never will.
Both are checked by asking the defragmenter to move the extent afterwards.

Power-loss atomicity.  With CONFIG_FS_XIPFS_FAULT_INJECT the suite fails the
Nth flash operation, remounts, and checks the volume is consistent and every
file that had been committed is byte-for-byte intact.  It sweeps N across
create, unlink and defragmentation, and repeats the sweep with the failing
write torn -- a partial program rather than a clean refusal -- which is what
a real power loss mid-program leaves behind.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-07-28 16:47:49 +08:00
Marco Casaroli
b695ec057f system/xipfs: Add a command to compact a xipfs volume and report it.
xipfs has a defragmentation ioctl and no way to reach it from a shell.  The
only caller was a demo in examples/nxflatxip, which built its own block map
to show what compaction had done.

  xipfs [-n] [-t <ms>] [<mountpoint>]

-n surveys and reports without moving anything: where each file sits, a map
of the volume, and how much of the free space a single allocation can reach.
That last number is the one a caller facing -ENOSPC actually wants; at 0%
the largest possible file already fits however scattered the map looks.

The compaction is asked for through a descriptor for the mountpoint
directory, so no file inside the volume is open while it runs and a single
pass can reach every extent.

The walk descends into the directories xipfs synthesises from names, and
reports each file by its path relative to the mount, so a volume that uses
them is described in full rather than down to its first level.

Block totals come from statfs rather than XIPFSIOC_EXTENTINFO, because that
one does name a file and an empty volume has none, yet its geometry is still
worth reporting.

Assisted-by: Claude Code:claude-opus-4-8
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-07-28 16:47:49 +08:00
Acfboy
ce49ac9053 examples/microwindows: add mwdemo demo application
This ports mwdemo.c from Microwindows as a standalone NuttX example
application.  mwdemo is the primary Win32 API demo in the Microwindows
project, featuring 3D graphics, window controls, timer-driven
animation, and bitmap image rendering.

The demo runs on both qemu-intel64:mw and sim:mw configurations.

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

examples/microwindows: address review, clean up mwdemo.

- Replace minimal copyright notice with full Apache 2.0 license header
- Use angle brackets for system and microwindows includes
- Remove OS-specific dead code (DOS_TURBOC, RTEMS, EMSCRIPTEN/MULTIAPP)
- Drop unused demo-mode macros and their corresponding dead code paths
  (IMAGE, CLIENT3D, CLIPDEMO, ARCDEMO).  Keep a fixed GRAPH3D+CONTROLS
  configuration as the single NuttX demo.
- Add g_ prefix to global variable (image -> g_image)
- Move demoWndData typedef from mid-file to Private Types section
- Merge WinMain body into main() and remove the WinMain indirection
- Removed unused images.

Signed-off-by: Acfboy <AcfboyU@outlook.com>
2026-07-28 09:53:05 +02:00
Acfboy
ae601e2892 graphics/microwindows: introduce Microwindows graphics support to NuttX
This commit integrates the Microwindows core into the NuttX apps
build system:

- Downloads a pinned upstream commit during build and compiles the
  engine, drivers and precompiled bitmap fonts via Microwindows'
  Objects.rules files.
- Adds Kconfig options for framebuffer path, keyboard driver
  selection (event-mode, raw byte-stream, none, custom), and
  mouse/touchscreen driver selection (relative, touchscreen, none,
  custom).
- Uses the MWCONFIG_FILE mechanism to inject NuttX-specific
  configuration (mwconfig.nuttx) without modifying upstream headers.
- The NuttX screen, keyboard, mouse and touchscreen drivers are
  pulled from upstream Microwindows. Driver selection is controlled
  via ARCH=NUTTX and Kconfig-driven KEYBOARD/MOUSE variables in
  the Makefile.
- Depends on VIDEO_FB for the framebuffer device.
- Builds the mwin library (Win32 API layer) when MICROWINDOWS_MWIN
  is enabled.

Co-authored-by: Pavel Pisa <ppisa@pikron.com>
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
Signed-off-by: Acfboy <AcfboyU@outlook.com>
2026-07-28 09:53:05 +02:00
Filipe Cavalcanti
636047a4e0 examples/fb: add SMPTE color bar example
Add a -p option to select the pattern to draw. The existing expanding
rectangles animation remains the default, and a new "smpte" pattern
fills the display with seven equal vertical bars (white, yellow, cyan,
green, magenta, red and blue), which is useful to verify color ordering
and channel wiring of a framebuffer display.

To support more than one palette, the draw_rect() helpers now receive
the color value to write instead of an index into the per-format color
tables. Monochrome displays pick black or white per bar using a BT.601
luma threshold.

The FBIO_UPDATE ioctl is moved out of draw_rect() into a new
present_area() helper, so the SMPTE pattern can draw every bar and
then update the display only once.

Assisted-by: Cursor:claude-opus-5
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-07-28 10:46:12 +08:00
dependabot[bot]
61161866f0 build(deps): bump docker/login-action from 4.4.0 to 4.5.1
Bumps [docker/login-action](https://github.com/docker/login-action) from 4.4.0 to 4.5.1.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](af1e73f918...abd2ef45e7)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 4.5.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-28 10:46:03 +08:00
Matteo Golin
b42589e8e7 games/NXDoom: Fix warnings in i_pcsound module
This fixes all the warnings in the i_pcsound module caused when enabling
the sound feature Kconfig option. This warnings would prevent CI from
passing.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-27 13:24:25 -03:00
Matteo Golin
a5c0e9c188 apps/games/NXDoom: Add support for RTTTL DOOM theme
Implements and RTTTL player music module to play the DOOM theme song
over RTTTL.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-27 13:24:25 -03:00
Marco Casaroli
57e761f724 build: Omit default priority ELF symbol.
Do not define nx_priority for applications that use SCHED_PRIORITY_DEFAULT. The ELF loader already uses its scheduler default when the symbol is absent, avoiding the invalid priority-zero value previously encoded by Application.mk.

Keep emitting nx_priority, and retaining it through stripping, for explicit numeric priorities.

Assisted-by: Zed:GPT-5.6 Terra
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-07-27 12:19:41 -03:00
Junbo Zheng
fabafbc361 nshlib: add relative image path support in boot command
cmd_boot passed the image path straight to boardctl(), which resolves
it in a context that does not inherit the NSH shell cwd, so relative
paths failed and only absolute paths worked. Use nsh_getfullpath() to
resolve relative paths against the cwd before calling boardctl().

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2026-07-27 09:38:34 -03:00
Alan Carvalho de Assis
8d5e9f3754 system/readline: Fix small issues
This PR fixes some small issues raised by Xiang Xiao.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-07-26 18:46:45 -03:00
aviralgarg05
f2ceac78db examples/sotest: support packaged shared library fixtures.
Extend the examples/sotest packaging path so the shared-library test
fixtures can also be prepared through nxpkg-style package artifacts.

Generate shared-index.json and pkgsotest.nsh from the built modprint
and sotest shared objects, recording the correct target arch/compat
metadata and SHA-256 digests for the packaged shared-library fixtures.
Allow sotest to run in either its existing builtin-ROMFS flow or from
explicit shared-library paths, with a --mount helper mode for
preparing the builtin test mount separately. Keep the paired fixture
outputs in one grouped make step so parallel builds do not re-enter
the generator independently.

This makes the sotest shared-library example usable as a
package-style fixture producer for the Dynamic ELF/nxpkg series,
useful for validating the shared-library side of the packaging flow
where the loader should consume installed artifacts rather than only
the default builtin test paths. The existing builtin-ROMFS path is
preserved with no regression to the normal sotest example flow.

Assisted-by: Claude:claude-sonnet-5
Assisted-by: OpenAI Codex:gpt-5.6-sol
Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-07-26 20:54:58 +08:00
Marco Casaroli
3ecd036f8f audioutils/lame: Add CMake vector sources.
Add the SSE2 and AVX2 vector implementation files to the CMake libmp3lame target for x86 simulator hosts. LAME's enabled runtime dispatch paths call these functions, so omitting them leaves sim:alsa with unresolved symbols at link time.

Non-x86 simulator hosts continue to use LAME's scalar implementation.

Assisted-by: Zed:GPT-5.6 Terra
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-07-26 08:33:06 -03:00
Felipe Moura
355d090d83 netutils/dropbear: back chacha20-poly1305 with NuttX /dev/crypto
Replace the bundled libtomcrypt chacha20-poly1305 implementation with an
adapter that drives the NuttX crypto device: the SSH construction maps onto
CRYPTO_CHACHA20_DJB (the original 64-bit counter/nonce ChaCha20
parameterization used by chacha20-poly1305@openssh.com) for the packet
length and payload streams, and onto CRYPTO_POLY1305 for the authentication
tag (plain MACs are driven in two steps through /dev/crypto: COP_FLAG_UPDATE
feeds the data, a final call retrieves the tag).

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-26 07:54:11 -03:00
Junbo Zheng
101b713be6 nshlib: add du command support
Add a du command to NSH that recursively summarizes the size of each
path argument in 1K-blocks, or human-readable form with -h.

Supports -s (summary only), -a (all files), -d N (max-depth), and -h,
matching GNU du semantics.

Testing:

Built and ran on sim:nsh with:
```bash
  cmake -B out/nuttx_sim_nsh -S nuttx -DBOARD_CONFIG=sim:nsh -GNinja
  ninja -C out/nuttx_sim_nsh
  ./out/nuttx_sim_nsh/nuttx

  nsh> du
  397449  /data/test/elf
  71993   /data/test/coredump
  5       /data/test/log2
  3251    /data/test/log1
  472700  /data/test

  nsh> du -h
  388.1M  /data/test/elf
  70.3M   /data/test/coredump
  4.1K    /data/test/log2
  3.1M    /data/test/log1
  461.6M  /data/test
```

Host Ubuntu22.04 du on the same directory:
```bash
  $ du
  397456  ./elf
  72000   ./coredump
  8       ./log2
  3252    ./log1
  472720  .

  $ du -h
  389M  ./elf
  71M   ./coredump
  8.0K  ./log2
  3.2M  ./log1
  462M  .
```

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2026-07-26 07:39:39 -03:00
aviralgarg05
6ca1272b99 examples/elf: extend nxpkg validation coverage.
Extend the examples/elf ROMFS path so nxpkg validation can use
generated package fixtures instead of hand-managed metadata.

Generate index.json, bad-index.json, pkgtest.nsh, and pkgfail.nsh
from the built hello ELF, recording the correct target arch/compat
metadata and SHA-256 digest for the valid fixture. Keep mismatched-
target and missing-artifact cases alongside the valid fixture so
nxpkg target selection and failure handling can be exercised from
the same example tree. Group the paired fixture outputs in one make
step so parallel builds do not re-enter the generator independently.

This keeps the fixture metadata tied to the actual built hello
artifact instead of relying on manually maintained hashes or ad hoc
shell setup, making follow-up review and later test reruns more
predictable. There is no intended loader or board-behavior change;
this is limited to fixture generation inside examples/elf.

Assisted-by: Claude:claude-sonnet-5
Assisted-by: OpenAI Codex:gpt-5.6-sol
Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-07-25 12:06:28 -03:00
Felipe Moura
690ec808e5 netutils/dropbear: back hmac-sha2-256 with NuttX /dev/crypto
Replace the bundled libtomcrypt HMAC modules with an adapter that computes the hmac-sha2-256 packet MAC through the NuttX crypto device using CRYPTO_SHA2_256_HMAC sessions.

Require CRYPTO, CRYPTO_RANDOM_POOL, CRYPTO_CRYPTODEV and CRYPTO_CRYPTODEV_SOFTWARE_CRYPTO explicitly instead of selecting crypto support.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-24 18:34:35 -03:00
Alan C. Assis
ae237624ee readline: Improve robustness of editing and escape-sequence handling
Replace fragile cursor compensation with full-line redraws where needed,
fix Ctrl+W buffer/screen corruption, properly consume unrecognized CSI
sequences, and always clean up leaked local-echo characters from buggy
serial drivers. These changes make line editing consistent across
terminals while preserving existing behavior.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
Assisted-by: Claude Code (Sonnet 5)
2026-07-24 14:12:38 -03:00
Alan C. Assis
48eb95998b readline: Make prompt-caching available
readline cached the current prompt only when TAB completion was enabled,
even though line-editing redraws also depend on that cached prompt.
With TAB completion disabled, full-line redraws erased the prompt and
repainted only the command buffer. Make the prompt cache available
whenever line editing is enabled.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-07-24 14:12:38 -03:00
Alan C. Assis
893f0c31ee readline: remove 5x duplicated in redraw code
The original readline_common.c file had some duplicated code that was
causing the nsh to be more than 1KB bigger. This clean up will allow
adding line editing without increasing the final firmware size too much.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
Assisted-by: Claude Code
2026-07-24 14:12:38 -03:00
Alan C. Assis
51bfd48e78 system/readline: Add support for line movements and editing
This commit adds support to nsh> command line editing. This is one
of the most missing feature of the NuttShell. If you typed a long
command line and make a mistake you need to press Backspace and
remove everything until reach that typo. Only the basic editing
feature is enabled by default (left/right keys movement, Home/End
to move to the beginning or ending of the command line).

More advanced features are available when CONFIG_READLINE_EDIT_EMACS
is selected. It enables the Emacs-style control keys (Ctrl+A/B/D/E/F/K/U/W)
that allow more flexible line editing.

Other more advanced feature is enabled when CONFIG_READLINE_CMD_HISTORY
and CONFIG_READLINE_EDIT_EMACS_REVERSE_SEARCH are enabled. It allows the
user to press Ctrl+R to do reverse search in the command line history.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
Assisted-by: Claude Code
2026-07-24 14:12:38 -03:00
Alan C. Assis
0304721c85 readline: Don't assert on a zero-length RL_WRITE
Then readline_write() was called with buflen == 0 it was causing a
debug assertion. Now it returns early for instead of asserting.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-07-24 14:12:38 -03:00
Carlos Sánchez de La Lama
094b988be3 interpreters: add Tcl support
Tcl is added using The Jim Interpreter. Jim is an opensource small-footprint
implementation of the Tcl programming language. It implements a large subset
of Tcl and adds new features like references with garbage collection,
closures, built-in Object Oriented Programming system, Functional Programming
commands, first-class arrays and UTF-8 support.

Signed-off-by: Carlos Sánchez de La Lama <csanchezdll@gmail.com>
2026-07-24 17:15:49 +08:00
wangjianyu3
86afa6d182 netutils/rexecd: forward PRIORITY/STACKSIZE config in CMake build
The Makefile build already forwards both values via PRIORITY /
STACKSIZE.  Align the CMake build with the Makefile so that
CONFIG_NETUTILS_REXECD_PRIORITY and CONFIG_NETUTILS_REXECD_STACKSIZE
take effect under CMake as well.

Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-07-23 17:18:08 -03:00
Matteo Golin
d273af4834 applications/audioutils/morsey: Update Morsey version
Use newer version without compile time warnings that prevent CI from
building.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-23 09:31:29 +02:00
Abhishek Mishra
e751331ecb ci: fix sim/login ROMFS passwd credential for promptpasswd.sh
NUTTX_ROMFS_PASSWD_PASSWORD lacked a special character, so nuttx's
promptpasswd.sh rejects it and headless CI builds fail at etctmp.c when
sim/login is built.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-22 17:21:22 +08:00
Abhishek Mishra
c02683e282 !nshlib: Remove fixed login; require FSUTILS_PASSWD
Report password policy failures clearly from useradd and passwd when a
password does not meet complexity requirements.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-22 17:21:22 +08:00
Abhishek Mishra
608f13fd4b !fsutils/passwd: Replace TEA with PBKDF2-HMAC-SHA256
Migrate passwd encrypt/verify to PBKDF2 modular crypt format using
kernel cryptodev (CRYPTO_PBKDF2_HMAC_SHA256 via /dev/crypto).  Add
passwd_pbkdf2 wrapper, base64url helpers, complexity validation, and
pbkdf2_test for RFC 6070 vector coverage.  FSUTILS_PASSWD selects
CRYPTO, ALLOW_BSD_COMPONENTS, and CRYPTO_CRYPTODEV so existing sim
defconfigs keep building.  Change NSH_LOGIN_USERNAME default to root and
remove fixed-login password defaults.

BREAKING CHANGE: TEA-encoded /etc/passwd entries no longer verify.
Regenerate each entry after upgrading.  Pair with the nuttx host mkpasswd
changes in apache/nuttx#19209.  Boards must enable the appropriate
software or hardware crypto backend for PBKDF2 at runtime.  When
CONFIG_NSH_LOGIN_FIXED=y, set CONFIG_NSH_LOGIN_PASSWORD in the board
defconfig or menuconfig; there is no default password.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-22 17:21:22 +08:00
hanzhijian
01c6a60581 testing/drivers: add watchdog notifier cmocka coverage
Extend the watchdog drivertest with notifier ordering, duplicate registration, repeated delivery, unregister, NULL-data, and concurrent registration coverage.

Register the watchdog test when either reset-cause or timeout-notifier support is available. Keep hardware watchdog cases gated by reset-cause support and allow notifier-only simulator builds through both Make and CMake.

Keep test state in the watchdog fixture and notifier blocks so callbacks do not depend on shared notifier state.

Assisted-by: OpenAI Codex
Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-07-21 15:37:01 -03:00
anjiahao
067b0ccf28 Application.mk:define application attribute in elf symbol
Emit --defsym for nx_stacksize, nx_priority (and nx_uid/nx_gid/nx_mode
under CONFIG_SCHED_USER_IDENTITY) into MODLDFLAGS so the ELF binary
loader can recover the application's configured attributes at load time.

Also skip builtin registration for separately-built module ELFs
(BUILD_MODULE instead of DYNLIB).

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-07-21 05:47:25 -03:00
dependabot[bot]
593bfca047 build(deps): bump actions/setup-python from 6 to 7
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6 to 7.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-21 16:47:02 +08:00
Matteo Golin
c814059f6c examples/txmorse: Example application for transmitting Morse code
Adds an example application leveraging the Morsey library for
transmitting Morse code, either to the console (debug) or to GPIO
devices for now as the two supported sinks.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-21 05:46:11 -03:00
Matteo Golin
4d3bb6e7c9 audioutils/morsey: Add the Morsey library
This commit adds the Morsey library (Apache 2.0 licensed) to be
downloaded from an external repository so it can be used in NuttX
applications.

This library parses ASCII text into Morse code marks to be played by a
user-implemented 'transmit' function (i.e. over an LED, buzzer, audio
sink, etc.).

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-21 05:46:11 -03:00
Abhishek Mishra
1e490d3fbe dropbear: rename libtomcrypt symbols to avoid NuttX collisions
Rename base64_encode, base64_decode, and ecc_make_key in bundled
libtomcrypt to avoid duplicate symbol link errors when dropbear is built
alongside netutils/codecs and NuttX crypto (e.g. sim:dropbear).

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-20 12:45:48 -04:00
Jorge Guzman
865393d419 system/curl: add a small curl-like HTTP client command
Add the "curl" NSH command: a command-line HTTP client built on top of
the netutils webclient library. It implements a subset of the real curl
options: GET and POST (and other methods via -X), custom request headers
(-H), a raw request body (-d, including -d @file), multipart/form-data
file uploads (-F name=@file), saving the response body to a file (-o)
and verbose output (-v). HTTP only (no HTTPS).

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-20 10:21:57 +02:00
Ansh Rai
98f683dea8 apps: Sanitize PROGNAME for _main symbol generation
Program names containing '-' (e.g. renaming hello to hello-world via
PROGNAME) previously generated an invalid identifier <PROGNAME>_main
when constructing internal entry-point symbols. This caused build
failures for C/C++ applications due to invalid identifiers in compiler
definitions and generated builtin_proto.h.

Introduce PROGSYM, a sanitized copy of PROGNAME with '-' replaced by
'_', and use it wherever an internal C/Zig identifier is constructed
(the -Dmain= defines, the Zig RENAMEMAIN rule, and the REGISTER
call's entry-point argument). Preserve the original PROGNAME for the
registered NSH command name and builtin registry entry, where hyphens
are valid and expected.

The Zig RENAMEMAIN path is also updated to use PROGSYM for consistency.
The current hello_zig and leds_zig examples do not exercise this path,
since neither uses a literal 'fn main' entry point, but the change
keeps symbol generation consistent for future Zig applications.

Testing (WSL2 Ubuntu, x86_64, sim:nsh):
- CONFIG_EXAMPLES_HELLO_PROGNAME="hello-world": clean build,
  'hello-world' runs and prints 'Hello, World!!'
- Reverted to default PROGNAME="hello": clean build, no regression
- Confirmed by inspection that RENAMEMAIN's sed substitution does not
  fire on either current .zig source (generated _tmp.zig is
  byte-identical to the source)

Fixes #19447

Signed-off-by: Ansh Rai <anshrai331@gmail.com>
2026-07-20 10:21:26 +02:00
Felipe Moura
7469e88bfa netutils/dropbear: retain child exit status for NSH PTY session
The per-session NSH task is reaped with waitpid() in
dropbear_nshsession.c.  Without CONFIG_SCHED_CHILD_STATUS the kernel does
not retain the child exit status, so waitpid() returns ECHILD right after
authentication and the interactive session never starts
("NSH session wait failed: Unknown error 10").

Depend on SCHED_HAVE_PARENT and SCHED_CHILD_STATUS (following the project's
depends-on-over-select convention) so the requirement is explicit; boards
enabling Dropbear must set these in their defconfig.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-20 10:04:50 +02:00
Matteo Golin
5114ddd6c0 examples/baromonitor: New LVGL example which integrates with barometer
This example is an LVGL application which reads pressure and temperature
data from a barometer and displays it on gauges. It is intended to
provide an idea of what LVGL on NuttX can practically be used for in an
application.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-20 09:40:04 +08:00
Filipe Cavalcanti
09682dad05 interpreters/python: support build without network
Adds options to support building when CONFIG_NET is not set.
This allows building Python for boards that do not have networking support.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-07-17 08:37:30 +08:00
Old-Ding
62d04ed484 system: fastboot: bound filedump path parsing
Parse the filedump path token into the existing PATH_MAX-sized buffer
before reading the optional offset and size arguments. This bounds the
write without constructing a scanf format string at runtime.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-16 15:59:21 +08:00
raiden00pl
eceb30e59c codespell: ignore ANS error
ignore ANS codespell error. ANS -> Alert Notification Service in bLE

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-15 08:40:55 +02:00
raiden00pl
f5b2c354ca wireless/bluetooth/nimble: make transport ACL buffer count configurable
The controller<->host ACL pool was hardcoded to 10 buffers (~6 KiB with
the 251-byte ACL size). Expose NIMBLE_TRANSPORT_ACL_FROM_LL_COUNT and
NIMBLE_TRANSPORT_ACL_FROM_HS_COUNT (default 10) so RAM-constrained
single-connection peripherals can lower it.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-15 08:40:55 +02:00
Old-Ding
850f481344 examples: fix local socket address lengths
The configured path size already includes its NUL terminator. Adding
another byte made the maximum address length exceed sockaddr_un, while
ustream could write at sun_path[UNIX_PATH_MAX].

Use the existing bounded copy length directly as the path portion of
the socket address and rely on strlcpy for termination.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-13 12:28:07 +02:00
Matteo Golin
b39228cd41 !examples/audio_rtttl: Implement example using RTTTL library
This commit fixes the audio_rtttl example (which was undocumented and
previously used kernel-level functions) such that now it uses the RTTTL
parsing library. Contributors can implement 'players' for different
types of audio sinks. Currently, PWM is supported.

BREAKING: The previous version of this example only supported a single
board (Spresense) and uses public interfaces from the kernel code. Now
it only uses user-space interfaces and supports any board implementing
those interfaces. Users who relied on the old behaviour should submit a
patch to add a new player to this application which uses the desired
audio sink for the Spresense through user-space interfaces.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-13 10:02:37 +08:00
Mihai Pacuraru
3762a64bc6 examples/mqttc: add a subscriber client implementation example
Implement the subscriber client that optionally integrates
    the TLS layer and can reconnect to the broker if the
    application is running in unstable network environments.

    The client is compliant with all 3 levels of QoS.

Signed-off-by: Mihai Pacuraru <mpacuraru@protonmail.com>
2026-07-13 10:02:05 +08:00
Felipe Moura
9b540556a1 netutils/dropbear: don't require a hardware TRNG
Dropbear gathers its entropy from /dev/urandom (libtomcrypt's
rng_get_bytes tries /dev/urandom before /dev/random), so requiring
ARCH_HAVE_RNG and DEV_RANDOM shuts the port out of targets without a
hardware TRNG -- including the simulator, where a dropbear
configuration silently loses NETUTILS_DROPBEAR at configure time.
Keep only the DEV_URANDOM requirement.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-12 15:56:25 -03:00
Jorge Guzman
62b7e95530 nshlib: top: add Linux-like summary and flicker-free refresh
Print a summary header before the task list in the style of the
Linux top command: uptime, task counts (total/running/sleeping),
CPU busy/idle and memory usage, all gathered via sysinfo().

Refresh the screen in place (cursor home + erase-line per row +
erase-below) instead of clearing the whole screen every cycle,
which removes the flicker.

Poll stdin during the update interval and exit on 'q', ESC or
Ctrl-C. Previously the only exit path was the SIGINT handler,
which requires both CONFIG_ENABLE_ALL_SIGNALS (handler) and
CONFIG_TTY_SIGINT (serial console converts Ctrl-C into SIGINT,
default n); on configurations missing either option top could
not be terminated at all.

Tested on linum-stm32h753bi:nsh.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-12 10:00:40 +08:00
Old-Ding
1d5f816874 system: audio: parse command filenames with PATH_MAX
Parse command filename tokens into PATH_MAX-sized buffers before
reading optional raw audio parameters. This bounds nxplayer and
nxrecorder input without runtime-built scanf formats.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-11 12:40:07 -03:00
liang.huang
2bcc6b96ea testing/sched: fix off-by-one sample count in timerjitter
cur_cnt++ in the loop condition increments even when the loop body
doesn't run, so avg is divided by one more sample than was collected.

Signed-off-by: liang.huang <liang.huang@houmo.ai>
2026-07-11 12:31:24 -03:00
Abhishek Mishra
1d15c81f69 ci: supply sim/login ROMFS passwd credential in build jobs
NuttX master now requires CONFIG_BOARD_ETC_ROMFS_PASSWD_PASSWORD for
sim/login builds. The nuttx-apps workflow mirrors nuttx CI but never
exported NUTTX_ROMFS_PASSWD_PASSWORD, so Linux sim-02 and macOS sim
jobs failed inside the Docker build container.

Set the documented test credential at the job and step level and
export it explicitly before cibuild.sh runs.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-11 07:31:04 -03:00
Peter Barada
27c466a429 crypto: Fix CRC-32 test case 8
Normal Crypto API usage is to call ioctl(CGCGSESSION) to initialize
the session, then one (or more) calls to ioctl(CIOCCRYPT) with flag
bit COP_FLAG_UPDATE set to append to the hash/xform calculation, then
a call to ioctl(CIOCCRYPT) with flag bit COP_FLAG_UPDATE cleared to
extract the result, and finally ioctl(CIOCFSESSION) to finish the
session. This follows the classic init / update* / finish data
processing model.

However crc32.c test case 8 precedes ioctl(CIOCCRYPT) with
COP_FLAG_UPDATE set with ioctl(CIOCGSESSION) and follows it with
ioctl(CIOCCRYPT) with COP_FLAG_UPDATE cleared to extract the CRC, and
then ioctl(CIOCFSESSION) to finish the session, all _within_ the loop
to CRC eight segments.  This works with the software implementation
since the intermediate CRC-32 is carried forward out of one session to
seed the next session. Fix by moving the init and finish portions out
of the loop in test case 8.

Signed-off-by: Peter Barada <peter.barada@gmail.com>
2026-07-10 13:02:44 +08:00
orbisai0security
d071a0b585 fix: V-001 security vulnerability
Automated security fix generated by OrbisAI Security

Signed-off-by: OrbisAI Security <mediratta01.pally@gmail.com>
2026-07-10 13:01:42 +08:00
raiden00pl
33b528a0de lte/lapi: fix warnings
fix warnings lte/lapi on sim:

   warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-09 13:57:49 +02:00
Alan Carvalho de Assis
707b24e5cb system/ping: Fix a segmentation fault when using ping
nsh> ping google.com
[   37.180000] dns_query_error: ERROR: IPv4 dns_recv_response fa: -84,
               server address: 8.8.8.8
Segmentation fault.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-07-09 09:42:30 +08:00
Old-Ding
0566af556a examples: lp503x: Fix command argument handling
The lp503x shell command handlers receive the remaining input string as their argument. Treat empty colour arguments as the query case, document that query form in help text, and keep colour and brightness values signed until the existing range checks have run so invalid values are not silently truncated.

Guard the readline_stream() result before using it as a buffer index. readline_stream() returns EOF on end of file or failure, and writing buffer[len] before checking len can write before the stack buffer.

Use MAX_BRIGHTNESS consistently for brightness range checks.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:41:15 +08:00
Old-Ding
17b028e592 examples: wgetjson: check allocations before use
Several malloc() results in the wgetjson example were used before checking for allocation failure, which could crash low-memory paths before cleanup ran.

Return or propagate allocation errors before using the allocated buffers. Use explicit NULL comparisons for the new pointer checks to match review feedback.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:35:19 +08:00
Old-Ding
7fa0767e30 examples: nrf24l01_term: reserve RX terminator
read_pkt() terminates the received payload with buff[ret], but a full-size read can leave no room for that trailing NUL byte.

Limit the read length to one byte less than the buffer size so the received payload remains safely terminated before it is printed.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:30:49 +08:00
Old-Ding
fd525988f8 netutils: smtp: treat recv EOF as an error
recv() returns zero when the peer closes the TCP connection cleanly. The SMTP response path only treated negative returns as errors, so EOF could leave stale or empty response data to be checked as if a server reply had arrived.

Return ERROR on zero-length receives at each SMTP response point and keep the SPDX copyright header within the project line length limit.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:29:57 +08:00
Old-Ding
13f04f65b1 examples: nrf24l01_btle: Fix RX terminator bounds
nrf24_read() reads up to the nRF24L01 maximum payload length and then appends a NUL terminator for the receive buffer. A full 32-byte payload can therefore write one byte past the local rbuf[32].

Reserve one extra byte for the terminator while keeping the read length capped at NRF24L01_MAX_PAYLOAD_LEN. Dump the number of bytes actually received in the debug path.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:28:21 +08:00
Old-Ding
5226be524c system/vncviewer: Drain truncated desktop names
The RFB ServerInit message carries the desktop name as a length-prefixed field. vncviewer caps the copied name to fit conn->name, but it must still consume the remaining bytes from the socket when the advertised name is longer than the local buffer.

Drain the unused suffix so the next RFB message is read from the correct boundary. Reuse the same discard helper for other skipped RFB payloads.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:28:13 +08:00
Old-Ding
54905cd0ff examples: xmlrpc: bound header value copy
xmlrpc_handler() stores HTTP header values in a CONFIG_XMLRPC_STRINGSIZE + 1 byte buffer, but it passed CONFIG_EXAMPLES_XMLRPC_BUFFERSIZE to xmlrpc_getheader(). With the defaults, that allows a 1024 byte copy into a 65 byte destination.

Make xmlrpc_getheader() treat size as the destination capacity, reserve one byte for the terminator, and pass sizeof(value) from the caller.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:27:44 +08:00
Old-Ding
662133eeca testing: nettest: Fix TCP server terminator bounds
The TCP nettest server receives up to TEST_BUFFER_SIZE bytes and then appends a NUL terminator before checking for the exit command. A full-size receive can therefore write one byte past the receive buffer.

Reserve one extra byte for the terminator while keeping the recv() limit and echo length capped at TEST_BUFFER_SIZE.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:27:28 +08:00
Old-Ding
50ffee7a85 examples: Fix network echo receive terminators
The netloop and poll TCP echo examples receive up to IOBUFFER_SIZE bytes and then append a NUL terminator before logging the data. A full-size receive can therefore write one byte past the input buffer.

Reserve one extra byte in the buffers that are terminated after recv(). Keep the receive limit and echo length capped at IOBUFFER_SIZE so the data path is unchanged.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:27:18 +08:00
Old-Ding
3dc9bd4598 README: Fix application directory wording.
Fix two wording issues in the apps README.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
2026-07-09 09:26:16 +08:00
hanzhijian
81accb0832 apps: fix distclean for partial builds and residual .kconfig files
The current distclean implementation has two issues:

1. Application.mk does not remove .kconfig on distclean, so stale
   config fragments from earlier builds can pollute subsequent ones.

2. Several external-library Makefiles (lame, libshvc, libulut) run
   "make -C <subdir> distclean" without checking whether the
   subdirectory exists.  When the library was never downloaded (common
   in CI partial-build environments), distclean fails with "No such
   file or directory".

Fix:

- Application.mk: add $(call DELFILE, .kconfig) to the distclean
  target so that .kconfig is cleaned along with .built, .depend, etc.

- audioutils/lame/Makefile: guard the distclean recipe with
  "if [ -d $(DST_PATH) ]; then ...; fi" and use $(MAKE) instead
  of bare make.

- netutils/libshvc/Makefile, netutils/libulut/Makefile: same
  directory-existence guard for their distclean recipes.

- crypto/wolfssl/Makefile: change "distclean:" to "distclean::"
  (double-colon) so it does not override the distclean:: rule
  inherited from Application.mk.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-07-09 09:25:33 +08:00
raiden00pl
cb7097a4e7 interial: fix SPDX License Identifier
licence is Apache-2.0, not BSD

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-09 02:08:43 +02:00
raiden00pl
dd109a88de inertial/madgwick: add CMake build support
add CMake build support for madgwick and update inertial/madgwick/.gitignore

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-09 02:08:43 +02:00
Matteo Golin
26c5dd8305 games/NXDoom: Use dirent for glob implementation
NuttX has dirent, so the glob implementation can be used. This removes
the warning for no native glob implementation.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-09 01:51:54 +02:00
Matteo Golin
3f04a28cbd games/NXDoom: Add LIBC_LOCALE dependency
The locale functions of libc are necessary for some parts of NXDoom.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-09 01:51:54 +02:00
Jorge Guzman
dd24407c71 examples/lvglterm: add USB HID keyboard input with cursor scrolling
Rework the terminal input selection into an explicit three-way Kconfig
choice so the format each keyboard delivers is picked up front:

  - On-screen keyboard (touch) - default, unchanged behaviour.
  - Matrix / upper-half keyboard - reads struct keyboard_event_s events
    (for example the M5Stack Cardputer matrix on /dev/kbd0).
  - USB HID keyboard - reads a byte stream (for example /dev/kbda with
    CONFIG_USBHOST_HIDKBD).

The physical-keyboard variant now polls the device non-blocking from the
LVGL thread (no dedicated task), mirroring the touch variant.  The USB
path decodes the stream with the keyboard codec, so with a driver built
for CONFIG_HIDKBD_ENCODED the Up/Down cursor keys scroll the terminal;
a plain-ASCII stream still works as ordinary key presses.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-07 09:52:42 +08:00
dependabot[bot]
5971d9c19f build(deps): bump docker/login-action from 4.2.0 to 4.4.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 4.2.0 to 4.4.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](650006c6eb...af1e73f918)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-07 09:48:55 +08:00
Old-Ding
64f9e8a4b7 system: nxinit: bound debug argv dump
Check the service argv array bound before reading the current entry in the debug dump loop. A full argument array may not have an in-array NULL terminator, so the old condition could read one entry past the array while CONFIG_SYSTEM_NXINIT_DEBUG is enabled.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-07 09:47:23 +08:00
raiden00pl
c785d40af7 examples: add Lely CANopen slave example
add Lely CANopen slave example

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-06 11:02:13 -03:00
raiden00pl
962d90bb6e examples: add Lely CANopen master example
add Lely CANopen master example

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-06 11:02:13 -03:00
Alan Carvalho de Assis
caa7d7faa5 apps/nsh: Don't disable error by default
NSH error shouldn't be disabled by default, even when in SMALL
Memory because it will make difficult to discover why things are
not working. It should be disabled manually by experienced dev.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-07-06 09:13:02 -03:00
raiden00pl
c706dd87a7 canutils/lely: fix unreliable download/unpack/patch logic
Rebuild from a clean tree in one recipe so a stale state no longer breaks the build.

This commit also simplify some build logic.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-06 20:04:57 +08:00
Old-Ding
e94e89113a examples: gps: bound NMEA line reads
The GPS example appends serial input to a fixed-size NMEA line buffer until CR or LF without checking the buffer limit. A malformed or overlong input line can write past the end of line[], and the code also uses ch even when read() does not return a byte.

Read bytes only after a successful read(), stop storing at MINMEA_MAX_LENGTH - 1, drain overlong lines until the line ending, and skip parsing truncated sentences.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 16:31:53 +08:00
Old-Ding
f1d53c875d tools: format bitmap converter
Run the bitmap converter through the Python formatter required by checkpatch so the Python 3 print syntax fix passes the project style checks.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 16:31:47 +08:00
Old-Ding
c0228d7b57 tools: Fix bitmap converter print syntax
Use Python 3 print function syntax so bitmap_converter.py can be parsed by current Python interpreters while preserving the existing usage message and exit path.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 16:31:47 +08:00
Old-Ding
6eead56aa9 system: resmonitor: check CPU load reads
Keep the default zero CPU value when the procfs load file cannot be read, and trim only the newline that was actually present. This avoids parsing uninitialized stack data in fillcpu and avoids writing before the showinfo CPU buffer when fgets returns no data.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 16:31:38 +08:00
Abhishek Mishra
da3234f936 !fsutils/passwd: remove insecure default TEA encryption keys
Use 0 as a Kconfig placeholder. The nuttx build rejects unset keys
and can generate random values when configured.

BREAKING CHANGE: CONFIG_FSUTILS_PASSWD_KEY1..4 no longer default to
0x12345678 / 0x9abcdef0. Configs that relied on those defaults must
set keys manually or enable BOARD_ETC_ROMFS_PASSWD_RANDOMIZE_KEYS in
nuttx. Fix: set keys in menuconfig or enable random key generation.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-06 16:30:13 +08:00
raiden00pl
afe2a0eafc canutils/lely: add dependencies for Kconfig options
some options depends on others and not selecting them can cause compilation errors.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-06 08:24:00 +02:00
Felipe Moura
4d5f60005c netutils/dropbear: add scp support via SSH exec requests
Code Clean up - Remove unnecessary code.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-05 15:06:17 +08:00
Felipe Moura
ec134a99a8 netutils/dropbear: add scp support via SSH exec requests
Add SCP support do the dropbear server.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-05 15:06:17 +08:00
Tiago Medicci
8e00b4d672 interpreters/python: Disable no-maybe-uninitialized warning
This commit disables the `no-maybe-uninitialized` warning because
it's wrongly evaluated after increasing the optimization level of
the Python's library.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-07-03 09:19:04 -03:00
Jorge Guzman
59d3a0d0ae examples/lvglterm: support physical keyboard input
Refactor the LVGL terminal into a shared core (lvglterm.c) plus two
selectable input variants: the existing on-screen touch keyboard
(lvglterm_touch.c) and a new physical keyboard variant (lvglterm_kbd.c) that
reads key events from a /dev/kbdN device and streams them to the shell.

The input source is chosen with a Kconfig choice (touch by default, keeping
the previous behaviour).  The keyboard variant reads its device from
CONFIG_EXAMPLES_LVGLTERM_KBD_DEV (default /dev/kbd0), overridable by the first
command-line argument, and scrolls the output with the Fn cursor keys.  A font
choice (UNSCII 8 or 16) is added for low-resolution displays.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-03 09:16:58 -03:00
Matteo Golin
c91abf2c8d games/NXDoom: Fix build warnings
This commit resolves all of the build warnings that were preventing
NXDoom from compiling in CI runs.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-02 09:08:46 -03:00
Frederick Blais
e61f46536e interpreters/berry: Fix Wshadow build errors
The pinned Berry source emits -Wshadow diagnostics in a couple of files. NuttX CI passes -Werror, so sim:berry fails when those third-party warnings are promoted to errors.\n\nAdd -Wno-shadow to Berry-specific compiler flags in both Make and CMake paths, keeping the local source patch limited to the NuttX port changes.

Signed-off-by: Frederick Blais <fred_blais5@hotmail.com>
2026-07-02 09:07:50 -03:00
dependabot[bot]
e3f7126a8f build(deps): bump actions/cache from 5 to 6
Bumps [actions/cache](https://github.com/actions/cache) from 5 to 6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-30 20:45:56 +02:00
Matteo Golin
53bc21feb8 apps/games/NXDoom: Style ignores
Ignore some style/spelling errors in the DOOM port that cannot be fixed.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-06-30 15:22:55 -03:00
Matteo Golin
073188b50d games/NXDoom: Initial port of Chocolate DOOM to NuttX.
This commit includes a (highly) modified version of Chocolate DOOM which
can run on NuttX. The majority of the modifications were made to pass
the NuttX style check. Some small modifications have been added to
support keyboard input, render graphics to frame buffers and directly
use the POSIX interfaces NuttX supplies, stripping out Windows/Mac stuff
and any references to SDL.

NOTE: Sound is currently not supported in any capacity, nor is the
networking stuff. A lot of Chocolate DOOM code was stripped out since it
was unused. If there is a need/desire to add it back later, the original
Chocolate DOOM source can be used as a reference.

WARNING: The NuttX keyboard codec is incredibly non-standard and so
there are problems translating from X11 keys to NuttX ones to play DOOM.
Right now, the CTRL key for firing doesn't work because the NuttX codec
has no concept of it. The NuttX codec should be modified (and other
input devices supported), but at the time of this port I am not
sufficiently comfortable doing so since I am afraid of breaking other
things in the kernel.

NOTE: This port (and likely the original DOOM) seems to be written with
32-bit computers in mind. As such, most things are given the type of
natural `int`, even when a single byte might do. There are significant
size optimizations that could be made to make this more suited to
embedded devices that NuttX typically runs on.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-06-30 15:22:55 -03:00
Matteo Golin
53ca441b32 apps/games/NXDoom: Original Chocolate DOOM source
This commit adds the original Chocolate DOOM source which forms a basis
for the NuttX port of DOOM.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-06-30 15:22:55 -03:00
Xiang Xiao
5ead824fff apps: Fix O_ACCMODE bitmask checks after Linux flag alignment
After aligning NuttX open() flag constants with Linux (O_RDONLY=0,
O_WRONLY=1, O_RDWR=2), code that used '(flags & O_RDONLY)' or
'(flags & O_WRONLY)' as a bitmask check is broken because O_RDONLY
is now 0.  Fix by using '(flags & O_ACCMODE)' comparisons instead.

  - usrsocktest: replace 'flags & O_RDWR' with 'flags & O_ACCMODE'
    in fcntl F_GETFL assertions
  - dd: verify mode used '(oflags & O_RDONLY)' to detect verify;
    replace with '(oflags & O_ACCMODE) == O_RDWR'
  - dpopen: replace '(oflag & O_RDWR) == O_RDWR' with
    '(oflag & O_ACCMODE) == O_RDWR'
  - usbmsc: replace 'flags & O_WRONLY' with
    '(flags & O_ACCMODE) == O_RDONLY'
  - fcntl_test: replace '(flags & O_WRONLY) == 0' with
    '(flags & O_ACCMODE) == O_RDONLY'

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-30 12:19:58 -04:00
Frederick Blais
fc25af7cd7 interpreters/berry: Patch CRLF upstream source directly
Berry's downloaded default/berry.c uses CRLF line endings, while the local NuttX patch was LF. Fresh Linux and CMake builds failed when patch saw the line-ending mismatch.

Regenerate the local Berry patch against the pinned upstream CRLF source and apply it directly in both Make and CMake fetch paths. This keeps the integration working until the Berry-side change is merged upstream and the pinned commit can be updated.

Signed-off-by: Frederick Blais <fred_blais5@hotmail.com>
2026-06-30 23:55:57 +08:00
hanzhijian
9b51035300 nshlib/nsh_fscmds: Fix potential NULL pointer dereferences
Fix two potential NULL pointer dereferences in nsh_fscmds.c:

1. fdinfo_callback: asprintf() failure left filepath potentially
   NULL, which was then passed to nsh_catfile(). Add early return
   on asprintf failure.

2. cmd_cat: malloc(BUFSIZ) for stdin reading was used without
   checking the return value. Add NULL check with -ENOMEM return.

Also fix a typo in error message: 'nsh_catfaile' -> 'nsh_catfile'.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-06-30 10:05:08 -03:00
hanzhijian
f57aa7b4cf nshlib/nsh_fscmds: Display modification time in ls -l output
Fixes #17063

Add modification time display to ls -l long format output.
The timestamp is shown as 'YYYY-MM-DD HH:MM' between the permission
string and the file size, following the ISO long-iso format.

Files with st_mtime == 0 (e.g., procfs, tmpfs pseudo-entries) skip
the timestamp display to avoid showing a meaningless epoch time.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-06-30 10:03:03 -03:00
wangjianyu3
c503843e38 netutils/rexecd: add -t option to serve connections without a thread
By default rexecd spawns a detached worker thread per accepted connection
to allow concurrent sessions. Add a "-t" runtime option to instead handle
each connection inline in the main task, avoiding the per-connection
worker stack (CONFIG_NETUTILS_REXECD_STACKSIZE) allocation from the heap.
This matters on low-memory targets with limited free heap.

With "-t", connections are served strictly one at a time: a long-running
or interactive command blocks the accept loop until it finishes. Without
it, the existing thread-per-connection behaviour is unchanged.

Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-30 13:46:37 +08:00
Michal Lenc
535ecd8640 testing/libc/fopencookie/fopencookie.c: fix spellcheck
succesfull => successful

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-06-29 12:29:42 +02:00
Xiang Xiao
d172f81ecc apps: Replace O_RDOK with O_RDONLY after alias removal
The O_RDOK/O_WROK aliases have been removed from fcntl.h.  Replace
all remaining O_RDOK usage with O_RDONLY in the apps repository.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-29 07:42:09 +02:00
Xiang Xiao
4c560ef0a2 apps: Replace O_RDOK with O_RDONLY after alias removal
The O_RDOK/O_WROK aliases have been removed from fcntl.h.  Replace
all remaining O_RDOK usage with O_RDONLY in the apps repository.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-28 13:00:52 +02:00
Frederick Blais
a2b1cc16da interpreters/berry: Add Berry scripting language
Add an optional Berry interpreter under apps/interpreters.

Fetch the pinned upstream source and apply the NuttX default-port patch.

Generate Berry constant objects and build the NSH command through Kconfig.

Make and CMake build paths are included for normal app integration.

Signed-off-by: Frederick Blais <fred_blais5@hotmail.com>
2026-06-28 02:16:58 +08:00
wangjianyu3
253f1d40c3 netutils/rexecd: use dpopen() instead of popen() to get raw fd
popen() now returns a fopencookie-backed FILE* whose fileno() yields the
cookie pointer rather than a real descriptor, so poll() silently ignores
the negative fd and the relay loop blocks forever waiting for command
completion. See https://github.com/apache/nuttx-apps/pull/3511

Use dpopen()/dpclose() to obtain the raw bidirectional socket descriptor
directly, restoring the EOF/POLLHUP command-completion signal.

Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-27 08:47:46 -03:00
wangjianyu3
d29ae9bda6 netutils/rexec: initialize ret to avoid maybe-uninitialized
When the relay loop exits early without entering any branch, ret would be
returned uninitialized, tripping -Werror=maybe-uninitialized. Initialize
it to 0.

Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-27 08:47:46 -03:00
Alan Carvalho de Assis
ae718ba47f nsh/echo: Fix echo previous behavior, single write with '\n'
This commit fixes the previous behavior where an echo with a
single string and its default new line is send as single write().

This issue came from:  https://github.com/apache/nuttx-apps/pull/1559

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-06-27 13:44:14 +02:00
Felipe Moura
fee2ddbf54 netutils/dropbear: add Dropbear SSH server port for NuttX
Integrated SSH daemon authenticating against FSUTILS_PASSWD, with an
ECDSA P-256 host key and an NSH session over a PTY per connection. Built
from the upstream Dropbear tarball (pinned commit) and patched for
NuttX, using Dropbear's bundled libtomcrypt for all crypto. setsid()
(apache/nuttx#19184) and link() now come from NuttX, not local stubs.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-06-27 08:42:00 -03:00
Michal Lenc
e44c4f370f testing/libc: add stdbit test
Adds the testing application used for CI stdc*_ functions tests.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-06-27 19:28:34 +08:00
Nightt
cea2f89f74 industry/scpi: add unit parser config options
Expose scpi-parser unit support through explicit Kconfig options instead of raw CFLAGS.

Map each option to the corresponding upstream USE_UNITS_* compile-time define, preserving the existing default unit set while allowing users to enable groups such as USE_UNITS_TIME.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-25 23:48:43 +08:00
dependabot[bot]
085ca0606e build(deps): bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-23 13:26:39 -04:00
aviralgarg05
da143595e1 apps: add missing module metadata for executable tools
Add the missing module metadata for the executable ELF helpers used by the package fixture flow so the generated artifacts describe their target and type consistently.

Also fix the existing embedlog spelling issue that is picked up by the current apps check, keeping this branch clean under CI.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-06-22 22:27:07 +08:00
Andrew Au
d9874394dd testing/sig_sp_test: add test for SP context restore on signal return
Add a test that verifies modifying SP (REG_R13) in the saved register
context is honored on signal return. The test pushes values onto the
stack, triggers SIGALRM, and in the handler advances SP to skip a
value, then verifies the correct value is popped after signal return.

This exercises the SP relocation fix in arm_sigdeliver.c for ARMv7-M
and ARMv8-M architectures.

Signed-off-by: Andrew Au <cshung@gmail.com>
2026-06-22 10:21:40 -03:00
Xiang Xiao
326b68aa36 examples/userfs: use designated initializers for struct dirent
The g_rootdir[] table initialized each entry's struct dirent member
positionally as { DTYPE_FILE, "FileN" }, which assumes d_type is the
first field.  This breaks when struct dirent gains the POSIX d_ino field
as its first member (see apache/nuttx: "fs/dirent: add d_ino member to
struct dirent"): the file-name string would be assigned to d_type,
producing -Wint-conversion warnings and an "initializer element is not
computable at load time" error.

Use designated initializers (.d_type / .d_name) so the table is robust
against the field order of struct dirent.

Also fix a 'Initiallly' typo in a nearby comment flagged by codespell.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-22 10:20:43 -03:00
Abhishek Mishra
75ee4d9090 nshlib: Add su, id, and whoami identity commands
Add NSH commands for switching effective credentials and inspecting
session identity. Update login and prompt to reflect effective user.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-06-20 15:38:45 -03:00
aviralgarg05
65854ea805 system/nxpkg: add local package lifecycle helper
Add the initial nxpkg command, metadata and store handling, the local install/list path, and the repository export helper.

Keep the current flow scoped to local artifacts and target-qualified repository entries so it remains usable as an incremental MVP while follow-up features land separately.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-06-20 15:05:28 -03:00
Nightt
477d04b975 examples/gps: print units after measurements
Move GPS example units after the printed values to match the requested output style.

Wrap long printf format strings for checkpatch.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-20 11:51:35 -03:00
Nightt
1a6d06c3be examples/gps: show units in output
The GPS example prints parsed measurements without explicit units. The RMC
floating-point speed path also used minmea_tocoord(), even though speed is
not a coordinate.

Add units to the output labels, print speed with minmea_tofloat(), and print
GGA altitude as a scaled value with the sentence-provided unit.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-20 11:51:35 -03:00
Shoji Tokunaga
8d6c495365 examples/rust: Show command arguments in hello_rust_cargo
Print each argument passed from nsh with its index, and report when
the example is running on the simulator target. This makes the Rust
example demonstrate both C argv handling and target-specific output.

Signed-off-by: Shoji Tokunaga <toku@mac.​com>
2026-06-20 10:33:46 -03:00
Shoji Tokunaga
d1202bd501 examples/rust: Avoid the infinite loop on sim for hello_rust_cargo
On the sim target (Windows/macOS/Linux), hello_rust_cargo_main() ended
with an infinite `loop {}` that never returned control to NSH, so the
example could not exit and the shell prompt hung.

Introduce a Cargo `sim` feature that is enabled only when CONFIG_ARCH_SIM
is set, and use it to compile out the trailing infinite loop and return 0
instead. Other embedded targets keep the original looping behavior.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-06-20 10:33:46 -03:00
Abhishek Mishra
ee4727fdba testing/ostest: Add multi-user permission regression tests
Add CONFIG_TESTING_OSTEST_MULTIUSER tests for seteuid, file permissions,
and pseudoFS/tmpfs permission enforcement.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-06-19 12:19:18 -03:00
Tiago Medicci
1e19ceb347 examples/webpanel: Add a web panel application to configure NuttX
Initial development of the NuttX's Web Panel application. This is
a self-hosted web page application that enables retrieving system
info, provides a simple NSH terminal and enables uploading files.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-18 09:14:36 -03:00
Tiago Medicci
b523f0e513 interpreters/python: Optmize Python for size
This aims to reduce Python's library size.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:54:51 -03:00
Tiago Medicci
ec764fbbab examples/lws_echo: Add a simple websocket server example
This commit adds a simple websocket server example that echoes data
back to the client using libwebsockets.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:27:29 -03:00
Tiago Medicci
d6cf3015d8 netutils/libwebsockets: Fix error regarding building with CMake
Prior to this change, if an empty folder existed instead of the
actual libwebsockets source, the build would fail. This commit
checks for an actual file instead, avoid such kind of errors.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:27:29 -03:00
Tiago Medicci
4263e27d92 netutils/libwebsockets: Enable libwebsockets server
This commit enables building libwebsockets server based on a new
Kconfig entry.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:27:29 -03:00
Tiago Medicci
d106011a7f netutils/libwebsockets: Remove hard dependency on mbedTLS
libwebsockets can be built without TLS support. To allow this, it
was necessary to create a specific Kconfig option that enables TLS
support if OPENSSL_MBEDTLS_WRAPPER is enabled. Otherwise, TLS is
not supported (but libwebsockets can still be used with plain ws://
connections).

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:27:29 -03:00
Tiago Medicci
c51180d780 examples/mdnsd: Create an event-based starter for mDNS daemon
Start the mDNS daemon based on the event of getting a new IP
address for any of the system's network interfaces. This allows
DHCP client to trigger the mDNS daemon after getting a new IP
address, for instance.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:24:42 -03:00
Jukka Laitinen
4740945157 ostest: Make POSIX timers test work with CONFIG_ENABLE_PARTIAL_SIGNALS
POSIX timers test doesn't really need signal actions, so we can change it
to synchronously wait for the signal in sigwaitinfo, instead of registering
a signal handler.

Also exclude the test from compilation with CONFIG_DISABLE_ALL_SIGNALS;
the test does require at least partial signal support.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-16 08:49:22 +02:00
Nightt
afc652243e examples/thttpd: use procfs for tasks CGI
The tasks CGI used nxsched_foreach() to walk scheduler internals and read
fields directly from struct tcb_s. That exposes an application example to
non-standard OS internals.

Read task information from /proc/<pid>/status instead, matching the public
procfs interface used by other task listing tools.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-14 08:56:44 -03:00
Filipe Cavalcanti
c00dc40525 interpreters/python: support nuttx-periphery package
Adds support for installing nuttx-periphery Python package by default
on Python support. This package provides API for accessing Nuttx
character drivers.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-06-12 11:56:37 -04:00
Filipe Cavalcanti
e18a206082 interpreters/python: update repack_wheel script
Updates the repack_wheel_add_pyc.py script to support other packages,
not only pip.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-06-12 11:56:37 -04:00
Lars Kruse
397047fa37 benchmarks/mtd: use uniform output style for numbers
One of the four values emitted by this interactive tools uses the
hexadecimal presentation. The other values are decimal numbers.
Now the confusion is avoided: all numbers use the decimal
representation.

In addition the suffix "size" is added to the "Erase block" label
in order to clarify its meaning.

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
2026-06-10 16:43:17 +08:00
Peter Barada
499352fb0c testing/drivers/hash: Add unaligned buffer size test
Add hash testing of unaligned buffer sizes via multiple call to
ioctl(CIOCCRYPT) in a single session with buffer sizes incrementally
increasing from zero size to 255 (with monotoncially increasing
byte value data) to force all sizes to be handled by cryptodev
implementations.

Signed-off-by: Peter Barada <peter.barada@gmail.com>
2026-06-10 16:42:13 +08:00
Nightt
fa2dd70386 system/popen: Avoid copying FILE
Use fopencookie() to attach the popen fd and shell pid to the returned FILE stream instead of copying FILE into the popen container.

Keep the upstream dpopen()/dpclose() implementation as the process and descriptor backend, and make pclose() close the cookie-backed stream directly.

Fixes #2937.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-09 19:35:15 +08:00
hanzhijian
03171162f1 system/uorb: introduce CONFIG_UORB_FORMAT for format string control
Introduce a new CONFIG_UORB_FORMAT Kconfig option to control whether
uORB format strings are compiled in. UORB_LISTENER, UORB_GENERATOR,
and DEBUG_UORB all select UORB_FORMAT automatically, so format strings
are included when any of these features are enabled.

This replaces the previous approach of guarding format strings with
CONFIG_DEBUG_UORB, which prevented uorb_listener from displaying
sensor data when debug output was disabled.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-06-09 17:02:03 +08:00
Felipe Moura
8b43c71595 examples/rng90: add RNG90 example
Add a new RNG90 example application that opens the RNG90 character device, reads random bytes, and prints them in hexadecimal format.

The example supports optional command-line arguments for device path and byte count and integrates with Kconfig, Make, and CMake build flows.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-06-09 12:36:04 +08:00
Shoji Tokunaga
33d96e92e5 apps/tools: Enable Rust sim builds on Intel Macs
Select the Mach-O Rust target (x86_64-unknown-nuttx-macho.json) when
building Rust apps for the simulator on x86_64 macOS.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-06-09 07:08:41 +08:00
hanzj
8b4d20e411 system/uorb: fix listener_top not showing topic data
listener_update() only prints topic data when delta_generation is
non-zero (i.e., new data arrived since last check). In listener_top,
the first call adds objects to the list, and subsequent calls only
print if new data was published between iterations. This results in
listener_top -T showing only the header with no topic rows.

Fix by always printing the current topic state in listener_update,
setting frequency to 0 when no new data arrives. This ensures
listener_top displays all topics every iteration.

Fixes apache/nuttx-apps#3202

Signed-off-by: hanzj <hanzhijian@zepp.com>
2026-06-06 18:27:56 +08:00
raiden00pl
80907e514c lte: make lte_initialize() build without the ALT1250 daemon
Guard the daemon path (and is_daemon_running()) with CONFIG_MODEM_ALT1250 and
return OK from lte_initialize() when it is not set, so lapi builds and works
for kernel-resident LTE modems.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-06 15:53:14 +08:00
simbit18
0758631811 workflows/build.yml: Fix Skipping sim\windows in the MSVC job
Fix

====================================================================================
Cmake in present: sim\windows
Configuration/Tool: sim\windows
2026-06-05 16:01:37
------------------------------------------------------------------------------------
  Cleaning...
  Skipping: sim\windows
------------------------------------------------------------------------------------
End: 2026-06-05 16:01:37
====================================================================================

The "windows-latest" and “windows-2025” labels in GitHub Actions will be migrated to use Visual Studio 2026 by default. Customers needing Visual Studio 2022 must migrate to the windows-2022 image.

https://github.com/actions/runner-images/issues/14017

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-06-06 08:44:50 +08:00
fangpeina
1d7d4fe67e system/nxinit: fix init parser to handle multiple quoted arguments
Fix argument parsing in init_parse_arguments() to properly handle
multiple quoted arguments like 'echo "arg1" "arg2"' by skipping
quote characters after processing them.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-06-05 09:43:45 +08:00
wangjianyu3
d79d8107b3 system/nxinit: Fix signal mask inheritance
The init process has blocked all signals, spawned services would
inherit that mask. This could cause services to miss important
signals like SIGTERM during graceful shutdown.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-05 09:43:45 +08:00
wangjianyu3
b73a5acf92 system/nxinit: Fix missing check for import argument
Add missing return value check for init_parse_arguments function.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-05 09:43:45 +08:00
v-maomingju
63c691eae2 system/nxinit: fix unused variable warning
fix the unused variable warnings for name and status in init.c.

Signed-off-by: v-maomingju <v-maomingju@xiaomi.com>
2026-06-05 09:43:45 +08:00
wangjianyu3
84d6b1276f system/nxinit: Avoid SIGCHLD race with ppoll()
Pending all signals(SIGCHLD) when ppoll() is not invoked to
avoid race conditions.

Case reproduction

  Set examples/hello as a service that exits immediately after startup.

  ```init.rc
  on boot
     start hello

  service hello hello
     restart_period 0
  ```

  Log - without this patch:

    # Service hello only restarts about 100 times, ppoll is not woken up
    # after the hello process with PID 119 exits.

    [    4.391274] [ 2] [ 0] init_main: service 'hello' pid 118 exited status 0
    [    4.401423] [ 2] [ 0] init_main: started service 'hello' pid 119

  Log - with this patch:

    # ppoll() can still be woken up normally after tens of thousands of
    # restarts of service hello in stress test.

    [  268.447747] [ 2] [ 0] init_main: service 'hello' pid 34503 exited status 0

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-05 09:43:45 +08:00
fangpeina
78bf19c83c system/nxinit: prevent parser from reading past string boundry
Any string ending with whitespace passed to init_parse_arguments()
could cause the parser to advance past the string boundary and read
unintended memory content.
 - " echo "A" \0& echo "B" should be parsed
   as a command with two argvs instand of five.
 - "command arg  " may lead to uncertain results.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-06-05 09:43:45 +08:00
wangjianyu3
b0fdffb7f6 system/nxinit: Fix timespec incomplete error in action.h
/.../apps/system/nxinit/action.h:72:19: error: field 'time_run' has incomplete type
    72 |   struct timespec time_run;
       |                   ^~~~~~~~

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-05 09:43:45 +08:00
fangpeina
62b74502fe system/nxinit: fix uninitialized 'wstatus' warning
reap_process() referenced an undeclared identifier 'wtatus' on
the WIFSIGNALED branch (typo of 'wstatus'). Some toolchains then
flagged a -Wmaybe-uninitialized on the surrounding wstatus use.

Correct the typo so WIFSIGNALED/WTERMSIG operate on the actual
wstatus value returned by waitpid().

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-06-05 09:43:45 +08:00
fangpeina
3d26835e0c system/nxinit: fix compilation errors in action.c
action.c uses clock_gettime(CLOCK_MONOTONIC, ...) but did not
pull in <nuttx/clock.h> directly, which fails to build on
configurations where the header is not transitively included.

Add the missing #include.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-06-05 09:43:45 +08:00
wangjianyu3
df01c3cbfc system/nxinit: Handle trailing file '\0'
When ETC_ROMFS is disabled to reduce the bin size, we can provide the init.rc
file via a pseudo-file in the boards/vendor directory. For example:
  - CONFIG_ETC_ROMFS=n
  - CONFIG_PSEUDOFS_FILE=y
  - CONFIG_DISABLE_PSEUDOFS_OPERATIONS=n
  ```C
  FAR const char *init_rc =
    "on init\n"
    "    start console\n";
    "service console sh\n"
    "    restart_period 100\n";

  int fd = open("/etc/init.d/init.rc", O_WRONLY | O_CREAT);
  /* ... */
  ssize_t n = write(fd, init_rc, strlen(init_rc) + 1);
  /* ... */
  close(fd);
  ```

The last character '\0' in the file content will be treated as a new line,
and the number of parsed parameters will be zero (abnormal, there should be
at least one keyword).

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-05 09:43:45 +08:00
hanzj
e86c0b997d system/nxinit: skip empty lines in init.rc parser
Empty lines in init.rc caused parsing to fail with -EINVAL because init_parse_arguments() returns 0 for empty strings, triggering the 'argc < 1' error path in init_action_parse() and accessing uninitialized argv[0] in init_service_parse().

Fix by skipping empty lines and lines containing only whitespace before attempting to match section keywords or calling parser callbacks.

Fixes apache/nuttx-apps#3513

Signed-off-by: hanzj <hanzhijian@zepp.com>
2026-06-04 13:11:09 -03:00
Shoji Tokunaga
840c2f30db apps/rust: Add dependencies for Rust cargo in make builds
Add a Rust make helper that collects crate input files, and use it for
the Rust hello and slint examples.

This makes the generated Rust static libraries depend on the crate
sources, manifests, build scripts. Hook the libraries into both context
and all, so re-running make after editing Rust inputs rebuilds the crate.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-06-04 08:58:07 -03:00
Arjav Patel
c106a02b58 examples/microros_sub: Add minimal Int32 subscriber example.
Mirror of microros_pub for the receive direction.  Creates a node,
subscribes to /nuttx_sub with std_msgs/Int32, drives an rclc_executor
spin loop, and prints each received value.  Exercises the new
rclc_executor + subscription callback path on top of the
microros_transport library shipped in apps/system/microros.

Validates the NuttX-native transport in the agent->client direction
end-to-end against a micro-ROS agent + ros2 topic pub on the host.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-06-04 14:30:34 +08:00
cuiziwei
97802bd9e0 testing/libc/popen: add popen/dpopen test for shell and no-shell modes
Add tests for popen()/pclose() and dpopen()/dpclose() that work in
both shell (NSH) and no-shell (direct posix_spawnp) modes.  The test
binary doubles as its own target via the --echo sub-command.

Tests:
 1-4: popen  - basic read, multi-arg, pclose, invalid mode
 5-7: dpopen - basic read, multi-arg, dpclose

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-06-02 23:35:28 +08:00
cuiziwei
740fda9630 system/popen: support no-shell mode via posix_spawnp
When NSH_LIBRARY is not available, dpopen()/popen() can still execute
commands by splitting the command string by whitespace and calling
posix_spawnp() directly.  Shell syntax (pipes, redirects, globbing)
is not supported in this mode.

Add CONFIG_SYSTEM_POPEN_MAXARGUMENTS (default 7) to control the
argv array size for the no-shell path.

Remove the hard dependency on NSH_LIBRARY from SYSTEM_POPEN so the
feature can be used in minimal configurations without a shell.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-06-02 23:35:28 +08:00
cuiziwei
0d35e2e0bb system/popen: add dpopen/dpclose fd-based interface
Add dpopen()/dpclose() as the descriptor-based counterpart of
popen()/pclose(), analogous to how dprintf() relates to fprintf().
dpopen() returns a raw file descriptor instead of a FILE stream,
avoiding the stdio.h dependency for callers that only need an fd.

Refactor popen() as a thin wrapper: dpopen() + fdopen() + FILE
container.  All pipe creation and process spawning logic now lives
in dpopen.c.

Also remove the hard dependency on NSH_LIBRARY from SYSTEM_POPEN.
When NSH is available, commands are executed through sh -c with full
shell syntax support.  When NSH is not available, commands are split
by whitespace and executed directly via posix_spawnp().

Add CONFIG_SYSTEM_POPEN_MAXARGUMENTS (default 7) to control the
argv array size for the no-shell path.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-06-02 23:35:28 +08:00
Eren Terzioglu
3a255d5463 testing/drivers/crypto: Fix typo on hash test
Fix typo issue on hash test

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-06-02 15:15:03 +02:00
Shoji Tokunaga
9796690b7b apps/cmake: Fix aarch64 NuttX Rust target specs
Add aarch64 Rust target specs for NuttX, including a Mach-O variant
for macOS sim builds. Use the NuttX custom targets instead of
aarch64-apple-darwin so Rust std is built with target_os=nuttx while
still producing link-compatible objects for sim.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-06-02 13:06:58 +02:00
Arjav Patel
1081225509 examples/microros_pub: Add minimal Int32 publisher example.
End-to-end exercise of the micro-ROS stack on NuttX: calls
microros_transport_init() to register the configured backend,
brings up rclc_support / node / publisher, publishes 30
std_msgs/Int32 messages on /nuttx_pub at 1 Hz, then tears the
stack down cleanly.

The example's Make.defs adds $(APPDIR)/system/microros/transport
to its own CFLAGS rather than the system/microros Make.defs, so
the transport-glue header path is not pushed into the global
search path for unrelated apps.

Serves as the smoke test for the transport layer and as a template
for downstream publisher apps.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-06-02 00:15:25 +08:00
Arjav Patel
5e91459b1a system/microros: Add UDP and serial custom transport backends.
Micro XRCE-DDS expects the application to supply open/close/write/read
callbacks for the wire transport. Add a single dispatcher that
registers the selected backend via rmw_uros_set_custom_transport(),
plus two backends:

transport/microros_transport_udp.c
  BSD-socket UDP backend. Opens an AF_INET/SOCK_DGRAM socket,
  resolves CONFIG_MICROROS_AGENT_IP/PORT, connect()s it, and uses
  send/recv. The socket fd is stashed in uxrCustomTransport->args
  so no module-level state is needed.

transport/microros_transport_serial.c
  termios serial backend. Opens CONFIG_MICROROS_SERIAL_DEVICE with
  O_RDWR|O_NOCTTY|O_CLOEXEC, switches to raw 8N1 at
  CONFIG_MICROROS_SERIAL_BAUD, and uses poll/read/write. Fd is
  again stashed in uxrCustomTransport->args.

Both backends are mutually exclusive at compile time via Kconfig;
the dispatcher selects which set of callbacks to register. Wired
into both the legacy Make build (CSRCS in system/microros/Makefile)
and the CMake build (separate microros_transport static library
with the transport directory only exposed to its INTERFACE).

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-06-02 00:15:25 +08:00
Arjav Patel
0a0118b93c system/microros: Wire libmicroros include layout and sim final link.
libmicroros is installed by colcon under include/<pkg>/<pkg>/file.h
for ament-packaged headers (e.g. rcl, rmw, rosidl) and the flat
include/<pkg>/file.h for a few others (e.g. rclc). A single
-I include/ therefore resolves <rclc/rclc.h> but not <rcl/rcl.h>.

Enumerate every immediate subdirectory of include/ in addition to
include/ itself so both layouts resolve.

Switch the library hand-off from LDLIBS to EXTRA_LIBS. The sim
target's final link pulls EXTRA_LIBS, not LDLIBS, so the previous
form left rcl/rclc/rcutils symbols unresolved.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-06-02 00:15:25 +08:00
Arjav Patel
3d6ea0ccec system/microros: Fix toolchain attribute strip breaking libc inlines.
micro_ros_lib/toolchain.cmake.in initialised C and CXX flags with
-D'__attribute__(x)=' to silence GCC attributes the upstream ament
build is not aware of. The strip also removed __gnu_inline__ and
__always_inline__ from NuttX's libc string.h inlines, so each
micro-ROS translation unit emitted external definitions of strcmp,
strcpy, strlen and friends. Sim final link then failed with ~50
multiple-definition errors.

Drop the define from both flag init lines so the attributes survive
and the inlines collapse as intended.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-06-02 00:15:25 +08:00
Peter Barada
fa46bdf9e8 testing/drivers/crypto: Add SH224 hash test
Add SHA224 hash test using results generated from sha224sum.

Modify "huge block" testing since allocating 600KB to hash all
at once fails on most microcontrollers.  Instead allocate a
smaller block and pass into syshash_update() enough times to
hash 600KB of data.

Signed-off-by: Peter Barada <peter.barada@gmail.com>
2026-05-31 11:44:37 +08:00
hanzj
07647d3fd4 system/lzf: Fix missing space in Kconfig help text.
Fix a missing space in the Kconfig help text for SYSTEM_LZF:
'Enable theLZF' → 'Enable the LZF'.

Signed-off-by: Zepp-Hanzj <Zepp-Hanzj@users.noreply.github.com>
Signed-off-by: hanzj <hanzjian@zepp.com>
2026-05-28 21:27:01 +02:00
Nightt
c0fc208202 system/settings: Bound storage string handling
Use configured key, value, and filename limits while loading and saving settings storage data.

The text backend now builds backup filenames with a sized buffer and bounded formatting, and both text and binary loading reject keys or string values that are not terminated within their configured field sizes. This completes #3109 without changing the storage formats.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-28 14:35:54 +02:00
Nightt
a74b2fc61b system/settings: Bound public string handling
Use strnlen() for public key, value, and storage path length checks so user-provided settings strings are validated against the configured maximum sizes before they are scanned.

Use bounded key comparisons and strlcpy() for fixed-size settings fields. This addresses part of #3109 without changing the settings API or storage formats.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-28 14:35:54 +02:00
hanzj
b5b54e7663 interpreters/quickjs,testing/nettest: fix typos in Kconfig and source.
Fix spelling errors in QuickJS Kconfig and nettest source:
* "distable" -> "disable" in INTERPRETERS_QUICKJS_NONE description
* "destory" -> "destroy" in INTERPRETERS_QUICKJS_EXT_HOOK option
  and help text (2 occurrences)
* "err_destory" -> "err_destroy" label in nettest_tcpserver.c
  (3 occurrences: 2 goto targets and 1 label definition)

These are cosmetic fixes with no functional change.

Signed-off-by: hanzj <hanzjian@zepp.com>
2026-05-28 15:02:31 +08:00
Matteo Golin
418cf21224 apps/nxinit: Fix uninitialized variable
Without debug enabled, the code would not compile due to checking
`WIFEXITED(wstatus)` when `wstatus` was uninitialized.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-05-28 01:08:11 -03:00
Matteo Golin
2b5899c7d4 apps/nxinit: Make init.rc file path configurable
The init.rc file path is now configurable to allow users to choose where
to put the startup script. This is useful for devices that mount
external media to a special directory like `/sd`.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-05-28 01:08:11 -03:00
Matteo Golin
6d8708184e apps/nxinit: Fix service length error
Would not compile due to typo in macro describing service name length.

Change ensures that:
* We do not malloc an extra `len` bytes since this is already allocated
  as part of the struct
* The name string always has a null terminating byte

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>

FIx
2026-05-28 01:08:11 -03:00
Matteo Golin
241096a87b apps/nxinit: Fix Kconfig typo
Fix typo in help string.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-05-28 01:08:11 -03:00
Alan Carvalho de Assis
c28e61fd39 system/nxinit: Change NXInit to EXPERIMENTAL
Since NXInit still under development, it is better to change it to
EXPERIMENTAL.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-05-27 17:20:07 -03:00
Alan Carvalho de Assis
5341a2fc92 system/nxinit: Add final event
Add the final event option to the Kconfig

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-05-27 17:20:07 -03:00
Alan Carvalho de Assis
d8ead1a0f3 system/nxinit: Remove deprecated BOARDIOC_INIT ioctl
Since boardctl(BOARDIOC_INIT, 0) was removed from all boards, it is
not right to use it here.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-05-27 17:20:07 -03:00
Alan Carvalho de Assis
820eb64f1a system/nxinit: Change LOG_DEBUG to LOG_USER
Make it clear it is a userspace log.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-05-27 17:20:07 -03:00
Alan Carvalho de Assis
cdb89a54f6 system/nxinit: Let use a define to define the class max cmds
Avoid fixing the max 99 class cmds directly in the code.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-05-27 17:20:07 -03:00
Alan Carvalho de Assis
7af8ed81fd system/nxinit: Fix name[0] issue
This an issue where a variable was declared as name[0]

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-05-27 17:20:07 -03:00
Alan Carvalho de Assis
610de9816d system/nxinit: Add comments to the Kconfig
This comments to be visible to the users

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-05-27 17:20:07 -03:00
wangjianyu3
84e87a5158 system/nxinit: Add reboot_on_failure for service
Add support for the reboot_on_failure option to the service.

When the execution of a command within a certain action fails (returning
a non-zero status code), NxInit will continue to execute subsequent commands or
actions and will not proactively terminate the startup process. To implement
the functionality of "terminating the startup process after a command
execution fails", there are two methods:
a. Execute conditional statements (if/then/else/fi) via exec command,
   but this depends on sh:
   ```
   on init
       exec -- set +e; \
               mount -t fatfs /dev/data /data ; \
               if [ $? -ne 0 ] ; \
               then \
                 echo "failed" ; \
                 reboot ; \
               else \
                 echo "succeed" ; \
               fi;
   ```
b. Via service's oneshot + reboot_on_failure:
   /* Although the example uses sh, it does not depend on it and can be
    * replaced with any other Builtin Apps.
    */
   ```
   on init
       exec_start mkdir_tmp
       ls /tmp

   service mkdir_tmp sh -c "mkdir /tmp"
       reboot_on_failure 0
       oneshot
   ```

Test
  - RC
      service console sh
          class core
          override
    >     reboot_on_failure 0
          restart_period 10000
  - Runtime
      [    0.150000] [ 3] [ 0] init_main: == Dump Services ==
      ...
      [    0.170000] [ 3] [ 0] init_main: Service 0x40486ea0 name 'console' path 'sh'
      [    0.170000] [ 3] [ 0] init_main:   pid: 0
      [    0.170000] [ 3] [ 0] init_main:   arguments:
      [    0.170000] [ 3] [ 0] init_main:       [0] 'service'
      [    0.170000] [ 3] [ 0] init_main:       [1] 'console'
      [    0.170000] [ 3] [ 0] init_main:       [2] 'sh'
      [    0.170000] [ 3] [ 0] init_main:   classes:
      [    0.170000] [ 3] [ 0] init_main:     'core'
      [    0.170000] [ 3] [ 0] init_main:   restart_period: 10000
    > [    0.170000] [ 3] [ 0] init_main:   reboot_on_failure: 0
      [    0.170000] [ 3] [ 0] init_main:   flags:
      [    0.170000] [ 3] [ 0] init_main:     'override'
      ...
      [    0.380000] [ 3] [ 0] init_main: started service 'console' pid 4
      ...
      nsh> kill -9 4
      [    8.060000] [ 3] [ 0] init_main: service 'console' flag 0x20000004 add 0x4
      [    8.060000] [ 3] [ 0] init_main:   -flag 'running'
      [    8.060000] [ 3] [ 0] init_main: service 'console' flag 0x20000000 add 0x8
      [    8.060000] [ 3] [ 0] init_main:   +flag 'restarting'
    > [    8.060000] [ 3] [ 0] init_main: Error reboot on failure of service 'console' reason 0

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-05-27 17:20:07 -03:00
wangjianyu3
84f798d434 system/nxinit: Add exec_start support for action
Format: exec_start <service>

Start the specified service and pause the processing of any additional
initialization commands until the service completes its execution. This
command operates similarly to the `exec` command; the key difference is
that it utilizes an existing service definition rather than requiring
the `exec` argument vector.

This feature is particularly intended for use with the `reboot_on_failure`
built-in command to perform all types of essential checks during system boot.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-05-27 17:20:07 -03:00
wangjianyu3
8049d91a95 system/nxinit: Add oneshot support for service
Add support for the oneshot option to the service.

Test
  - RC
      service telnet telnetd
          class test
    >     oneshot
          restart_period 3000
  - Runtime
      [    0.150000] [ 3] [ 0] init_main: == Dump Services ==
      ...
      [    0.160000] [ 3] [ 0] init_main: Service 0x40486aa8 name 'telnet' path 'telnetd'
      [    0.160000] [ 3] [ 0] init_main:   pid: 0
      [    0.160000] [ 3] [ 0] init_main:   arguments:
      [    0.160000] [ 3] [ 0] init_main:       [0] 'service'
      [    0.160000] [ 3] [ 0] init_main:       [1] 'telnet'
      [    0.160000] [ 3] [ 0] init_main:       [2] 'telnetd'
      [    0.160000] [ 3] [ 0] init_main:   classes:
      [    0.160000] [ 3] [ 0] init_main:     'test'
      [    0.170000] [ 3] [ 0] init_main:   restart_period: 3000
      [    0.170000] [ 3] [ 0] init_main:   reboot_on_failure: -1
      [    0.170000] [ 3] [ 0] init_main:   flags:
    > [    0.170000] [ 3] [ 0] init_main:     'oneshot'
      ...
      [    0.370000] [ 3] [ 0] init_main: starting service 'telnet' ...
      [    0.380000] [ 3] [ 0] init_main: service 'telnet' flag 0x2 add 0x4
      [    0.380000] [ 3] [ 0] init_main:   +flag 'running'
      [    0.380000] [ 3] [ 0] init_main: service 'telnet' flag 0x6 add 0x8
      [    0.380000] [ 3] [ 0] init_main:   -flag 'restarting'
      [    0.380000] [ 3] [ 0] init_main: service 'telnet' flag 0x6 add 0x1
      [    0.380000] [ 3] [ 0] init_main:   -flag 'disabled'
      [    0.380000] [ 3] [ 0] init_main: started service 'telnet' pid 9
      ...
      nsh> kill -9 9
      nsh> [    7.350000] [ 3] [ 0] init_main: service 'telnet' flag 0x6 add 0x4
      [    7.350000] [ 3] [ 0] init_main:   -flag 'running'
      [    7.350000] [ 3] [ 0] init_main: service 'telnet' flag 0x2 add 0x80000001
      [    7.350000] [ 3] [ 0] init_main:   +flag 'disabled'
      [    7.350000] [ 3] [ 0] init_main:   +flag 'remove'
      [    7.350000] [ 3] [ 0] init_main: service 'telnet' pid 9 exited status 1
    > [    7.360000] [ 3] [ 0] init_main: removing service 'telnet' ...

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-05-27 17:20:07 -03:00
wangjianyu3
4281a1096f system/nxinit: Warning for long commands
If the command of an action takes too long (greater than
CONFIG_SYSTEM_NXINIT_ACTION_WARN_SLOW milliseconds, 50 ms by default),
a warning log will be output for analysis and debugging.

For example:

  a. sleep 1
       [    0.340000] [ 3] [ 0] init_main: executing NSH command 'sleep 1'
       [    1.360000] [ 3] [ 0] init_main: NSH command 'sleep 1' exited 0
     > [    1.360000] [ 3] [ 0] init_main: command 'sleep' took 1020 ms

  b. hello (add sleep(1) to examples/hello)

       [    1.390000] [ 3] [ 0] init_main: executed command 'hello' pid 14
       [    1.390000] [ 3] [ 0] init_main: waiting 'hello' pid 14
       Hello, World!!
     > [    2.400000] [ 3] [ 0] init_main: command 'hello' pid 14 took 1010 ms
       [    2.400000] [ 3] [ 0] init_main: command 'hello' pid 14 exited status 0

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-05-27 17:20:07 -03:00
wangjianyu3
7c02e7f555 system/nxinit: Add NSH builtin support for action
Enable CONFIG_SYSTEM_SYSTEM to support nsh builtins, which depends on nsh.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-05-27 17:20:07 -03:00
wangjianyu3
8594627d8a system/nxinit: Add class start/stop for service
Usage:
  class_start <classname>
  class_stop <classname>

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-05-27 17:20:07 -03:00
wangjianyu3
492a86691d system/nxinit: Add NuttX Init
This component (abbreviated as "NxInit") is specifically developed
for NuttX and intended for system initialization. While we have
adopted the Android Init Language among various syntax options,
this is a brand-new implementation—it is not a port or variant of
Android Init.

Refer to the implementation of Android Init Language, consists of five broad
classes of statements: Actions, Commands, Services, Options, and Imports.

Actions support two types of triggers: event and action. Action triggers also
support runtime triggering. Services support lifecycle management, including
automatic restart (at specified intervals), and starting/stopping
individually or by class. Import supports files or directories, and we may
add a static method in the future. The following are some differences:
  1. The Android Init Language treats lines starting with `#` as comments,
     while we use a preprocessor to handle comments.
  2. For action commands, we can omit "exec" and directly execute
     built-in apps or nsh builtins.
  3. Regarding the property service, users can either adapt it by self or
     directly use the preset NVS-based properties.
  4. Only part of standard action commands and service options are
     implemented currlently.

To enable system/nxinit:
  ```diff
  -CONFIG_INIT_ENTRYPOINT="nsh_main"
  +CONFIG_INIT_ENTRYPOINT="init_main"
  +CONFIG_SYSTEM_NXINIT=y
  ```

For format and additional details, refer to:
  https://android.googlesource.com/platform/system/core/+/
  master/init/README.md

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-05-27 17:20:07 -03:00
wangjianyu3
ed063a0981 nshlib: fix infinite loop on broken stdout in nsh_catfile
When stdout is broken (e.g. PTY master closed), nsh_catfile could spin
forever: write() fails, error logging generates syslog output to
/dev/log, next read() picks it up, write() fails again, ad infinitum.

Two fixes:
- nsh_console: drop the _err() in nsh_consolewrite entirely.  The risk
  is errno-agnostic (EPIPE / EIO / ENOSPC / ...): any failure logged
  here can be re-injected by the syslog backend when OUTFD is bound to
  /dev/log.  Callers already see the failure via the negative return
  value and errno, so on-failure logging at this layer is redundant.
- nsh_fsutils: jump straight from the inner write-failure path to a
  single errout: cleanup label instead of using a two-level break +
  flag check, so a failed write cannot fall through to another read().

Assisted-by: GitHubCopilot:claude-4.7-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-05-26 16:06:28 -03:00
Shoji Tokunaga
72bedd5c5d apps/tools: Make hello_rust_cargo buildable with make
* Add JSON specification compatibility flag.
* Add Rust target conversion support for `aarch64` on macOS.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-05-26 23:30:12 +08:00
Jiri Vlasak
d0fa5af39b audioutils: Add RTTTL parsing library
Add a simple library for parsing Ring Tone Text Transfer Language
(RTTTL).

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-05-26 09:55:31 -03:00
dependabot[bot]
84022eaa81 build(deps): bump docker/login-action from 4.0.0 to 4.2.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 4.0.0 to 4.2.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](b45d80f862...650006c6eb)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-26 17:30:37 +08:00
Arjav Patel
939ed0ca2a apps/system/microros: add rcutils strcasecmp strings.h include patch.
POSIX specifies strcasecmp/strncasecmp in <strings.h>, not <string.h>.
On NuttX (and other strict POSIX environments) rcutils/src/strcasecmp.c
only includes <string.h>, causing an implicit-declaration error for
strcasecmp when cross-compiling.

Patch 0003 adds #include <strings.h> guarded by !_WIN32, matching the
existing Windows/POSIX split in the file.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-26 06:57:55 +08:00
Arjav Patel
55a7d4d2df apps/system/microros: define __NuttX__ in cross-compile toolchain flags.
Add -D__NuttX__ to CMAKE_C_FLAGS_INIT and CMAKE_CXX_FLAGS_INIT in
toolchain.cmake.in so that all cross-compiled micro-ROS packages see the
NuttX target macro.  Without this, rcutils/src/process.c follows the
__linux__ branch and references program_invocation_name, a glibc-only
extension absent from the NuttX C library.

Pair with 0002-rcutils-process-nuttx-compat.patch which additionally
guards the linux branch with !defined(__NuttX__), ensuring the embedded
fallback path is taken on NuttX even if the host compiler defines any
linux-flavoured macros.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-26 06:57:55 +08:00
Arjav Patel
9a0c249c79 apps/system/microros: add CMake ExternalProject build support.
Mirror the Makefile build pipeline into CMakeLists.txt using
ExternalProject_Add so that CMake-based NuttX builds (cmake --build)
can also produce libmicroros.a.  The external project delegates to the
existing Makefile targets, then exposes the result via an IMPORTED
STATIC library target with correct INTERFACE_INCLUDE_DIRECTORIES.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-26 06:57:55 +08:00
Arjav Patel
7dbebe1673 apps/system/microros: add DIR-typedef NuttX guard patch.
NuttX defines DIR as a struct type in dirent.h.  The rcutils filesystem
source has a bare typedef int DIR that triggers a redefinition error when
NuttX system headers are on the include path.  Guard it with #ifndef DIR
so the typedef is skipped when the type is already defined.

Applied automatically during the micro_ros_src/src fetch step with
  patch -p1 --forward --ignore-whitespace ... || true
so the build is idempotent if the upstream ever merges a fix.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-26 06:57:55 +08:00
Arjav Patel
cb316ec165 apps/system/microros: wire libmicroros.a into LDLIBS and CFLAGS.
When CONFIG_SYSTEM_MICROROS=y, add the prebuilt libmicroros.a to LDLIBS
and the colcon-installed include/ tree to CFLAGS/CXXFLAGS so that any
application in nuttx-apps can include micro-ROS headers and link against
the library without extra flags.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-26 06:57:55 +08:00
Arjav Patel
b1a4d3fcd5 apps/system/microros: add libmicroros.a colcon build pipeline.
Replace the Directory.mk stub with a full Application.mk-based Makefile
that builds libmicroros.a from upstream micro-ROS sources via colcon.
Build pipeline (six steps, each a Make target):

  1. micro_ros_dev/install  -- clone + build ament/colcon host tools
  2. micro_ros_src/src      -- git clone all Jazzy micro-ROS packages
                               with --depth 1; apply DIR-typedef guard
                               patch; mark unused packages COLCON_IGNORE
  3. toolchain.cmake        -- sed-substitute CC/CXX/CFLAGS into template
  4. colcon.meta            -- sed-substitute Kconfig resource limits
  5. micro_ros_src/install  -- colcon cross-build (merge-install,
                               packages-ignore-regex=.*_cpp)
  6. libmicroros.a          -- ar-merge all install/lib/*.a into one
                               archive; copy include/ tree

clean:: removes generated files; distclean:: removes all fetched dirs.
Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-26 06:57:55 +08:00
Arjav Patel
e764594d26 apps/system/microros: add CMake cross-compile toolchain template.
Add toolchain.cmake.in and include_override/assert.h for the colcon
cross-build.  Key differences from the old robertobucher port:
  - Drop -DCLOCK_MONOTONIC=0: NuttX defines CLOCK_MONOTONIC=1 and
    the override broke nanosleep() on newer kernels.
  - CMAKE_SYSTEM_PROCESSOR is a placeholder substituted per-arch.
  - include_override/assert.h works around the rosidl NDEBUG issue
    (https://github.com/ros2/rosidl/pull/739).

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-26 06:57:55 +08:00
Arjav Patel
98d3a0bcb0 apps/system/microros: add colcon.meta.in resource-limit template.
Add a colcon.meta.in template that is substituted at build time with
Kconfig values.  Key settings:
  - Custom transport only (UCLIENT_PROFILE_CUSTOM_TRANSPORT=ON,
    UCLIENT_PROFILE_STREAM_FRAMING=ON) -- actual UDP/serial callbacks
    are wired in Phase 4.
  - RCL_MICROROS=ON (Jazzy/Kilted renamed flag replacing the old
    RCL_COMMAND_LINE_ENABLED/RCL_LOGGING_ENABLED pair).
  - RCUTILS_NO_FILESYSTEM=OFF -- NuttX provides POSIX filesystem.
  - Resource limits use @MAX_NODES@/@MAX_PUBLISHERS@ etc. placeholders
    substituted from CONFIG_MICROROS_MAX_* Kconfig values.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-26 06:57:55 +08:00
Arjav Patel
0f8f9125f0 apps/system/microros: add micro_ros_lib directory skeleton.
Add micro_ros_lib/ subdirectory with a .keep sentinel so the directory
is tracked by git before any generated build artifacts appear.  All
colcon/fetch outputs land here and are gitignored by the parent .gitignore.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-26 06:57:55 +08:00
Nightt
0dd221cc76 system/settings: Drop unused recursive mutex type
The settings save path no longer re-enters g_settings.mtx, so the mutex does not need to be initialized as PTHREAD_MUTEX_RECURSIVE.

This keeps the #3105 fix independent of CONFIG_PTHREAD_MUTEX_TYPES and destroys the temporary mutex attribute object after initialization.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-25 14:36:36 +02:00
Nightt
2d949fa7c5 system/settings: Avoid recursive save locking
Fix #3105 by making the immediate save path write pending settings while the caller still owns g_settings.mtx instead of calling the timer callback, which locks the same mutex again.

The cached-save timer callback still takes the mutex before using the same locked helper, so asynchronous saves keep their existing synchronization while non-cached saves no longer depend on a recursive mutex.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-25 14:36:36 +02:00
Nightt
f8a48fa5f3 testing/sd_stress: Harden file creation cleanup
Close the temporary file descriptor when create_files() fails after open(), and release the read buffer before returning from the path-length failure branch.

This is logically separable from the #3205 stale-directory fix: it does not change how existing /sd/stress is handled, but keeps the same failure paths from leaking resources while the stress test exits after an error.

The scope intentionally stays within sd_stress failure cleanup and does not touch SD/MMC transfer behavior or other testing drivers.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-25 10:28:32 +08:00
Nightt
2d6cd74215 testing/sd_stress: Handle stale temporary directories
Fix #3205 by removing stale sdstress work directories left by previous interrupted or failed runs before starting a new test.

The cleanup only removes entries matching the generated tmpNNN file pattern. If the directory contains any unexpected entry, the test fails instead of deleting user data.

Also make create_dir() and remove_dir() use their path argument instead of the fixed temporary directory names.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-25 10:28:32 +08:00
Nightt
8568013436 netutils/thttpd: Apply the same check to related allocation sites
Extend the allocation-failure check to httpd_strdup(), the thttpd-local wrapper that has the same failure contract as strdup().

This is logically separable from the direct strdup()/asprintf() fixes: it prevents using hs->hostname before checking whether the wrapped string allocation succeeded, and releases the partially allocated server state on failure.

The scope intentionally does not extend to malloc(), calloc(), or other raw allocators because #1727 specifically calls out strdup()/asprintf(), and covering all allocation APIs would make this PR much broader.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-23 16:30:52 -04:00
Nightt
c44f9a0556 apps: Fix unchecked strdup()/asprintf() as requested in #1727
Add missing failure handling for direct strdup() and asprintf() calls where the allocated result is consumed locally before any NULL/error check.

This keeps the scope to the functions named in #1727 and avoids changing pass-through return sites where callers already receive NULL on allocation failure.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-23 16:30:52 -04:00
Tiago Medicci
58b780c280 interpreters/python: Add ctypes prototype patches for NuttX
Integrate NuttX-specific ctypes and posixmodule updates.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-05-22 21:51:31 +08:00
Tiago Medicci
965cddfa36 system/libffi: Add libffi package integration
Add Kconfig, build rules, and ignore entries required to build and
package libffi as a standalone system component.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-05-22 21:51:31 +08:00
Shoji Tokunaga
c9c5c75d08 examples/rust: Fix hello_rust_cargo CMake settings
Use the hello_rust_cargo-specific Kconfig symbols for the built-in
application stack size and priority.

Previously, CMake referenced the generic hello example symbols, so the
configured hello_rust_cargo stack size could be ignored.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-05-22 15:00:26 +08:00
raiden00pl
5cce60aa9a examples: add pulse count example
add pulse count driver example. Previously it was mixed with PWM example.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-22 13:39:32 +08:00
raiden00pl
2ad3e4e17b examples/pwm: remove refenrences to PULSECOUNT
Remove refenrences to PULSECOUNT from PWM example.
Pulse count driver will be handled by separate application.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-22 13:39:32 +08:00
Nightt
5355adb9cf apps: Fix codespell warnings.
Fix the reported typo warnings and ignore the V4L2 parm field name in apps codespell configuration, matching the main NuttX repository.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-22 13:39:04 +08:00
Nightt
fcd10aa725 examples/lp503x: Open device write-only.
Open the LP503X device with O_WRONLY because the driver registers the device node with write-only permissions and the example controls it through ioctl().

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-22 13:39:04 +08:00
Nightt
b4f1e29494 apps: Fix additional open() arguments.
Add missing mode arguments to direct open() calls that use O_CREAT.

Also open the lp503x device with explicit read-only flags instead of O_CREAT, matching the device-node usage.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-22 13:39:04 +08:00
Nightt
5c703f5603 nshlib/testing: Fix open() arguments.
Pass explicit open flags for the NSH script redirect file so the mode argument is used as file creation permissions.

Add the missing mode argument to AIO ostest open() calls that create the test file.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-05-22 13:39:04 +08:00
Xiang Xiao
f9f59bd0f8 !apps: drop redundant casts on tv_sec/tv_nsec and fix printf formats
Now that time_t is unconditionally 64-bit (signed int64_t) and the
struct timespec fields tv_sec / tv_nsec are wide enough on their own,
the explicit (uint64_t)/(int64_t)/(int) casts that used to guard the
multiplications and subtractions in *_us / *_ms / *_ns helpers are no
longer needed.  Drop them to keep the timekeeping math readable.

In the same spirit, this commit also normalises the printf-style format
specifiers and casts used to print tv_sec / tv_nsec / tv_usec values.
The prior code was a mix of "%d"/"%u"/"%ld"/"%lu"/"%lld" with matching
(int)/(unsigned long)/(long long) casts; some formats truncated time_t
on 32-bit hosts, others mismatched signedness or width.  Replace all
such cases with the portable POSIX-recommended forms:

  - tv_sec  (time_t,       signed, impl-defined width) -> %jd  + (intmax_t)
  - tv_nsec (long,         signed)                     -> %ld  (no cast)
  - tv_usec (suseconds_t / long)                       -> %ld  (no cast)

Also drop two stale `(FAR const time_t *)&ts.tv_sec` casts that are
unnecessary now that ts.tv_sec is plain time_t.

Arithmetic-cleanup files (existing scope):

  - benchmarks/cyclictest/cyclictest.c:        timediff_us()
  - benchmarks/sd_bench/sd_bench_main.c:       get_time_delta_us()
  - examples/oneshot/oneshot_main.c:           maxus computation
  - examples/watchdog/watchdog_main.c:         current_time_ms (x2)
  - industry/nxmodbus/nxmb_internal.h:         nxmb_util_clock_ms()
  - netutils/ntpclient/ntpclient.c:            timespec2ntp()
  - netutils/ptpd/ptpd.c:                      ptp_adjtime()
  - system/dd/dd_main.c:                       elapsed accounting
  - testing/drivers/drivertest/drivertest_posix_timer.c:
                                               get_timestamp()
  - testing/drivers/sd_stress/sd_stress_main.c:get_time_delta()
  - testing/sched/getprime/getprime_main.c:    elapsed accounting
  - testing/sched/pthread_mutex_perf/pthread_mutex_perf.c:
                                               timespec_avg()

Printf-format-fix files (new in this revision):

  - examples/adjtime/adjtime_main.c
  - examples/charger/charger_main.c
  - examples/netpkt/netpkt_ethercat.c
  - fsutils/mkfatfs/mkfatfs.c
  - graphics/tiff/tiff_initialize.c
  - netutils/ptpd/ptpd.c
  - nshlib/nsh_timcmds.c
  - system/coredump/coredump.c
  - system/ptpd/ptpd_main.c
  - testing/drivers/drivertest/drivertest_oneshot.c
  - testing/mm/kasantest/kasantest.c
  - testing/ostest/semtimed.c
  - testing/sched/pthread_mutex_perf/pthread_mutex_perf.c
  - testing/sched/timerjitter/timerjitter.c
  - testing/testsuites/kernel/time/cases/clock_test_clock01.c
  - testing/testsuites/kernel/time/cases/clock_test_smoke.c

No behavioural change.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-22 13:38:25 +08:00
Arjav Patel
e9d1141f7c apps/system/microros: Add CMakeLists.txt for CMake support.
Add CMakeLists.txt file for CMake build system integration.
Enables the micro-ROS library module to be built using NuttX CMake
build system alongside traditional Make-based builds.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-22 06:49:02 +08:00
Arjav Patel
faf07ed3b0 apps/system/microros: Add .gitignore for library build artifacts.
Ignore build outputs and generated files:
- Directories: micro_ros_src/, micro_ros_dev/, build/, install/
- Build outputs: libmicroros.a, toolchain.cmake, colcon.meta
- Archives: *.tar.gz

Prevents build artifacts and downloaded sources from being committed.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-22 06:49:02 +08:00
Arjav Patel
0be4928893 apps/system/microros: Add Makefile skeleton.
Add Makefile with standard NuttX build system integration. Follows
the MENUDESC + Directory.mk pattern used throughout nuttx-apps.
Enables the system/microros module to be built as part of the apps
directory build process.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-22 06:49:02 +08:00
Arjav Patel
2a3a41d53a apps/system/microros: Add Kconfig with configuration options.
Add Kconfig file defining CONFIG_SYSTEM_MICROROS and related options:
- MICROROS_DISTRO: ROS 2 distribution selection (default jazzy)
- MICROROS_TRANSPORT_UDP/SERIAL: Transport method selection
- MICROROS_AGENT_IP/PORT: UDP agent address configuration
- MICROROS_SERIAL_DEVICE/BAUD: Serial transport configuration
- Resource limits: MAX_NODES, MAX_PUBLISHERS, MAX_SUBSCRIPTIONS,
  MAX_SERVICES, MAX_CLIENTS

Allows menuconfig integration for micro-ROS library configuration.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-22 06:49:02 +08:00
Arjav Patel
bda3448106 apps/system/microros: Create empty library skeleton.
Add Make.defs with copyright header for the micro-ROS library
build system. This establishes the directory structure for Phase 2,
with actual build logic to follow in subsequent steps.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-05-22 06:49:02 +08:00
Filipe Cavalcanti
43bc7e99d6 system/nxdiag: add CMake support for NXDiag tool
Supports building NXDiag with CMake.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-05-21 12:34:05 +08:00
Eren Terzioglu
173e19cde1 apps/examples: Add path option to SPI Slave test
Add path option to spislv_test example

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-05-19 07:02:31 -03:00
Shunchao Hu
02153debae system/ping: Fallback to ping6 for gethost error handling.
When ping only receives an IPv6 DNS response, the current command
reports "ping_gethostip" and exits even though ping6 can still
handle the target.

Keep the existing ping and ping6 netutils interfaces unchanged and
add a one-way fallback in the ping command. If IPv4 name resolution
fails, ping will spawn ping6 with the same arguments and let ping6
report the final result.

Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
2026-05-19 09:56:01 +02:00
Shoji Tokunaga
e536adaabc apps/cmake: Add DEPENDS for Rust-related files.
* Add `DEPENDS` to ensure staticlib rebuilds when Rust-related files change.
* Uses `GLOB_RECURSE` to search for Rust-related files.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-05-19 11:22:47 +08:00
Abhishek Mishra
ecfc1b5b61 nshlib: add chmod and chown builtins
Add minimal chmod/chown support to NSH using the
existing libc/VFS syscall interfaces.

Supported forms:

  - chmod <octal-mode> <path>
  - chown <uid>[:gid] <path>

The chown implementation supports the numeric
ownership forms already handled by the underlying
NuttX chown() implementation, including unchanged
uid/gid semantics via omitted fields.

Only numeric permission modes and numeric uid/gid
forms are supported in this initial implementation.

This adds interactive filesystem permission and
ownership management support to NSH and aligns the
shell more closely with standard POSIX environments.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-05-19 09:56:24 +08:00
raiden00pl
f0f7c5ada9 wakaama: add support for TLV
add support for LWM2M TLV

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-18 16:18:53 -04:00
Tiago Medicci
8ba84edb0a interpreters/python: Enable using pip to install Python packages
This commit enables using `pip` as a pre-compiled (pyc) built-in
distributed along with cpython.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-05-18 15:08:30 -04:00
raiden00pl
2fce07fe1c testing/drivertest_pwm: remove references to CONFIG_PWM_MULTICHAN
remove references to CONFIG_PWM_MULTICHAN

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-18 11:35:09 -04:00
raiden00pl
8bd6615034 examples/pwm: remove references to CONFIG_PWM_MULTICHAN
remove references to CONFIG_PWM_MULTICHAN

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-18 11:35:09 -04:00
Matteo Golin
86fb38fbe4 boot/mcuboot: Update commit version
This updates the version of mcuboot used by NuttX now that BOARDIOC_INIT
is removed.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-05-18 09:03:47 +02:00
Shoji Tokunaga
bb7c83b01c apps:cmake: Add APPLE to a build target for sim's configuration using CMake.
* Add Rust target conversion support for `aarch64` on acOS/Linux (and Linux `arm`).
* When a Rust target is unsupported and results in an empty configuration, trigger a CMake `FATAL_ERROR`.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-05-18 12:22:48 +08:00
Shoji Tokunaga
c10ce6aa4f apps/cmake: Make hello_rust_cargo buildable with cmake
* Resolve APPDIR.
* Remove "debug" from RUST_PROFILE_FLAG.
* Add JSON specification compatibility flag.
* Correct the directory structure for RUST_LIB_PATH.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-05-14 07:16:15 -04:00
xiaoxiang781216
21b28a4126 testing/ltp: silence -Wshift-count-overflow on -Werror builds
The LTP open_posix_testsuite header timespec.h has, since 2019:

  #define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1)

When time_t is 64 bits (the default after sched/remove-system-time64),
the shift reaches the sign bit of the underlying type and toolchains
emit -Wshift-count-overflow, which the LTP build promotes to a hard
error via -Werror.  This breaks rv-virt/citest and rv-virt/citest64
on CI.

The diagnostic is benign here (TIME_T_MAX itself is correct) and the
defect is in upstream LTP, so disable the warning alongside the other
'should be removed in the future' relaxations until upstream is fixed.

Signed-off-by: xiaoxiang781216 <xiaoxiang781216@gmail.com>
2026-05-14 09:42:44 +02:00
zhanghongyu
5d15d97418 netlib: replace DNS ping with gateway ping for connectivity check
Refactor netlib_check_ipconnectivity() to use gateway/router ping instead
of DNS server ping for network connectivity checks. Add IPv6 support.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-05-14 11:58:15 +08:00
zhanghongyu
97485342aa netlib_ipv6route.c: fix the issue of parsing IPv6 routing entries
Update the column ruler and field labels in route_ipv6_entry comment
to match the actual output: lowercase to uppercase, remove colons.
Consistent with Nuttx definition

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-05-14 11:58:15 +08:00
raiden00pl
275a083464 ci: retry git clone for nuttx-ntfc-testing
github infra is not stable so even "git clone" from github repos can fail with error: 500.
With this commit we try to clone repo few more times.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-12 11:31:11 -04:00
Xiang Xiao
a6477ec8dc !apps: replace sclock_t with clock_t and drop redundant time_t/off_t casts
Align with the upstream nuttx change that drops the sclock_t alias now
that clock_t is itself a signed 64-bit type (int64_t).  Beyond the pure
sclock_t -> clock_t rename, this commit also removes the
now-unnecessary (time_t)-1 / (time_t)0 / (off_t)-1 casts that were
papering over the previously-unsigned time_t.

Files touched:

  - examples/alarm/alarm_main.c:        sclock_t -> clock_t
  - netutils/dhcpd/dhcpd.c:             sclock_t -> clock_t
  - netutils/ftpd/ftpd.c:               sclock_t -> clock_t
  - netutils/thttpd/libhttpd.c,
    netutils/thttpd/tdate_parse.c:      drop (time_t)-1 / (time_t)0 /
                                        (off_t)-1 sentinel casts
  - system/resmonitor/filldisk.c,
    system/zmodem/zm_receive.c:         sclock_t -> clock_t
  - testing/ostest/wdog.c:              sclock_t -> clock_t (the bulk
                                        of the rename, 30 sites)
  - testing/testsuites/kernel/syscall/cases/{clock_nanosleep_test,
    fsync_test,time_test}.c:            drop (time_t)-1 casts in the
                                        new signed-time_t world

No behavioural change.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-11 17:38:32 +08:00
Xiang Xiao
72837c8d26 !apps: drop CONFIG_SYSTEM_TIME64 conditionals
NuttX always uses a 64-bit system clock now (time_t/clock_t are
always 64-bit). Remove the obsolete CONFIG_SYSTEM_TIME64 #ifdef
branches and Kconfig dependency.

  - examples/dronecan: drop SYSTEM_TIME64 dependency
  - examples/netlink_route: always use PRIx64
  - netutils/netinit: always use the 1-hour LONG_TIME_SEC
  - netutils/ptpd: always pack the 48-bit seconds field and apply
    the 64-bit overflow guard in timespec_delta_ns()
  - testing/ostest/semtimed: always validate tv_sec >= 0

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-11 17:38:32 +08:00
Xiang Xiao
ed746548ca !testing/libc/scanftest: drop CONFIG_LIBC_LONG_LONG from help text
CONFIG_LIBC_LONG_LONG has been removed; long long support is now
unconditional.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-11 17:38:32 +08:00
Xiang Xiao
3adb14f12d !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support
The matching nuttx commit removes CONFIG_HAVE_LONG_LONG; clean up the
remaining users in nuttx-apps so that "long long" is always assumed:

  - examples/noteprintf, examples/nxscope:
        unconditionally exercise the %lld / long long branch.
  - fsutils/mkfatfs/configfat.c:
        drop the 32-bit fall-back paths in mkfatfs_nfatsect12/16/32;
        always use uint64_t for the FAT-size arithmetic.
  - logging/nxscope/nxscope_chan.c:
        drop the CONFIG_HAVE_LONG_LONG guard around the 64-bit
        sample helpers.
  - netutils/ftpd, netutils/ntpclient:
        always emit the 64-bit format strings.
  - testing/fs/fstest/fstest_main.c:
        drop the parallel 32-bit verification path; keep only the
        64-bit (long long) random pattern generator.
  - system/zmodem/host/nuttx/compiler.h:
        remove the host-side CONFIG_HAVE_LONG_LONG stub macro.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-11 17:38:32 +08:00
raiden00pl
783957da07 system/uorb: DEBUG_UORB depends on float data
DEBUG_UORB depends on float data, FIXED16 not supported

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-06 08:54:32 +02:00
raiden00pl
b3cf222836 system/sensorscope: support for fixe16 data
system/sensorscope: support for fixe16 data

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-06 08:54:32 +02:00
Matteo Golin
dca76ccb78 codespell: Ignore lines without typos
Ignore some new lines with incorrect spelling error detection.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-05-06 13:27:05 +08:00
Matteo Golin
5b0cae9ab0 !apps: Simplify NuttX initialization
BREAKING: In an effort to simplify board initialization logic for NuttX,
NSH will no longer support architecture initialization. This will happen
during boot via the BOARD_LATE_INITIALIZE option. The boardctl command
BOARDIOC_INIT is also no longer available from user-space.

Quick fix:
Any application relying on BOARDIOC_INIT should now enable
BOARD_LATE_INITIALIZE to have initialization performed by the kernel in
advance of the application running. If control over initialization is
still necessary, BOARDIOC_FINALINIT should be implemented and used.
Boards relying on NSH for initialization should also enable
BOARD_LATE_INITIALIZE instead.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-05-06 13:27:05 +08:00
raiden00pl
a9881037ea nimble: remove -Wno-pointer-to-int-cast from CFLAGS
it's not needed and cause warnings for C++ builds:

cc1plus: warning: command-line option '-Wno-pointer-to-int-cast' is valid for C/ObjC but not for C++
Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-05 13:29:11 -04:00
Serg Podtynnyi
ded0a17514 graphics/lvgl: bump version to 9.2.2
Update lvlg version to 9.2.2, includes fix for nuttx lcd release
Get version from config in Makefile
Get version from config in cmake file

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2026-05-03 17:39:10 +02:00
shichunma
0105a9b238 netutils/ntpclient: guard DHCP-only helpers
fix a warning that static function defined by not used

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-04-30 13:29:42 +02:00
shichunma
c82957109f netutils: prefer DHCP-provided NTP servers for ntpc
Use the DHCP-learned NTP server list as the default ntpc server source when DHCP option 42 is available.

Fall back to CONFIG_NETUTILS_NTPCLIENT_SERVER only when DHCP does not provide any NTP servers, and restart ntpc when the DHCP-provided server list changes.

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-04-24 10:44:08 -03:00
shichunma
4b705721ca netutils/dhcpc: parse DHCP NTP server option
Request DHCP option 42 and store the returned IPv4 NTP server
addresses in struct dhcpc_state for later consumers.

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-04-24 10:44:08 -03:00
wangjianyu3
62f3d37041 examples/vncviewer: add VNC viewer for LCD display
Add a minimal VNC viewer application that connects to a VNC server
and renders the remote desktop on a local LCD.

Features:
- RFB 3.8 protocol with VNC Authentication (DES, pure software)
- Raw encoding with pixel format auto-detected from LCD driver
- Row-by-row rendering via LCDDEVIO_PUTAREA (minimal RAM usage)
- LCD resolution and format queried at runtime via LCDDEVIO_GETVIDEOINFO
- Auto-reconnect on connection loss with 2-second retry

Usage:
  vncviewer <host> [port]
  vncviewer -p <password> <host> [port]
  vncviewer -p <password> -d <lcd_devno> <host> [port]

Assisted-by: GitHubCopilot:claude-4.6-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-24 14:58:49 +02:00
Tiago Medicci
6379e531de system/irtest: Set irtest command line size to CONFIG_LINE_MAX
Let `irtest` command line size be equal to CONFIG_LINE_MAX so that
bigger (or smaller) commands can be set.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-04-24 14:58:05 +02:00
Tiago Medicci
9b6b7607f2 system/irtest: Avoids silently truncating long write_data commands
Long write_data commands can be truncated without any check due to
the maximum size of CONFIG_SYSTEM_IRTEST_MAX_SIRDATA. This commit
adds a check to avoid a silent fail.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-04-24 14:58:05 +02:00
Tiago Medicci
6cb1a04fe7 system/irtest: Fix issues regarding portability and buffer size
This commit fixes issues regarding portability by using variables
with fixed width (and their format macro constants).

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-04-24 14:58:05 +02:00
Tiago Medicci
901278a4ba examples: Remove deprecated rmtchar example application
The upper-half RMT driver is no longer available on NuttX. Instead,
Espressif's RMT peripheral was bound directly to the lirc driver.
For testing purposes, use the `irtest` application. NuttX OS PR
https://github.com/apache/nuttx/pull/18654 removed the upper-half
driver interface used by this application, so removing it does not
break any existing feature on NuttX.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-04-24 14:58:05 +02:00
raiden00pl
eccfba4776 .github: use ntfc test cases from Apache repo
use ntfc test cases from Apache repo

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-24 19:55:57 +08:00
raiden00pl
180607372a .github/build.yml: improve ntfc installation
increase retries and timeout for pip install and try again in case of failure

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-24 19:55:57 +08:00
raiden00pl
773f69d5d9 modbus: add nxmodbus
NxModbus is a lightweight Modbus protocol stack implementation for NuttX RTOS.

This commit adds:
- nxmodbus stack
- nxmbserver - Modbus Server (Slave) example
- nxmbclient - Modbus Client (Master) tool

Supported Modbus transports:
- ASCII
- RTU over serial port
- TCP
- RAW (ADU) for custom transport implementations

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-20 12:45:17 -03:00
Alan Carvalho de Assis
2016c0b6ae apps/modbus: Move modbus to inside industry/
Modbus is a protocol mostly used on industries and since it is a
protocol it is not a category to be at root of apps/

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-04-20 08:42:37 +02:00
Alan Carvalho de Assis
2ee08209a0 apps/modbus: Move modbus to inside industry/
Modbus is a protocol mostly used on industries and since it is a
protocol it is not a category to be at root of apps/

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-04-20 08:42:37 +02:00
Michal Lenc
8e9f5a8d3a nshlib/nsh_timcmds.c: fix incorrect time set during summer time
Value zero in tm_isdst means daylight saving time (or summer
time) is not in effect. This is obviously not true for half of the year
in most timezones and keeping it at zero leads to incorrect time
being set. This commit sets tm_isdst to -1, which means the information
is not available and it should be handled according to timezone rules.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-04-17 11:11:53 -03:00
raiden00pl
722f3193ce modbus: move freemodbus to a separate directory
move freemodbus to modbus/freemodbus so it is possible to add other
modbus implementations

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-14 09:09:42 +02:00
dependabot[bot]
f22a8d0d4f build(deps): bump actions/upload-artifact from 7.0.0 to 7.0.1
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v7...v7.0.1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-14 11:01:10 +08:00
dependabot[bot]
a6c11a1db7 build(deps): bump actions/github-script from 8.0.0 to 9.0.0
Bumps [actions/github-script](https://github.com/actions/github-script) from 8.0.0 to 9.0.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v8...v9)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-14 11:00:57 +08:00
Michal Lenc
7dc8cec1ac examples/hello_nim/Kconfig: name consistent with other Hello World apps
Use "Hello, language" scheme to keep the naming consistency with other
Hello World applications for different languages.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-04-13 00:28:32 +08:00
Piyush Patle
96a003072d include/debug.h: fix checkpatch fallout in touched apps files
Clean up style issues in the files touched by the <nuttx/debug.h> include
migration so the full apps-side PR passes checkpatch.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-11 10:39:27 -03:00
Piyush Patle
9d849adfab include/debug.h: Use <nuttx/debug.h> in apps
Replace app-side includes of <debug.h> with <nuttx/debug.h> to use the
header from the NuttX tree explicitly after the header move.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-11 10:39:27 -03:00
Filipe Cavalcanti
3591378113 crypto/mbedtls: expose include paths as public
Expose include paths as public when using CMake.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-04-10 12:23:37 -03:00
Filipe Cavalcanti
bfbeafabbf netutils/mqttc: fix patch and add mbedtls dependency
Add mbedtls dependecy and fix patch path.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-04-10 12:23:37 -03:00
wangjianyu3
f95b53d15b examples/camera: add -m option for horizontal mirror preview
Add -m command line option to enable horizontal mirror on the
camera sensor via VIDIOC_S_CTRL + V4L2_CID_HFLIP.  This uses
the sensor hardware mirror (e.g. GC0308 register 0x14 bit[0])
with zero CPU overhead.

Also refactor parse_arguments to use a loop-based parser so
options can appear in any order.

Usage: camera 0 -m    (mirror preview)
       camera -jpg -m (mirror still capture)

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-09 10:34:06 -03:00
wangjianyu3
21dd3082c1 examples/camera: handle RGB565X (BE) format from 8-bit DVP camera
Some image sensors on 8-bit DVP buses (e.g. GC0308) produce RGB565X
(big-endian) pixel data — the high byte is clocked out first and
stored first in PSRAM by the ESP32-S3 CAM controller.

The V4L2 framework does not negotiate formats automatically, so try
RGB565 first and fall back to RGB565X if S_FMT fails.

When the sensor reports RGB565X:
 - Invalidate D-Cache after DQBUF so the CPU reads fresh DMA data
 - Byte-swap each pixel in place from BE to LE RGB565 for display

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-09 10:34:06 -03:00
wangjianyu3
52b36deb13 examples/camera: use MMAP with USERPTR fallback and fix NX stride
Use MMAP buffer allocation by default so the driver can manage
DMA-capable memory with proper alignment and cache attributes.
Fall back to USERPTR if the driver does not support MMAP.

Also fix NX framebuffer stride calculation to use the actual
display width instead of hardcoded values.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-09 10:34:06 -03:00
liuhongchao
a6286ee0ea graphics/input: Add getevent input event monitor tool.
Add getevent utility for monitoring input events including
mouse clicks/movement, multi-touch coordinates/pressure,
and keyboard key presses. Supports automatic device detection
in /dev and command-line device path specification with
non-blocking I/O.

Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2026-04-09 11:59:19 +02:00
Lup Yuen Lee
9db3e26c85 graphics/libyuv: Download libyuv from NuttX Mirror Repo
NuttX Build Target `sim:nxcamera` failed to build because chromium.googlesource.com is blocking our download of libyuv library: https://github.com/apache/nuttx/actions/runs/24106742084/job/70356374433#step:10:603

```
Configuration/Tool: sim/nxcamera
Building NuttX...
curl -L https://chromium.googlesource.com/libyuv/libyuv/+archive/refs/heads/stable.tar.gz -o libyuv.tar.gz
gzip: stdin: not in gzip format
```

This PR updates the libyuv Makefile to download libyuv from the NuttX Mirror Repo instead: https://github.com/NuttX/nuttx/releases/tag/libyuv

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2026-04-08 18:40:26 +08:00
Shunchao Hu
231ac397a7 canutils/lely-canopen: avoid patch reapply on repeated builds.
The patch step currently uses a phony target, so it is executed
again when the build is repeated in the same source tree. In that
case `patch -N` detects previously applied patches and returns 1,
which make treats as a failure.

Replace the phony patch target with a stamped `.patched` file so
the patch step is not re-run unnecessarily.

Fixes #3188

Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
2026-04-03 11:18:21 +02:00
raiden00pl
5c867b21e6 examples/nxscope: control stream interval from CLI
add the ability to control the stream interval from the CLI
which is useful for performance testing

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-04-02 10:02:16 -03:00
simbit18
b8718d8c52 build.yml: Fix No files were found with the provided path
Fix

Warning: No files were found with the provided path: buildartifacts/.

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-04-02 06:41:51 +08:00
wangjianyu3
073df9d1de examples/uvc_cam: add UVC camera streaming app
Usage: uvc_cam [nframes] [video_dev] [uvc_dev]

V4L2 capture -> write UVC gadget device.
Uses boardctl to initialize/deinitialize UVC gadget.
Queries sensor pixel format, resolution and frame rate via V4L2.
Uses poll() to wait for USB host streaming state.
Supports optional device path arguments (default /dev/video0, /dev/uvc0).
Supports configurable frame count (0=infinite).

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-03-30 14:52:06 +08:00
Tiago Medicci
dc4ecc973e ci: split xtensa jobs into three separate jobs (instead of two)
This is necessary because new defconfig were recently added to
Xtensa-based Espressif SoCs and the build job may exceed 2 hours.
In order to avoid increasing job timeout, a specific job for each
supported SoC (ESP32, ESP32-S2 and ESP32-S3) was created instead.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-03-28 09:40:28 +08:00
Vlad Pruteanu
cd2b0c0e87 testing/crypto: Add pbkdf2 test app
This adds support for testing PBKDF2 implementation. Test
vectors for SHA1 are taken from RFC6070. SHA256 vectors
were extrapolated using an online PBKDF2 generator which
was checked against RFC6070.

Signed-off-by: Vlad Pruteanu <pruteanuvlad1611@yahoo.com>
2026-03-27 21:46:08 +08:00
raiden00pl
e564816e1d .github: install NTFC from PIP
install NTFC package from PIP

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-03-27 20:37:09 +08:00
Filipe Cavalcanti
f3a7282230 netutils/cjson: fix apps path in CMake
Fix mismatch on apps directory naming when it is cloned under 'nuttx-apps' instead of 'apps'.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-03-26 20:18:52 -04:00
wangjianyu3
6a1b2c6903 system/nxrecorder: Fix null pointer dereference in argument parsing
When a command has no arguments (e.g., 'q', 'quit', 'stop'), the strtok_r()
function returns NULL for the arg parameter. The argument trimming loop was
dereferencing this NULL pointer without checking, causing undefined behavior
and system hang on ESP32-S3.

This commit adds a null check before dereferencing the arg pointer in the
leading space trimming loop.

Tested on ESP32-S3 (lckfb-szpi-esp32s3) - quit command now works correctly.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-03-26 10:42:48 +01:00
dependabot[bot]
509b807462 build(deps): bump docker/login-action from 3.7.0 to 4.0.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.7.0 to 4.0.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](c94ce9fb46...b45d80f862)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-24 13:00:16 +08:00
wangjianyu3
460281a90f system/fastboot: fix socket() parameter order for TCP transport
SOCK_CLOEXEC and SOCK_NONBLOCK were incorrectly passed as the
third argument (protocol) instead of being OR'd into the second
argument (type). This caused socket() to fail with EPROTONOSUPPORT
(errno 93) on NuttX.

Move SOCK_CLOEXEC | SOCK_NONBLOCK to the type parameter and set
protocol to 0.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-03-23 08:46:18 -03:00
raiden00pl
b986eef7a7 system/sensorscope: fix compilation
fix compilation error:

sensorscope_main.c:314:3: error: implicit declaration of function 'list_initialize'; did you mean 'fs_initialize'? [-Wimplicit-function-declaration]

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-03-23 11:00:44 +01:00
Lup Yuen Lee
5fe0877989 CI: Revert GitHub Actions for Docker
All CI Builds have been failing since 18 hours ago:
- https://github.com/apache/nuttx/pull/18571#issuecomment-4104792750
- https://github.com/apache/nuttx/actions/runs/23389990049

> _The action docker/login-action@v4 is not allowed in apache/nuttx because all actions must be from a repository owned by your enterprise, created by GitHub, or match one of the patterns: 1Password/load-secrets-action@13f58eec61, 1Password/load-secrets-action@8d0d610af1, 1Password/load-secrets-action@dafbe7cb03, AdoptOpenJDK/install-jdk@*, BobAnkh/auto-generate-changelog@*, DavidAnson/markdownlint-cli2-action@07035fd053, DavidAnson/markdownlint-cli2-action@30a0e04f18, EnricoMi/publish-unit-test-result-action@*, JamesIves/github-pages-deploy-action@4a3abc783e, JamesIves/github-pages-deploy-action@d92aa235d0, Jimver/cuda-toolkit@6008063726, Jimver/cuda-toolkit@b6fc3a9f3f, JustinBeckwith/linkinator-action@af984b9f30f63e796..._

That's because ASF Infrastructure Team has mandated that we use the Hash Versions of GitHub Actions for Docker, stated below:
- https://github.com/apache/infrastructure-actions/blob/main/actions.yml
- Which generates: https://github.com/apache/infrastructure-actions/blob/main/approved_patterns.yml
- Due to: https://github.com/apache/infrastructure-actions/pull/547

```yaml
docker/build-push-action:
  10e90e3645eae34f1e60eeb005ba3a3d33f178e8:
    tag: v6.19.2
docker/login-action:
  c94ce9fb468520275223c153574b00df6fe4bcc9:
    tag: v3.7.0
docker/metadata-action:
  c299e40c65443455700f0fdfc63efafe5b349051:
    tag: v5.10.0
docker/setup-buildx-action:
  8d2750c68a42422c14e847fe6c8ac0403b4cbd6f:
    tag: v3.12.0
```

This PR reverts our GitHub Actions for Docker to the hash versions stated above.

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2026-03-22 14:41:17 +08:00
raiden00pl
7884410be2 examples/nxscope: add UDP interface
add UDP interface for examples/nxscope

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-03-18 12:43:50 -03:00
raiden00pl
193fadfaa8 logging/nxscope: add UDP transfer interface
add UDP transfer interface for nxscope

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-03-18 12:43:50 -03:00
Neil Berkman
cb880b7257 boot/nxboot: remove unused header variable
The header variable in nxboot_perform_update() is no longer
used after validate_image() was changed to take only the fd.

Signed-off-by: Neil Berkman <neil@xuku.com>
2026-03-18 13:06:05 +01:00
Neil Berkman
83af0a011e boot/nxboot: update stale comment to reflect CRC validation
The comment previously stated CRC was not calculated before
boot. This is no longer accurate after adding full image CRC
validation in validate_image().

Signed-off-by: Neil Berkman <neil@xuku.com>
2026-03-18 13:06:05 +01:00
Neil Berkman
4decc1699a boot/nxboot: add flush barriers and CRC-validate primary before boot
Two hardening fixes for nxboot power-loss resilience:

1. Add flash_partition_flush() calls between critical partition
   operations in perform_update(). Without explicit flush barriers,
   writes may remain buffered in RAM (e.g. via FTL rwbuffer) when
   nxboot proceeds to the next phase. A power loss between phases
   can leave the recovery image uncommitted while the staging
   partition has already been consumed.

   Flush points added:
   - After copy_partition(primary, recovery) completes
   - After copy_partition(update, primary) completes, before
     erasing the staging first sector

2. Replace validate_image_header() with validate_image() in the
   final primary validation path of nxboot_perform_update(). The
   header-only check validates magic and platform identifier but
   does not CRC-check the image body. After an interrupted update,
   a corrupt primary with an intact header would pass this check
   and be booted, resulting in a persistent boot failure.

Signed-off-by: Neil Berkman <neil@xuku.com>
2026-03-18 13:06:05 +01:00
wangjianyu3
8cd9e9acc2 examples/camera: fix spelling errors
Fix typos found by codespell:
- camera_bkgd.c: defaul -> default
- camera_main.c: memorys -> memories (2 occurrences)
- camera_main.c: freame -> frame
- camera_main.c: valiable -> variable

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-03-16 17:45:24 +01:00
wangjianyu3
10056077f4 examples/camera: fix build error and still capture logic
Add missing #include <sys/boardctl.h> in camera_bkgd.c to fix
implicit declaration of boardctl() and undeclared BOARDIOC_NX_START.

Also fix capture_num check in camera_main.c to only apply still
capture size enumeration when capture_type is STILL_CAPTURE.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-03-16 17:45:24 +01:00
Filipe Cavalcanti
3a156581ca examples/rmtchar: fix source file ordering for RMTCHAR
rmtchar_main.c is coming after rmtchar_common.c, which causes an
undefined reference error. This change fixes the problem.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-03-15 15:42:00 -04:00
Huang Qi
ea22a66dcf tools: Fix target-pointer-width type in x86 target configs
Remove quotes around target-pointer-width values in i486 and x86_64
target configuration files to change from string to numeric type.
This change is required due to recent rustc JSON format modifications
that expect numeric values instead of strings for target-pointer-width.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-03-13 12:37:55 +01:00
Huang Qi
f90e1e184f tools/build: Make Rust target triples for x86 use JSON files
X86 support for Rust needs more test and verification, and not
upstreamed to Rust side yet.

It's better to use custom target triples for x86 by json files for now,
and it can be upstreamed to Rust side if stable enough.

Changed the Rust target triples in the CMake configuration to reference JSON files for x86_64 and i486 architectures. This improves the build process by providing more detailed target specifications.
* Added JSON files for i486 and x86_64 targets
* Updated CMake functions to use the new target triples
* Enhanced build directory structure for Rust crates

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-03-13 12:37:55 +01:00
Huang Qi
68f9e5424b codespell: Add ARCHTYPE to ignore list
ARCHTYPE is a valid abbreviation for 'architecture type' used
consistently across the codebase. This matches the nuttx repo's
.codespellrc configuration.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-03-10 18:23:22 -03:00
Huang Qi
b5d151f73f cmake/tools: Fix panic_immediate_abort deprecation in Rust build
Replace deprecated -Zbuild-std-features=panic_immediate_abort with
-Cpanic=immediate-abort compiler flag via RUSTFLAGS.

The panic_immediate_abort feature has been stabilized as a real panic
strategy in recent Rust nightly versions. The old method of enabling
it via -Zbuild-std-features is no longer supported and triggers a
compile error in core/src/panicking.rs.

Changes:
* cmake/nuttx_add_rust.cmake: Use RUSTFLAGS with -Cpanic=immediate-abort
* tools/Rust.mk: Use RUSTFLAGS with -Cpanic=immediate-abort

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-03-10 18:23:22 -03:00
Neil Berkman
8579459bb0 boot/nxboot: fix Clang warnings for format and va_start
Use PRIdOFF instead of %ld for off_t arguments in flash.c syslog
calls, fixing -Wformat errors when off_t is not long.

Change nxboot_progress parameter from enum progress_type_e to int
to avoid undefined behavior from va_start on a parameter that
undergoes default argument promotion (-Wvarargs).

Signed-off-by: Neil Berkman <neil@xuku.com>
2026-03-10 13:28:22 +01:00
dependabot[bot]
2964c8cc3d build(deps): bump docker/login-action from 3 to 4
Bumps [docker/login-action](https://github.com/docker/login-action) from 3 to 4.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-10 11:08:39 +01:00
dependabot[bot]
45d4c7098b build(deps): bump actions/download-artifact from 7 to 8
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-04 16:38:39 +01:00
dependabot[bot]
af7222ec9f build(deps): bump actions/upload-artifact from 6.0.0 to 7.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-03 10:13:49 +01:00
Mihai Pacuraru
7d13ee204b examples/mqttc: Fix mqtt_init() failed message typo (ERRPR -> ERROR).
Modify the message logged when mqtt_init() failed to execute properly.

Signed-off-by: Mihai Pacuraru <mpacuraru@protonmail.com>
2026-03-02 17:14:44 +01:00
Mihai Pacuraru
c46ed184ed examples/mqttc: Fix QOS arguments parsing (char->long).
Modify the switch cases in parsearg function for QOS levels definition.
The comparison was made between a long value and a char.

Signed-off-by: Mihai Pacuraru <mpacuraru@protonmail.com>
2026-03-02 17:14:44 +01:00
ouyangxiangzhen
e4b84b29d4 ostest/hrtimer: Update the comments.
This commit updated the comments.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-02-26 13:42:45 -05:00
ouyangxiangzhen
256d6685d5 sched/hrtimer: Refactor the hrtimer_test.
This commit refactored the hrtimer_test and provided significantly
improved test-cases for both SMP and non-SMP.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-02-26 13:42:45 -05:00
ouyangxiangzhen
d33830e83f ostest/hrtimer: Increase the tolerent latency.
For QEMU, virtual CPUs can be preempted by any high priority thread in
test environments. This can cause the timer to be triggered later than
expected. This commit increased the tolerant latency to avoid the test
failures.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-02-26 13:42:45 -05:00
ouyangxiangzhen
0bbf5dc092 sched/hrtimer: Improve code readability
This commit improved the code readability.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-02-26 13:42:45 -05:00
ouyangxiangzhen
1c0281be15 sched/hrtimer: relocate the hrtimer test to simplify.
This commit relocated the hrtimer test to simplify the code.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-02-26 13:42:45 -05:00
ouyangxiangzhen
e69f9e902b sched/hrtimer: Fix test in QEMU.
This commit fixed the hrtimer test.
In a QEMU environment, the hrtimer latency can be arbitrary because vCPUs can be preempted. We can not assert the latency. we can only issue alerts for excessively high latency.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-02-26 13:42:45 -05:00
ouyangxiangzhen
9b84a0ab02 sched/hrtimer: Simplify the hrtimer test.
This commit simplified the hrtimer test.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-02-26 13:42:45 -05:00
ouyangxiangzhen
05e8b0ae60 ostest/hrtimer: Remove HRTIMER_TEST to simplify the code.
This commit removed HRTIMER_TEST to simplify the code.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-02-26 13:42:45 -05:00
ouyangxiangzhen
da105afee2 ostest/hrtimer: Add missing assert.h
This commit added missing assert.h.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-02-26 13:42:45 -05:00
Matteo Golin
e0d118e349 examples/powerled: Fix board initialization compilation
When NSH_ARCHINIT is not enabled, initialization is to be performed by
boardctl(BOARDIOC_INIT). However, the boardctl header is not included so
this causes compilation to fail. This commit corrects that issue.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-26 12:10:01 +08:00
Eren Terzioglu
0b084ded88 testing/crypto: Add options to disable hash tests
Add options to disable individual hash tests for devices not supported each hash

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-02-24 13:36:32 +08:00
Lup Yuen Lee
fe546acfc7 github/workflow: Sync the new PR Labeling Workflow from NuttX Repo to NuttX Apps
This PR replicates the new PR Labeling Workflow from NuttX Repo to NuttX Apps Repo. For Future Syncing:
- Copy from NuttX Repo to NuttX Apps: `.github/workflows/labeler.yml` and `.github/workflows/pr_labeler.yml`
- Edit `.github/workflows/labeler.yml` and change `repository: apache/nuttx` to `repository: apache/nuttx-apps`
- Don't overwrite `.github/labeler.yml` by NuttX Repo

The new workflow reimplements PR Labeling with two triggers: pull_request and workflow_run. We no longer need pull_request_target, which is an unsafe trigger and may introduce security vulnerabilities.

The New PR Labeler is explained here:
- https://lupyuen.org/articles/prtarget
- https://github.com/apache/nuttx/issues/18359

Modified Files:

`.github/workflows/labeler.yml`: Changed the (read-write) pull_request_target trigger to (read-only) pull_request trigger. Compute the Size Label (e.g. Size: XS) and Arch Labels (e.g. Area: Examples). Save the PR Labels into a PR Artifact.

`.github/labeler.yml`: Added comment to clarify that NuttX PR Labeler only supports a subset of the `actions/labeler` syntax: `changed-files` and `any-glob-to-any-file`. Note: Don't overwrite this file by NuttX Repo.

New Files:

`.github/workflows/pr_labeler.yml`: Contains the workflow_run trigger, which is executed upon completion of the pull_request trigger. Download the PR Labels from the PR Artifact. Write the PR Labels into the PR.

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2026-02-23 20:33:22 +08:00
Matteo Golin
448b0bd0a6 interpreters: Fix spelling errors
Fix some spelling errors for CI.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-18 11:01:02 +01:00
Matteo Golin
3ce356378d !interpreters/python: Align naming of configuration options
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.

BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_PYTHON_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-18 11:01:02 +01:00
Matteo Golin
a604c46b00 !interpreters/minibasic: Align naming of configuration options
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.

BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_MINIBASIC_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-18 11:01:02 +01:00
Matteo Golin
468ded86bb !interpreters/lua: Align naming of configuration options
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.

BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_LUA_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-18 11:01:02 +01:00
Matteo Golin
be2cdfa597 !interpreters/bas: Align naming of configuration options
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.

BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_BAS_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-18 11:01:02 +01:00
Arjav Patel
76e02c0dd6 netutils/cjson: update cJSON download URL format
Modified CMakeLists.txt, Kconfig, and Makefile to change the cJSON download URL to include 'refs/tags/' for proper version fetching. This ensures compatibility with GitHub's archive download requirements.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-02-16 10:29:27 -03:00
Arjav Patel
1ab486d1d0 netutils/cjson: update download URL for cJSON tarball to include refs/tags
Modified the CMakeLists.txt and Makefile to ensure the correct format for downloading the cJSON tarball from GitHub by including 'refs/tags/' in the URL. This change addresses issues with fetching the correct version of the library.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-02-16 10:29:27 -03:00
Matteo Golin
7289c27a85 testing/{ostest,sched/smp}: Remove BOARD_LOOPSPERMSEC references
In an effort to avoid unexpected behaviour from users not calibrating
BOARD_LOOPSPERMSEC, a compilation error occurs when it is undefined. On
some systems, this is allowed (those that use timer implementations
instead of busy-looping for delays). In these cases, we should busy-loop
using the clock time instead of relying on a possibly
undefined/uncalibrated macro.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-09 09:21:50 +01:00
zhanghongyu
d48b45000d netlib_xarp: remove redundant cast
removes redundant type casts in ARP-related network library functions.
The casts from req.arp_dev (already a char array) to (FAR char *)
are unnecessary and can be safely removed.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-02-04 01:52:49 +08:00
fangpeina
bb9229de06 testing/drivers: set default vendor dalay to 1 for rtc cases run correctly
Set default VENDOR_DELAY to 1 for reliable test execution

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-02-03 17:36:49 +08:00
fangpeina
f9dc9bc21e testing: Fix cmocka_syscall_test crash when CONFIG_FDCHECK enable
Fix cmocka_syscall_test crash when CONFIG_FDCHECK is enabled.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-02-03 17:36:49 +08:00
fangpeina
eb9b9a2d60 netutils/rexecd: fix rpname mismatch with rexec when using AF_RPMSG
When using AF_RPMSG (-r option), rexecd was setting the rp_name
to the raw port number, while rexec was using htons(port). This
caused a mismatch where rexec couldn't connect to rexecd.

This commit fixes the issue by applying htons() to REXECD_PORT
when setting rp_name in the AF_RPMSG case, making it consistent
with the rexec client implementation.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-02-03 10:18:57 +08:00
hujun5
b2d4ad67b1 testing/ostest: Add performance event time counter test
Integrate up_perf_gettime() test into ostest suite with comprehensive
test coverage including monotonicity verification, interval statistics,
and frequency validation. The test verifies performance event counter
functionality across 5 independent test cases with proper error handling.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-02-02 14:01:00 +08:00
zhaoxingyu1
eda1309745 mtdconfig: modify config names for mtdconfig testcases 2
change nvs module testcase name TESTING_MTD_CONFIG_FAIL_SAFE
to TESTING_MTD_CONFIG_NVS and modify the configuration names
related to mtdconfig testing.

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-02-02 11:01:19 +08:00
zhaoxingyu1
d9d434d97e mtdconfig: lomtdconfig device change to depends on !MTD_CONFIG_NONE
Because  MTD_CONFIG configuration item in drivers/mtd/Kconfig
has changed.

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-02-02 11:01:19 +08:00
zhaoxingyu1
102c078834 mtd/nvs: modify config name to MTD_CONFIG_NVS part1
Because the MTD_CONFIG configuration item in
drivers/mtd/Kconfig has changed

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-02-02 11:01:19 +08:00
wangxingxing
2908f10154 apps/system/ymodem: Optimized ymodem for burn during bootloader
If device automatically enters the ymodem rb mode when it starts up,
the PC tool does not need to send rb command anymore. Here, when a
specified number of consecutive 'C' are received, the subsequent
ymodem protocol content will continue.

Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
2026-02-02 11:00:19 +08:00
anjiahao
8804f086b3 ymodem:sbrb.py send command need flush and reset input buffer
These changes fix reliability issues when initiating ymodem transfers
over serial connections.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-02-02 11:00:19 +08:00
makejian
367e9dca01 testing: move nist-sts into drivers/rng directory
Move NIST Statistical Test Suite (nist-sts) testing module from testing/drivers/
into testing/drivers/rng/ directory to better organize RNG (random number generator)
related tests that utilize /dev/random device.

Changes:
- Create testing/drivers/rng/ directory structure
- Move nist-sts from testing/drivers/ to testing/drivers/rng/nist-sts
- Update build configuration file paths:
  - CMakeLists.txt
  - Makefile
  - Make.defs
- Maintain all test patches and Kconfig settings

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-29 12:08:50 +08:00
liqinhui
b80d67c628 netutils/netinit: Support the NETINIT_MACADDR
Support getting MAC address from boardctl(BOARDIOC_MACADDR) via NETINIT_MACADDR.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2026-01-29 12:08:20 +08:00
wangxingxing
42e3566147 testing/fs:reduce the test time of fs test
Reduce TEST_NUM from 1000 to 100 in fs_opendir_test.c
Reduce loop count from 100 to 30 in fs_stream_test.c

Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
2026-01-28 10:37:52 -03:00
wangxingxing
f2ba4883fa testing/fs:remove the usleep of evend_fd read to solve the questiong of sem wait
Remove unnecessary usleep(1000) in the read thread of eventfd test.
The eventfd read operation will block and wait for data naturally via semaphore, no additional delay is needed.

Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
2026-01-28 10:37:52 -03:00
ligd
050fb406c2 testing/eventfd_test: avoid the orphan Thread
Replace sleep() with pthread_join() to properly wait for the child thread to finish, avoiding orphan threads.
Change sleep(1) to usleep(1000) to reduce test time while maintaining synchronization.
Fix loop iteration count mismatch between reader thread (6 iterations) and writer (5 iterations).

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-28 10:37:52 -03:00
guohao15
4ac3732734 testing/fdcheck: fix fd close in other thread
Fix file descriptor leak issue where fd was stored in test_state for deferred close, but could fail when CONFIG_FDCHECK is enabled because fd cannot be closed in a different thread.

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2026-01-28 10:37:52 -03:00
wangchengdong
ebe2dd57dd ostest/hrtimer: sync hrtimer ostest with latest hritmer update
sync hrtimer ostest with latest hritmer update

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-27 23:11:48 +08:00
ouyangxiangzhen
71561d2979 testing/ostest: run spinlock_test only in flat mode.
Since the kernel spinlocks can only work in flat mode, this commit
allowed spinlock_test only in flat mode.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
06d07b1522 testing/ostest: Fix Coverity for spinlock test.
This commit fixed coverity for spinlock test.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
5eef7f324f testing/ostest: refactor the spinlock test.
This commit refactored the spinlock test for better accuracy and
minimized jitters introduced by scheduling.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
anpeiyun
52c2a8909b ostest/spinlock: Check the return value.
This commit added checking for the return value.

Signed-off-by: anpeiyun <anpeiyun@xiaomi.com>
2026-01-27 22:59:36 +08:00
anpeiyun
f86246f7c6 ostest/spinlock: fix the operations does not affect the result.
When expanding the macro VERIY, (0 == pthread_barrier_wait(&param->pub->barrier)) < 0 always false.
Regardless of the value of its operands.

Signed-off-by: anpeiyun <anpeiyun@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
36e701448c ostest/spinlock: Check the return value.
This commit added checking for the return value.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
7fb71aa57a testing/drivers: Fix posix timer assertions.
On QEMU, if vcpus are preempted by other threads, the deviation of the
timer might be very large, causing assertion failure. This commit
addressed the problem.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
jiangtao16
1b8c90c12d ostest: Add spinlock/rspinlock.
This commit added spinlock/rspinlock test.

Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
35cf746025 testing/drivers: Fix wrong test-cases.
This commit fixed totally wrong test-cases for the periodical timers.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
b9bf7f5c4f testing/drivers: Change uint32_t time to uint64_t.
This commmit fixed the time multiplication overflow issue.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
62fe1a3ac5 ostest/wdog: Fix a synchronizing bug.
If we updated `callback_cnt` before the `triggered_tick` in the wdog timer callback, the `wdtest_rand` might failed randomly. This commit fixed the synchronizing bug by swapping the execution order of updating.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
69bfda8736 apps/ostest: Fix wqueue_test in flat mode.
This commit re-enabled wqueue_test in flat mode.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
ce3e35233c benchmark/taclebench: Add clock measurement.
This commit added clock measurement for taclebench.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
429a65901f apps/testing: Fix timerjitter iteration
This commit used the interval to calculate the timejitter iteration.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
f687088453 apps/testing: Fix timerjitter interval
This commit increased the default interval of the timerjitter to avoid errors with large USEC_PER_TICK setting.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
e0e9f3d7e5 apps/testing: Fix Coverity.
This commit is to make Coverity happy.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
a16c545134 testing/drivers: Fixed the wrong test-case.
This commit fixed the wrong-test case where the time is acquired after
the timer being set, leading to the assertion failure.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
ae7a0d81e9 testing/drivers: Fix posix timer assertions.
On QEMU, if vcpus are preempted by other threads, the deviation of the
timer might be very large, causing assertion failure. This commit
addressed the problem.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
01e5e50619 testing/time: Relax the timing constraints.
On SIM and QEMU, it is inevitable that the simulating vCPU got preempted
by other threads, causing large timing delay. This commit relax the timing
constraints to reduce the CT error.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
a4b43521f4 testing/drivers: Fix posix timer assertions.
On QEMU, if vcpus are preempted by other threads, the deviation of the
timer might be very large, causing assertion failure. This commit
addressed the problem.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
0faaed99a5 testing/drivertest: Fix timing issues on QEMU and sims.
Since sim and qemu are not cycle accurate simulators, if the vCPU thread is preempted by other high priority tasks, it may cause timing issues. This is easy to happen when the test machine is busy. This commit modifies the condition of timing error and prints out the latency as a warning.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
hujun5
8aa48c4fb6 examples: foc: Add critical section protection to FOC control loop
Introduce CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC configuration option to enable
critical section protection in the FOC (Field-Oriented Control) motor control
examples. This adds irq-safe critical sections around the main control loop
processing to prevent race conditions and ensure atomic updates of motor
control state and parameters during interrupt handling.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-27 20:48:04 +08:00
fangpeina
35f3690a4c nshlib: Add stderr redirection support
This commit implements stderr redirection in HSN, support
Bash-like syntax for redirecting standard error output.
Support both foreground and background commands.

example:
- nsh> ls noexists 2> err.log
- nsh> ls noexists 2> err.log &
- nsh> ls noexists 2>> err.log
- nsh> sh < /dev/ttyS0 > /dev/ttyS0 2> /dev/ttyS1 &
- nsh> sh < /dev/ttyS0 > /dev/ttyS0 2>&1 &

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-01-27 03:14:00 +08:00
hujun5
80c2b43197 testing/ostest: fix uninitialized variable warning in wdog test
Initialize the flags variable to 0 to fix compiler warning about
potential use of uninitialized variable. The flags variable is
conditionally assigned in wdtest_rand() based on callback count.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-27 03:09:24 +08:00
wangxingxing
9c022949e4 fs/test:Fix formatting check issues
fix the typo error of fs cases

Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
2026-01-26 22:09:19 +08:00
wangxingxing
2d2394201c fs/bugfix: fix the fd error of fs test
remove test_state of fs test cases

Removes unnecessary test_state structure usage for tracking file descriptors
Adds missing close(newfd) call in fs_dup_test.c to prevent file descriptor leaks
Simplifies test code by eliminating redundant fd tracking that could lead to incorrect resource management

Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
2026-01-26 22:09:19 +08:00
yukangzhi
71593dffad apps/system/trace: support binary dump of noteram
This patch adds support for dumping binary contents from noteram via the
`trace dump -b <file>` command. Changes include:

- Add a `binary` parameter to `trace_dump()` and the public header
  `system/trace/trace.h` to indicate binary output mode.
- Update `trace_dump()` to set the noteram read mode to binary using
  `NOTERAM_SETREADMODE` when requested.
- Update `trace dump` CLI parsing in `system/trace/trace.c` to accept
  the `-b` flag and pass it through to `trace_dump()`.
- Update usage/help text to include the new `-b` option.

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-26 19:32:42 +08:00
hongfengchen
c69df55cd0 rexecd: fix type change
Fix cast from pointer to integer of different size to ensure
proper type conversion and avoid compilation warnings.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-26 19:32:27 +08:00
tengshuangshuang
34e4d7eacd testing: add unistd.h for drivertest_touchpanel.c
Add unistd.h header file to drivertest_touchpanel.c to fix missing
sleep/usleep function declarations in touchpanel driver tests.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-26 19:32:27 +08:00
hongfengchen
d0e949cb24 testing: add unistd.h and pthread.h headers
Add unistd.h and pthread.h for memorystress_main.c, unistd.h for
dhm.c and cachetest_main.c, and pthread.h for kv_test_019.c to fix
missing declarations.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-26 19:32:27 +08:00
hongfengchen
b56c785640 testing: add missing header files
Add missing header files in netutils and lsan modules to fix
implicit function declarations and improve compilation compatibility.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-26 19:32:27 +08:00
hongfengchen
9a3778cb91 testing: add malloc.h for fstest.h
Add malloc.h header file to fstest.h to fix missing malloc/free
function declarations in filesystem test suites.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-26 19:32:27 +08:00
dongjiuzhu1
854d00e49e system/uorb: uorb_listener add new features.
Add nonwakeup ways to using uorb_listener

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-26 19:31:45 +08:00
dongjiuzhu1
1f990388ec system/uorb: support non-wakeup subscribe.
default subscribing is wakeup.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-01-26 19:31:45 +08:00
hujun5
d1de009bc2 sched: inline enter_critical_section
Inline enter_critical_section function calls in performance-critical
paths to reduce function call overhead while maintaining consistent
semantics, improving overall system latency and responsiveness in
real-time scenarios.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 16:39:15 +08:00
Vlad Pruteanu
c883c3f6dd testing/drivers/crypto/hmac.c: Add long keys
This adds 2 tests, which include keys that are
longer than the SHA's block size.

Signed-off-by: Vlad Pruteanu <pruteanuvlad1611@yahoo.com>
2026-01-26 10:58:22 +08:00
mazhuang
5c822ea4d3 rpmsgsocket:add rpmsg socket test cases
Signed-off-by: mazhuang <mazhuang@xiaomi.com>
2026-01-24 17:07:42 +08:00
Jiri Vlasak
0e1ccbe35d license: Fix typo in LICENSE file
license: Fix typo in LICENSE file

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-01-23 11:05:48 -03:00
Jiri Vlasak
72f57fc34e netutils: Add BARE
BARE is a simple binary representation for structured application data.

cbare, the BARE implementation ported by this commit, is an I/O agnostic
C implementation of the BARE message encoding.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-01-23 11:05:48 -03:00
guohao15
197401975a mtdconfig: support ram_mtdconfig device && lomtdconfig device
For nvs test in qemu

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2026-01-23 10:07:11 +08:00
likun17
a454cf4d94 system/uorb: uorb_listener flush functionality optimization.
uorb/listener:Added flush failure prompt information.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-23 10:01:33 +08:00
likun17
ada12ce175 system/uorb: uorb_listener adds new features.
uorb/listener.c: Added flush function.
aurora:/ # uorb_listener -f sensor_accel_uncal,sensor_mag_uncal,sensor_aaa
Waited for 5 seconds without flush complete event. Giving up. err:25

Result:
        Topic [sensor_mag_uncal0] flush: FAILURE. [-1]
        Topic [sensor_accel_uncal0] flush: SUCCESS.
Total number of flush topics: 1/2

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-23 10:01:33 +08:00
likun17
183deb66e9 system/uorb: uorb_listener adds new features.
add get sensor device information based on topic.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-23 10:01:33 +08:00
Bartosz Wawrzynek
f09d0b2e09 apps: Fix minor issues for latest toolchains
- crypto/mbedtls: Add -Wno-cpp flag to suppress warnings
- interpreters/quickjs: Add flags to suppress warnings
- lte/alt1250: Fix spelling issues in comments
- system/dd: Add missing includes for modern compilers
- system/zlib: Add -Wno-cpp flag
- testing/cxx: Include missing algorithm header

Signed-off-by: Bartosz <bartol2205@gmail.com>
2026-01-23 10:00:52 +08:00
fangpeina
715da6bde6 system/ymodem: fix send err when partial write
Fix buffer offset calculation in ymodem_send_buffer() to correctly
handle partial writes by advancing the buffer pointer and adjusting
the remaining size on each retry.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-01-23 09:43:22 +08:00
hujun5
19dcc896d7 sched/tcb: add a reference count to the TCB to prevent it from being deleted.
To replace the large lock with smaller ones and reduce the large locks related to the TCB,
in many scenarios, we only need to ensure that the TCB won't be released
instead of locking, thus reducing the possibility of lock recursion.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-22 11:06:12 -03:00
hongfengchen
b72f7997a3 system/popen: close newfd correctly
Fixes a bug where newfd is not properly closed when newfd[0] equals newfd[1].
This can cause file descriptor leaks in certain edge cases where the read
and write sides of the pipe are duplicated.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-22 19:54:56 +08:00
wangzhi16
f16a45a854 examples/pipe: bugfix testcase of fifo
There are three bug in fifo testcase.

1. line 211 and line 295 should be nbytes not ret.
2. coverity report error:
CID 1667262: (#4 of 11): Double close (USE_AFTER_FREE)
11. double_close: Calling close(int) will close the handle fd that has already been closed. [Note: The source code implementation of this function has been overwritten by the built-in model.]

Double close will ocurr when line 234 is true and goto line 341, close again!
Now, Using the previous code logic, Use a tid and an errout_with_null_thread to avoid uninitialized problems.

3. since line 295 is used ret not nbytes, error not expose before.

When the end of read and write are opened, end of write will write successfully even if end of read not read.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-22 19:53:39 +08:00
wangzhi16
5c6d646d76 testing/fs: add testcase to test the stability of memfd.
Supplement ostest test cases.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-22 19:53:39 +08:00
wangzhi16
094b0f235a test/mutex: fix mutex testcases.
Multiple threads should use the same lock for resource protection.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-22 19:53:39 +08:00
yukangzhi
122a4a6f4e apps/examples/popen: Modify kconfig file
This test depends on !DISABLE_POSIX_TIMERS.

arm-none-eabi/bin/ld:
apps/examples/popen/libapps_popen.a(popen_main.c.obj):
in function `popen_main':
apps/examples/popen/popen_main.c:62:(.text.popen_main+0x1c):
undefined reference to `timer_create'

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-22 19:52:02 +08:00
yukangzhi
3c99bad310 crctest: Test the CRC library that the E2E depends on.
Test the CRC Library defined in the AUTOSAR specification

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-22 19:51:51 +08:00
tengshuangshuang
b6203955f9 syscall: fix listen case bug
Skip UDP listen test when CONFIG_NET_UDP is disabled to prevent
test failures on configurations without UDP support.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
338301de76 timerjitter: fix signal-cause error
Handle timer-delivered signals correctly to prevent assertions when
signal-related events occur during timing measurements.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
be26d79633 syscall: fix badfd test for fdcheck compatibility
Handle fdcheck path for badfd test to prevent unexpected dumps when
fdcheck is enabled, allowing proper testing of bad file descriptor
error cases.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
b86457dfcb apps/testing: fix syscall cases for fdcheck compatibility
Guard fdcheck-sensitive paths in setsocketopt, dup2, and fsync tests
to avoid assertion failures when fdcheck is enabled, ensuring tests
can properly verify error handling behavior.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
8afe3c0645 test: clean driver_audio_test (void *) cast
Drop unnecessary casts in driver_audio_test to silence compiler
warnings and improve code clarity.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
4df2ce98aa testing: fix net case bug
Adjust net socket test expectations for correct behavior to prevent
false test failures in network socket test cases.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
df48348fca test: fix timerjitter data style error
Fix timerjitter output formatting for date/time fields to match
expected format and improve test result readability.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
6249f22f97 tests: fix cache_test and arch_lib_test date style error
Correct date formatting in cache_test and arch_lib_test outputs to
ensure consistent date/time display format across test results.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
5216065fb8 cache_test: fix up_flash_dcache error
Fix flash dcache helper error handling in cache_test to properly
handle errors when flushing data cache operations fail.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
likun17
8146403512 system/uorb: uorb listener bug fix.
Fixed the issue that instance+1 subscription will be triggered when
topic exists in this core

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-22 03:34:51 +08:00
tengshuangshuang
10873c6b59 testing: specify arch kconfig for testsuites
Specify architecture configuration in testsuites Kconfig to ensure
correct architecture-specific settings and build configurations.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-21 14:44:00 -03:00
tengshuangshuang
40a890626d testing: specify arch format Kconfig
Specify architecture format in Kconfig to ensure proper configuration
handling for different architectures in testing modules.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-21 14:44:00 -03:00
zhenwei fang
72fe4e21e1 nsh: fix nsh redirect fd double close
avoid double-close of redirection fds

Signed-off-by: zhenwei fang <fangzhenwei@bytedance.com>
2026-01-21 14:42:50 -03:00
Côme VINCENT
85b1a1c8c1 fix(macro): fix CAPIO_FREQUENCY macro typo
Going from CAPIOC_FREQUENCE to CAPIO_FREQUENCY according to nuttx/pull/16925

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2026-01-21 16:59:08 +01:00
makejian
57ced95c07 crypto/openssl-wrapper: align SSL_CTX_new declaration with OpenSSL
Remove the extra rngctx parameter from SSL_CTX_new() to match
the standard OpenSSL API signature:
  SSL_CTX *SSL_CTX_new(const SSL_METHOD *method)

This improves compatibility with code written for OpenSSL.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-21 19:25:02 +08:00
makejian
690d8bddce crypto/openssl-wrapper: fix SSL error code mapping
Map mbedtls error codes to OpenSSL standard return codes in
SSL_connect/SSL_do_handshake:
- Return 1 on success
- Return 0 on controlled shutdown
- Return -1 on fatal error (was returning mbedtls error codes)

This aligns the return values with OpenSSL specification where
SSL_get_error() should be called to get the actual error reason.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-21 19:25:02 +08:00
makejian
825007aafb crypto/openssl-wrapper: export SSL_CTX_load_verify_file and SSL_CTX_load_verify_dir
Export SSL_CTX_load_verify_file() and SSL_CTX_load_verify_dir()
interfaces to allow loading CA certificates from file or directory.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-21 19:25:02 +08:00
makejian
22f85e8b61 benchmarks/fpu: improve timing precision to milliseconds
Change FPU benchmark timing from seconds to milliseconds for better accuracy.
This allows for more precise measurement of test cycles, especially for
shorter test runs that previously completed within a single second.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-21 07:43:09 -03:00
makejian
9148fb9718 benchmarks: Add Whetstone FPU benchmark
Add the Whetstone floating-point benchmark to NuttX applications.
The Whetstone benchmark is a widely-used tool for evaluating FPU
(floating-point unit) performance.

This benchmark is ported from netlib.org whetstone.c which has a
custom permissive license requiring attribution. Therefore it
depends on ALLOW_CUSTOM_PERMISSIVE_COMPONENTS.

Usage: whetstone [loops]

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-21 07:43:09 -03:00
Jiri Vlasak
37403210f9 netutils/nng: Update help for NETUTILS_NNG
NNG depends on options that, if not enabled, makes compilation or
runtime crashes. Noting these options in help helps to find out which
are such options.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-01-21 09:48:11 +08:00
wangchengdong
5456849446 ostest/hrtimer: Add threaded hrtimer tests
Add threaded hrtimer tests

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-21 00:29:40 +08:00
wangchengdong
840c4fceef ostest/hrtimer: align hrtimer callback declaration
align hrtimer callback declaration with latest update of hrtimer

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-21 00:29:40 +08:00
wangchengdong
19dd2531fb testing/ostest: fix build issue
fix:

  Building NuttX...

  /d/a/nuttx-apps/nuttx-apps/sources/apps/Application.mk:238: target 'signest.c.d.a.nuttx-apps.nuttx-  apps.sources.apps.testing.ostest.o' given more than once in the same rule

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-20 17:01:42 +01:00
guoshichao
755fae7ac1 system/cu: merge the cu.h to cu_main.c
Merge the cu.h header file contents into cu_main.c to simplify the
code structure. The cu_globals_s structure and related definitions
are now directly in cu_main.c.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-20 10:23:34 +01:00
makejian
ddc699a4f3 system/cu: fix signal handler to use sa_sigaction
The sigint() function uses siginfo->si_user but was declared with
only one parameter (int sig). This causes compilation error because
siginfo is undeclared.

Fix by:
1. Rename sigint to cu_exit with proper sigaction signature
2. Use sa_sigaction instead of sa_handler to receive siginfo_t
3. Pass cu pointer via sa.sa_user for signal handler access

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-20 10:23:34 +01:00
wangchengdong
d9afe2db8c signals: fix build and runtime issues when signals all isabled
Fix build and runtime issues when signals all disabled.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-19 22:55:19 +08:00
zhanghongyu
9c85568c4f icmpv6_ping.c: change socket type from SOCK_DGRAM to SOCK_RAW.
standardize the implementation of ping6 to better comply with socket
permissions on certain systems.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-19 22:52:06 +08:00
makejian
d2902008fe openssl-wrapper: fix code style compliance
Fix coding style issues in OpenSSL/MbedTLS wrapper implementation:
- Align whitespace and indentation
- Fix line formatting
- Ensure consistent code style per NuttX standards

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-19 22:51:14 +08:00
makejian
bafe30898a openssl-wrapper: mapping more error code whitin mbedtls and openssl when ssl error
VELAPLATFO-66562

Change-Id: Ibb1446a7fcae1d2bc09d75052466a6ce084103b8
Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-19 22:51:14 +08:00
makejian
49e2592e34 openssl-mbedtls-wrapper: export SSL_ASSERT* macro
VELAPLATFO-62586

Change-Id: I2ceac930c87196a16ea7ddf5e4130bb991b51025
Signed-off-by: makejian <makejian@xiaomi.com>
(cherry picked from commit d0547662d5006ec0a348d89d3d7e251ef4bb183c)
2026-01-19 22:51:14 +08:00
makejian
94ffd5e9f0 openssl_wrapper_mbedtls: extend openssl interfaces in ssl module for mqtt
VELAPLATFO-62586

Change-Id: I3b56b028e76aee118ed90211c097ac3fe86bc129
Signed-off-by: makejian <makejian@xiaomi.com>
(cherry picked from commit 7a567e98489f64b740044b9ce4066fa8d41af359)
2026-01-19 22:51:14 +08:00
makejian
33d5062ba6 openssl_wrapper_mbedtls: support bio interfaces in openssl
VELAPLATFO-62586

Change-Id: I5d7675c05dc3a52c1cb15a6132b969a19f848248
Signed-off-by: makejian <makejian@xiaomi.com>
(cherry picked from commit 409c86a062a816b56a3a48b1111102d12f24a48f)
2026-01-19 22:51:14 +08:00
guoshichao
782de2748f cu: implement the cu exit logic like top cmd
using the local cu_globals_s instance to manange the cu exit procedure

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-19 22:48:25 +08:00
guanyi3
a75fa37090 usrsocktest: fix TEST_ASSERT_EQUAL fail for POLLIN
This assertion should be removed because the POLLIN event is now only
raised when there is data pending to be received. Previously, POLLIN
was incorrectly set as soon as the connection was established, even
when no data was available, which was not consistent with the expected
behavior.

Signed-off-by: guanyi3 <guanyi3@xiaomi.com>
2026-01-19 22:46:45 +08:00
wangchengdong
df30f84f33 ostest/hrtimer: sync hrtimer test with latest updates
Synchronize the hrtimer ostest with the latest hrtimer changes.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-19 08:37:08 -03:00
guoshichao
5595a01fcd watchdog: disable the drivertest_watchdog_api testcase on some platform
When we support the watchdog interrupt on the Armv7-A platform with
the TEE enabled, the watchdog interrupt needs to be configured as
a FIQ to avoid the impact of interrupt disabling in the AP.
In this case, the drivertest_watchdog_api testcase cannot pass the
test in such a scenario.

This is because the drivertest_watchdog_api itself requires
calling a specified callback after the watchdog interrupt is
triggered, instead of directly dumping the AP's context and
then asserting the system.

Therefore, when both CONFIG_ARCH_ARMV7A and CONFIG_ARCH_HAVE_TRUSTZONE
are enabled, we need to skip the current drivertest_watchdog_api
testcase.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-19 17:51:42 +08:00
liqinhui
45a6b0365c netutils/ping: Support ICMP filter for ping.
Add setsockopt support to filter ICMP packets.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2026-01-19 14:09:31 +08:00
makejian
056ba984e8 tinycrypto: add unix as compile flags to use dev/random
Add UNIX platform flag to tinycrypto build configuration to enable access to /dev/random for secure random number generation.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-19 14:07:21 +08:00
likun17
ed7bb51b14 system/uorb:unit_test bug fix
Fixed the error message caused by inconsistent definitions of pthread_t on different platforms.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-19 12:22:40 +08:00
dongjiuzhu1
7ba3638507 system/uorb: merge set_info to orb_advertise_multi_queue_info.
support new api: orb_advertise_multi_queue_info to advertise topic
with info

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-01-19 12:22:40 +08:00
likun17
3d97bf02e4 system/uorb:Loop bug fix
Fixed the epoll issue that when multiple events come only the first POLLIN is entered.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-19 12:22:40 +08:00
zhangshuai39
11c8220fd5 netlib: Replace perror with nerr
Use the nerr interface for error print.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-17 12:09:13 +08:00
zhanghongyu
faefee4897 MQTT-C: compile tests only if no with_mbedtls is enabled
tests only supports tests in non-encrypted mode. when we open tests
compilation in other modes, there will be many compilation warning
with mismatched parameter types, and it will not run correctly.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 21:12:36 +08:00
gaohedong
54bef649ea net/ptpd: fix compile warning issue
In some scenarios, dynamic memory allocation is not allowed, so it is modified to a static allocation method.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-16 21:12:22 +08:00
guoshichao
e804886c68 libuv: fix sendmsg parameter type in NuttX port
Update the libuv NuttX port patch to change sendmsg() parameter from
"struct msghdr *msg" to "const struct msghdr *msg" in the NuttX-specific
implementation stub. This maintains compatibility after NuttX's socket API
was made POSIX-compliant with const-correct parameters.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 21:10:55 +08:00
guoshichao
0a90fe5167 benchmarks/ramspeed: add cmake build support
Add CMakeLists.txt for the RAMSpeed benchmark application, enabling it to
be built with the CMake build system alongside the existing Makefile-based
build. This ensures consistent build behavior across build systems.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 21:09:07 +08:00
zhanghongyu
c62d0d0875 netlib_setarp.c: add ATF_PERM to mark arp entry as permanent
Improve the behavior of the ARP table so that the manually configured
ARP table has the highest priority, can only be manually modified to
other values, otherwise will never change again, and will not time out.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 21:08:26 +08:00
anjiahao
63e2650487 elf:avoid interference between different ELFs generated by symtab
if defined CONFIG_EXAMPLES_ELF and CONFIG_EXAMPLES_MODLUE,
elf will generated BINDIR, so generated symtab will interference.
It supports inputting multiple specified files in mksymtab.sh to
avoid interference.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-16 21:07:56 +08:00
v-tangmeng
6630c08783 examples/elf: add support for CONFIG_DISABLE_SIGNALS
make the example elf can work with SIGNAL disabled

Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
2026-01-16 21:07:56 +08:00
anjiahao
27e0811312 elf:Delete unnecessary generation, elf does not use kernel api
delete the mod_symtab.c generate procedure

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-16 21:07:56 +08:00
anjiahao
91f55245eb apps:modify examples elf compile method
rearrange the elf test directory, make the sub-testcase in separate
directory

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-16 21:07:56 +08:00
zhanghongyu
2b0a4a20f5 iptables: add file lock to prevent concurrent overwrite
the kernel can only prevent the concurrency of s/getsockopt, but
iptables will call these interfaces multiple times at a time. We
need to wait for one iptables to complete before executing the second
one, otherwise the data will be overwritten.

iptables flow:
get current iptables entries [1] -> add new entry 2 [1,2] -> set to kernel [1,2]
get current iptables entries [1] -> add new entry 3 [1,3] -> set to kernel [1,3]
entry 2 is lost

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-15 17:20:03 +08:00
daichuan
859fc54c96 netutils/ping: change socket type to SOCK_RAW
The ping socket creation method is changed from SOCK_DGRAM to SOCK_RAW,
because SOCK_DGRAM may not have permission in some environments (e.g. Docker).
Also add checksum calculation when send, and perform IP header processing when receive.

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-15 17:19:29 +08:00
zhanghongyu
5f634815cb iptables: fix the ipv4 mask conversion error
the configured mask should be in network byte order, but the logic here
calculates it as host byte order.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-15 17:12:03 +08:00
zhanghongyu
3e3b8c6936 graphics/libyuv: fix the typo.
fix the typo.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-15 16:46:40 +08:00
wangchengdong
60d814efa2 sched/signal: Add support to disable partial or all signals
Fix dependency issue when signals are partially or fully enabled

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-15 15:48:54 +08:00
zhaoxingyu1
26fcdbd9ad mtdconfig/nvs: fix typo error in nvs testcase
such as: 2st->2nd, 3st->3rd and so on

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-15 10:26:21 +08:00
zhaoxingyu1
32facd5b3a mtd/nvs: testcases fit the situation where erasestate is 0
Special_id dynamically adjusts based on erase value

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-15 10:26:21 +08:00
zhaoxingyu1
58c2473b38 apps/testing: nvs testcases support remove align size
mtd/nvs removes CONFIG_MTD_WRITE_ALIGN_SIZE,
testcases need to be modified meanwhile

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-15 10:26:21 +08:00
gaohedong
af8ff17f95 netlib: fixed compilation issues
fixed compilation issues

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-15 10:26:02 +08:00
haopengxiang
680dca1121 ltp: close mq_close/3-1 testcase when open CONFIG_FDCHECK
Caused the cause will used after free on fd

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-15 10:25:21 +08:00
ligd
429f24afbd ltp: close mq_close/4-1 testcase when open CONFIG_FDCHECK
Caused the cause will used after free on fd

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-15 10:25:21 +08:00
ligd
b7b2ba37a1 timer_test: reduce the sleep time to improve testing efficiency
reduce the sleep time

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-15 10:25:21 +08:00
jingfei
97545f6ff9 ymodem:rb of ymodem add prefix and suffix for download file name
Adding parameters to rb main can add prefixes and suffixes
to the file names to be downloaded

Signed-off-by: jingfei <jingfei@xiaomi.com>
2026-01-15 01:24:17 +08:00
liucheng5
58326d39dc system/uorb: add a new uorb topic ENG
Add a new uorb topic for ENG sensor

Signed-off-by: liucheng5 <liucheng5@xiaomi.com>
Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-14 10:49:28 -05:00
meijian
b0b90ac728 apps/net: add http connectivity check API
Add netlib_check_httpconnectivity() to verify HTTP service connectivity by sending GET request and validating status code.

Signed-off-by: meijian <meijian@xiaomi.com>
2026-01-13 10:55:40 +08:00
raiden00pl
a22bf844cd .github/build.yml: fix python venv installation
install venv package in one command to avoid issues with ubuntu mirrors

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-01-12 11:04:21 -05:00
Matteo Golin
8d4e872402 !testing/cmocka: Compile cmocka as a libary only by default
BREAKING CHANGE

This commit introduces a Kconfig switch to include the cmocka binary
built from cmocka_main.c. The default behaviour is now changed so that
cmocka is built as a library only, which would be the desired behaviour
for users creating their own cmocka projects.

To restore the old behaviour (where the cmocka program is compiled), add
CONFIG_TESTING_CMOCKA_PROG=y to your legacy configuration.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-01-12 10:14:55 +08:00
shichunma
7daac30cb4 system/iptables: avoid trap when running "iptables -L"
A trap occurs every time CONFIG_NET_NAT is enabled while CONFIG_NET_IPFILTER is not.

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-01-11 15:07:15 -05:00
gaohedong
d594c953a1 net/vlan: fix issue of vlan pcp config
Fix a issue of vlan pcp config.
`vconfig add eth0 10` will create eth0.10 with VID=10 and no PCP(0)
`vconfig add eth0 10 3` will create eth0.10 with VID=10 and PCP=3

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-12 00:55:47 +08:00
hujun5
21f4156048 sighand: need block WAKEUP_SIGNAL in current tcb
If the main thread receives the signal, the waiter_main will not be awakened.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-12 00:55:33 +08:00
Huang Qi
4e8a0ae4c4 style: Fix coding style violations in nuttx-apps
Fix various coding style issues including:
- Case statement formatting
- Include placement and ordering
- Whitespace issues
- Long line formatting
- Bracket alignment

Affected modules:
- audioutils, examples, include
- netutils, system

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-01-12 00:54:48 +08:00
zhangshuai39
63f61d080a netutils/ntpclient: Fix a large number of print DNS request errors
Before attempting to sample via NTP, network connectivity should be checked to avoid frequent sampling that could cause network error logs to overflow.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-11 15:57:05 +08:00
zhangshuai39
13a019450a netlib: Add an empty macro definition to the two connectivity functions
The `netlib_check_ipconnectivity` and `netlib_check_ifconnectivity` functions depend on the `NETUTILS PING` configuration item. When `NETUTILS PING` is not enabled, a compilation error will occur; therefore, an empty macro definition is added.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-11 15:54:38 +08:00
meijian
c61fb846d7 apps/net: add if network conntivity check API
Perform connectivity testing on the specified network interface card.

Signed-off-by: meijian <meijian@xiaomi.com>
2026-01-09 14:03:20 +08:00
Zhe Weng
10eae1dc6b vconfig: Support setting default PCP when creating VLAN
Now we allow setting a default PCP when creating VLAN like:
`vconfig add iface-name vlan-id [pcp]`
e.g.
`vconfig add eth0 10` will create eth0.10 with VID=10 and no PCP(0)
`vconfig add eth0 10 3` will create eth0.10 with VID=10 and PCP=3

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2026-01-08 22:51:19 +08:00
Zhe Weng
ae7c168bf6 nshlib: Add vconfig command
Add vconfig command

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-08 22:51:19 +08:00
mazhuang
9c4103d496 nsh_syscmds/rpmsg: add rpmsg test command support
User can use rpmsg test /dev/rpmsg/<cpuname> to test the rpmsg
channel

Signed-off-by: mazhuang <mazhuang@xiaomi.com>
2026-01-08 22:50:11 +08:00
buxiasen
1512f9c6e5 netlib/ping: fix the stack variable not initialized.
We add devname in ping_info_s, but not initializeed, cause
data abort as value in stack possible not NULL.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-07 11:58:13 +08:00
wangchengdong
416c315f92 ostest: sync hrtimer ostest with hrtimer updates
Update the hrtimer ostest to reflect recent changes in the hrtimer
implementation.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-07 09:44:42 +08:00
Huang Qi
73bc5cbcc6 interpreters: Add mquickjs JavaScript interpreter integration
Add complete integration for the MicroQuickJS JavaScript interpreter,
supporting both CMake and Make build systems with automatic source
acquisition.

Key features:
* FetchContent downloads mquickjs from bellard/mquickjs if local
  git repository is not available in interpreters/mquickjs/mquickjs/
* Builds mqjs_stdlib host tool to generate mqjs_stdlib.h and
  mquickjs_atom.h headers during build
* Creates libmquickjs library with proper header generation dependencies
  to prevent parallel build failures
* Provides mqjs NSH application for interactive JavaScript execution
* Configurable task priority and stack size via Kconfig options
  (INTERPRETERS_MQJS_PRIORITY, INTERPRETERS_MQJS_STACKSIZE)
* Supports both 32-bit and 64-bit architectures with appropriate build flags

Files added:
* CMakeLists.txt - CMake build configuration with FetchContent support
* Kconfig - Configuration options for interpreter features
* Make.defs - Make build definitions
* Makefile - Alternative Make-based build support
* .gitignore - Ignores generated files and local mquickjs source directory

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-01-07 09:44:19 +08:00
Felipe MdeO
ca11a7e093 system/smf: Port SMF .c/.h files to NuttX
This commit add state machine framework lib to the NuttX project. Also an example is added to help users understand and use this feature.

Changes: Added some files. No impact in other features are expected.

Adjust SMF macro names

Fix issues requested during MR review

update kconfig

fix ci-cd issue

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-01-05 12:50:04 -05:00
Zhe Weng
4f93ec0a43 pkt: Set sll_protocol for raw socket to ETH_P_ALL
Ref: https://man7.org/linux/man-pages/man7/packet.7.html

We should either set protocal when creating socket or binding, otherwise
we cannot capture any packet.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2026-01-04 21:41:21 +08:00
buxiasen
157ecb091d iperf: compatible work with no IPv4
We possible want to use iperf to test rpmsg socket etc.

Fix error when enable iperf and no IPv4
```
arm-none-eabi-ld: warning: ~/nuttx/nuttx has a LOAD segment with RWX permissions
arm-none-eabi-ld: ~/nuttx/staging/libapps.a(iperf_main.c.~.apps.netutils.iperf_1.o): in function `iperf_main':
~/apps/netutils/iperf/iperf_main.c:248:(.text.iperf_main+0x330): undefined reference to `inet_ntoa_r'
arm-none-eabi-ld: ~/apps/netutils/iperf/iperf_main.c:240:(.text.iperf_main+0x354): undefined reference to `netlib_get_ipv4addr'
arm-none-eabi-ld: ~/nuttx/staging/libapps.a(iperf.c.~.apps.netutils.iperf_1.o): in function `iperf_print_addr':
~/apps/netutils/iperf/iperf.c:226:(.text.iperf_print_addr+0x3c): undefined reference to `inet_ntoa'
```

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-04 00:06:17 +08:00
buxiasen
188838469c kernel/syscall: fix required INET may case no support
We may possible enable socket and no ipv4

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-04 00:06:17 +08:00
meijian
3467f9b82d apps/net: add ip address connectivity check API
The system checks connectivity with the input IP address; if no IP address is provided, it defaults to checking DNS server connectivity.

Signed-off-by: meijian <meijian@xiaomi.com>
2026-01-04 00:05:38 +08:00
dongjiuzhu1
150c5756a0 examples/capture: support monitor edge change by signal
add monitor code about edge change

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-01-03 23:51:26 +08:00
zhangshuai39
6830e297cf dhcpd: Supports kernel mode compilation
The previous method of terminating the dhcp daemon via a global variable has been removed; instead, the `kill pid` command is used. Also, because the original `dhcp_start` method creates tasks via `task_create`, which is not supported in kernel mode, `dhcp_start` is not compiled in kernel mode. The daemon can be started in kernel mode using `dhcpd xxx &`.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-02 12:29:42 -03:00
nuttxs
9ad4c3c395 netutils/dhcpc.h: fix the compilation error caused by undefined
CONFIG_NETDB_DNSSERVER_NAMESERVERS

Provide a default value for CONFIG_NETDB_DNSSERVER_NAMESERVERS if
CONFIG_NETDB_DNSCLIENT is not enabled

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2026-01-02 14:12:10 +01:00
p-szafonimateusz
85539a1223 github/ci: add support for NTFC
Add support for NTFC testing framework.

At the moment NTFC is downloaded from a private repo,
and installed with pip and venv. In the future NTFC repositories
will be migrated to Apache organization.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-12-31 16:33:10 -03:00
dongjiuzhu1
c90b64ed8b nshlib/ls_handler: eliminate floating-point operations for human-readable sizes
Replace floating-point arithmetic with fixed-point integer math to avoid
linking soft-float library (~2-3KB Flash) when displaying human-readable
file sizes (ls -lh command).

Changes:
- Use integer division and modulo to calculate size components
- Calculate decimal part: (remainder * 10) / unit for one decimal place
- Refactor duplicated code: consolidate GB/MB/KB logic into single path
- Remove CONFIG_HAVE_FLOAT dependency

This eliminates calls to __aeabi_f2d, __aeabi_fmul, __aeabi_i2f and other
ARM EABI floating-point helpers, reducing Flash footprint for systems
compiled with -mfloat-abi=soft.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-31 16:32:27 -03:00
zhangkai25
710aef6bd0 iperf: Increase the priority of the report thread
ensure it is not blocked by the iperf thread, preventing iperf from completing

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2025-12-30 19:51:57 +08:00
dongjiuzhu1
e5c85d1ca2 netutils/ptpd: Add switch correction time change
The current gPTP stack does not support path delay correction of the Switch.
This patch adds the path delay correction field in the Header.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
03ca9ba500 netutils/ptpd: using -B to control BMCA message
new option -B to BMCA message

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
54cbc2ee0d netutils/ptpd: support PTP ethernet transport
support ptp by rawsocket

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
65d29de0f7 netutils/ptpd: add NET_PKT to enable PTP
support ptp clock device

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
54d55fe5f4 netutils/ptpd: add NETUTILS_PTPD_ADJTIME_THRESHOLD_NS to accelerate adjustment
optimize the speed of adjustment

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
d3504bf9b3 netutils/ptpd: support adjtime for ptp device
support ptp clock deivce to adjust time

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
4426ce733a netutils/ptpd: using dynamic config to config clien-only mode and delaye2e
fix compile warning when only enable PTPD_CLIENT or PTPD_SERVER

ptpd.c:493:38: error: 'CONFIG_NETUTILS_PTPD_PRIORITY1' undeclared (first
use in this function); did you mean 'CONFIG_NETUTILS_PTPD_CLIENT'?

ptpd.c:494:39: error: 'CONFIG_NETUTILS_PTPD_CLASS' undeclared (first use
in this function); did you mean 'CONFIG_NETUTILS_PTPD_CLIENT'?

ptpd.c:495:39: error: 'CONFIG_NETUTILS_PTPD_ACCURACY' undeclared (first
use in this function); did you mean 'CONFIG_NETUTILS_PTPD_DEBUG'?
ptpd.c:498:38: error: 'CONFIG_NETUTILS_PTPD_PRIORITY2' undeclared (first
use in this function); did you mean 'CONFIG_NETUTILS_PTPD_CLIENT'?

ptpd.c:502:36: error: 'CONFIG_NETUTILS_PTPD_CLOCKSOURCE' undeclared
(first use in this function); did you mean
'CONFIG_NETUTILS_PTPD_STACKSIZE'?

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
5d34a0906a netutils/ptp: destroy donesem at the end of ptpd_status
fix minor issue

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
Xiang Xiao
832e61c1c4 netutils/ptpd: Add the missing comparison in is_better_clock
The original implementation only checked if each field was less than,
but didn't check for greater than before proceeding to the next field.
This caused incorrect clock selection behavior in the PTP Best Master
Clock Algorithm (BMCA).

The fix expands each comparison to explicitly check both < and >
conditions, returning the appropriate result immediately. This ensures
proper precedence evaluation according to IEEE 1588 specification:
- gm_priority1
- gm_quality (class, accuracy, variance)
- gm_priority2
- gm_identity

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
e718fdd2c6 netutils/ptpd: get nanoseconds by SO_TIMESTAMPNS to satisfy higher precision
using nanoseconds as timestamp

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
4411a41bc2 netutils/ptpd: using hardware_ts to replace CONFIG_NET_TIMESTAMP
runtime to config the ways of timestamp

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
ac881e5108 system/ptpd: provide more parameter by struct ptpd_config_s when starting ptpd
origin command change to new command:
ptpd start interface & -> ptpd -i eth0 &
ptpd stop pid          -> ptpd -d pid
ptpd status pid        -> ptpd -t status

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
28302ae7d7 system/ptpd: using main task to replace new task
new starting command:
ptpd start interface &

we should run it in background ways

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
d1f59bef8e netutils/ptpd: using DEBUG_PTP_ERR/WARN/INFO to replace NETUTILS_PTPD_DEBUG
using new ptp clock device debug function

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
e4ddfdeed1 netutils/ptpd: byte align for ptp structure
pass structure between remote and local core

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
dongjiuzhu1
3ddda82313 netutils/ptpd: add CMakelist for ptpd
support cmake build

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 08:51:51 -03:00
Zhe Weng
40c7982816 netlib: Add support for adding/removing VLAN device
Add support for adding/removing VLAN device

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-30 11:17:38 +08:00
zhangkai25
b2f7ead2dd apps/examples/udp: Update CMAKEList.txt for UDP tests under CMAKE
add Update CMAKEList.txt for UDP tests under CMAKE

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2025-12-29 22:34:52 +08:00
zhangkai25
1ca7838482 apps/testing: add cmock_test for enet in order to test send and receive pkt
add cmock_test for enet in order to test send and receive pkt

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2025-12-29 22:30:56 +08:00
Matteo Golin
39310946ec testing/nuts: NuttX Unit Test Selection (NUTS) application.
Introduces a collection of unit tests for NuttX, built on top of the
cmocka framework. Tests are organized into suites/groups which can be
individually included/excluded from the build using Kconfig. Output is
easily legible and separated with headers including the test group name.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-12-28 10:28:14 +08:00
meijian
9da2bc0696 apps/net: add get iobinfo api
Obtain detailed IOB information by parsing the /proc/iobinfo file.

Signed-off-by: meijian <meijian@xiaomi.com>
2025-12-25 12:27:27 -05:00
wangchengdong
fb4f80665d ostest/hrtimer: Fix typos
The current code incorrectly used the CONFIG_SCHED_EVENTS
macro in ostest.h for hrtimer_test(). This has been corrected to use CONFIG_HRTIMER.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-12-25 23:06:42 +08:00
zhangshuai39
09ddb06c9d dhcpd: Align makefile implementation
Improve the CMakeLists.txt to achieve the same compilation results as Makefile.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-25 11:17:17 -03:00
gaohedong
9f035ea0be qnet/wireless: fix compile warning of i8sak
fix tasking compile warning isssue
warnning log:  undefined reference to 'g_ieee802154_status_string'

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-25 18:05:23 +08:00
gaohedong
9dc6781bf9 net/wireless: dup g_ieee802154_status_string from kernel
dup g_ieee802154_status_string from kernel to fix cmopil issue

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-25 18:05:23 +08:00
gaohedong
de6aac8afb net/wireless: fix compile warning
fix tasking compile warning isssue
warnning log: unused variable "IEEE802154_STATUS_STRING"

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-25 18:05:23 +08:00
gaohedong
74c71145da net/ethernet: ARP can be configured on interface
ARP can be configured on interface

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-25 12:25:02 +08:00
gaohedong
b56795e1e2 net/ping: utils ping should depends on ipv4
utils ping should depends on ipv4

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2025-12-25 12:24:30 +08:00
wangchen
f89773cbc8 ping: Initialize info.devname to NULL
Initialize info.devname to NULL to solve the problem of the SO-BINDTODEVICE property being set incorrectly in the icmp_ping function

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-25 12:24:04 +08:00
meijian
5d3b2d07d6 ping: add -I for bind device
Add -I option to specify the network device to use for sending ICMP
echo requests. This allows users to explicitly bind ping to a
specific network interface, which is particularly useful in
multi-homed systems with multiple network interfaces.

Signed-off-by: meijian <meijian@xiaomi.com>
2025-12-25 12:24:04 +08:00
zhangshuai39
532a055abb paho_mqtt: Add mqtt compilation files
It provides the necessary compilation files and configuration management files, and offers a publish demo and a subscribe demo

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-25 12:20:17 +08:00
zhangshuai39
de87836c7a netpkt: Add parameters to support specific network cards
Supports sending and receiving data packets on specified interfaces.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-25 09:45:30 +08:00
meijian
4b3070c081 apps/net: add ip conflict check API
Supports checking for IP conflicts on a NIC.

Signed-off-by: meijian <meijian@xiaomi.com>
2025-12-25 09:44:47 +08:00
zhanghongyu
837c27d6e3 netutils/libwebsockets: add cmake support
add libwebsockets cmake support

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-25 09:43:48 +08:00
wangchengdong
4d98ecccaf testing/ostest: add hrtimer API functional tests
Add functional tests for the newly added hrtimer APIs,
including hrtimer_init(), hrtimer_start(), and hrtimer_cancel().

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-12-24 09:52:18 +08:00
zhengyu9
b78ab0c6e8 fsutils/flashtool: add flashtool command support
Introducing flashtool command with following capabilities:
- Flash geometry information display
- Bad blocks checking
- Page contents read/write
- Block erase
- Full flash erase

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
2025-12-23 11:25:16 -05:00
p-szafonimateusz
8856a587a6 testsuites/Kconfig: fix codespell issues
fix codespell issues

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-12-23 09:12:02 -03:00
p-szafonimateusz
951740627b testing/testsuites/Kconfig: add missing dependencies for test cases
add missing dependencies for test cases to avoid compilation errors

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-12-23 09:12:02 -03:00
p-szafonimateusz
008433dcfe testing/testsuites: add cmake support
add cmake support for testsuites

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Co-authored-by: v-wangshihang <v-wangshihang@xiaomi.com>
Co-authored-by: v-chenglong8 <v-chenglong8@xiaomi.com>
Co-authored-by: xuxin19 <xuxin19@xiaomi.com>
Co-authored-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-12-23 09:12:02 -03:00
Matteo Golin
0045d8b546 uorb/listener: Fix typos
Fix typo in comments and strings.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-12-22 12:07:36 +01:00
zhangshuai39
26a969ac71 apps/netutils: Modify the MQTT compilation file to enable MQTT testing
Modify the build and test files to make the MQTT test cases run.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-22 11:11:59 +08:00
fangpeina
c4da1b5b9f system/cu: Optimize I/O performance with batch read/write
Due to DMA-based transfers, the rx buffer can receive a large amount
of data at once. The previous character-by-character processing approach
was inefficient.

Modify character-by-character read to block read of the entire buffer.
This improves throughput and reduces CPU overhead, especially for high-speed
serial communication or other DMA-based transfers.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2025-12-18 21:49:00 +08:00
Alan Carvalho de Assis
8cb7dd0694 apps/testing: Add pthread_mutex_perf created by Anchao
During the discussion about the impact of adding counter to TCB
Mr anchao created a pthread mutex performance example:
https://github.com/apache/nuttx/pull/17468#issuecomment-3660925314

Because this example can exercise (not ideally) the pthread mutex
I decided to add it to apps/testing/sched, the program name will
be called "pmutexp" (because "pmp" is not a good name).

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-16 20:57:58 -03:00
dependabot[bot]
a5e455cc1c build(deps): bump actions/cache from 4 to 5
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-16 09:24:27 +01:00
dependabot[bot]
c487d669cf build(deps): bump actions/download-artifact from 6 to 7
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-16 09:23:57 +01:00
dependabot[bot]
8e7ec46cce build(deps): bump actions/upload-artifact from 5 to 6
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 21:21:53 -05:00
yangsong8
60f5a68c96 adb: adb tcp server configuration depends on NET_TCPBACKLOG
For TCP-based adb, if the current CPU contains TCP protocol stack,
then NET_TCPBACKLOG needs to be enabled.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-11 19:16:23 +08:00
yangsong8
953fa21fef adb: adb shell depends on SCHED_CHILD_STATUS
Without this configuration, when executing exit in adb shell,
adb will not be able to exit because it cannot receive the
close packet.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-11 19:16:23 +08:00
chenxiaoyi
a59436985c testing: getTimeofday_test: fix build warning
getTimeofday_test.c:68:22: error: variable 'cnt' set but not used [-Werror,-Wunused-but-set-variable]

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-12-10 12:17:44 +01:00
Yanfeng Liu
aa3320fab4 import/Make.defs: use _start entry name
This reverts `_start` entry name to fix issue#17443 together with
nuttx side pull#17450.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2025-12-10 19:05:56 +08:00
zhengyu16
cfff7f5a22 nshlib: add -f for umount
adds support for the -f (force) option to the NSH umount command

Signed-off-by: zhengyu16 <zhengyu16@xiaomi.com>
2025-12-10 12:16:49 +08:00
yangsong8
dbc99dbf35 apps/spitool: Support multiple trans
By adding a parameter -r, spitool can exchange multiple transactions.
example:
spi exch -b 1 -t 0 -n 0 -f 3000000 -m 1 -w 32 -x 1 -r 2 f001fff1 0000ff35

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-10 11:26:43 +08:00
yangsong8
74293114aa apps/system: fix spitool can not send data issue
when use cmd 'spi exch -b 1 -f 3000000 -m 1  -n 0 -w 32 -x 1 1f',
the last character '1f' can not be trans out.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-10 11:26:43 +08:00
yangsong8
00154fd818 apps/system/composite: change cmake build name to conn and disconn
The executable file compiled by cmake has the same filename as
that compiled by make.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-10 11:24:35 +08:00
yangsong8
f82e6c2229 nsh: return EOF when nread is 0
If enable CONFIG NSH_CLE. When sh reads data and detects that nread is 0,
return EOF and exit.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-10 11:24:14 +08:00
yangsong8
2bc4bdadee apps/nsh: fix switchboot command spelling error
modify swtichboot -> switchboot

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-10 11:24:14 +08:00
Filipe Cavalcanti
c3b5c6cedf boot/mcuboot: update MCUBoot version
Updates default MCUBoot hash.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-12-09 23:10:01 +08:00
hujun5
24e1c4df6f testing/ostest/smp_call.c: fix smp_call cpu_set inconsistency issue
If we set CONFIG_SMP_DEFAULT_CPUSET=1
This will cause the value of cpuset to be 0x1,
((1 << CONFIG_SMP_NCPUS) - 1) will result in the cpuset being 0x11,
leading to test case errors.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-12-09 09:44:37 -05:00
yangsong8
e19d99022a apps/fastboot: fix build warning
apps/system/fastboot/fastboot.c:351:43: error: '%s' directive output may be truncated writing up to 63 bytes into a region of size 60 [-Werror=format-truncation=] ...... apps/system/fastboot/fastboot.c:351:3: note: 'snprintf' output between 5 and 68 bytes into a destination of size 64 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ apps/system/fastboot/fastboot.c:351:43: error: '%s' directive output may be truncated writing up to 63 bytes into a region of size 60 [-Werror=format-truncation=] ...... apps/system/fastboot/fastboot.c:351:3: note: 'snprintf' output between 5 and 68 bytes into a destination of size 64 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-09 20:16:21 +08:00
yangsong8
9633580d2c apps/fastboot: add switchboot command
The switchboot command can be sent even without enabling sh

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-09 20:16:21 +08:00
yangsong8
63c1767d33 apps/fastboot: organize an api for external apps to call
add an interface fastboot_handler. This interface can be called
when nsh is disable.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-09 20:16:21 +08:00
yangsong8
5eae4c8f15 apps/fastboot: Enable network via ioctl during fastboot initialization
Bring up the network when do fastboot tcp init.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-09 20:16:21 +08:00
raiden00pl
641f7ced84 testing/ltp: add ltp zip file to gitignore
add ltp zip file to gitignore

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-05 17:53:57 +01:00
raiden00pl
5549f66dc1 testing/memtester: fix build error for cmake
fix broken CMakeLists.txt for memtester

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-05 17:53:57 +01:00
raiden00pl
39cb6fefda testing/memtester: add memtester.zip to gitignore
add memtester.zip to gitignore

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-05 17:53:57 +01:00
raiden00pl
8c5c506e40 testing/cachetest: fix compilation error for arm64
fix compilation error:

cachetest_main.c:37:26: error: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
   37 | #define CACHETEST_PREFIX "CACHE Test: "
      |                          ^~~~~~~~~~~~~~
cachetest_main.c:150:20: note: in expansion of macro 'CACHETEST_PREFIX'
  150 |   syslog(LOG_INFO, CACHETEST_PREFIX "waddr:%p, uncacheble addr start:%p,"
      |                    ^~~~~~~~~~~~~~~~
cachetest_main.c:151:17: note: format string is defined here
  151 |          "size:%u\n", info->waddr,
      |                ~^
      |                 |
      |                 unsigned int
      |                %lu

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-05 17:53:57 +01:00
simbit18
a78a3a461b workflows/build.yml: fix fatal: write error: No space left on device
Fixed error verified in this PR https://github.com/apache/nuttx/pull/17423

added to the workflow:

- Show Disk Space

- Free Disk Space (Ubuntu)
  Only Android runtime removed

- Post-build Disk Space

We can now monitor disk space.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-05 11:44:11 +08:00
simbit18
f000ed733f workflows/build.yml: macOS Workflow updated to macos-15-intel
The macOS 13 runner image will be retired by December 4th, 2025.
To raise awareness of the upcoming removal, jobs using macOS 13 will temporarily fail during the scheduled brownout time periods defined below:

November 4, 14:00 UTC to November 5, 00:00 UTC
November 11, 14:00 UTC to November 12, 00:00 UTC
November 18, 14:00 UTC to November 19, 00:00 UTC
November 25, 14:00 UTC to November 26, 00:00 UTC

https://github.blog/changelog/2025-09-19-github-actions-macos-13-runner-image-is-closing-down/

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-01 18:32:10 -03:00
buxiasen
0f8bca6d8f testing/pm_smp: add more delay, avoid idle canot run one cycle
If the host performance low, possible not able to enter idle thread,
cause case break.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 19:10:11 +08:00
buxiasen
df9fe43cc9 fb: fix no mmap with get_pinfo, kernel build with data abort
When BUILD_KERNEL, will case userspace access the kernel address and
abort.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 19:09:54 +08:00
buxiasen
4ac0b10318 drivertest_uart: uart device open should use cfmakeraw to ensure raw.
reference: https://www.man7.org/linux/man-pages/man3/termios.3.html

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 19:09:41 +08:00
buxiasen
3bd8506ae8 testing/ostest/roundrobin: add compatible for SMP
Fix if SMP cause calculation run in multi-core cause case break.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 19:09:27 +08:00
buxiasen
b95c9980b5 apps/ostest/roundrobin: add fail detect and print
Before patch we never detect the roundrobin fail.
After patch use a array to detect if the calculation swapped when
processing.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 19:09:27 +08:00
buxiasen
d23eb01490 fs_stat_test: fix fs date case not strict enough
use utc diff should prefer and more strict.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 19:07:22 +08:00
buxiasen
8126aaf803 cmake/process-spawn: remove if not required align with Makefile
We already fixed the process-spawn.c in Makefile, should align to cmake

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-12-01 11:23:10 +01:00
xuxingliang
6bd593459c examples/elf: fix cmake build error
CMake Error at cmake/nuttx_parse_function_args.cmake:76 (message):
  : unparsed INCLUDES;/home/neo/projects/nuttx/apps/examples/elf
Call Stack (most recent call first):
  cmake/nuttx_add_application.cmake:77 (nuttx_parse_function_args)
  /home/neo/projects/nuttx/apps/examples/elf/CMakeLists.txt:24 (nuttx_add_application)

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-11-27 22:23:42 +08:00
Jukka Laitinen
c3247ecc6c nshlib/nsh_fscmds.c: Allocate a PATH_MAX sized buffer for unlink_recursive
This fixes heap corruption when deleting a folder containing other folders
or files. The issue appeared at commit 131d50ae9d, which removed the
stack-based temporary buffer.

unlink_recursive requires that the path is provided in PATH_MAX sized
buffer. It concatenates sub-folder or file names to the same buffer.

nsh_getfullpath just allocates a buffer using strdup, so there is no room
for concatenating more data to it.

To keep the stack usage smaller, instead of reverting the breaking commit,
allocate the temporary buffer with lib_get_pathbuffer instead.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-11-26 10:27:47 -05:00
dependabot[bot]
3f6fc4b4f7 build(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-25 10:03:55 +08:00
likun17
6028b42d0f uorb/generator:Fix generator bugs and formatting issues.
replace kmm_zalloc with zalloc and malloc, and fix format and return value errors.

Signed-off-by: likun17 <likun17@xiaomi.com>
2025-11-20 20:44:25 +08:00
likun17
9cf9b862c1 uorb: add generator tool.
e.g.:
1. uorb_generator -f /data/sensor/19700101000003/sensor_accel_uncal0.csv -t sensor_accel_uncal2
2. uorb_generator -s -r 5 -n 200 -t sensor_accel_uncal2 timestamp:1,x:-2.0,y:3,z:4,temperature:5

Signed-off-by: likun17 <likun17@xiaomi.com>
2025-11-20 20:44:25 +08:00
caofuqi1
1c769d1410 testing/ltp: add cmake support
add cmake support for LTP

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Co-Authored: xuxin19 <xuxin19@xiaomi.com>
2025-11-19 01:38:36 +08:00
p-szafonimateusz
188d533dd2 testing/cmoka: fix cmake build
fix cmake build for cmoka:

   [2/9] No update step for 'cmocka_fetch-populate'
   [3/9] Performing patch step for 'cmocka_fetch-populate'
   can't find file to patch at input line 16
   Perhaps you used the wrong -p or --strip option?

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-11-18 21:59:42 +08:00
simbit18
c7ac717167 game: Aligned Cmake with Make
- Conway's Game of Life #3210

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-11-14 22:40:17 +08:00
Matteo Golin
31d567e880 games/cgol: Add Conway's Game of Life
This commit introduces a new application, Conway's Game of Life (or
`cgol`). It is a simple frame buffer rendering application that makes
for an interesting, animated visual.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-11-14 14:20:58 +08:00
daniel-geotab
9bbc2fe1e4 Revert "ppp: Fix wrong lcp_state handling on peer reconnection"
This reverts commit 800b93de9f.

Signed-off-by: daniellizewski <daniellizewski@geotab.com>
2025-11-11 14:05:47 -05:00
daniel-geotab
ba8823534c Revert "ppp: Reformat to match nuttx coding style"
This reverts commit 0c734ca62b.

Signed-off-by: daniellizewski <daniellizewski@geotab.com>
2025-11-11 14:05:47 -05:00
nuttxs
92269be92a netutils/netlib: support delete the DNS server address by index or address
- Modify the DHCP-client data structure to support multiple DNS addresses
- Enhance DHCP-option parsing to extract all DNS-server addresses
- Set all received DNS-server addresses
- fix some test case build error

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-11-10 18:10:16 +08:00
wangchengdong
bd10572851 testing/ostest: align wdog ostest with wdog bugfix
https://github.com/apache/nuttx/pull/17293 fixed
    wd_start bug, and this patch fixed the related ostest
    accordingly

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-10 10:44:53 +08:00
Michal Lenc
761f25c857 nshlib/nsh_proccmds.c: fix description for TID and switch order
ID previously marked as PID was in fact TID. PID was hidden under
GROUP column. This fixes the description. The order of TID, PPID, PID
is also changed to more logical TID, PID, PPID.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-11-07 10:32:42 +08:00
raiden00pl
91a7580303 testing/mm/cachetest/cachetest_main.c: fix codespell error
fix codespell error for cachetest_main.c

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-11-02 22:33:46 +08:00
raiden00pl
4f5fe44af1 testing/testsuites/kernel/socket/cases: fix compilation error
fix compilation error:

kernel/socket/cases/net_socket_test_010.c: In function ‘ioctltestinternal’:
kernel/socket/cases/net_socket_test_010.c:188:20: error: ‘siocgifname’ undeclared (first use in this function)
  188 |   ret = ioctl(sfd, siocgifname, &ifr);

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-11-02 22:33:46 +08:00
raiden00pl
0a906edd81 testing/mm/cachetest/cachetest_main.c: fix compilation error
fix compilation error:

cachetest_main.c: In function ‘cachetest_main’:
cachetest_main.c:240:7: error: implicit declaration of function ‘up_flush_dcache’ [-Wimplicit-function-declaration]
  240 |       up_flush_dcache((uintptr_t)info.waddr, (uintptr_t)info.waddr +

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-11-02 22:33:46 +08:00
raiden00pl
1f1240a0f4 testing/drivers/fftest/fftest.c: fix compilation error
fix compilation error:

CC:  vfs/fs_rmdir.c fftest.c: In function ‘fftest_main’:
fftest.c:104:7: error: implicit declaration of function ‘ioctl’ [-Wimplicit-function-declaration]
  104 |   if (ioctl(fd, EVIOCGBIT, fffeatures) < 0)

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-11-02 22:33:46 +08:00
George Poulios
f3dc21755f tee/optee_client: Consolidate libteec and optee_supplicant
Merges build file structure so that both libteec and optee_supplicant
are under the same nuttx-app directory. This better reflects external
source repo structrure (optee_client containing both libteec and
tee-supplicant) and avoids a case where build of supplicant
was attempted before libteec, leading to a missing .zip file
(zip file was only downloaded by libteec, but order of builds was
not enforced).

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-10-30 21:46:56 +08:00
dependabot[bot]
099c8ff58e build(deps): bump actions/download-artifact from 5 to 6
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-28 10:32:42 +01:00
dependabot[bot]
d1c1ce09df build(deps): bump actions/upload-artifact from 4 to 5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-28 10:32:22 +01:00
Kevin Witteveen (MartiniMarter)
452ae235c6 graphics/jpgresizetool: Add libjpeg resize tool
Add a libjpeg based JPEG resize tool.
Simple resizer that can resize JPEGs using
"jpgresize input.jpg output.jpg scale_denom(1,2,4,8) quality%".
Tries to use little memory by scanning per line.

Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
2025-10-27 00:14:45 +08:00
simbit18
4ffed5d6dc CI MSYS2: added the genromfs tool for creating romfs file systems
Add:

 - the genromfs tool for creating romfs file systems

https://github.com/chexum/genromfs

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-10-20 12:30:45 -04:00
trns1997
4f5d25e1eb ci: Sync build.yml workflow with NuttX repository.
Update the  workflow in nuttx-apps to match the
corresponding workflow in the main NuttX repository, ensuring
consistency across both CI configurations.

This synchronization follows the guidance from:
https://lupyuen.org/articles/ci3\#sync-to-nuttx-apps

* Aligns CI triggers, job structure, and naming conventions.
* Maintains consistency between NuttX and nuttx-apps CI setups.

Signed-off-by: trns1997 <trns1997@gmail.com>
2025-10-20 01:11:15 +08:00
Huang Qi
847f862fd4 examples/elf: Fix invalid preprocessor directive syntax
Fix invalid preprocessor directive in elf_main.c by changing
`#  Warning "No file system selected"` to `#  warning "No file system selected"`.

The incorrect uppercase "Warning" directive would cause compilation
errors, while the proper lowercase "warning" directive generates
the intended compiler warning when no file system is selected.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-10-19 11:53:23 -04:00
Stepan Pressl
9e83bc2270 examples/shv-nxboot-updater: use downgraded pyshv==0.8.0
The problem probably arises from an incompatibility issue
between the shv-libs4c and pyshv libraries. The fix is to downgrade
the library for now and then revert back.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-10-17 14:40:03 -04:00
Pavel Pisa
7f90139918 netutils/libshvc: update to correct reply head for non single element CID array
The update enables interoperability with a Silicon-Heaven
SHV3 protocol broker implemented in Rust language

  https://github.com/silicon-heaven/shvbroker-rs

New commits from shv-libs4c project

  https://github.com/silicon-heaven/shv-libs4c

- shv_pack_head_reply: correct reply head for non single element
  CID array

  When servicing request from the SHV3 protocol version broker
  itself then CID array is empty and missing TAG_CALLER_IDS
  for empty array breaks encoding scheme.

- shv_process: even in case of unsuccessful attempts to connect
  respect request to stop

  The request to stop initiate  by signal caused the high priority
  thread to enter busy-loop and block a system. Check for request
  to stop (running flag cleared) even in disconnected state after
  unsuccessful attempt.

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2025-10-17 14:39:16 -04:00
Huang Qi
27579eb531 examples/fb: Fix error message formatting and accuracy
Fix two error message issues in the framebuffer example:
* Add missing newline character to fbmem2 error message in fb_init_mem2()
* Correct mmap() error message that incorrectly referenced FBIOGET_PLANEINFO

These changes improve error reporting clarity and consistency for debugging framebuffer initialization issues.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-10-17 14:56:51 +08:00
trns1997
a44d65c939 testing/cxx-oot-build: Exclude cxx-oot-build in CMake projects.
Remove the previous guard logic and use a proper CMake
`exclude` rule to prevent `cxx-oot-build` from being
included when building projects with CMake.

* Ensures OOT test project is not pulled into normal apps.
* Keeps CI and export tests isolated from regular builds.

Signed-off-by: trns1997 <trns1997@gmail.com>
2025-10-15 14:34:32 +08:00
Halysson
ddf1dcc3ff netutils/cmux: Add support for CMUX protocol
This commit adds CMUX (GSM 07.10) protocol support to netutils.
CMUX allows multiplexing multiple virtual serial connections
over a single physical serial link.

Changes include:
- CMUX protocol implementation
- CRC table for frame validation
- Basic frame handling

Signed-off-by: Halysson <halysson1007@gmail.com>
2025-10-06 15:04:22 -03:00
trns1997
3684699190 testing/cxx-oot-build: Add out-of-tree build test.
Add the source content for the out-of-tree build test
under `apps/testing/cxx-oot-build`. This supports the
new CI check in NuttX to prevent regressions in the
`make export` workflow.

The test project provides:
* Sample OOT build structure.
* Integration with exported `nuttx-export`.
* Verification of successful build and link.

Signed-off-by: trns1997 <trns1997@gmail.com>
2025-09-25 18:32:38 +08:00
Stepan Pressl
cf41b01135 netutils/libshvc: add Silicon Heaven integration into NuttX and SHV examples
This commit marks the end of my GSoC 2025 project in the NuttX section.
All changes:

- Silicon Heaven protocol (SHV) implementation:
  The library is cloned from github.com/silicon-heaven/shv-libs4c
  and compiled here. The library has out-of-the-box support
  for NuttX and possibly all posix systems.
  The library is compiled with CONFIG_SHV_LIBS4C_PLATFORM define
  set to "nuttx". The library's dependancy is Pavel Pisa's ULUT
  and originates from Michal Lenc's GSoC.

- examples/shv-nxboot-updater:
  An example which constructs a SHV tree with which you can perform
  firmware updates using a SHV "file node". The file node wraps
  around NXBoot's update partition.
  The application also allows for NXBoot confirmation of the images.
  This application is to be meant used as a "background service",
  started before any apps, possibly using rcS. The tree is allocated
  as GAVL (see below).

- examples/shv-test:
  An example which constructs a SHV tree and gives the user
  the ability to choose which type of construction should be used,
  either:
    - GAVL:       dynamic SHV tree allocation encapsulated within
                  an AVL tree.
    - GSA:        dynamic SHV tree allocation encapsulated within
                  a continuous array with binary search
    - GSA_STATIC: SHV tree is defined as static const, this means
                  all the data structures are placed in .rodata.
		  Extremely beneficial for embedded systems,
		  as .rodata is located in flash and embedded
		  systems usually have more flash than sram,
		  thus reducing sram usage. The downside is that
		  the definitions are rather tedious, but can
		  be automated in case of some code generation
		  (like in pysimCoder).
		  All of it is places in a continuous array with
		  binary search.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-09-24 21:43:07 +08:00
wangjianyu3
bc73779144 nshlib/nsh_parse: Fix "e" flag not take effect
The NSH exits when a command exits with a non-zero status, even if the "e" flag is not set.
This error does not exist in NSH scripts.

Without this patch:

  nsh> sh -c "set -e; mkdir /test; echo $?"
  nsh: /test: mkdir failed: 17
  nsh> sh -c "set +e; mkdir /test; echo $?"
  nsh: /test: mkdir failed: 17
  nsh> rm /test
  nsh> sh -c "set +e; mkdir /test; echo $?"
  0

With this patch:

  nsh> sh -c "set -e; mkdir /test; echo $?"
  nsh: /test: mkdir failed: 17
  nsh> sh -c "set +e; mkdir /test; echo $?"
  nsh: /test: mkdir failed: 17
  1
  nsh> rm /test
  nsh> sh -c "set +e; mkdir /test; echo $?"
  0

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-09-18 02:15:49 +08:00
Lars Kruse
00911d417d boot/nxboot: improve documentation
Previously it was hard to guess the correct entrypoint for the
bootloader application.

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
2025-09-18 02:15:43 +08:00
michal matias
a85121b168 netutils: Add plcatool
Add plcatool - simple tool for managing PLCA configuration in 10BASE-T1S PHYs.

Signed-off-by: michal matias <mich4l.matias@gmail.com>
2025-09-17 19:29:10 +08:00
Jukka Laitinen
479d206dff system/cdcacm: Support sercon and serdis in CONFIG_BUILD_KERNEL
- Put sercon and serdis in separate source files, so that the main
functions can be compiled in also in kernel build.
- Don't store the ttyacm handle in the application, it is stored
in kernel side in case of the system_cdcacm

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-09-17 12:38:05 +02:00
wangjianyu3
10cab6bf6d nshlib/nsh_syscmds: Fix resetcause and rpmsg_help typos
nshlib/nsh_syscmds.c:111: unkown ==> unknown
nshlib/nsh_syscmds.c:651: acknowlege ==> acknowledge

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-09-17 10:07:24 +02:00
wangjianyu3
09f0f89e3a nshlib/reset_cause: Fix format warning for flag
Fix format string not appropriate warning for cause.flag.

nsh_syscmds.c: In function 'cmd_reset_cause':
nsh_syscmds.c:513:24: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint32_t' {aka 'unsigned int'} [-Werror=format=]
  513 |       nsh_output(vtbl, "%s(%lu)\n",
      |                        ^~~~~~~~~~~
  514 |              g_resetcause[cause.cause], cause.flag);
      |                                         ~~~~~~~~~~
      |                                              |
      |                                              uint32_t {aka unsigned int}

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-09-17 10:07:24 +02:00
Stepan Pressl
9968fa064b benchmarks/cyclictest: fix comp. warning and optargs termination
Fix reqtimeout_timer may be uninitilized.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-09-14 10:37:27 +02:00
Lars Kruse
df711238fe system/dd: implement "--help" parameter
Previously the usage hints were displayed only in case of errors.

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
2025-09-12 09:33:13 +08:00
Lars Kruse
db36c8c617 system/dd: emit status messages to stderr (not stdout)
Previously `dd` clobbered its output by writing status messages (e.g.
transfer statistics) to stdout.

Now all status messages are written to stderr.

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
2025-09-12 09:33:13 +08:00
wangchengdong
93060aa59d nshlib/nsh_builtin.c : Add support to run builtin dirrectly as command
Add a new config: NSH_BUILTIN_AS_COMMAND.
  Provide a new implementation for nsh_builtin
  when CONFIG_NSH_BUILTIN_APPS_AS_COMMAND is enabled.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-11 20:00:20 +08:00
wangchengdong
1b9d420e79 sched/event: add nxevent_getmask tests
add test cases for the new nxevent_getmask() function

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-10 13:59:04 +08:00
dependabot[bot]
5a337e188e build(deps): bump actions/setup-python from 5 to 6
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 09:44:25 +08:00
dependabot[bot]
a7276c2c3e build(deps): bump actions/github-script from 7 to 8
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 09:44:13 +08:00
wangchengdong
7c5800924a testing/ostest: add nxevent_clear() test cases
Add test cases to verify the new recently added nxevent_clear() api

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-09 15:36:01 +08:00
Filipe Cavalcanti
6bcb347982 system/ntpc: update ntpc messages
Updates verbosity on ntpc commands. Also updated documentation on NuttX side.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-09-05 23:47:36 +02:00
raiden00pl
ac08faa2b8 codespell: add codespell configuration
add codespell configuration with ignored lines for nimble

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-09-03 09:30:47 +08:00
raiden00pl
18823c8b32 bluetooth/nimble: update to the latest master
Update NimBLE to the latest master. This includes fixing the debug log control,
which was broken since:

  da4e2f0f12

The debug log was always enable and it wasn't possible to disable it.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-09-03 09:30:47 +08:00
Tiago Medicci
61e82925dc examples/i2schar: Implement loopback mode check
This commit implements the loopback mode for the i2schar example
application. This mode - available only when both RX and TX are
enabled - allows the user to test the I2S buses when the TX pin is
connected to the RX pin. This is done by pre-filling a buffer with
known data (additionally, it checks the peripheral's data width to
format the data in the buffer accordingly) and passing it for both
the transmitter and the receiver threads. This buffer is written to
the TX and the received buffer is compared to the known buffer.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2025-08-28 21:58:41 +08:00
Michal Lenc
7ac03cfcef boot/nxboot/loader/boot.c: avoid unwanted confirm on double update
Following steps led to incorrect behavior:
 - upload update image
 - restart device and perform the update
 - upload the same update image again without confirming

This led to the unwanted confirm of the update image. This change
ensures the update image is not confirmed by uploading the same
image to the update slot. The correct behavior is to perform revert
to the last stable image if this occurs.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-08-28 14:59:39 +08:00
YAMAMOTO Takashi
0e65af606f mbedtls: Add an option to build ssl_client2 test program
Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-08-28 14:57:45 +08:00
YAMAMOTO Takashi
71ce94a13e system/dd/dd_main.c: fix a typo in a comment
Found by the CI.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-08-26 21:56:12 +08:00
YAMAMOTO Takashi
93ced081dc system/dd/dd_main.c: replace #if defined with #ifdef
Although I personally prefer the former, at least one reviewer
preferred the latter. I coundn't find project-wide preferences.
Anyway, this is not important for me.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-08-26 21:56:12 +08:00
YAMAMOTO Takashi
78bae4f14f system/dd: portability to non-nuttx platforms
while this is not a goal for this repository,
it's convenient for me (hopefully for some others too)
to be able to build this for other platforms.

an obvious downside is to have a few more ifdefs.

tested with:
```
/opt/wasi-sdk-25.0/bin/clang -Wall -Oz -s -o dd.wasm dd_main.c
```

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-08-26 21:56:12 +08:00
Niccolò Maggioni
dfd1eb0672 examples/ads7046: Add new example for ADS7046 ADC
Add a new example that shows how to read a sample from
an ADS7046 ADC sensor registered on the SPI bus.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-20 02:28:15 +08:00
Niccolò Maggioni
14a39ee7ce examples/tmp112: Add new example for TMP112 temperature sensor
Add a new example that shows how to read the temperature from a
TMP112 sensor registered on the I2C bus.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-19 14:27:45 +08:00
Niccolò Maggioni
d8dcc9926e crypto/libsodium: Update libsodium to 1.0.20
Update the libsodium crypto library to the latest 1.0.20 tagged release.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 22:10:12 +08:00
Niccolò Maggioni
b0726955a0 fsutils/libtinycbor: Update TinyCBOR to 0.6.1
Update the TinyCBOR serialization library to the latest 0.6.1 tagged release.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 22:09:32 +08:00
Niccolò Maggioni
056f04d170 tools/mksymtab: Replace deprecated fgrep usages
In most modern distros, fgrep is deprecated in favor of "grep -F"

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 22:09:20 +08:00
liuchan3
fdf6f57d6c graphics/input: Adjust input tool priority and sampling rate
Align to monkey's priority, with a sampling rate similar to a real touch.

Signed-off-by: liuchan3 <liuchan3@xiaomi.com>
2025-08-12 20:20:01 +08:00
liuchan3
6f93e401aa apps/graphics: Refactor the input tool using input generator library
Signed-off-by: liuchan3 <liuchan3@xiaomi.com>
2025-08-12 20:20:01 +08:00
liuchan3
36b117c00a apps/graphics: Refactor monkey using input generator library
Signed-off-by: liuchan3 <liuchan3@xiaomi.com>
2025-08-12 20:20:01 +08:00
Zhe Weng
7bfd5e5790 apps/system: Move input/monkey to apps/graphics/input
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-08-12 20:20:01 +08:00
Zhe Weng
7a2d5bbc64 apps/graphics: Add input generator library
We can use it to unify our monkey / input tools, and for other input
generation purposes easily.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-08-12 20:20:01 +08:00
dependabot[bot]
1820d7d2c7 build(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 20:18:29 +08:00
dependabot[bot]
cd1c835a35 build(deps): bump actions/download-artifact from 4 to 5
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 20:18:15 +08:00
nuttxs
9cb9cea4b2 ntpclient/ntpclient.c: fix the NTP client’s timeval conversion
bug from milliseconds to microseconds

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-08-11 21:49:28 +08:00
Matteo Golin
d334c5eb67 apps/unity: Add printf configuration
Allows the user to select whether or not they want access to the Unity
``TEST_PRINTF`` commands.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-07 11:21:57 +08:00
nuttxs
8f3c3c57f9 netutils/dhcpc/dhcpc: add implementation to get renewal (T1) time and
rebinding (T2) time from DHCP packet.
According to RFC 2131, T1 and T2 times play a critical role in lease
management in DHCP clients.

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-08-06 10:54:18 +08:00
wangjianyu3
8d2a7e32a5 nshlib: Add ppid support for command ps
Add parent process ID support for command ps,
get from "/proc/<PID>/group/status:Parent".

For example

  nsh> sh
  nsh> ps
    PID  PPID GROUP CPU PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK COMMAND
  ... ...
      3     0     3 --- 100 RR       Task      - Waiting  Signal    0000000000000000 0008136 nsh_main
  ... ...
      9     3     9   0 100 RR       Task      - Running            0000000000000000 0004064 sh

  nsh> sleep 100 &
  sh [10:100]
  nsh> ps
    PID  PPID GROUP CPU PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK COMMAND
  ... ...
      3     0     3 --- 100 RR       Task      - Waiting  Signal    0000000000000000 0008136 nsh_main
  ... ...
      9     3     9   0 100 RR       Task      - Running            0000000000000000 0004064 sh
     10     9    10 --- 100 RR       Task      - Waiting  Signal    0000000000000000 0004040 sh -c sleep

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-08-03 22:56:32 +08:00
wangjianyu3
7cc7cb8ffa system/uORB: Add flags for gnss satellite format
Some applications require satellite information for positioning using the flag USED_IN_FIX.
More details: https://github.com/apache/nuttx/pull/16805

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-08-03 22:56:12 +08:00
Jorge Guzman
c19c2a71f3 netutils/xedge: refactor Makefile to use git clone instead of zip downloads
Previous zip-based approach was failing in CI environment. Changed to use
git clone with specific commit hashes to resolve CI build issues.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2025-08-02 10:00:20 -03:00
George Poulios
caefd0de9f tee/libteec, examples/optee_gp: Fix cmake build
Top level:
 - 'tee' subdirectory added to top-level CMakeLists.txt

tee/libteec:
 - BINARY_PREFIX defined PUBLIC to make it accessible to consumer
   apps
 - added missing DEBUGLEVEL definitions

examples/optee_gp:
 - added missing dependency to libteec

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-08-02 09:59:21 -03:00
George Poulios
3ee6fdaf99 tee/libteec: Remove downloaded zip file on distclean
Initially, leaving the .zip around seemed like a good idea to
avoid re-downloading often. But it turns out deleting downloaded
packages during distclean is standard practice and some CI
scripts depend on the git local copy being clean, including
ignored files.

Change also CMakeLists.txt to download the zip instead of the
tarball.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-08-02 09:59:21 -03:00
Tim Hardisty
7506c026fa nxboot/loader: Fix boot progress calculation.
This patch corrects a mathematical error in the progress reporting function which
caused incorrect percentage progress calculations.

Signed-off-by: Tim Hardisty <timh@jti.uk.com>
2025-07-30 22:25:54 +08:00
makejian
08fdbb03bb mbedtls-alt: aligned alternative implementation return value with mbedtls
mbedtls interfaces overwritten by nuttx crypto driver, change return value of mbedtls interfaces from return value of nuttx crypto driver into starndard return value of mbedtls

Signed-off-by: makejian <makejian@xiaomi.com>
2025-07-30 15:41:50 +08:00
jingfei
4ecdb92e61 examples/mtdpart:Register MTD devices using the mtd_register method
1. Due to the automatic wrapping of MTD devices during the open() process,
   the legacy registration methods ftl_initialize() and bchdev_register()
   are no longer required for MTD device registration. The new method is
   now changed to register_mtddriver

2. Some code for space release and deregistration has been added,
   and certain error handling methods have been updated.
2025-07-30 10:10:34 +08:00
Michal Lenc
8fbba09895 boot/nxboot/loader/boot.c: copy partition with blocksize large writes
The previous logic MAX(info_from.blocksize, info_where.blocksize) was
incorrect. The most effective access with by writing the entire
size of the block, therefore just decide the size based on the
target page size.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-07-28 18:21:46 +02:00
Michal Lenc
beacf792fa boot/nxboot/loader/flash.c: open partition with O_DIRECT flag
There is no need to use buffers in a bootloader. We expect a sequential
access, therefore we just need to erase the erase page before writing
to it for the first time, which is something FTL layer already takes
care of.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-07-28 18:21:46 +02:00
RTL
2de49b8b22 examples/xedge_demo: Add Xedge IoT Toolkit with BAS integration
Add support for Xedge, an embedded software toolkit for IoT applications
 using Lua scripting with HTTP(S), WebSockets, MQTT, and device I/O.

* netutils/xedge: Dependency manager that downloads BAS library
  and BAS-Resources, generates XedgeZip.c during build

* examples/xedge_demo: Complete example showing Xedge integration
  with HTTP server, Lua runtime, and SNTP time synchronization

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2025-07-25 09:19:10 -03:00
Theodore Karatapanis
72668d7234 tee/optee_supplicant: Added optee supplicant
Support for extracting (from libteec), patching and compiling
optee_client/tee-supplicant by NuttX apps. Defaults to version
4.6.0 (same as the current libteec).

Enabled with:
CONFIG_OPTEE_SUPPLICANT=y
CONFIG_LIBTEEC=y

And the following for the nuttx kernel:

CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_FS_ANONMAP=y
CONFIG_DEV_OPTEE_SMC=y
CONFIG_DEV_OPTEE_SUPPLICANT=y

The version of the supplicant needs to match the libteec version
since the patch to be applied might fail otherwise. If the versions
differ the build will be aborted.

More info:
 - https://github.com/OP-TEE/optee_client
 - https://optee.readthedocs.io/en/latest/architecture/secure_storage.html

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-07-25 17:31:12 +08:00
SPRESENSE
5e704891d9 netutils/esp8266: Add a function for finalization.
Add a function for finalization so that it can be used repeatedly.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
SPRESENSE
549836600c netutils/esp8266: Add to get channel from access points
Fix bug that channel retrieved by lesp_list_access_points is undefined.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
SPRESENSE
e61ee7981d netutils/esp8266: Fix bug to get gateway address
Fix bug to get gateway address.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
SPRESENSE
5429191ab0 netutils/esp8266: Fix nxstyle
Fix nxstyle.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
SPRESENSE
8b4a015f07 netutils/esp8266: Fix compile error
Fix compile error.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 15:04:36 +02:00
Tiago Medicci
c83e17c083 interpreters/python: Fix symbol collision with list_length function
NuttX implements a function with the same name which may end up
being included whenever `CONFIG_MM_KERNEL_HEAP` is set. To avoid
it, insert a prefix to it on Python's implementation.

Please note that the other patches had their metadata updated too.
2025-07-22 14:18:23 +08:00
wangmingrong1
3f823f9f25 kasantest: -fno-builtin is enabled by default
The strlen function called by kasantest will be optimized by the compiler, and the strlen function implemented in NX will not be called. Adding -fno-builtin can solve the problem.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-07-18 22:42:25 +08:00
wangjianyu3
f34ae4587a system/gdbstub: Add depends of LIB_GDBSTUB
in function `gdbstub_main':
undefined reference to `gdb_state_init'
undefined reference to `gdb_process'
undefined reference to `gdb_state_uninit'

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-07-18 22:42:03 +08:00
Kevin Witteveen (MartiniMarter)
6bca3c2ca2 Add JPEG compressor support to Makefile
Before this PR only the decompressor files were added to the Makefile.
Now all the required compressor files are added.
Decompression and compression tested on STM32H7 with 1:8 JPEG scaling.

Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
2025-07-17 13:54:22 +08:00
Eren Terzioglu
f3e1985b1e games/snake: Change consolekey magic numbers with ASCII macros
Change consolekey magic numbers with ascii values to make it more understandable

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-16 10:32:16 +08:00
Eren Terzioglu
9ea3fc6995 games/snake: Fix terminal issue after returning back from snake game
Fix terminal issue after returning back from game

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-16 10:32:16 +08:00
Filipe Cavalcanti
d27d6e635f examples/mcuboot: add example to update from binary in local storage
This example makes it possible to use a binary from local storage for MCUBoot update.
It copies the binary file to the secondary slot instead of downloading from a remote URL.
Can be used to update from a SD Card, for example.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-07-16 09:49:45 +08:00
Alan Carvalho de Assis
a7e4a2a30e examples/keyboard: Fix compilation warning
Replace %d with %PRIu32 to avoid warning convered in error on CI.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-07-15 06:12:21 +08:00
nuttxs
dfeeef41ed netutils/dhcpc/dhcpc.c:Implement a dedicated interface to send
DHCPRELEASE, According to RFC 2131 section 3.1, DHCPRELEASE is
used by a client to relinquish a network address and cancel any
remaining lease time

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-07-14 15:49:29 -03:00
Petro Karashchenko
227d3ec35b netutils/nanopb: fix unpack step for MACOS
Currently NANOPB_UNPACK step in Makefile uses nanopb binary name with
hardcoded suffix '-linux-x86' that is not suitable for MACOS x86.
This commit replaces the hardcoded nanopb binary name with name that
is derived from NANOPB_NAME variable that reflects the nanopb binary
that is selected based on host OS selected in the build system

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2025-07-14 15:48:08 -03:00
simbit18
29c88356e9 [CI] build.yml: fix ERROR: Dangerous symbolic link path was ignored
add Command Line Switch -snld

-snld ->  allow extracting of denagerous symbolic links.

https://sourceforge.net/p/sevenzip/discussion/45798/thread/187ce54fb0/

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-07-13 07:05:09 +08:00
Eren Terzioglu
8b121eb138 games/match4: Add new match4 game
Add match4 game support

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-12 08:38:32 -03:00
Niccolò Maggioni
0c680bcb8e system/coredump: Fix missing loglevel to logmask conversion.
The current setlogmask call used in the coredump app specifies a raw log level
instead of a bitmask, and this causes wrong evaluations later on when that value
is checked against a mask. Therefore the LOG_UPTO macro is added for conversion.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-07-09 09:54:40 +02:00
SPRESENSE
0037868ff0 examples/nximage: Rename program name to nximage
The original name is nxhello, which duplicates in examples/nxhello.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-09 09:28:57 +02:00
Tim Hardisty
e6a335ded0 Fix Compiler warnings 2025-07-03 10:42:11 +08:00
Tim Hardisty
8c9e126f91 netutils/thttpd-fix-broken-CGI-and-fixup-Kconfig 2025-07-03 10:42:11 +08:00
wangjianyu3
c3e628c45a nshlib/md5: Support reading from standard input
Sometimes users may want to calculate the MD5 of part of a file(e.g. check
partition contents for debug after flashing, size of which may be greater
than image). This can be done with the "dd" command and pipes, the "md5"
command just needs to support reading from standard input. For example:
`dd if=/dev/virtblk0 bs=512 count=1 | md5`.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-07-02 10:59:40 -03:00
Eren Terzioglu
ecd7b84871 games/snake: Enchacements for snake game
Add high score feature into snake game

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-02 10:16:04 -03:00
Tang Meng
971a7374d6 examples/i2schar: fix spelling mistakes 2025-06-27 21:42:02 +08:00
Alan Carvalho de Assis
63c86438fb apps/can: Replace fprintf with dprint
This modification will remove the dependency on
CONFIG_FILE_STREAM, useful for small devices.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-06-27 09:41:29 +08:00
Jean THOMAS
c7b395e7da system/settings: Add spaces after each switch 'case' 2025-06-26 13:22:47 -03:00
Jean THOMAS
4be82876e4 system/settings: general code cleaning
* Remove duplicate checks, use switch/case whenever possible
* Remove assertions just before if () condition checking the exact
  same thing
* Replace if (condition) assert(0) with assert(condition)

Signed-off-by: Jean THOMAS <jean@lambdaconcept.com>
2025-06-26 13:22:47 -03:00
wangmingrong1
92c490579d gcov: Output mode judgment is implemented in the kernel layer
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 23:48:01 +08:00
wangmingrong1
dfbaedd5c2 gcov: Refactoring the implementation framework of gcov
All implementations of gcov are sunk to the kernel implementation
1. Support three dump modes: serial port output, single file output, standard output

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 23:48:01 +08:00
wangmingrong1
25d43c65db apps/gcov: Alloc to strip 0
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 23:48:01 +08:00
Jean THOMAS
bb508520f1 system/settings: fix assertion triggered by uninitialized variables
Fix non-NULL pointer assertion in `get_setting()` caused by
uninitialized pointer variables.

Signed-off-by: Jean THOMAS <jean@lambdaconcept.com>
2025-06-26 19:23:02 +08:00
wangjianyu3
c4ff19a7e4 system/fastboot: fix typos of response error log
Fix typos of sparse header comments and download/upload response error log.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-25 10:01:27 +02:00
wangjianyu3
9df322d938 system/fastboot: add disconn for usb transport
Disconnect usbdev when deinit USB transport.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-25 10:01:27 +02:00
wangjianyu3
4b5af957ac system/fastboot: remove interest and close epoll
Remove fds from the interest list and close epoll if need.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-25 10:01:27 +02:00
Xiang Xiao
ee33688aca Fix /.github/ISSUE_TEMPLATE/001_bug_report.yml:122: Intertial ==> Inertial
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-24 22:19:00 +08:00
Brennan Ashton
f97274611f docs: Include released 10.x and 11.x versions under security policy.
Fixes #7514
2025-06-24 22:19:00 +08:00
Abdelatif Guettouche
f1b78948db .github/SECURITY.md: Fix a typo.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2025-06-24 22:19:00 +08:00
Brennan Ashton
b6f554c3e2 Add project GitHub Security Policy page
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2025-06-24 22:19:00 +08:00
Xiang Xiao
433765bbc8 .github/linters: Ignore E704 warning
since black and flake8 disagree on code style:
https://github.com/pyvista/pyvista/issues/5591

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-24 22:19:00 +08:00
xuxingliang
23d5abeb76 tools: make isort and black formatters to work together
Config multi line output to mode 3, so isort and black can agree with
each other:
```
3 - Vertical Hanging Indent

from third_party import (
    lib1,
    lib2,
    lib3,
    lib4,
)
```

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-06-24 22:19:00 +08:00
Tomasz 'CeDeROM' CEDRO
559dcf5a90 Contributing and PR template fix.
* Fix CONTRIBUTING.md github link reference.
* Full URL is provided to avoid relative/fork reference issues.
* Minor update on full contributing documentation.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-06-24 22:19:00 +08:00
Tomasz 'CeDeROM' CEDRO
0ff820e614 Update github pull request template.
* Update CONTRIBUTING.md guide with hints and examples.
* Minor GitHub Pull Request Template update hinting expected information.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-06-24 22:19:00 +08:00
Lars Kruse
b1fcf50410 ci: enable spelling checks (via codespell) 2025-06-24 22:19:00 +08:00
Eren Terzioglu
6bc5e71a13 .github/ISSUE_TEMPLATE: Add host_info command section into bug report template 2025-06-24 22:19:00 +08:00
Tomasz 'CeDeROM' CEDRO
2dcad906bc github: master branch protection tune.
* Strict master branch protection requires all PR to be in sync with latest
  master even if changes are not related and there are no conflicts.
* Because we have lots of daily merges this blocks most of the PRs as they
  are forced to be rebased on top of current master.
* This also causes unnecessary automatic CI rebuild of each rebase.
* Therefore we are setting strict status checks setting to false.
* required_signatures in github means not only `git commit -s` but also
  cryptographic signature which is not required by us, setting false.
* Disable "contexts" checks enforcement, that cause CI problems, mark TODO.

References:
https://github.com/apache/infrastructure-asfyaml?tab=readme-ov-file
https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification
https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-06-24 22:19:00 +08:00
Tomasz 'CeDeROM' CEDRO
fa0e073baf github: Setup protection for master branch.
* We do not have "Settings" tab in the Apache's owned repository,
  thus we need to update .asf.yaml file with repository settings.
* No direct push to master branch is possible.
* Require status checks to pass before merge.
* Setup reviews parameters.
* Require signatures.
* Require conversation resolution.
* Require linear history.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-06-24 22:19:00 +08:00
simbit18
1e053ee936 check.yml: fix cvt2utf not found sync with nuttx repository
This PR add missing cvt2utf installation on our CI
see apache/nuttx#16561

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-06-24 08:02:07 +08:00
wangjianyu3
6afed10118 system/fastboot: add depends for TCP poll
Add TCP backlog dependence for poll(),
network related configurations referenced to may has not enable it,
without which the TCP handshake will fail.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-23 15:45:51 +08:00
wangjianyu3
11cf4211ab system/fastboot: enable usb and tcp the same time
Add support for enabling USB and TCP transport at the same time.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-23 15:45:51 +08:00
wangjianyu3
abf9fbee30 system/fastboot: switch to epoll
Switch from poll() to epoll().

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-23 15:45:51 +08:00
wangjianyu3
e23ba4891d system/fastboot: rename argument context to ctx
Rename argument "context" to "ctx" for all functions.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-23 15:45:51 +08:00
wangjianyu3
7790894bb6 system/fastboot: add support for fastboot tcp
Add TCP network transport support for fastboot, users can
add "-s tcp:HOST[:PORT]" option to specify a network device.

Examples

  fastboot -s tcp:192.168.100.2 getvar version
  fastboot -s tcp:192.168.100.2 flash virtblk0 fastboot.c
  fastboot -s tcp:192.168.100.2 oem shell "uname -a"

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-18 22:06:08 +08:00
wangjianyu3
75033b7d26 system/fastboot: add func for context and usbdev
fastboot_context_initialize : initialize fastboot context
fastboot_context_deinit     : deinitialize fastboot context
fastboot_usbdev_initialize  : initialize usbdev and open USB endpoint
fastboot_usbdev_deinit      : close USB endpoint

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-18 22:06:08 +08:00
wangjianyu3
88fea63ff4 system/fastboot: replace GETUINT32 with be32toh
Replace macro `FASTBOOT_GETUINT32` with function `be32toh()`.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-18 22:06:08 +08:00
raiden00pl
faea03f1fd add system/adcscope - streaming tool for ADC
add adcscope app allowing to stream data from ADC device with logging/nxscope.
Useful for testing ADC drivers.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-06-17 14:29:08 -03:00
Michal Lenc
7b42dfc53e boot/nxboot: fix compile errors caused by nxboot_progress
Function nxboot_progress is located in nxboot_main.c, but this file
is not compiled when NXboot is used as a library to an existing
application and not as a bootloader. Therefore, the declaration of
nxboot_progress function should be dependent on NXBOOT_PROGRESS
config option.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-06-17 21:25:22 +08:00
wangjianyu3
38bd6accea system/fastboot: add const for memdump_print_t
Add qualifier "const" to the declaration of `memdump_print_t`,
the value of the 2nd argument will not be changed.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-17 20:57:23 +08:00
Matteo Golin
5e50e2c1f9 system/syslogd: Initial implementation
Initial implementation of syslogd including version information, simple
usage help and UDP transmission. The current implementation transmits
RFC 5424 formatted syslog entries over UDP for consumption by a syslog
collector. Only some options from the manpage are implemented since
NuttX doesn't currently have the ability for some of the more complex
features (-l, etc.).

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-06-17 20:43:58 +08:00
wangjianyu3
7375f6574e system/fastboot: move usbdev init after help
Move initialization of usbdev to after help().

This patch fix that even users just run `fastbootd -h`,
the usbdev will also be (re)initialized,
and if the daemon is running the status will be broken.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-15 11:19:49 +08:00
wangjianyu3
4c605ac43f system/fastboot: dump all memory regions
Add examples for oem memdump dumping all memory regions.

Host side

  $ fastboot oem memdump
  fastboot oem memdump 0x20000 0x28000
  fastboot get_staged 0x20000.bin
  fastboot oem memdump 0x40000000 0xf590000
  fastboot get_staged 0x40000000.bin
  fastboot oem memdump 0x4ff30000 0xd0000
  fastboot get_staged 0x4ff30000.bin
  FAILED (remote: 'Invalid argument')
  fastboot: error: Command failed

Device side

  nsh> fastbootd -h
  Usage: fastbootd [wait_ms]

  memdump:
      fastboot oem memdump 0x20000 0x28000
      fastboot get_staged 0x20000.bin
      fastboot oem memdump 0x40000000 0xf590000
      fastboot get_staged 0x40000000.bin
      fastboot oem memdump 0x4ff30000 0xd0000
      fastboot get_staged 0x4ff30000.bin

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-15 11:19:21 +08:00
Michal Lenc
7ca3656c3e benchmarks/osperf/osperf.c: add pipe read-write performance test
This adds a simple pip read-write performance test.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-06-14 17:20:23 +08:00
Michal Lenc
9a73fb7f4b benchmarks/osperf/osperf.c: fix spelling mistakes
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-06-14 17:20:23 +08:00
dongjiuzhu1
4f5c283438 testing/fs: update api name fs_getfilep/fs_putfilep to file_get/file_put
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-12 18:12:32 +08:00
Tim Hardisty
bcd1b46946 apps/boot/nxboot: Enhancements to add progress messages and copy-to-RAM feature
This adds Kconfig-enabled progress messages that are output to stdout.

It also adds Kconfig-enabled option to copy the validated and bootable image to RAM

Signed-off by: Tim Hardisty <timh@jti.uk.com>
2025-06-05 20:06:51 +08:00
wangjianyu3
4b8b96f060 system/uORB: fix orb_subscribe_multi undefined
Fix `orb_subscribe_multi` undefined error.

/workspace/prebuilts/gcc/linux/arm64/bin/../lib/gcc/aarch64-none-elf/13.2.1/../../../../aarch64-none-elf/bin/ld: apps/system/uorb/libapps_uorb_listener.a(listener.c.o): in function `listener_monitor':
/workspace/apps/system/uorb/listener.c:803:(.text.listener_monitor.constprop.0+0xe4): undefined reference to `orb_subscribe_multi'
/workspace/apps/system/uorb/listener.c:803:(.text.listener_monitor.constprop.0+0xe4): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `orb_subscribe_multi'

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-05 19:43:10 +08:00
ouyangxiangzhen
a03ed46947 ostest/wdog: Remove periodical wdog test cases.
The peridiodical wdog test cases should be removed after removing of the periodical wdog APIs.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-06-05 19:42:52 +08:00
Tim Hardisty
f0eb00ffd9 examples: add mdnsd example application to accompany netutils/mdns library
This commit adds a new example app to allow the newly added netutils/mdns
library and associated daemon to be exeercised.

Signed-off-by: Tim Hardisty <timh@jti.uk.com>
2025-06-02 23:18:24 +08:00
Tim Hardisty
30b1c024a1 apps/netutils: add mdns library support
This commit allows an external mDNS library to be included in NuttX.

It originates from here: <https://github.com/mjansson/mdns>

It is declared as being in the Public Domain as per <http://unlicense.org>

Signed-off-by: Tim Hardisty <timh@jti.uk.com>
2025-06-02 23:18:24 +08:00
vrmay23
8ff533beb3 examples/posix_stdio: Fix Kconfig to define default stack size
Fix the Kconfig file for the posix_stdio example by adding
the STACKSIZE symbol and setting it to DEFAULT_TASK_STACKSIZE.

This change ensures that the example builds properly and
respects system-wide stack size configuration.

Signed-off-by: Vinicius May <vmay.sweden@gmail.com>
2025-06-01 09:21:15 -03:00
raiden00pl
44eeb1c7c8 testing: unify Private Types banners
unify Private Types banners according to NuttX coding standard

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-28 10:16:50 +08:00
raiden00pl
32bcd87d8f system: unify Private Types banners
unify Private Types banners according to NuttX coding standard

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-28 10:16:50 +08:00
raiden00pl
1d3abc2651 modbus: unify Private Types banners
unify Private Types banners according to NuttX coding standard

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-28 10:16:50 +08:00
raiden00pl
d62db5eb38 logging: unify Private Types banners
unify Private Types banners according to NuttX coding standard

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-28 10:16:50 +08:00
raiden00pl
94d02aaaf2 examples: unify Private Types banners
unify Private Types banners according to NuttX coding standard

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-28 10:16:50 +08:00
dependabot[bot]
291373732f build(deps): bump codelytv/pr-size-labeler from 1.10.2 to 1.10.3
Bumps [codelytv/pr-size-labeler](https://github.com/codelytv/pr-size-labeler) from 1.10.2 to 1.10.3.
- [Release notes](https://github.com/codelytv/pr-size-labeler/releases)
- [Commits](https://github.com/codelytv/pr-size-labeler/compare/v1.10.2...v1.10.3)

---
updated-dependencies:
- dependency-name: codelytv/pr-size-labeler
  dependency-version: 1.10.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 14:11:00 +08:00
Richard Tucker
18b72e89a4 apps/testing: fix typo 2025-05-26 18:56:32 +02:00
ouyangxiangzhen
a570953257 ostest/wdog: update wdog_test.
This commit updated the wdog_test to adapt to the semantic changes of
the wd_start.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-05-22 13:27:16 +08:00
ouyangxiangzhen
afade4f5c9 testing/ostest: add periodic wdog testing.
This commit added periodic wdog testing.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-05-22 13:27:16 +08:00
George Poulios
49f6a219f9 examples/optee_gp: Fix Kconfig if/else condition
Previous Kconfig had a mistake guarding optee_gp
Kconfig values based on EXAMPLES_OPTEE instead of
EXAMPLES_OPTEE_GP. Fix that

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-21 00:35:27 +08:00
raiden00pl
a8740c2602 logging/nxscope: fix various warnings reported by CodeChekcer
fix various warnings reported by CodeChekcer for nxscope

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-17 12:02:32 +08:00
raiden00pl
877e4919cb wireless/bluetooth/nimble/Kconfig: add missing header
wireless/bluetooth/nimble/Kconfig: add missing header

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-17 12:02:02 +08:00
raiden00pl
71df58e937 logging/nxscope: allow use in C++ code
allow nxscope to use in C++ code

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-17 12:01:42 +08:00
dongjiuzhu1
fb6b3ddfd9 nsh/script: remove double close for output fd
the output fd had been closed in nsh_closeifnotclosed, so
remove double close.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-05-14 15:03:35 +08:00
George Poulios
7b383d0562 examples/optee_gp: Add a OP-TEE GP API client example
Add an example app that opens a session with the devices pseudo-TA
and enumerates the available devices (prints their UUIDs only)
using the GlobalPlatform API and libteec.

The example showcases:
  - initializing the context
  - opening a session
  - invoking a command using NULL references
  - invoking a command using temp shared memory
  - invoking a command using registered shared memory
  - closing the session
  - finalizing the context

Enabled with CONFIG_EXAMPLES_OPTEE_GP.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-13 21:17:51 +08:00
George Poulios
67db0af4eb tee/libteec: Add optee_client/libteec library
Support for downloading, patching and linking against
optee_client/libteec by NuttX apps. Defaults to version
4.6.0.

Enabled with CONFIG_LIBTEEC.

More info:
 - https://github.com/OP-TEE/optee_client
 - https://optee.readthedocs.io/en/latest/architecture/globalplatform_api.html#tee-client-api
 - https://globalplatform.org/specs-library/?filter-committee=tee (GPD_SPE_007)

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-13 21:17:51 +08:00
George Poulios
677089b912 examples/optee: Correct use of shm reg id and flags
Previous version of optee example was using id during
shm registration as input whereas it is an output
variable. It was also specifying flags to dictate the
behaviour whereas the latest implementation of the
driver prohibits their use. This commit addresses
those issues.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-13 21:17:51 +08:00
wangjianyu3
0fbeae7f0d uORB/sensor: Add timestamp for GNSS data
Add timestamp for GNSS measurements and clock, for matching.

When recovering the combination of `GnssMeasurement` and `GnssClock` into
[GnssData](https://android.googlesource.com/platform/hardware/libhardware/+/
           refs/heads/android14-release/include/hardware/gps.h#1748),
the reason for splitting is that the uORB buffer is not large enough to
accommodate `GnssData`, since different topics cannot guarantee the
same timing when publishing and subscribing data, we need an index to match.

WARNING: A new member "timestamp" of type uint64_t has been added at
the beginning of the struct "sensor_gnss_measurement" and "sensor_gnss_clock".

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-05-12 16:22:10 +08:00
Tiago Medicci
d63bb6d81d interpreters/python: Do not link to standard libraries
This commit prevents Python from linking to standard libraries.
This is needed because Python's `configure` script tests for a set
of available functions that are provided by NuttX (instead of the
toolchain) and not having `-nostdlib` set may give wrong results.
2025-05-11 11:31:57 +08:00
Jukka Laitinen
376cc5a731 testing/ostest: Add checking of signal delivery TID to signest test
- Add another signal action, "interfere_action", and signal the interfere thread
- In both signal action functions (waiter and interfere), check that they get executed
  in correct thread's context

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-08 23:21:13 +08:00
vrmay23
77b2e8dfee examples/posix_stdio: New example dedicated to posix stdio library.
This example will help newcomers to port software from Linux to NuttX
in a POSIX compliant fashion using stdio library. It shows how to work with
open(), close() and write() functions over /dev/console.

Signed-off-by: Vinicius May <vmay.sweden@gmail.com>
2025-05-07 20:07:35 +08:00
George Poulios
30ef8ff845 examples/optee: Introduce an OP-TEE client example
Add an example app that opens a session with the devices pseudo-TA
and enumerates the available devices (prints their UUIDs only).

The example showcases:
 - opening the OP-TEE client driver
 - printing its version
 - opening a session
 - allocating shared memory
 - registering shared memory
 - invoking a function to the TA referencing the shared memory
 - closing the session

Enabled with CONFIG_EXAMPLES_OPTEE.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-05 23:58:57 +08:00
Jukka Laitinen
a011cad584 testing/ostest/signest: Replace kill with pthread_kill to fix running in SMP
"kill" sends the signal to all the the threads in the group. The intention of
the test is to send signals only to the "waiter" thread.

Running signal actions in parallel is not compatible behaviour with
the signest test, which assumes that signals are being run one after another.
For example running signals 38 and 40 in parallel on two threads/two cpus
would cause the test incorrectly fail on "even signals nested".

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-05-03 11:09:07 +08:00
wangjianyu3
f14249d1d3 system/uORB: Add API for sending loop exit event
Add orb_loop_exit_async() API to send exit event to uORB loop.

Closing immediately after a write may cause missing a wakeup.

When all file descriptors associated with the same eventfd object have been closed, the resources for object are freed by the kernel. --EVENTFD(2)

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-26 15:48:15 +02:00
wangjianyu3
3b0181dbd0 system/uORB: Fix orb_loop_s undeclared error
/workspace/apps/system/uorb/uORB/internal.h:42:31: error: 'struct orb_loop_s' declared inside parameter list will not be visible outside of this definition or declaration

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-26 15:48:15 +02:00
dongjiuzhu1
d670805758 system/uorb: add eventfd to notify loop exit.
Add support for exiting loop by writing eventfd.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-26 15:48:15 +02:00
dongjiuzhu1
84d4fe0bfd system/uorb: using UORB_LOOP_MAX_EVENTS to config loop function
Disable loop events by default (not compile loop.c and epoll.c).

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-26 15:48:15 +02:00
Carlos Sanchez
f94bccf119 canutils/slcan: explicitly manage the interface.
A recent change (https://github.com/apache/nuttx/pull/16199) has made the bitrate setting no
longer bring the interface up. Moreover, it is now no longer possible to change bitrate
of a CAN interface if it is up. Therefore, slcan needs to bring the interface down
to change it. Fortunately, it already had commands to open and close the interface
which map nicely to this.

Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2025-04-23 22:30:47 +08:00
Carlos Sanchez
4fb47a6a6d canutils/slcan: Work with CAN interfaces with names longer than 4 characters.
Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2025-04-23 22:30:47 +08:00
dongjiuzhu1
5585c9d347 nshlib/dd: remove nsh dd cmd
using system/dd to instead nsh dd cmd
remove related to config, file.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:18 +08:00
dongjiuzhu1
6db2c14faa system/dd: align nsh dd command
nshlib/dd: Increase the integer width for sector size in dd.

    On some systems, using sector sizes larger than 65536 is needed for
    profiling performance or testing.

    Stuart Ianna <stuart.ianna@motec.com.au>

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:18 +08:00
dongjiuzhu1
be6a45cb14 system/dd: check infile/outfile when closing
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:18 +08:00
dongjiuzhu1
721d79fb73 system/dd: align nshlib/cmd_dd
cmd_dd:support dd can do verify

    After writing the file, compare the contents of the two files again

    Signed-off-by: anjiahao <anjiahao@xiaomi.com>

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:18 +08:00
dongjiuzhu1
b608dd0e3f system/dd: align nshlib/cmd_dd
nshlib/cmd_dd: Retry if read() was interrupted

    Without this patch

      nsh> ls /etc/group | dd | dd
      sh [13:100]
      sh [14:100]
      nsh: dd: read failed: 4
      nsh>

    Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:18 +08:00
dongjiuzhu1
2a52c4c7f5 system/dd: support conv=nocreat
align nshlib/nsh_cmddd

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-04-20 00:41:18 +08:00
Laczen JMS
61194fe6c0 examples/elf: add possibility to create romfs image
Add the possibility to create a romfs image for an "external" file
system. The romfs.img can directly be written to a configurable
mtdblock device.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-04-19 11:30:29 +08:00
Carlos Sanchez
8d89d73bb8 canutils: use bps units for bitrate in SocketCAN interfaces.
This matches PR https://github.com/apache/nuttx/pull/16225 in Nuttx where
units for SocketCAN bitrate ioctls were changed.
2025-04-17 15:39:43 +08:00
Jukka Laitinen
ecbd1e964a examples/camera: Initialize g_nximage semaphore with SEM_INITIALIZER
Use SEM_INITIALIZER macro instead of direct { 0 }

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-04-16 15:18:06 +03:00
YAMAMOTO Takashi
57365ac05d toywasm: regen for v67.0.0
```shell
REF=2e4474d1af3bf9bc5a4b571be7ee69694f4a8aef ./regen.sh
```

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-04-13 11:31:36 +08:00
YAMAMOTO Takashi
1094573025 toywasm: bump to v67.0.0
see below for the included changes.
the "fix GCC warnings for the target with long uint32_t" change
is for https://github.com/apache/nuttx/pull/16022.

```shell
2e4474d1af3bf9bc5a4b571be7ee69694f4a8aef wapm.toml: bump the version
95fdefcd3ea85ce18d0fd9c41536e609f6b0d7b2 suppress ubsan complaints on function type mismatches
9e131d0b86f29f453b51390e7a57db2f12efa8af fix a type in a comment
6832384862dab5f44b5328dbfe2a09cdba35713b platform.h: add WRONG_FUNC_TYPE macro to suppress -fsanitize=function
50062832c0481f4dcc67458fcfd2e1184e423d8b fix GCC warnings for the target with long uint32_t
04861b1084cd4925d99bfc758d5ae00359360c5d explain a cryptic dyld error
569aaa9b0ab6309311f331cdf3376e8d4445b1c0 libwasi_littlefs: emulate preadv/pwritev
b3f665319efe68215d9c9f51f489ba61b03c27fb ci: bump littlefs version
fe5cd58608c0eab0e3383626988240da1971a6ba fix debug info with IPO on macOS
7ef1b8abc4e4d1558986336732f21cf54f6abc58 libwasi_littlefs: fix crashes with non-debug builds
abb5efe1141721225945087d414d348f4afd4976 libwasi_littlefs: fix a few races
125d8973b485583d3ac4a8c4a60f97334135ee53 lfs_error_to_errno: translate unknown values to EIO
f1eda35d45229d02c7e23c872d2e0faeb9b2c731 Fix compilation errors with the latest macOS 15.2 SDK
3a01d8c5a063c18c8ebc58c45a61c7dd12cd4b75 libwasi_littlefs/README.md: remove a stale section
b7f015fd933fd330ed6e4e6f9af0dfc7b280e70d CI: update actions/upload-artifact download-artifact to v4
3a90622e105a2064878d4d63fc5e4566c6d1906b comment
6cdb84116abb930e903221231dd657ec08fec9e2 cmake: add custom-page-sizes tests
a2958960f59b6b0ccf7733fc3db301236991ff0b add run-wasm3-spec-test-custom-page-sizes.sh
f1029a818e638e0a5995a7fef43988592e709740 fetch-spec-test.sh: bump wasm-spec-test
7aa3d9050abcac11f7f8abef12ced6334acf0670 prepare-spec-test.sh: use my fork of custom-page-sizes for now
c987677a10557a0f938e3c10cfd05e5d741cf51e fetch-spec-test.sh: bump wasm-spec-test
c9372193a766c145a76a7ceaf79c820ce4576ce8 test/prepare-spec-test.sh: add custom-pages-sizes tests
9a74326a8d9503151ca3868ea6ed855293cb77b1 doc
cc700465b4275cc27007950f00ecf5079f68a778 comment
1700c523acf9fa3ba20772731eb04096852902a2 add a comment
```

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-04-13 11:31:36 +08:00
chao an
27846ffec7 libc/elf: rename modlib to libelf
Renaming "modlib" to "libelf" is more in line with the implementation content,
which makes it easier for individual developers to understand the capabilities of this module.

CONFIG_LIBC_MODLIB -> CONFIG_LIBC_ELF

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-11 09:43:07 +08:00
chao an
69cb2e89e9 libs/libc/crc16: Separate implementation of crc16xmodem from crc16
keep default crc16 catalogue for CRC-16/XMODEM

Mapping crc16 implement to crc16xmodem

crc16     -> crc16xmodem
crc16part -> crc16xmodempart

- CRC-16/ACORN, CRC-16/LTE, CRC-16/V-41-MSB, XMODEM, ZMODEM
poly: 0x1021 initial seed: 0x0000, xor output: 0x0000

: width=16
: poly=0x1021
: init=0x0000
: refin=false
: refout=false
: xorout=0x0000
: check=0x31c3
: residue=0x0000
: name="CRC-16/XMODEM"

https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-xmodem

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-10 22:38:48 +08:00
raiden00pl
ac12971ac9 nxscope/nxscope_pser.c: use xmodem crc16 directly
use crc16xmodem directly to avoid using confusing crc16()

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-10 19:34:27 +08:00
YAMAMOTO Takashi
70f28553c6 examples/gps: fix a few printf formats
references:
https://github.com/apache/nuttx/pull/16022
4abb6f8da5/minmea.h (L241C15-L241C28)
4abb6f8da5/minmea.h (L43)

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-04-10 16:47:21 +08:00
anjiahao
21a6a13698 kernel build:avoid multiple definition ld script
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-04-09 14:01:40 +08:00
YAMAMOTO Takashi
61551aa849 system/dd: Implement conv=notrunc
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/dd.html
> notrunc
>   Do not truncate the output file. Preserve blocks in the output
>   file not explicitly written by this invocation of the dd utility.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-04-03 18:45:22 +08:00
raiden00pl
5d4b720596 foc/foc_feedforward.c: vdq_comp->q should use idq->d
fix typo in calculations for vdq_comp->q. It should use idq->d not idq->q.

Reported in https://github.com/apache/nuttx-apps/issues/3047

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-03 18:34:55 +08:00
Tiago Medicci
cf1d5bb08b benchmarks/mtd: use PRIxxx macro to improve portability
To improve portability, use `PRIxxx` macro instead of int/long int
format specifiers.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2025-04-01 09:08:59 +02:00
Tiago Medicci
b80e444aea benchmarks/mtd: Select libc's floating point support
The application requires libc's floating point support. Although
it may be already enabled by other applications and/or hardware
support, it should be explicitly selected by the app too.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2025-04-01 09:08:59 +02:00
Filipe Cavalcanti
19352ab3c0 gps: modify printf to use format specifier macros
Replace '%d' with 'PRId32' in some printf calls.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-03-30 14:29:21 +08:00
raiden00pl
fa8daf4071 examples/nimble_bleprph: fix various coding standard issues
fix various coding standard issues examples/nimble_bleprph

also fix compilation for make

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 14:28:47 +08:00
raiden00pl
a4af41f893 examples/nimble_blecent: fix various coding standard issues
fix various coding standard issues for examples/nimble_blecent

also fix compilation for make

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 14:28:47 +08:00
raiden00pl
3764ab041a cmake: remove empty strings from FetchContent
remove empty strings from FetchContent to eliminate cmake build warnings like this:

CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1564 (cmake_parse_arguments):
  The BUILD_COMMAND keyword was followed by an empty string or no value at
  all.  Policy CMP0174 is not set, so cmake_parse_arguments() will unset the
  ARG_BUILD_COMMAND variable rather than setting it to an empty string.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 14:20:21 +08:00
raiden00pl
4bca48431a examples/adc: fix printf warning
examples/adc: fix printf warning

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 11:36:48 +08:00
simbit18
1193a82fca system/uorb/listener.c: fix typo
fix typo "Mointor" -> "Monitor"

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-03-29 10:31:47 +08:00
zhangshoukui
369729eea4 testing/drivers/drivertest: Uniform test case name
1.Some test functions are named too simply
2.Many driver tests depend on specific configurations and hardware, and the unified specification name facilitates cmocka to skip tests by using the skip parameter for wildcard matching

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-03-27 09:00:15 +01:00
Michal Lenc
0640d3f550 nshlib/nsh_fsutils.c: fix getpid_callback function read size
Commit 5330966 replaced local static buffer with malloc allocated
lib_get_pathbuffer. This however prevents the usage of sizeof(buffer)
in the follow up read function, therefore the read size has to be
specified as PATH_MAX - 1.

This fixes the functionality of pidof function call (and subsequently
pkill call that uses pidof).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-03-27 09:25:21 +08:00
Max Kriegleder
940ee9385c examples: add blecent and bleprph similar to mynewt-nimble apps
These example apps create a BLE central and peripheral based on
mynewt-nimBLE and work in companion. The apps are mostly based
on their equivalents, which can be found at
https://github.com/apache/mynewt-nimble/tree/master/apps

Signed-off-by: Max Kriegleder <max.kriegleder@gmail.com>
2025-03-27 02:30:00 +08:00
zhangshoukui
7b65b2bb41 drivertest_uart: Pass in the specified parameters to test
https://github.com/apache/nuttx/blob/master/tools/ci/testrun/script/test_framework/test_cmocka.py
cmocka --skip test_case_posix_timer|test_case_oneshot|write_default|read_default|burst_test|gpiotest01

In the CI of the community, this test is skipped because this test will block the terminal, and I think that the test added to cmocka should not be designed this way

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-03-26 15:23:40 +08:00
chao an
83eba58232 nxlooper: fix typo in nxlooper
replace CONFIG_O_MULTI_SESSION to CONFIG_AUDIO_MULTI_SESSION

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-03-26 02:41:36 +08:00
chao an
6d0a039cc9 system/nxplayer/nxrecorder: move apb buffer instance to stack
move apb buffer instance to stack to avoid alloc buffer from heap

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-03-26 02:41:17 +08:00
raiden00pl
e280e9bdb4 modbus: add an option to disable log
Introduce new configuration option that allow disable all logging functionality for FreeModBus.
This option is useful for small systems when we don't use any logging features.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-25 18:02:36 +01:00
Tiago Medicci
494554618e benchmark/mtd: Add MTD testing/benchmark application
This test allows measuring write and read operations on an MTD
flash device, evaluating its transfer rates.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2025-03-25 09:53:38 +08:00
Alan Carvalho de Assis
cdc5968c67 testing: Add Serial Error Reporting testing app
This commit adds support to Serial Error Reporting using the ioctl
TIOCGICOUNT.

This examples was inspired on this sample code:
https://stackoverflow.com/questions/78796301/c-serial-communication-why-does-read-lose-some-data-bytes-at-high-baud-rates/78800245#78800245

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-03-24 21:52:26 +08:00
zhanghongyu
fc142045a4 mbedtls: add MBEDTLS_SSL_COOKIE_C to Kconfig for manual configuration
current defconfig and mbedtls_config.h can not enable the definition
of MBEDTLS_SSL_COOKIE_C.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-03-24 21:49:36 +08:00
Huang Qi
16a16a9543 ostest: Implement mutex move test functionality
Add a new test for moving mutexes to verify behavior when a mutex is relocated.
* Introduced mutex_thread_args_t structure for thread arguments
* Created moved_mutex_thread_func to handle mutex operations in threads
* Updated mutex_test to include mutex_move_test for comprehensive testing

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-03-24 20:34:54 +08:00
Huang Qi
a8c62307ec examples/rust/slint: Update nuttx crate branch from master to main and fix pixel format check.
Changed the NUTTX dependency branch to 'main' for consistency with repository updates.
Updated pixel format check to use FB_FMT_RGB16_565 for better clarity and accuracy.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-03-24 20:34:29 +08:00
Huang Qi
99d2de6540 tools: Export NUTTX_INCLUDE_DIR for Rust builds
Set NUTTX_INCLUDE_DIR in the Rust build commands to include the necessary directories for proper compilation.
* Ensured correct include paths for Rust projects
* Improved build reliability for Rust components

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-03-24 20:34:29 +08:00
Roy Feng
cc3392452a nshlib: typo fixed in Kconfig
`NSH_DISABLE_NFSMOUNT` should be `NSH_DISABLE_NFSMOUNT`

Signed-off-by: Roy Feng <roy.feng@sony.com>
2025-03-24 20:33:26 +08:00
raiden00pl
e336ebad5e cmake: fix cmake build for FreeModBus
fix cmake build for FreeModBus:

  1. nuttx-apps/modbus/mb.c:50:12: fatal error: mbrtu.h: No such file or directory
     50 | #  include "mbrtu.h"

  2. nuttx-apps/modbus/functions/mbutils.c:41:10: fatal error: port.h: No such file or directory
     41 | #include "port.h"

  3. various "undefined reference to" errors

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-24 02:04:36 +01:00
raiden00pl
9e2775de98 fix build for canutilis/lely-canopen
This commit fixes lely-canopen build for make and cmake.
It also update lely commit tag to the latest lely master.

The required changes are now split into several patches
to make it easier to fix any issues in the future.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-22 08:53:26 +08:00
Tomasz 'CeDeROM' CEDRO
bbcba55bbc examples/xmlrpc: Fix calls buffers size.
* examples/xmlrpc/calls.c used 80 bytes call buffers.
* update buffers to CONFIG_XMLRPC_STRINGSIZE+1 that is build time configurable.
* this keeps buffers size coherent with configuration.
* updated internal variable names to pass lint checks.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-03-21 14:21:31 +08:00
Lup Yuen Lee
1e4a952eea examples/fbcon: Fix endchoice and help in Kconfig
This PR fixes the `endchoice` and `help` in the Kconfig for fbcon
- https://github.com/apache/nuttx-apps/pull/3029#discussion_r2006527306

This patch will fix these build errors:
```text
apps/examples/fbcon/Kconfig:62: syntax error
apps/examples/fbcon/Kconfig:172: unknown option "---help--"
```
https://github.com/lupyuen/nuttx-riscv64/actions/runs/13981663903/job/39147989438#step:5:158

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2025-03-21 09:49:06 +08:00
simbit18
95c99d933a build.yml: Brought into sync with NuttX repository
added
    CI: Kill CI Test after 2 hours
    see https://github.com/apache/nuttx/pull/14849

    job msvc Windows native
    see
    https://github.com/apache/nuttx/pull/13894
    https://github.com/apache/nuttx/pull/15989

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-03-21 07:15:31 +08:00
Tim Hardisty
3e37dd2517 Add Framebuffer Console Example App 2025-03-20 10:19:49 -03:00
Eren Terzioglu
60e4052f81 games/snake: Add snake game
Add snake game support to have more demo games to show

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-18 17:16:39 -03:00
Michal Lenc
0639a2ad7b boot/nxboot: enhance bootloader capabilities and decision logic
This commit enhances the bootloader capabilities. The image's header
is extended with header version, size, platform identifier and
pointer to optional next header. CRC32 now includes part of
the header in its calculation as well.

The change also avoids having two different magics for image uploaded
over programmer and update image. Both these images have the same
magic and this magic is changed internally by the bootloader's logic.
The change is needed because image with standard magic is automatically
considered as a confirmed image (uploaded with programmer).

The current implementation avoids tails at all, therefore the user
application uploading the image does not have to erase the tail before
new upload. The image is considered as confirmed if it has standard
magic or its recovery is present. This means the bootloader has to
erase the header of the update image after the update is done (to
avoid update loop and to mark the image as unstable). This page is
written back during the confirmation.

This is a breaking change, but necessary for the future development
of the bootloader. The added header version field will allow to
add minor/major updates while keeping the backwards compatibility.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Pavel Pisa <pisa@fel.cvut.cz>
Co-authored-by: Karel Koci <cynerd@email.cz>
2025-03-14 10:35:49 -03:00
SPRESENSE
3b03636e95 examples/bmi160: Fix typo of depends on
Fix SENSORS_BMG160 to SENSORS_BMI160.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-03-07 11:21:34 +01:00
chenrun1
9c829f6650 examples: Add depends to different test cases
Summary:
  1.ftpd
  2.unionfs
  3.userfs
  4.nxffs
  5.smart

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-03-06 09:34:24 +01:00
chenrun1
a7020e45cc benchmarks/osperf: fix warning maybe-uninitialized
Summary:
In function 'performance_gettime',
    inlined from 'hpwork_performance' at osperf.c:245:10:
osperf.c:123:3: error: 'result.end' may be used uninitialized [-Werror=maybe-uninitialized]
  123 |   up_perf_convert(result->end - result->start, &ts);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
osperf.c: In function 'hpwork_performance':
osperf.c:228:29: note: 'result.end' was declared here
  228 |   struct performance_time_s result;
      |                             ^~~~~~
CC:  audio/lib_buffer.c
CC:  common/arm64_initialize.c
CC:  builtin/lib_builtin_getname.c

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-03-05 20:00:52 +01:00
chenrun1
a0f05d0c62 ostest:Fix the issue that nxevent pthread was not executed, causing case failed
Summary:
  In the case of slow overall system response (such as when MM_KASAN is turned on), the nxevent case work thread will not be executed and will be switched back to the main thread, so that the event does not get the expected result and the case fails.
By adjusting the thread priority, the work thread can be scheduled to avoid the expected result failure

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-03-05 10:08:17 +01:00
chenrun1
2e61c6bff8 examples/romfs:add EXAMPLES_ROMFS_RAMDEVNO
Summary:
  add EXAMPLES_ROMFS_RAMDEVNO for custom initliaze ramdisk number

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-03-05 10:02:22 +01:00
Stepan Pressl
91aa0b8ae8 benchmarks/cyclictest/cyclictest.c: periodic output and -q option
Without the -q (--quiet) option, the program outputs the thread
stats every 100ms, which is compatible with the original
rt-tests/cyclictest utility.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-03-04 06:16:57 +08:00
tengshuangshuang
844b9c657d apps/testing:fix uclibc atomic make.defs error
In the previous changes to the apps/testing folder, I added an extra slash in the make.defs of uclibcxx, atomic.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-03-03 16:03:13 +01:00
YAMAMOTO Takashi
036fe7668d toywasm: regen for v66.0.0
```
REF=b0e100a4ebd666f02b2bb9222d402a9f399a740b ./regen.sh
```

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-02-28 10:24:51 +01:00
YAMAMOTO Takashi
322c81bd8a toywasm: bump to v66.0.0
the included changes are:

```shell
spacetanuki% git log --pretty=oneline v65.0.0..v66.0.0
b0e100a4ebd666f02b2bb9222d402a9f399a740b (tag: v66.0.0) wapm.toml: bump the version
7604b9b896d7f48c46e484f560bbc679a87b0241 LICENSE: new year
c674c030025aab4cac94962328ae69590c5f1367 test/spectest.wat: update to match the spec harness
a5cf6bda2b2e022775d4d2d54aa11afc2e1295c2 test/fetch-spec-test.sh: update wasm-spec-test
c97f2d8e9e19d586d46b5db48a0582f374796d12 test/prepare-spec-test.sh: bump https://github.com/WebAssembly/multi-memory
b5f75600df812c421855ab7008b13113658af1c4 test/prepare-spec-test.sh: bump https://github.com/WebAssembly/spec version
1bfdc750dc18d085ac739a629b8b12b7ed9d9f6b escape.c: fix an integer overflow issue, especially on 32-bit archs
e15be49961d32e1878bfea399fd9cd609ff94045 escape.c: fix a comment
spacetanuki%
```

for nuttx-apps, only the escape.c fix is important.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-02-28 10:24:51 +01:00
Stepan Pressl
31daca45ba benchmarks/cyclictest: the rt-tests cyclictest NuttX Port
Despite the existence of the patch in benchmarks/rt-tests,
this commit adds the NuttX Official cyclictest utility.

The main difference is the introduction of different
waiting methods next to POSIX clock_nanosleep:
- The thread can wait for a g_waitsem, posted by board_timerhook()
  if CONFIG_SYSTEMTICK_HOOK is defined.
  Since the semaphore is only one, only one thread can wait.
- The thread can wait for a Timer Device to timeout.
  The timer's timeout determines the waiting time of the thread.
  Since the timer is only one, again, only one thread can wait.

The user can measure the elapsed time using clock_gettime
or the timer device itself. The different waiting and measuring
methods were introduced because NuttX, by default, does not
offer fine measuring capabilities using POSIX time functions
(as of Feb 25).

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-02-27 11:30:37 -03:00
Eren Terzioglu
8fcff3e88c games/brickmatch: Add led matrix output option
Add led matrix output option for brickmatch game example

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-26 11:31:02 -03:00
Eren Terzioglu
9c7e298097 games/brickmatch: Add GPIO input option
Add gpio input option for brickmatch example

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-26 11:31:02 -03:00
chenxiaoyi
0da270d9d6 system/debugpoint: fix bug the length option parsing error
The debugpoint program has an option "-l" which requires an argument,
which means the optstring to getopt() should be "l:".

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-02-25 13:07:58 -03:00
simbit18
b84f93c4df [nxstyle] fix Relative file path
fix Relative file path does not match actual file.

EOL Conversion  -> Unix (LF)

Adding the message header to the Kconfig file

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-02-25 09:31:30 +01:00
simbit18
a0dfd187d8 [Kconfig style] Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
Replace help => ---help---
Remove extra TABs

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-02-25 09:27:14 +01:00
wangjianyu3
536e2ccac6 system/fastboot: Add support for fastboot oem shell
To support executing custom commands.

Usage

  fastboot oem shell <command>

Tests

  # Configuration "esp32s3-devkit:fastboot" with `SYSTEM_FASTBOOTD_SHELL` enabled

  $ fastboot --version
  fastboot version 35.0.2-12147458

  $ fastboot oem shell ls /FILE_NOT_EXISTS
  FAILED (remote: 'error detected 0xff00 4')
  fastboot: error: Command failed

  $ fastboot oem shell ps
    PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK COMMAND
      0     0   0 FIFO     Kthread   - Ready              0000000000000000 0003056 Idle_Task
      1     0 224 RR       Kthread   - Waiting  Semaphore 0000000000000000 0001976 hpwork 0x3fc8bd50 0x3fc8bd80
      2     2 100 RR       Task      - Waiting  Semaphore 0000000000000000 0004048 nsh_main
      3     3 100 RR       Task      - Ready              0000000000000000 0001992 fastbootd
      4     4 100 RR       Task      - Running            0000000000000000 0001992 popen -c ps
  OKAY [  0.010s]
  Finished. Total time: 0.010s

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-02-25 08:23:37 +01:00
wangjianyu3
89c784188e system/fastboot: Add format string support for fastboot_fail()
Add support for producing output according to a format like printf().

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-02-25 08:23:37 +01:00
Felipe Moura
2eb18712d3 netutils/pppd/ppp.h: Fix build issue when network debug is enabled
This commit add include necessary when we enable network debug feature using ppp feature.

Signed-off-by: Felipe Moura de Oliveira <moura.fmo@gmail.com>
2025-02-24 10:19:31 +01:00
simbit18
d05ecafc4b interpreters/quickjs/CMakeLists.txt: Sync of build Cmake with build Make
Setting the right version 2024-02-14

To avoid future breakage, used the URL with last commit ID

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-02-22 13:48:26 +08:00
simbit18
a8b8a7320c system/irtest/Make.defs: fixed the wrong path
fix this error
make[3] *** /nuttxspace/nuttx/apps/testing/irtest: No such file or directory.  Stop.

error due to this change
apps/testing: Move irtest/sensortest/resmonitor/monkey to apps/system #2976

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-02-22 13:27:25 +08:00
simbit18
4315a1c8cc [nxstyle] fix Relative file path
fix Relative file path does not match actual file.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-02-21 16:29:13 -05:00
simbit18
71ff60753c interpreters/quickjs/Makefile: fix the build with Make
QUICKJS_URL_BASE in Cmakefile and Makefile was not the same.
Updated the correct url in Makefile.

fix https://github.com/apache/nuttx/issues/15712

To avoid future breakage, used the URL with last commit ID

Current version 2024-02-14 as found in the VERSION file https://github.com/bellard/quickjs/blob/master/VERSION

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-02-21 10:52:29 -03:00
Michał Łyszczek
751c4efe7f system/psmq: add proper include path for embedlog
embedlog.h were residing in include/system path, but has been
moved to include/logging. This causes psmq to not be able to
find <embedlog.h> include, which results in compilation error

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2025-02-20 08:39:13 +01:00
Michał Łyszczek
da9dade71f system/psmq: bump version to v0.2.2
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2025-02-20 08:39:13 +01:00
Michał Łyszczek
0fb063f329 logging/embedlog: bump version to v0.7.2
v0.7.2 fixes few minor bug fixes during compilation

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2025-02-20 08:38:27 +01:00
Tiago Medicci
ece14800e1 system/cpuload: Fix application's Make.defs location
The PR https://github.com/apache/nuttx-apps/pull/2974 first moved
it to `testing/sched/cpuload` and the Make.defs was adjusted
accordingly. However, during the review process, it was moved to
`system/cpuload` folder, but its Make.defs wasn't updated. This
commit fixes it.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2025-02-20 08:34:52 +01:00
wangjianyu3
5de75adfb4 system/fastboot: Add prefix "SYSTEM" for USB boardctl configuration
- FASTBOOTD_USB_BOARDCTL
  + SYSTEM_FASTBOOTD_USB_BOARDCTL

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-02-20 15:34:10 +08:00
Felipe Moura
62894b9baf examples/spislave_test: Add user data receive
Improve example, now it can receive commands / data from user;
Fixed indentation issues.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2025-02-17 23:06:58 +01:00
Tiago Medicci
db8542d2b1 interpreters/python: fix patch to set _PyRuntime attribute
This commit also adds the check for the `__NuttX__` macro to the
patch file that allows setting an attribute to the `_PyRuntime`
structure. The `__NuttX__` macro is guaranteed to be present when
building any application for NuttX.
2025-02-14 20:53:07 +08:00
chao an
7f424c3e8d nshlib/builtin: check background task before restore the signal
fix crash if:
CONFIG_SCHED_WAITPID=n
CONFIG_SCHED_CHILD_STATUS=y

The old signal will be restored only when sigaction is saved to avoid invaild access.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-12 10:30:05 -03:00
Matteo Golin
fb0c1e10de system/uorb: require that LIBC_FLOATINGPOINT be enabled for DEBUG_UORB
This change prevents users from trying to use the `uorb_listener`
application without having floating point printing enabled on systems
that do not have an FPU (systems with FPUs have `LIBC_FLOATINGPOINT`)
enabled by default. Solution dicussed and agreed in:
https://github.com/apache/nuttx/issues/15599.
2025-02-07 09:45:59 +01:00
Tiago Medicci
f139e56cd6 testing/libc/wcstombs: Add testing application for wcstombs
This application test the libc's `wcstombs` function for different
len sizes (bigger than the converted string, exactly the size of
it and smaller than it).
2025-02-06 23:41:31 +01:00
Luchian Mihai
5d7ff307c2 examples/amg88xx: fix kconfig
fix amg88xx kconfig EXAMPLES_AMG88XX_STACKSIZE option name

add depends on SENSORS_AMG88XX to hide the example is the driver is not enabled
2025-02-05 10:51:56 +08:00
Tiago Medicci
43439a6b16 interpreters/python: set ROMFS-generated data to const char
This allows the data to be placed in the .rodata section, which can
be allocated in the flash or other read-only storage, freeing the
internal memory.
2025-02-01 23:34:24 +01:00
Tiago Medicci
87f4eb8021 interpreters/python: add wrapper to initialize Python
This wrapper application checks if the Python's modules are already
mounted (and mounts them, if not), sets the necessary environment
variables and, then, runs the Python interpreter.
2025-02-01 23:34:24 +01:00
Tiago Medicci
4c6a6c7b16 interpreters/python: create Python's config files dynamically
The `Setup.local` and the `config.site` files are used by Python's
build system to, respectively, enable or disable Python's modules
and set/unset available functions in the target system. These files
are now set according to NuttX's configs, enabling or disabling
Python's features according to the configs set on NuttX.
2025-02-01 23:34:24 +01:00
Tiago Medicci
5a7661a928 interpreters/python: add patch to set _PyRuntime section
By setting a specific region for the `_PyRuntime` structure, it is
possible to move it to the external memory, for instance, freeing
the internal memory (this structure occupies around 140KiB).
2025-02-01 23:34:24 +01:00
Neo Xu
e1e28eb88a ostest: fix cmake build break
/nuttx/apps/testing/ostest/ostest_main.c:322:(.text.user_main+0x3c3): undefined reference to `sched_thread_local_test'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-01-30 17:15:49 +01:00
Hiroki Noda
b43fd50ff0 examples:hello_nim: fix comment syntax 2025-01-30 02:18:52 +08:00
Huang Qi
18838d23bf examples/rust: Add basic Slint example
Summary:
- Added a basic Slint example for NuttX, demonstrating how to integrate Slint UI framework with Rust on NuttX
- Includes a simple UI with a counter and touchscreen input handling
- Provides CMake, Kconfig, and Makefile configurations for building the example

Impact:
- Introduces a new example showcasing Slint UI framework usage on NuttX
- Enables developers to explore Rust-based UI development on embedded systems
- Demonstrates integration with NuttX framebuffer and touchscreen drivers

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-29 14:08:45 +08:00
Huang Qi
285607608e tools/Rust: Add support for x86 platform
Summary:
- Added support for x86 and x86_64 architectures in the Rust build system
- Updated `nuttx_rust_target_triple` function in `cmake/nuttx_add_rust.cmake` to handle x86 and x86_64 target triples
- Updated `RUST_TARGET_TRIPLE` macro in `tools/Rust.mk` to include x86 and x86_64 target triples

Impact:
- Enables Rust crate compilation for x86 and x86_64 platforms
- No functional changes for existing architectures (ARM, RISC-V, etc.)
- Improves platform compatibility and expands Rust support in NuttX

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-29 13:41:30 +08:00
Xiang Xiao
cf46792554 apps/testing: Move sd_bench to apps/bechmarks
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-27 04:53:57 +01:00
Xiang Xiao
85a6aaa322 apps/testing: Move irtest/sensortest/resmonitor/monkey to apps/system
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-27 02:25:08 +01:00
Xiang Xiao
4e9d907677 testing: Move rpmsgdev to drivers/rpmsgdev
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-26 09:53:02 -03:00
Xiang Xiao
d7be1bd672 testing: Move fs/fopencookie to libc
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-26 09:53:02 -03:00
Xiang Xiao
b7f05e89ba testing: Move crypto/setest to drivers and open_memstream to libc
follow the dissusion from:
https://github.com/apache/nuttx-apps/pull/2931

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-26 07:32:53 +01:00
tengshuangshuang
0406e6734a apps/testing:move atomic,cpuload,getprime,smp and timerjitter folders to the new sched folder
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-26 00:23:15 +08:00
yintao
d3a1f80308 coredump: add error print
So we know if coredump exits with error, or there's no coredump.

Signed-off-by: yintao <yintao@xiaomi.com>
2025-01-24 09:34:47 +08:00
xuxingliang
1d1a8ba92e system/coredump: move coredump info to note
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-01-24 09:34:47 +08:00
Yanfeng Liu
048b3e6f7b examples/module: add hostfs support
This allows loading the kernel module from a hostfs file system.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-23 18:43:02 +08:00
tengshuangshuang
077c3461db apps/testing:merge case folder to the new mm folder
1.rename original  mm folder to heaptest and move it to mm folder

2.move the following folders into the new mm folder:
  cachetest, heaptest, iob, kasantest, memstress, memtester, ramtest, stressapptest

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-23 18:19:06 +08:00
Matteo Golin
acc2b390c3 examples/gps: Allow GPS serial port to be specified as command line argument, mark MINMEA dependency in Kconfig. 2025-01-23 14:31:14 +08:00
xuxin19
add50b3bd5 cmake(bugfix):fix NuttX CMake Wasm build multi dirs cannot be identified
System is unknown to cmake, create:
Platform/WASI to use this system, please post your config file on discourse.cmake.org so it can be added to cmake
Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. Please post that file on discourse.cmake.org.
CMake Error at CMakeLists.txt:100 (add_subdirectory):
  add_subdirectory given source
  /home/data/vela/tmp/apps/frameworks/security/ta/hello_world
  /home/data/vela/tmp/apps/frameworks/security/ta/" which is not an
  existing directory.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2025-01-23 14:26:08 +08:00
xuxin19
0b0a220c52 cmake(bugfix):fix wasm bin link entry missing issue
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2025-01-23 14:26:08 +08:00
xuxin19
aa7c63bfe1 cmake(bugfix):fix WASM install bin do not define error
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2025-01-23 14:26:08 +08:00
xuxin19
fb367c9792 cmake(enhance):Enhanced full WASM library and application compilation
1.add complete compilation FLAGS for wasm toolchain
2.wasm build no longer traverses the native directory, saving build time
3.implement OPT and AOT process actions for wasm files
4.create a bridge interface for navtie build and wasm build

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2025-01-23 14:26:08 +08:00
chao an
2ad162d27d system/cu: fix nxstyle error
$ ../nuttx/tools/checkpatch.sh -g HEAD~1
apps/system/cu/cu_main.c:5:78: error: Long line found

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-23 09:57:22 +08:00
chao an
dfb3fc9acf system/cu: remove canonical input mode from termios flag
ASCII_DEL will unable to handle after below change:
https://github.com/apache/nuttx/pull/14037

| commit df5c876932c4c82e8aee32adca651bb99d9d6200
| Author: zhangwenjian <zhangwenjian@xiaomi.com>
| Date:   Thu May 23 13:13:48 2024 +0800
|
|     libc:getline support backspace
|
|     Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>

remove canonical input mode to support backspace in cu

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-23 09:57:22 +08:00
tengshuangshuang
57c8a62e1e apps/testing:move arch_libc, fmemopen, scanftest folders to the new lib folder
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-22 17:18:30 +08:00
tengshuangshuang
8141e35f99 apps/testing:move epoll, fatutf8 ... folders to the new fs folder
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-22 01:34:00 +08:00
tengshuangshuang
6bc2b3c933 apps/testing:move {drivertest fftest irtest monkey nand_sim pcitest sd_bench sd_stress sensortest} folders to the new driver folder
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-21 16:22:56 +08:00
Eren Terzioglu
dca032ab18 examples/i2schar: Make tx/rx count value generic on transmit/recieve operations 2025-01-21 10:15:42 +08:00
Xiang Xiao
5330966762 nshlib: Replace the big temp buffer with lib_get_[path|temp]buffer
to save the stack consumption

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-20 22:39:35 +08:00
Xiang Xiao
131d50ae9d nshlib: Remove the unnecessary temp path buffer
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-01-20 22:39:35 +08:00
tengshuangshuang
903fbe41e9 apps/testing: move cxxsize,cxxtest and uclibcxx_test folders to the new cxx folder
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-20 21:15:21 +08:00
Neo Xu
e59ab2b3af gdbstub: change send buffer to const char
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2025-01-20 20:07:22 +08:00
Huang Qi
efcfd87b44 tools/Rust: Add support for panic_immediate_abort
Summary:
- Added support for `panic_immediate_abort` in Rust builds, which causes the system to abort immediately on panic instead of unwinding the stack
- Enabled `-Zbuild-std-features=panic_immediate_abort` flag for release builds when `CONFIG_DEBUG_FULLOPT` is set
- Updated both CMake and Makefile build systems to include the new flag

Impact:
- Significantly reduces binary size (e.g., from 2270605 to 84987 bytes for riscv64imc)
- Changes panic behavior to immediate abort, which may be preferred for embedded systems
- Improves system reliability by preventing undefined behavior from stack unwinding in constrained environments
- Maintains compatibility with existing Rust code while providing a more deterministic panic handling mechanism

For example, if it is enabled, the system will panic immediately:
```
NuttShell (NSH) NuttX-12.8.0
nsh> hello_rust_cargo
{"name":"John","age":30}
{"name":"Jane","age":25}
Deserialized: Alice is 28 years old
Pretty JSON:
{
  "name": "Alice",
  "age": 28
}
riscv_exception: EXCEPTION: Illegal instruction. MCAUSE: 0000000000000002, EPC: 0000000080027df6, MTVAL: 0000000000000000
riscv_exception: PANIC!!! Exception = 0000000000000002
dump_assert_info: Current Version: NuttX  12.8.0 8e3621e059 Jan 20 2025 14:45:00 risc-v
dump_assert_info: Assertion failed panic: at file: :0 task: hello_rust_cargo process: hello_rust_cargo 0x80020588
/* Stack dump from NuttX */
```
vs the default behavior:
```
NuttShell (NSH) NuttX-12.8.0
nsh> hello_rust_cargo
{"name":"John","age":30}
{"name":"Jane","age":25}
Deserialized: Alice is 28 years old
Pretty JSON:
{
  "name": "Alice",
  "age": 28
}

thread '<unnamed>' panicked at /home/huang/Work/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/std/src/sys/random/unix_legacy.rs:19:10:
failed to generate random data: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
nsh>
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-20 19:48:25 +08:00
tengshuangshuang
bdb0fcd71b apps/testing: move himem_test,mtetest and x86-64-ABI folders to the new arhc folder
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-20 17:48:48 +08:00
Huang Qi
9b6de015bc rust/hello: Optimize the build flags
Summary:
- Added `codegen-units = 1` and `opt-level = 'z'` to the release profile in `Cargo.toml`
- These changes optimize the build for minimal binary size

Impact:
- Reduces the final binary size by ~7% (244316 -> 228380 bytes)
- Improves resource utilization for embedded systems
- No functional changes to the application behavior

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-19 17:16:38 +08:00
Huang Qi
6669372415 wamr: Map armv7a/thumbv7a to armv7/thumbv7 for wamrc
Summary:
- Added explicit mapping of thumbv7a architecture to thumbv7 in the WAMR toolchain definitions
- WAMR's AOT compiler uses armv7/thumbv7 as the target architecture for all ARMv7-A processors
- This includes Cortex-A series processors like Cortex-A9 which use the armv7a/thumbv7a ISA

Impact:
- Fixes AOT compilation for ARM Cortex-A processors using thumbv7a architecture
- Maintains compatibility with WAMR's expected target architecture naming
- Ensures consistent architecture targeting across all ARMv7-A processors
- No impact on other architectures or build configurations

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-17 23:31:49 +08:00
wangjianyu3
f6462111b7 apps/nshlib: Reuse local variable for cmd_memdump
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-17 23:27:43 +08:00
zhangshoukui
339eeaa087 Use lib_get_tempbuffer Saving stack
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-01-16 22:49:19 +08:00
zhangshoukui
4685ca557b lp503x_main: Minor fix
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-01-16 22:48:45 +08:00
wangjianyu3
3108c27877 apps/nshlib: Save result and return ERROR if lib_get_tempbuffer() fails
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-16 22:48:34 +08:00
zhangshoukui
f8e4afbad3 optimize GPIO test for sim test pass
cmocka_driver_gpio //gpio input/output is tested by default
cmocka_driver_gpio -a /dev/gpio0 -b /dev/gpio1 -l // test loop
cmocka_driver_gpio -a /dev/gpio0 -b /dev/gpio0 // gpio input/output is tested by default

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-01-16 22:44:14 +08:00
zhangshoukui
b4def306fa Remove Useless filtering.The string for filtering rules should not point to a stack space
==1805058==ERROR: AddressSanitizer: heap-use-after-free on address 0xe18126a0 at pc 0x52b06320 bp 0xd7b13ee8 sp 0xd7b13ed8
READ of size 1 at 0xe18126a0 thread T0
    #0 0x52b0631f in tre_parse regex/regcomp.c:1356
    #1 0x52b2b1d0 in regcomp regex/regcomp.c:3710
    #2 0x48f55435 in c_regexmatch cmocka/src/cmocka.c:494
    #3 0x48f65bcf in _cmocka_run_group_tests cmocka/src/cmocka.c:3252
    #4 0x48f67e2d in cmocka_fs_test_main apps/testing/testsuites/kernel/fs/cmocka_fs_test.c:201
    #5 0x46210b2a in nxtask_startup sched/task_startup.c:72
    #6 0x45ff40fb in nxtask_start task/task_start.c:116
    #7 0x462695bb in pre_start sim/sim_initialstate.c:52

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-01-16 22:44:14 +08:00
tengshuangshuang
4432d84dd3 test:driver_audio bug fix
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2025-01-16 22:44:14 +08:00
wangjianyu3
410ca7d88e apps/nshlib: Remove the deprecated config NSH_LINELEN
NSH_LINELEN is replaced by POSIX standard LINE_MAX.

https://github.com/apache/nuttx/pull/15541
https://github.com/apache/nuttx-apps/pull/2943

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-16 20:54:50 +08:00
Huang Qi
14fa7d2726 examples/rust: Rename hello_rust to rust/baremetal
Summary:
- Renamed hello_rust example to rust/baremetal to better reflect its purpose
- Updated file headers and Makefile paths
- Maintained all existing Kconfig options and functionality
- Prepares for future Rust development patterns where Cargo will be the
mainstream approach, with baremetal demonstrating traditional build method
- Creates clearer structure for Rust examples as we expand Rust support

Impact:
- No functional changes to the example itself
- Better organization of Rust examples under examples/rust/
- Existing configurations using this example will continue to work
- Build system will now look for the example in the new location

Testing:
- Confirmed Kconfig options remain unchanged
- GitHub CI passed and local build tested

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-15 01:53:56 +08:00
wangjianyu3
a3049aae56 apps/nshlib: Using lib_get_tempbuffer() to save stack space
Comparison

  Config: "esp32s3-devkit:adb" with `CONFIG_LINE_MAX=512`

  Test CMD: `ls | cat | cat | cat`

  Without this patch

    |                | Before Test CMD | After Test CMD  |
    |---------------:|----------------:|----------------:|
    | nsh_main.STACK | 0002624/0008096 | 0002624/0008096 |
    |       sh.STACK | 0003360/0004008 | 0003360/0004008 |
    |     Free/Total |   355288/403116 |   355288/403116 |

  With this patch

    |                | Before Test CMD | After Test CMD  |
    |---------------:|----------------:|----------------:|
    | nsh_main.STACK | 0001616/0008096 | 0001616/0008096 |
    |       sh.STACK | 0002352/0004008 | 0002352/0004008 |
    |     Free/Total |   355288/403116 |   354760/403116 |

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-14 19:31:54 +08:00
wangjianyu3
26173597a9 apps/nshlib: replace CONFIG_NSH_LINELEN to LINE_MAX
LINE_MAX: https://github.com/apache/nuttx/pull/15344

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-14 19:31:54 +08:00
chao an
66231194be apps/system: replace CONFIG_NSH_LINELEN to LINE_MAX
Applications should not depend on any properties of nshlib

Signed-off-by: chao an <anchao@lixiang.com>
2025-01-14 19:31:54 +08:00
Zhe Weng
2df2534898 testing/nettest: Add test for net bufpool
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-01-14 14:39:44 +08:00
zhangshuai39
a6b9e71846 testing/nettest: Add utils directory and two tcp testcases to the testing framework
Based on the original directory structure, an additional utils directory is added. It store public functions which used by multiple testcases, such as the tcp server-related functions added this time. In addition, two testcases for testing tcp connections have been added.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-01-12 01:24:12 +08:00
Huang Qi
46f77a632d examples/usbserial: Fix style issues in host.c
- Break long preprocessor conditionals across multiple lines
- Add spaces around operators for better readability
- Reformat long string literals to fit within line length limits
- Improve consistency in spacing around parentheses and brackets

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-11 12:23:29 +08:00
Huang Qi
f7e7453807 examples: New app to build Rust with Cargo
Build Rust applictions with cargo is the most commn way,
and it's more easy to cooporate with Rust ecosystem.

This example shows how to use cargo to build a simple hello world
application.

And please notice that you need to install nighly version of rustc
to support this feature, any version after https://github.com/rust-lang/rust/pull/127755
is merged, can use NuttX as cargo target directly.

Build
-----

To build hello_rust_cargo application, you can use any target that based
on RISCV32IMAC, for example:
```
cmake -B build -DBOARD_CONFIG=rv-virt:nsh -GNinja .
```

And disable ARCH_FPU in menuconfig, since the hard coded target triple
in this demo is `riscv32imac`.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-10 22:25:13 +08:00
Huang Qi
ffd256d32b Remove unused header files across multiple source files
Clean up code by removing redundant and unused header file includes that were identified through static analysis.
This improves code readability and reduces unnecessary dependencies.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-10 21:42:00 +08:00
wangmingrong1
a5a93c0a17 stressapptest: Add download step
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-10 21:14:04 +08:00
xuxin19
4e854cfe03 cmake:builtin register support NONE srcs target
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2025-01-09 22:41:01 +08:00
zhangshuai39
f2b0437688 apps/testing: Add a cmocka framework for network testing
Provides a network automated testing framework, including the main directory structure and Makefile, CMakeLists, Kconfig and other files such as tcp.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-01-09 22:40:36 +08:00
Lup Yuen Lee
121205fd13 CI: Increase CI Jobs to 100% for Complex PRs
This PR increases the CI Jobs for Complex PRs from 50% to 100%, as explained here:
- https://github.com/apache/nuttx/issues/15451#issuecomment-2576576664

This PR also includes the fix for Simple x86 PR:
- https://github.com/apache/nuttx/pull/14896
2025-01-08 13:08:05 +08:00
Eren Terzioglu
6c7bc3c788 apps/nxdiag: Update nxdiag app due to script place changes
Nxdiag app build scripts updated due to changes to make diagnostic
tools independent from nxdiag app. Change aims that nxdiag app does
not a reqirement to fetch system information.
2025-01-07 23:41:42 +08:00
YAMAMOTO Takashi
da615bf5a6 examples/pipe/interlock_test.c: fix the uses of uninitialized variables
found by clang warnings.
2025-01-07 23:41:22 +08:00
jialuxiao
b73adbe56b testing/monkey: add running-minutes parameter
Signed-off-by: jialuxiao <jialuxiao@xiaomi.com>
2025-01-07 15:29:52 +08:00
wangmingrong1
edf44c881b mtetest: add thread to control mte test separately
After thread A holds the semaphore, it first accesses it safely. After releasing it, thread B closes MTE for unsafe access. After accessing, it switches back to thread A for unsafe access. At this time, an error should be reported.
log:
Process 1 holding lock
Process 2 holding lock
Process 1 holding lock again
default_fatal_handler: (IFSC/DFSC) for Data/Instruction aborts: synchronous tag check fault
arm64_exception_handler: CurrentEL: MODE_EL1
arm64_exception_handler: ESR_ELn: 0x96000011
arm64_exception_handler: FAR_ELn: 0xf00000040441700
arm64_exception_handler: ELR_ELn: 0x402ee5f4
print_ec_cause: DABT (current EL)
print_ec_cause: Data Abort taken without a change in Exception level

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-07 14:25:44 +08:00
Tiago Medicci
a61fd58f8e interpreters/python: Enable Python's socket module
Enables the Python's socket module. This allows applications to be
built to interact with POSIX-compatible sockets, which is supported
by NuttX.
2025-01-07 05:51:02 +08:00
wangjianyu3
c29a75bbfb testing/rpmsgdev: Replace space with tab for Kconfig
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-06 18:22:06 +08:00
zhangshoukui
2cfbdbb401 driver test: add depends on
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-01-03 21:28:20 +08:00
zhangshoukui
d404b846f9 examples: Add depends on
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-01-03 21:28:20 +08:00
wangjianyu3
366865723b testing/rpmsgdev: Add option for rpmsgdev_export()
And fix errors for other platform

Test

  Server (NuttX)

    testdev -d 0 -r "/dev/testrpmsgdev"
    testdev -d 2 -c "CLIENT" -l "/dev/testrpmsgdev"

  Client (Other)

    testdev -l /dev/testrpmsgdev -t 1
    testdev -l /dev/testrpmsgdev -t 2
    testdev -l /dev/testrpmsgdev -t 3
    testdev -l /dev/testrpmsgdev -t 5
    testdev -l /dev/testrpmsgdev -t 6
    testdev -l /dev/testrpmsgdev -t 7
    testdev -l /dev/testrpmsgdev -t 8

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-02 23:25:19 +08:00
wangjianyu3
047f881673 testing/rpmsgdev: Add from tests/testcases
Add makefile and format codes

  ../nuttx/tools/checkpatch.sh -f testdev.c

Squashed commits

  commit 2914f842fb7b30f9819f951638a72af7ccd0857e
  Author: v-chenglong8 <v-chenglong8@xiaomi.com>
  Date:   Tue Aug 27 20:26:40 2024 +0800

      [new]: init coral sea execution client project

      Signed-off-by: cuiliang <cuiliang@xiaomi.com>

  commit e783ef9d33e980a8d67f0732287545ee1dc9654d
  Author: rongyichang <rongyichang@xiaomi.com>
  Date:   Fri Jun 21 11:48:11 2024 +0800

      tests/devrpmsg: fix use after free error

      Signed-off-by: rongyichang <rongyichang@xiaomi.com>

  commit d2221fa82a9a30c99bcfc6cff46276505f653a77
  Author: songshuangshuang <songshuangshuang@xiaomi.com>
  Date:   Tue May 14 15:27:02 2024 +0800

      [tests]: test case cmake transformation

      Signed-off-by: songshuangshuang <songshuangshuang@xiaomi.com>

  commit 4209ce4a10e34fe37a58df5e2c2e8d1299ef056c
  Author: liugui <liugui@xiaomi.com>
  Date:   Wed Aug 16 20:35:41 2023 +0800

      [fix]:resolving the problem of rpmsgdev ioctrl interface test crashing on the audio core

      Signed-off-by: liugui <liugui@xiaomi.com>

  commit a3ac3c9b9dc5210ebc61897cf79e411ae337d70f
  Author: litong12 <litong12@xiaomi.com>
  Date:   Fri Jul 28 15:06:00 2023 +0800

      [fix]: fix poll's bug in rpmsgdev test

      Signed-off-by: litong12 <litong12@xiaomi.com>

  commit c3085e74b2c356bc805d904259e97126ea55ff7d
  Author: litong12 <litong12@xiaomi.com>
  Date:   Wed Jan 18 11:47:25 2023 +0800

      [test]: file_operations add mmap and truncate in rpmsgdev test

      Signed-off-by: litong12 <litong12@xiaomi.com>

  commit 617623f7c3eb302e2921de17d21235ea4c4e2990
  Author: litong12 <litong12@xiaomi.com>
  Date:   Tue Nov 8 20:13:29 2022 +0800

      [test]: add rpmsgdev testcases

      Signed-off-by: litong12 <litong12@xiaomi.com>

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-02 23:25:19 +08:00
Alin Jerpelea
94b9c0b120 videoutils/x264: migrate license to ASF
Xiaomi has submitted the SGA and we can migrate the licenses to ASF

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
Alin Jerpelea
d921170a02 tools: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
Alin Jerpelea
068220d3a7 testing: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
Alin Jerpelea
d2ff6c8f28 system/tee: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
Alin Jerpelea
5369d238a8 tee: remove the advertising clause
3. All advertising materials mentioning features or use of this software must
display the following acknowledgement: This product includes software
developed by the University of California, Berkeley and its contributors.

permitted by Berkley amendment
https://ipira.berkeley.edu/sites/default/files/amendment_of_4-clause_bsd_software_license.pdf

following example from NETBSD and OPENBSD
eb7c1594f1
6580fee329

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
Alin Jerpelea
66e8296230 system: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
Alin Jerpelea
11cd9beb9b wireless: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
Alin Jerpelea
45c13e594a video: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
Alin Jerpelea
209ff8e402 sdr: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
Alin Jerpelea
4a28a0b693 platform: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
Alin Jerpelea
27d8ae36ba nshlib: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
Alin Jerpelea
c341185423 apps: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
Alin Jerpelea
a91768e715 examples: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-30 18:02:50 +08:00
zhangshoukui
d581ccc7e2 fix tab error and remove Useless depends on
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-12-30 18:02:12 +08:00
YAMAMOTO Takashi
7a36a70e06 toywasm: regen
```
REF=e972e94fa427c3371fb21ad4bb9f238a1cca7795 ./regen.sh
```
2024-12-29 20:40:22 +08:00
YAMAMOTO Takashi
9b6bb67f9e interpreters/toywasm/tmpl/license.in: Add SPDX identifier 2024-12-29 20:40:22 +08:00
YAMAMOTO Takashi
c2b6c75cdc toywasm/tmpl: Revert "interpreters: migrate to SPDX identifier"
Note that these files are templates used by regen.sh script.
2024-12-29 20:40:22 +08:00
YAMAMOTO Takashi
c7a694ecc8 toywasm: bump to v65.0.0 2024-12-29 20:40:22 +08:00
zhangshoukui
54d73e4666 TESTING_NAND_SIM: Add depends on
apps/testing/nand_sim/nand_sim_main.c:172:(.text.nand_main+0x93): undefined reference to `nand_ram_initialize'
collect2: error: ld returned 1 exit status

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-12-26 23:32:49 +08:00
chenrun1
ee3400e78a scanftest:need enable CONFIG_LIBC_SCANSET
Summary:
"",
        instead of
"   ",
        to the first argument.

Test #29 returned 0 instead of 1.
Test #29 assigned
"",
        instead of
"  q",
        to the first argument.

Test #30 returned 0 instead of 2.
Test #30 assigned
"",
        instead of
"  ",
        to the first argument.

Test #30 assigned
"",
        instead of
"Q",
        to the second argument.

Test #31 returned 0 instead of 2.
Test #31 assigned
"",
        instead of
"qwerty-",
        to the first argument.

Test #31 assigned
"",
        instead of
"QWERTY-",
        to the second argument.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-12-23 22:40:11 +08:00
chenrun1
42d6ae6d07 memorystress:fix build warning
Summary:
CC:  memorystress_main.c memorystress_main.c: In function ‘global_init’:
memorystress_main.c:39:26: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint32_t’ {aka ‘unsigned int’} [-Wformat=]
   39 | #define MEMSTRESS_PREFIX "MemoryStress:"
      |                          ^~~~~~~~~~~~~~~
memorystress_main.c:442:22: note: in expansion of macro ‘MEMSTRESS_PREFIX’
  442 |     syslog(LOG_INFO, MEMSTRESS_PREFIX "\n max_allocsize: %zu\n"
      |                      ^~~~~~~~~~~~~~~~
memorystress_main.c:443:41: note: format string is defined here
  443 |            " nodelen: %zu\n sleep_us: %lu\n nthreads: %zu\n debug: %s\n",
      |                                       ~~^
      |                                         |
      |                                         long unsigned int
      |                                       %u

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-12-23 22:40:00 +08:00
chenrun1
876130b8e7 memorystress:Optimization of multithreaded scenario
Summary:
  1. In a multi-threaded scenario, each thread has its own context
  2. Adjust code structure

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-12-23 22:40:00 +08:00
chenrun1
196be15587 Adjust the default priority of some test cases
Summary:
 Avoid blocking other tasks when there is a large amount of data, such
as rpmsg, etc.
 1. change ramtest PRI to 90
 2. change memtester PRI to 90

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-12-23 22:37:31 +08:00
Alin Jerpelea
83ea91531f netutils: migrate the license to ASF
Xiaomi has submitted the SGA and we can migate the license to ASF

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-21 13:53:10 +08:00
Alin Jerpelea
ac8002d7d3 Cmake: migrate the license to ASF
Xiaomi has submitted the SGA and we can migate the license to ASF

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-21 13:53:10 +08:00
Alin Jerpelea
a53ac351f6 modbus: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-21 13:53:10 +08:00
Alin Jerpelea
7220a3bf48 mlearning: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-21 13:53:10 +08:00
Alin Jerpelea
efefa6d87d math: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-21 13:53:10 +08:00
Alin Jerpelea
2a89ee6cb7 lte: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-21 13:53:10 +08:00
Alin Jerpelea
905e79a69d logging: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-21 13:53:10 +08:00
Alin Jerpelea
d3102f0dce interpreters: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-21 13:53:10 +08:00
Alin Jerpelea
be38e77de3 inertial: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-21 13:53:10 +08:00
Eren Terzioglu
82ee1ffbd6 system/nxdiag: Make espressif specific option appear when espressif devices selected 2024-12-21 13:52:59 +08:00
Eren Terzioglu
a0479c86fb tools: Add debug_info target to diagnostic system 2024-12-21 13:52:59 +08:00
wangjianyu3
d02b05328a uORB/sensor: Update macro of sensor_gnss format string
Make it easier to extend the format of struct member

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-20 15:29:06 +08:00
wangjianyu3
ba0a8fbcb2 uORB/sensor: Add carrier frequency for GNSS Satellite
The `struct sensor_gnss_satellite.cf` may be parsed from `GSV.signal_id`(e.g. NMEA 0183 v4.11) and `struct sensor_gnss_satellite.constellation`

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-20 15:29:06 +08:00
Alan Carvalho de Assis
9500938d44 testing/sensortest: Add support to Speed Sensors
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-12-20 08:52:42 +08:00
Alin Jerpelea
cc345c785d industry: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
064c6e16f7 include: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
c8ec20fe4d graphics: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
96d3cb60e5 import: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
f59c5da915 games: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
cdb6d76f0a fsutils: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
5b68158154 crypto: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
440d69a310 canutils: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
e41ef49995 builtin: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
087cac4471 database: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
7fe01f1c52 cmake: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
dc4bf4a5fb boot: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
69b6c936d1 benchmarks: migrate license to ASF
Xiaomi has submitted the SGA and we can migrate the licese to ASF

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
41e51e68a2 benchmarks: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
Alin Jerpelea
7e9cf0237d audioutils: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:25:28 +08:00
wangjianyu3
39bd365787 nshlib/nsh_parse: Removing unnecessary value assigning about redirection
Coverity Log

  CID 1612757: (#1 of 1): UNUSED_VALUE
  assigned_value: The value -1 is assigned to param.fd_in here, but the stored value is overwritten before it can be used.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-19 14:11:55 +08:00
wangjianyu3
f1212a6065 nshlib/nsh_parse: Closing fds opened for redirection if necessary
Coverity Log

  CID 1612743: (#1 of 1): Resource leak (RESOURCE_LEAK)
  12. leaked_handle: The handle variable fd_out goes out of scope and leaks the handle.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-19 14:11:55 +08:00
Xiang Xiao
adb4c3b555 testing/testsuites: Fix format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'size_t'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-12-19 04:22:09 +01:00
zhangshoukui
cebd77c614 fs cases: fix compile error
kernel/fs/cases/fs_stream_test.c:279:70: error: format ‘%zi’ expects argument of type ‘signed size_t’, but argument 4 has type ‘int’ [-Werror=format=]
  279 |           syslog(LOG_ERR, "len = %zi != return value from fwrite = %zi",
      |                                                                    ~~^
      |                                                                      |
      |                                                                      long int
      |                                                                    %i
  280 |                  len, ret);
      |                       ~~~
      |                       |
      |                       int
kernel/fs/cases/fs_stream_test.c:311:69: error: format ‘%zi’ expects argument of type ‘signed size_t’, but argument 4 has type ‘int’ [-Werror=format=]
  311 |           syslog(LOG_ERR, "len = %zi != return value from fread = %zi",
      |                                                                   ~~^
      |                                                                     |
      |                                                                     long int
      |                                                                   %i
  312 |                  len, ret);
      |                       ~~~
      |                       |
      |                       int

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-12-19 04:22:09 +01:00
chao an
d6f6f5ce11 mlearning/tflite-micro: fix build break if enable cmsis-nn and neon
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-19 02:00:48 +08:00
Tiago Medicci
231827e84e ostest: Add test for GCC's tls (CONFIG_SCHED_THREAD_LOCAL)
Enables testing the GCC thread local storage (tls) and the __thread
keyword within ostest.
2024-12-18 22:46:04 +08:00
wangmingrong1
c4fa568457 gcov: Add a signature end statement to test statement matching
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-18 22:45:39 +08:00
YAMAMOTO Takashi
3efbed1f27 system/libuv/Kconfig: depends on CONFIG_PIPES
libuv unconditionally uses pipe().

Fixes: https://github.com/apache/nuttx/issues/14773
2024-12-18 20:04:21 +08:00
YAMAMOTO Takashi
d8faa9b18e interpreters/luamodules/luv: use "depends on" instead of "select" 2024-12-18 20:04:12 +08:00
tengshuangshuang
1e199e4d4f test:add mutex socket syscall directory
some test cases have been added that cover the functionality of fs, mutex, pthread, socket, and syscall

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2024-12-18 17:43:33 +08:00
YAMAMOTO Takashi
53db7817d9 Remove all references to CONFIG_SCHED_ATEXIT
It has been removed a few years ago.
https://github.com/apache/nuttx/pull/6197
2024-12-18 17:42:24 +08:00
chao an
9c8a96aa51 nshlib: add support for disable sigmask from ps command
before:

nsh> ps
  PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK COMMAND
    0     0   0 FIFO     Kthread   - Ready              0000000000000000 0069616 Idle_Task
    1     0 224 FIFO     Kthread   - Waiting  Signal    0000000000000000 0067536 loop_task
    2     0 224 FIFO     Kthread   - Waiting  Semaphore 0000000000000000 0067504 hpwork 0x400fcfe0 0x400fd028
    3     3 100 FIFO     Task      - Running            0000000000000000 0067536 nsh_main

after:

nsh> ps
  PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT       STACK COMMAND
    0     0   0 FIFO     Kthread   - Ready              0069616 Idle_Task
    1     0 224 FIFO     Kthread   - Waiting  Signal    0067536 loop_task
    2     0 224 FIFO     Kthread   - Waiting  Semaphore 0067504 hpwork 0x400fcfe0 0x400fd028
    3     3 100 FIFO     Task      - Running            0067536 nsh_main

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-18 11:48:16 +08:00
wangjianyu3
7e77ab29e5 uORB/sensor: Add macro for satellite format string
Make it easier to extend the format of struct member

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-18 09:38:54 +08:00
zhangshoukui
2e0b577680 drivertest_uart: The string was not truncated because one more character was read
#0 0x43c7443a in strnlen nuttx/libs/libc/string/lib_strnlen.c:42
    #1 0x43c698aa in vsprintf_internal nuttx/libs/libc/stdio/lib_libvsprintf.c:933
    #2 0x43c6ca80 in lib_vsprintf nuttx/libs/libc/stdio/lib_libvsprintf.c:1383
    #3 0x4409c0bd in vsnprintf nuttx/libs/libc/stdio/lib_vsnprintf.c:72
    #4 0x47137cd0 in vcmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2097
    #5 0x47139573 in cmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2422
    #6 0x471376ff in string_equal_display_error apps/testing/cmocka/cmocka/src/cmocka.c:1410
    #7 0x471379a0 in _assert_string_equal apps/testing/cmocka/cmocka/src/cmocka.c:1952
    #8 0x4433d972 in read_default apps/testing/drivertest/drivertest_uart.c:242
    #9 0x4713c6cd in cmocka_run_one_test_or_fixture apps/testing/cmocka/cmocka/src/cmocka.c:3029
    #10 0x4713d487 in cmocka_run_one_tests apps/testing/cmocka/cmocka/src/cmocka.c:3143
    #11 0x4713f2ca in _cmocka_run_group_tests apps/testing/cmocka/cmocka/src/cmocka.c:3294
    #12 0x443444c6 in cmocka_driver_uart_main apps/testing/drivertest/drivertest_uart.c:358
    #13 0x4409a472 in nxtask_startup nuttx/libs/libc/sched/task_startup.c:72
    #14 0x43dc92e7 in nxtask_start nuttx/sched/task/task_start.c:116
    #15 0x43e31f00 in pre_start nuttx/arch/sim/src/sim/sim_initialstate.c:52

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-12-17 16:06:13 +08:00
hujun5
32ee7611bb fix a typo
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-17 12:06:32 +08:00
Lup Yuen Lee
9c5568c2af testing/ltp: Increase Stack Size
Inside CI Build risc-v-05: `rv-virt:citest` fails with a Stack Overflow at ltp_interfaces_pthread_barrierattr_init_2_1:
- https://github.com/apache/nuttx/issues/15170

This PR doubles the Stack Size for `testing/ltp` (from 4096 bytes to 8192), so that `rv-virt:citest` completes successfully.
2024-12-17 02:20:15 +08:00
buxiasen
fa22f80ee3 ramspeed: fix dest align typo, add not-aligned print
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-12-12 13:48:19 +08:00
chao an
e861ea8b53 nshlib/[cd|ls|pwd]: add support for local CWD(Current working directory)
This PR will still allow basic shell operations such as cd/ls/pwd to be used even when the environment is disabled.

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-12 02:12:55 +08:00
Tiago Medicci
d7ed69200f interpreters/python: Avoid warnings that could be treated as errors
This commit disables some warnings when building CPython to avoid
CI failing when `EXTRAFLAGS="-Wno-cpp -Werror"` is set.
2024-12-12 02:12:25 +08:00
buxiasen
1f8b9aa74c drivertest: update comment in driver test Kconfig
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-12-11 01:28:27 +08:00
buxiasen
b232fa42cf drivertest: add arm-m signal through isr case
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-12-11 01:28:27 +08:00
chao an
9c5a2ad062 mlearning/tflite-micro: add a config option to redirect micro log to syslog
new config option TFLITEMICRO_SYSLOG to redirect micro log to syslog

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-10 18:11:27 +08:00
chao an
37acd5e671 mlearning: fix build break if enable cmsis-nn
apps/mlearning/tflite-micro/tflite-micro/tensorflow/lite/micro/kernels/cmsis_nn/conv.cc:18:10:
  fatal error: Include/arm_nnfunctions.h: No such file or directory
   18 | #include "Include/arm_nnfunctions.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-09 17:29:05 +08:00
Eren Terzioglu
9411e898e6 Move verbose option to common use 2024-12-07 11:38:10 +08:00
Eren Terzioglu
95a8c43b73 apps/nxdiag: Add dignostic info without esptool support for Espressif devices 2024-12-07 11:38:10 +08:00
Eren Terzioglu
f2e5d5c13f apps/nxdiag: Add dignostic info logging support during build on nxdiag example for Espressif devices 2024-12-07 11:38:10 +08:00
wangmingrong1
f1ae5f32f5 mtetest: Add a series of tests for the mte instruction set
Added basic mte instructions, ldg, stg, irg, gmi instruction tests

➜  NX git:(master) ✗ qemu-system-aarch64 -cpu max -nographic \
        -machine virt,virtualization=on,gic-version=3,mte=on \
        -chardev stdio,id=con,mux=on, -serial chardev:con \
        -mon chardev=con,mode=readline  -kernel ./nuttx/nuttx
- Ready to Boot Primary CPU
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize

NuttShell (NSH)
nsh>
nsh>
nsh> mtetest
Spawning process for test: mtetest1
Running test: mtetest1
Test 'mtetest1' completed
Spawning process for test: mtetest2
Running test: mtetest2
Test 'mtetest2' completed
Spawning process for test: mtetest3
Running test: mtetest3
Test 'mtetest3' completed
Spawning process for test: mtetest4
Running test: mtetest4
Test 'mtetest4' completed
Spawning process for test: mtetest5
Running test: mtetest5
Test 'mtetest5' completed
All tests completed.
nsh>

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-06 19:44:12 -03:00
Tiago Medicci
efc1bf710c interpreters/python: Add Python's port to NuttX
This is the NuttX's port of Python (cpython)!

Initial support of Python includes building the Python's static
library and the `python` (Programs/python.c) application. Python's
modules are stored in `pyc` (byte-code file) and loaded as needed
from flash.
2024-12-06 19:42:09 -03:00
Tiago Medicci
9d7714f843 system/nxdiag: Change the order to generate the sysinfo.h file
The generation of `sys info.h` depends on evaluating whether
Espressif's HAL exists in the arch folder. However, cloning the HAL
itself happens in the `context` phase of the build, so it is
necessary to wait for it to finish before proceeding to the
evaluation in nxdiag. This is done by using the `depend` phase to
generate the `sysinfo.h` file.
2024-12-06 22:30:25 +08:00
wangjianyu3
b08c29617b system/usbmsc: Add support for setting paths that bind to LUN at runtime
Help

  nsh> msconn -h
  Usage: msconn [-o OPTION]... [-l LUNs]...
  Configures the USB mass storage device and exports the LUN(s).

  Supported arguments
    -o
        nc: No const LUN
        ro: Readonly
        rw: Read/Write(default)
    -l
        Device path to export

  Examples
    1. Export const LUN(s) only
        msconn
    2. Export /dev/ramx and const LUN(s)
        msconn -l /dev/ramx

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-06 08:56:30 +08:00
George Poulios
6600a5fd08 MbedTLS: patch warning when DTLS is off
This is to patch upstream MbedTLS issue:
  https://github.com/Mbed-TLS/mbedtls/issues/9425
that triggers a -Werror=undef when MBEDTLS_SSL_PROTO_DTLS
is undefined. There is no other way to silence that warning
and it breaks builds in systems with -Werror. Once the
upstream issue is resolved, this can be reverted.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2024-12-05 13:45:38 +08:00
wangmingrong1
818a3e6b63 kasantest.c: Adding Dependencies
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-04 22:36:04 +08:00
pengyiqiang
ce217b8744 lvgldemo: add LVGL duplicate initialization protection
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2024-12-02 19:50:19 +08:00
chao an
296d5d15af tflm: add tflm hello world example into nuttx build
1. add tflm hello world example into nuttx build
2. add tflm model convert flow

Test on sim/tflm

$ cmake -B build -DBOARD_CONFIG=sim/tflm -GNinja
$ cmake --build build
$ ./build/nuttx

NuttShell (NSH) NuttX-10.4.0
nsh> tflm_hello
0 (id=0): size=16, offset=0, first_used=0 last_used=1
1 (id=1): size=64, offset=64, first_used=1 last_used=2
2 (id=2): size=64, offset=0, first_used=2 last_used=3
3 (id=3): size=16, offset=64, first_used=3 last_used=3
 0: 0000000000...................................................................... (1k)
 1: 0000000000..............................1111111111111111111111111111111111111111 (1k)
 2: 22222222222222222222222222222222222222221111111111111111111111111111111111111111 (1k)
 3: 22222222222222222222222222222222222222223333333333.............................. (1k)

"Unique Tag","Total ticks across all events with that tag."
FULLY_CONNECTED, 0
"total number of ticks", 0

[RecordingMicroAllocator] Arena allocation total 2344 bytes
[RecordingMicroAllocator] Arena allocation head 128 bytes
[RecordingMicroAllocator] Arena allocation tail 2216 bytes
[RecordingMicroAllocator] 'TfLiteEvalTensor data' used 240 bytes with alignment overhead (requested 240 bytes for 10 allocations)
[RecordingMicroAllocator] 'Persistent TfLiteTensor data' used 128 bytes with alignment overhead (requested 128 bytes for 2 tensors)
[RecordingMicroAllocator] 'Persistent buffer data' used 1152 bytes with alignment overhead (requested 1100 bytes for 7 allocations)
[RecordingMicroAllocator] 'NodeAndRegistration struct' used 192 bytes with alignment overhead (requested 192 bytes for 3 NodeAndRegistration structs)
0 (id=0): size=16, offset=0, first_used=0 last_used=1
1 (id=1): size=64, offset=64, first_used=1 last_used=2
2 (id=2): size=64, offset=0, first_used=2 last_used=3
3 (id=3): size=16, offset=64, first_used=3 last_used=3
 0: 0000000000...................................................................... (1k)
 1: 0000000000..............................1111111111111111111111111111111111111111 (1k)
 2: 22222222222222222222222222222222222222221111111111111111111111111111111111111111 (1k)
 3: 22222222222222222222222222222222222222223333333333.............................. (1k)
0 (id=0): size=16, offset=16, first_used=0 last_used=1
1 (id=1): size=16, offset=0, first_used=1 last_used=2
2 (id=2): size=16, offset=16, first_used=2 last_used=3
3 (id=3): size=16, offset=0, first_used=3 last_used=3
 0: ................0000000000000000................................................ (1k)
 1: 11111111111111110000000000000000................................................ (1k)
 2: 11111111111111112222222222222222................................................ (1k)
 3: 33333333333333332222222222222222................................................ (1k)
~~~ALL TESTS PASSED~~~

nsh>

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-02 13:33:55 +08:00
George Poulios
0b3428942f Update MbedTLS 3.4.0 -> 3.6.2 and set it as default
Even though one could in theory simply set CONFIG_MBEDTLS_VERSION="3.6.2",
this commit is needed for 2 reasons:
  1. The patches need to be updated: 0001 works almost as-is (with fuzz 2)
     but 0002 hunk #4 fails and needed adjustment. Otherwise, the patches
     are identical.
  2. mbedtls_config.h needs to be updated: Following the same approach
     for the Kconfig this commit updates both Kconfig and mbedtls_config.h
     according to the changes:
       mbedtls$ git diff v3.4.0...v3.6.2 -- include/mbedtls/mbedtls_config.h

Minor edits also to crypto/controlse to comply with v3.6.2.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2024-12-01 17:57:21 +08:00
chao an
8b253d699c mlearning/tflite-micro: add tflm tool into cmake build
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-01 10:14:49 +08:00
chao an
3fd04e86e8 math/ruy: remove ruy library from cmake list
ruy is not really used, tflite just uses the header file

Error log from CMake:
================================================================
-- Configuring done (2.1s)
CMake Error at cmake/nuttx_add_library.cmake:183 (add_library):
  No SOURCES given to target: ruy
Call Stack (most recent call first):
  apps/math/ruy/CMakeLists.txt:57 (nuttx_add_library)

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-01 10:14:49 +08:00
chao an
5cb1cc7ac7 mlearning/tflite-micro: correct include patch of support library
1. correct include patch of support library
2. add flatbuffers include path

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-01 10:14:49 +08:00
chao an
581b4cb673 mlearning/CMakeLists: include subdirectory to ensure ML module could be compile
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-01 10:14:49 +08:00
chao an
8bc824a5e7 system/tflite-micro: fix patch flow of tflite-micro
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-01 10:14:49 +08:00
chao an
bd94b6da1a system/flatbuffers: fix patch flow of flatbuffers
Applying patch to flatbuffers
patching file '<'
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file '<.rej'
patching file '<'
Hunk #1 FAILED at 39.
1 out of 1 hunk FAILED -- saving rejects to file '<.rej'
patching file '<'
Hunk #1 FAILED at 495.
1 out of 1 hunk FAILED -- saving rejects to file '<.rej'
patching file '<'
Hunk #1 FAILED at 23.
1 out of 1 hunk FAILED -- saving rejects to file '<.rej'
patch: **** Can't reopen file '<' : No such file or directory
-- Configuring done (12.8s)
-- Generating done (0.3s)

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-01 10:14:49 +08:00
buxiasen
22d5d1d9d8 coredump: move definition out of types
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-30 07:36:36 +08:00
buxiasen
b75e404ec1 coredump: use llx to fix coverity report
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-30 07:36:36 +08:00
buxiasen
04f49f179b system/coredump: coredump restore independ and support mtd
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-30 07:36:36 +08:00
buxiasen
52bfcb3ab9 system/coredump: compatible restore name with NAME_MAX 32 Bytes
Coredump should compatible with default 32B NAME_MAX

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-30 07:36:36 +08:00
YAMAMOTO Takashi
6560618600 system/dd: improve EOF handling a bit 2024-11-28 15:20:13 +08:00
YAMAMOTO Takashi
9039b9cb18 system/dd: Fix a printf format 2024-11-28 15:20:13 +08:00
YAMAMOTO Takashi
f6f223e674 system/dd: portability to non-nuttx platforms
eg.
```
/opt/wasi-sdk-24.0/bin/clang -Wall -Oz -s -o dd.wasm dd_main.c
```
2024-11-28 15:20:13 +08:00
YAMAMOTO Takashi
1fed08e870 system/dd: make if= and of= optional 2024-11-28 15:20:13 +08:00
YAMAMOTO Takashi
1caf06bd77 system/dd: print help and abort on unknown options 2024-11-28 15:20:13 +08:00
YAMAMOTO Takashi
9c7a65e1e7 system/dd/dd_main.c: remove unnecessary header include 2024-11-28 15:20:13 +08:00
simbit18
0327abb483 build.yml: MSYS2 GitHub Action disable ccache and enable
You need to disable the msys2 cache from the GitHub action because we moved the Scheduled Merge Jobs to a new NuttX Mirror Repo and approaching total cache storage limit !!!

https://github.com/apache/nuttx/actions/caches

https://github.com/msys2/setup-msys2?tab=readme-ov-file#cache

Enable CMake+Ninja for Msys2
2024-11-26 18:11:31 +01:00
dependabot[bot]
3f418f482e build(deps): bump codelytv/pr-size-labeler from 1.10.1 to 1.10.2
Bumps [codelytv/pr-size-labeler](https://github.com/codelytv/pr-size-labeler) from 1.10.1 to 1.10.2.
- [Release notes](https://github.com/codelytv/pr-size-labeler/releases)
- [Commits](https://github.com/codelytv/pr-size-labeler/compare/v1.10.1...v1.10.2)

---
updated-dependencies:
- dependency-name: codelytv/pr-size-labeler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-26 10:10:47 +08:00
wangjianyu3
38b54f6fc5 system/adb: Waiting for enumeration to complete before opening endpoint
Env

  esp32s3-devkit:adb

Error

  adbd [3:100]

  NuttShell (NSH)
  nsh> adb_uv_usb_setup (154): failed to open usb device -1 2

Test
  + adb_log("Waiting for %s ..", ep);

  adbd [3:100]

  NuttShell (NSH)
  nsh> adbd_main (161): Waiting for /dev/adb0/ep0 ..

  nsh> ps
    PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK COMMAND
      0     0   0 FIFO     Kthread   - Ready              0000000000000000 0003008 Idle_Task
      1     0 224 RR       Kthread   - Waiting  Semaphore 0000000000000000 0008080 hpwork 0x3fc8bc00 0x3fc8bc24
      2     2 100 RR       Task      - Running            0000000000000000 0003992 nsh_main
      3     3 100 RR       Task      - Waiting  Semaphore 0000000000000000 0008112 adbd
  nsh>

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-23 01:44:19 +08:00
YAMAMOTO Takashi
365869b0a2 testing/ostest/signest.c: fix the range of signals
Note that MAX_SIGNO is a valid signal number.
2024-11-22 13:31:33 +08:00
YAMAMOTO Takashi
54a571fc92 testing/ostest/wdog.c: remove a set-only global 2024-11-22 13:31:19 +08:00
anjiahao
3cbcbb6521 bin:Copy debug info to a separate folder
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-22 09:03:57 +08:00
yinshengkai
7fb7e21bf2 system: support gcov output to stdout
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-22 09:02:48 +08:00
wangjianyu3
70e7ad85ed system/adb: Fix log format error
The "%pV" format depends on libc extension

Log

  adbd_main (***): 0x3fc9175cV

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-22 09:01:38 +08:00
xuxin19
1b91e3c4a6 cmake:add missing rtptools CMake scripts
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-19 17:17:30 +08:00
xuxin19
fee82bd3d3 cmake(build):add missing basic and nxlooper cmake script
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-18 13:52:45 +08:00
xuxin19
4d301988a9 cmake(build):add benchmarks osperf CMakeLists.txt
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-17 21:10:55 +08:00
hujun5
d9d851813e testing: add iob test
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-17 21:10:25 +08:00
Xiang Xiao
c7530f5e45 quickjs: fix mp_mul multiple definition
in function `mp_mul':
apps/interpreters/quickjs/quickjs/libbf.c:1179: multiple definition of `mp_mul';
nuttx/staging/libapps.a:apps/math/libtommath/libtommath/bn_mp_mul.c:8: first defined here

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-11-16 21:34:11 +01:00
haopengxiang
f67097662f build(bugfix):fix uClibc++ layout build error
make[2]: *** No rule to make target '/home/nuttx/libs/libxx/uClibc++/tests/testframework.cpp',
needed by '/home/nuttx/libs/libxx/uClibc++/tests/testframework.cpp.home.apps.testing.uclibcxx_test.o'.  Stop.

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2024-11-16 21:33:32 +01:00
wangjianyu3
687c1cacd9 nshlib/cmd_wait: Wait failed if "PROCFS/PROCES" not enabled
Env

  sim:nsh
  - CONFIG_FS_PROCFS_EXCLUDE_PROCES=y

Error

  nsh> sleep 5 &
  sh [4:100]
  nsh> wait 4
  nsh: wait: wait failed: 2

cmd_wait():

  snprintf(path, sizeof(path), "/proc/%d/status", tid);

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-14 23:20:39 +08:00
Huang Qi
9f859e914d posix_spawn: Move dependencies to Kconfig
`posix_spawn` depends on these configurations:
- !BINFMT_DISABLE
- !DISABLE_MOUNTPOINT
- BOARDCTL
- BOARDCTL_APP_SYMTAB
- ELF
- FS_ROMFS

Check them in compile time may waste some time if the dependencies are not met,
move them to Kconfig to avoid this.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-14 17:22:27 +08:00
wangjianyu3
3c4ddd2802 nshlib/pipeline: Concat variable arguments failed
1. Without this patch

  nsh> set var_test `uname`
  nsh> echo $var_test
  NuttX
  nsh> echo $var_test | cat
  sh [5:100]

  nsh>

2. With this patch

  nsh> set var_test `uname`
  nsh> echo $var_test
  NuttX
  nsh> echo $var_test | cat
  sh [4:100]
  NuttX
  nsh>

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-14 15:51:40 +08:00
buxiasen
3a6ecb82b5 nshlib/nsh_parse: Fix variable arguments concat error of nsh_execute()
Without this patch

  nsh> set time 5
  nsh> echo $time
  5
  nsh> sleep $time &
  sh [5:100]
  nsh> nsh: sleep: missing required argument(s)

With this patch

  nsh> set time 5
  nsh> echo $time
  5
  nsh> sleep $time &
  sh [4:100]
  nsh> ps
    PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK COMMAND
      0     0   0 FIFO     Kthread   - Ready              0000000000000000 0069616 Idle_Task
      1     0 224 FIFO     Kthread   - Waiting  Signal    0000000000000000 0067536 loop_task
      2     0 224 FIFO     Kthread   - Waiting  Semaphore 0000000000000000 0067504 hpwork 0x501760e0 0x50176128
      3     3 100 FIFO     Task      - Running            0000000000000000 0067536 nsh_main
      4     4 100 FIFO     Task      - Waiting  Signal    0000000000000000 0067520 sh -c sleep

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-14 15:49:14 +08:00
xuxin19
1c7a7f7529 cmake(bugfix):add INCLUDE_DIRECTORIES for nimble
/github/workspace/sources/apps/examples/nimble/nimble_main.c:40:10: fatal error: nimble/nimble_npl.h: No such file or directory
   40 | #include "nimble/nimble_npl.h"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-13 21:58:26 +08:00
wangmingrong1
378afdebd5 gprof: modify depends on
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-13 21:58:07 +08:00
anjiahao
59855a1a67 remove <nuttx/xxx.h> in stdio need add depend header file
libuv:
CC:  pthread/pthread_mutexattr_setrobust.c libuv/src/unix/thread.c: In function ‘uv_thread_create_ex’:
libuv/src/unix/thread.c:174:24: error: storage size of ‘param’ isn’t known
  174 |     struct sched_param param;
      |                        ^~~~~

btsak_main:
In file included from btsak_main.c:39:
btsak.h:149:1: error: unknown type name ‘bool’
  149 | bool btsak_str2bool(FAR const char *str);

pipe_main.c:
CC:  sim/sim_registerdump.c pipe_main.c:44:30: error: unknown type name ‘pthread_addr_t’
   44 | static void *open_write_only(pthread_addr_t pvarg)
      |                              ^~~~~~~~~~~~~~
pipe_main.c: In function ‘pipe_main’:
pipe_main.c:81:3: error: unknown type name ‘pthread_t’
   81 |   pthread_t writeonly;

redirect_test.c: In function ‘redirection_test’:
redirect_test.c:205:3: error: unknown type name ‘pthread_t’
  205 |   pthread_t readerid;
      |   ^~~~~~~~~
redirect_test.c:206:3: error: unknown type name ‘pthread_t’
  206 |   pthread_t writerid;
      |   ^~~~~~~~~

drivertest_posix_timer.c:48:29: error: ‘optarg’ undeclared (first use in this function)
   48 |       value = (type)strtoul(optarg, &ptr, base);                      \

drivertest_posix_timer.c:208:3: warning: implicit declaration of function ‘sleep’ [-Wimplicit-function-declaration]
  208 |   sleep(SLEEPSECONDS);
      |   ^~~~~

drivertest_uart.c:92:13: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration]
   92 |       len = read(fd, &tmp_char, 1);
      |             ^~~~
      |             fread

drivertest_uart.c:323:44: error: ‘optopt’ undeclared (first use in this function)
  323 |             printf("Unknown option: %c\n", optopt);

kernel/fs/cases/fs_getfilep_test.c:71:9: warning: implicit declaration of function ‘fs_getfilep’ [-Wimplicit-function-declaration]
   71 |   ret = fs_getfilep(fileno(fp), &filep);
      |         ^~~~~~~~~~~

kernel/mm/cases/mm_test_008.c:148:9: warning: implicit declaration of function ‘task_create’; did you mean ‘timer_create’? [-Wimplicit-function-declaration]
  148 |   pid = task_create("TestNuttx08_routine_1",
      |         ^~~~~~~~~~~
      |         timer_create

/home/ajh/work/nuttxwork/apps/testing/cmocka/cmocka_main.c:171:11: warning: implicit declaration of function ‘setenv’ [-Wimplicit-function-declaration]
  171 |           setenv("CMOCKA_XML_FILE", xml_path, 1);
      |           ^~~~~~

drivertest_pm_runtime.c:123:7: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration]
  123 |       usleep(210 * 1000);
      |       ^~~~~~

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-13 16:49:12 +08:00
xuxin19
37bab55843 cmake(bugfix):reduce static library propagation behavior
This will cause duplicate definitions during the link  process

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-13 16:39:50 +08:00
cuiziwei
2a76d17e10 cxxtest: Add static string test.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-11-13 13:18:17 +08:00
wangmingrong1
bb03ef0ce3 gcov: modify depends on
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-13 02:38:42 +08:00
anjiahao
dfbf408567 stdio.h:Remove unnecessary header file, app header change
stdio.h remove <nuttx/xxxx.h>  Some .c previously depended on
<nuttx/xxx.h> and needed to be added to .c instead of stdio.h

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-12 19:37:10 +08:00
jianglianfang
0c467dc02d audioutils/nxaudio: added pause/resume interface in nxaudio.h
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-11-11 17:18:09 +08:00
zhushiqshi
1f5ec0bfe7 apps/rexecd: add more trace info when failed
Signed-off-by: zhushiqi <zhushiqshi@xiaomi.com>
2024-11-11 17:17:52 +08:00
zhushiqshi
de8080dbff apps/rexecd: fix bind failed return 13
Signed-off-by: zhushiqi <zhushiqshi@xiaomi.com>
2024-11-11 17:17:52 +08:00
wenlingyun1
4a1c40aa96 update quickjs patch for cmake compilation
Signed-off-by: wenlingyun1 <wenlingyun1@xiaomi.com>
2024-11-11 17:17:22 +08:00
wenlingyun1
1adfefd88d add CMakeLists.txt for quickjs
Signed-off-by: wenlingyun1 <wenlingyun1@xiaomi.com>
2024-11-11 17:17:22 +08:00
wangjianyu3
b3e1077f87 nsh: Using sizeof() to get string length of char array
Changed from calling `strlen()` at runtime to using `sizeof()` at compile time.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-11 10:36:46 +08:00
wangjianyu3
c052bd8377 nsh: Add pipeline support for nsh commandline
And nested pipeline supported.

Test
  1. Redirect in
    cat < /etc/init.d/rc.sysinit

  2. Simple pipeline
    ls | cat

  3. Nested pipeline
    ls | dd | cat | dd | cat

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-11 10:36:46 +08:00
wangjianyu3
3da204c23e Pack parameters of nsh_execute() as struct nsh_exec_param_s
1. Input redirect flags currently is hardcode, passing by arguments maybe better.
2. Only support redirect to path_name, redirect to fd is needed for pipeline.

Test
  1. Redirect in
    cat < /etc/init.d/rc.sysinit

  2. Redirect with FIFO
    mkfifo /dev/testfifo
    cat /dev/testfifo &
    ls > /dev/testfifo

  3. NSH Params
    set name `uname`
    echo $name

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-11 10:36:46 +08:00
wangjianyu3
27b5021e0d nshlib/cmd_dd: Retry if read() was interrupted
Without this patch

  nsh> ls /etc/group | dd | dd
  sh [13:100]
  sh [14:100]
  nsh: dd: read failed: 4
  nsh>

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-11 10:36:23 +08:00
wangjianyu3
ebc19a60ff nshlib/cmd_cat: Retry if nsh_read was interrupted by a signal
When read from stdio of child process through pipe, SIGCHLD received if child exits.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-10 22:03:07 +08:00
hujun5
e2a21337ac ostest/pthread_rwlock: We need to wait for race_cond_thread2
to acquire the rdlock first, otherwise it may cause a deadlock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-10 00:54:35 +08:00
Daniel Jasinski
eec957a514 build: increase FetchContent timeout to 120 seconds for LVGL
LVGL 9.2.1 archive is ~70MB. Over poor connections, it may take
longer to download it. This renders CMake build unusable in such
environments.

Signed-off-by: Daniel Jasinski <jasinskidaniel95szcz@gmail.com>
2024-11-09 23:32:45 +08:00
hujun5
39908cc40c isrthread: add configuring the stack of an isrthread as static
reason:
we configure the isr thread stack as static to allow for more flexible placement of the stack.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-08 01:49:20 +08:00
Karel Kočí
87ce33b1d8 examples/pipe: fix write usage
write returns in case some bytes were written but not everything can
fit.

This wasn't the case in NuttX but commit
d0680fd1bc51b7ead0b068fb24a31a144d22dc6c introduced this standard
behavior.
2024-11-08 01:42:24 +08:00
xinbingnan
febd738ce5 nxaudio: fix audio stop logic to prevent buffer addition after STOP signal
- Ensure `AUDIO_STOP` via `ioctrl` is followed by `mq_send STOP` without race conditions.
- Modify loop condition to correctly handle `running = false` upon receiving STOP signal.
- Resolve potential issue where `AUDIO_MSG_DEQUEUE` could still accept buffers after STOP signal due to timing.

Before:
- `nxaudio_stop` would call `ioctrl AUDIO_STOP` followed by `mq_send STOP`, which might lead to `AUDIO_MSG_DEQUEUE` accepting buffers after STOP.

After:
- Synchronized the sequence of `ioctrl AUDIO_STOP` and `mq_send STOP` to prevent buffer addition after STOP.
- Enhanced loop condition to accurately reflect the STOP state.

Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2024-11-08 01:41:15 +08:00
wangjianyu3
40a5e47d5c uORB/sensor: Add GNSS firmware version for sensor_gnss_format
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-06 21:20:41 +08:00
hujun5
748a4d6b8f fix compile error
Error: smp_call.c:36:31: error: 'g_call_data' defined but not used [-Werror=unused-variable]
   36 | static struct smp_call_data_s g_call_data;
      |                               ^~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [/github/workspace/sources/apps/Application.mk:237: smp_call.c.github.workspace.sources.apps.testing.ostest.o] Error 1
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:52: /github/workspace/sources/apps/testing/ostest_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 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-06 17:28:18 +08:00
hujun5
a320e6dda5 smpcall: add nxsched_smp_call_async and nxsched_smp_call_single_async
reason:
The old implementation of the SMP call, even when using the "no wait" parameter,
could still result in waiting, if invoking it within a critical section
may lead to deadlocks. Therefore, in order to implement a truly asynchronous SMP
call strategy, we have added nxsched_smp_call_async.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-06 09:53:35 +08:00
Huang Qi
5048d6b472 tools: Add essential math.h for wasm build
If the experimental feature Wasm build enabled with multi thread
compiling, the COPYFILE (cp) maybe raise the error below:
```
cp: cannot create regular file 'math.h': file exists
```

This error cause by that the wasi-sdk don't provide the math.h for
non-wasi envrioment, for this case, provide a math.h for it instead of copy
file each time is better.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-06 01:38:10 +08:00
Michal Lenc
2d5afd0625 nxboot: fix incorrect confirm state for directly flashed image
API function nxboot_get_confirm was returning incorrect value if
primary image was flashed directly into the embedded flash (this
image does not have a tail, but is automatically considered as valid
and stable based on the header magic value).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-11-06 01:37:46 +08:00
Ville Juven
f97304fa3f nsh_vars: Remove rogue sched_unlock()
There is no corresponding sched_lock() for this and therefore this causes
random crashes.

Found when running a long init script which utilizes shell variables in
SMP mode.
2024-11-06 01:35:42 +08:00
Xiang Xiao
400a8e3264 benchmarks: add .gitignore files
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-11-04 10:56:36 +01:00
Lup Yuen Lee
594558eddf CI: Check out the correct branch of nuttx repo when compiling nuttx-apps
When compiling the Release Branch of `nuttx-apps`, our CI Workflow `build.yml` checks out the Master Branch of `nuttx` repo, which is incorrect. This happens due to a typo in `build.yml`: https://github.com/apache/nuttx/issues/14513

This PR fixes the typo in `build.yml` to checkout the correct branch of `nuttx` repo.
2024-11-04 12:51:06 +08:00
Lup Yuen Lee
80bbc01790 CI: Disable the CI Build on push to master branch
Due to the [recent cost-cutting](https://github.com/apache/nuttx/issues/14376), we are no longer running PR Merge Jobs in the `nuttx` and `nuttx-apps` repos. For this to happen, I am now running a script on my computer that will cancel any PR Merge Jobs that appear: [kill-push-master.sh](https://github.com/lupyuen/nuttx-release/blob/main/kill-push-master.sh)

This PR disables PR Merge Jobs permanently, so that we no longer need to run the script. This prevents our CI Charges from over-running, in case the script fails to operate properly.
2024-11-04 09:33:27 +08:00
robert
0212e57f44 Added demo for BLE
Summary
---------------------------------------------------------------------------------------------------------
Created a minimal demo application for Bluetooth. It works by displaying some data over Bluetooth and the
user can connect to the device running it on NuttX and read this data.

This can work in 2 scenarios: a real scenario, in which data from the BME680 (temperature, humidity, etc..)
is used and the user will be able to read it. The second scenario involves displaying some dummy data
(hardcoded values) for testing purposes.

This application can serve as an example for users implementing more complex applications using Bluetooth on NuttX.

Testing
---------------------------------------------------------------------------------------------------------
I used the ESP32-Sparrow (which includes the BME680 sensor) and the ESP32-devkitc boards for testing.

The Bluetooth stack starts by default with advertising when it initializes, however I noticed that enabling
advertising in the stack does not work (at least on ESP32). However, when scanning is also enabled, the
device starts advertising. Therefore, in our application, during the BLE services initialization part, I also
enable scanning as a temporary workaround in order to make sure the device advertises and the user can see it
and connect to it.
2024-11-04 02:33:42 +08:00
Huang Qi
3799e0922d wamr: add iwasm include directory to nuttx target
This patch allow from other module that outside
WAMR directory include `wasm_export.h` to use WAMR as library.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-04 02:27:50 +08:00
xuxin19
7bab630e72 sotest:implement cmake sotest when kernel build does not support yet
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-03 09:22:36 +08:00
xuxin19
90f2a33b69 cmake(bugfix):fix ymodem cmake typo
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-03 09:22:36 +08:00
Lup Yuen Lee
c403d6c362 CI: Add Python linter to check
This PR syncs https://github.com/apache/nuttx/pull/14323 from `nuttx` repo to `nuttx-apps`.

This will resolve the `checkpatch.sh` failure: https://github.com/apache/nuttx-apps/issues/2812
2024-11-02 15:55:02 +01:00
Lup Yuen Lee
76c016b557 CI: Enable builds for msys2, msvc, arm-08, arm-10, arm-13 for Complex PRs
This PR enables the CI Builds for msys2, msvc, arm-08, arm-10, arm-13 for Complex PRs. We disable the CI Builds for arm-01, arm-09, arm-11.

This will help to fix the recent breakage of builds: https://github.com/apache/nuttx/issues/14598
2024-11-02 21:40:53 +07:00
Eren Terzioglu
d6edbd0cec Improve nxdiag example for Espressif devices 2024-11-02 12:22:25 +08:00
Eren Terzioglu
6c3ca23dbf system/debugpoint: Fix RO watchpoint test issue for esp devices 2024-11-01 23:09:37 +08:00
Michal Lenc
61fec07c62 boot: add NuttX bootloader with update and recovery support
This commit adds NuttX based bootloader with the support for image
update and recovery if not confirmed. The algorithm utilizes three
flash partitions: primary (image runs from this area), secondary
and tertiary. Secondary and tertiary areas are used for update upload
and recovery.

The update is performed by simple copy from update area to primary
area with recovery being created in recovery area if not already present.
Once image is confirmed by the user, the image in update area is
confirmed as well, update area becomes recovery area and vice versa.
This means the recovery is always present (except for the first update)
and subsequent updates just copy image from update to primary. This
makes the update significantly faster and more considerable to flash
wear while keeping the recovery/revert possibility.

A header (aligned to flash's erase size) must be added to the beginning
of the image. Python script nximage.py can be used to prepend this
header to built binary. The algorithm also uses one erase page at the
end of a partition (partition, not image!) to store flags used to
indicate image confirm status and to detect update/recovery partitions.
Any program uploading update image to the update partition has to erase
this page for the boot to work correctly!

The algorithm implementation is based on a patch initially developed
for MCUboot project but rejected by the project's maintainers

https://github.com/mcu-tools/mcuboot/pull/1902

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-11-01 11:30:28 -03:00
makejian
242b947342 crypto: remove MBEDTLS_CONFIG_FILE
* \def MBEDTLS_CONFIG_FILE
 *
 * If defined, this is a header which will be included instead of
 * `"mbedtls/mbedtls_config.h"`.
no need to specify MBEDTLS_CONFIG_FILE

Signed-off-by: makejian <makejian@xiaomi.com>
2024-11-01 17:02:10 +08:00
chenzhijia
34ca696b86 Add The Linux Programming Interface under examples
https://man7.org/tlpi/index.html

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-10-31 17:12:12 +08:00
ouyangxiangzhen
4ba65ccde9 benchmarks: support tacle-bench.
This commit supports tacle-bench for real-time systems.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-30 23:16:22 +08:00
ouyangxiangzhen
0edb210561 benchmarks: support test-tlb
This commit added support for test-tlb, a memory latency micro-benchmark.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-30 23:13:01 +08:00
ouyangxiangzhen
ddabb6e0ef benchmarks: support cyclictest
This commit supports cyclictest from RT-Tests for the timer jitter profiling.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-30 23:10:48 +08:00
ligd
d9e178aad0 nshlib/console: fix compile error when open CONFIG_NSH_ALTCONDEV
CC:  mm_heap/mm_memalign.c misc/rwbuffer.c: In function 'rwb_readbytes':
misc/rwbuffer.c:1172:2: warning: #warning Not Implemented [-Wcpp]
 1172 | #warning Not Implemented
      |  ^~~~~~~
CC:  binfmt_unloadmodule.c In file included from nsh_console.c:40:
nsh_console.c: In function 'nsh_consoleredirect':
nsh_console.h:85:30: error: 'struct serialsave_s' has no member named 'cn_confd'; did you mean 'cn_infd'?
   85 | #  define INFD(p)      ((p)->cn_confd)
      |                              ^~~~~~~~
nsh_console.c:344:7: note: in expansion of macro 'INFD'
  344 |       INFD(ssave) = INFD(pstate);
      |       ^~~~
nsh_console.c: In function 'nsh_consoleundirect':
nsh_console.h:85:30: error: 'struct serialsave_s' has no member named 'cn_confd'; did you mean 'cn_infd'?
   85 | #  define INFD(p)      ((p)->cn_confd)
      |                              ^~~~~~~~
nsh_console.c:370:18: note: in expansion of macro 'INFD'
  370 |   INFD(pstate) = INFD(ssave);
      |                  ^~~~

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-29 23:43:04 +08:00
anjiahao
95368deae2 ymodem:fix bug,When sending a retransmission, HEAD is overwritten.
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-29 18:02:20 +08:00
zhanghongyu
7dd4b28950 netpkt_ethercat.c: fix the description of usage
the current usage description is incorrect,
ifname must follow ethercat. The number of transfers can be specified
only after ifname is specified.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-29 18:02:08 +08:00
zhangning21
d2205f8759 add x86-64-ABI/.gitignore
Signed-off-by: zhangning21 <zhangning21@xiaomi.com>
2024-10-29 12:30:42 +08:00
ouyangxiangzhen
85094f3eae benchmarks: support tinymembench
This patch adds tinymembench for memory bandwidth and latency measuring.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-29 12:28:18 +08:00
zhanghongyu
b42bbcb5d3 netlib_getarptab.c: improved the display without any arp entry
before:
server> arp
ERROR: send() failed: 2
nsh: arp: S��x�����Ì
 failed: 2
server>

after:
server> arp
IP Address   Ethernet Address  Interface
server>

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-29 12:27:16 +08:00
zhanghongyu
4cec3dad0d nsh_netcmds.c: handle the ENETUNREACH error number
before:
server> arp -a 10.0.1.4
nsh: arp: ioctl failed: 101

after:
server> arp -a 10.0.1.4
nsh: arp: no such ARP entry: 10.0.1.4

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-29 12:27:16 +08:00
ligd
48db89158a ostest: update wqueue test for new API
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-29 01:22:29 +08:00
buxiasen
36be4a08ed resmonitor: add showinfo/filldisk/fillcpu/fillmem from test/
add cmake support

after enable TESTING_RESMONITOR, use showinfo -i 2 can show cpuload to
syslog every two seconds.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:36 +08:00
liwenxiang1
a526a4a173 app/testing:Add x86_64 abi test cases
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>

app/testing:Add x86_64 abi test download path

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-28 22:51:25 +08:00
buxiasen
e260522fa3 testing/pm_smp: delay_yield ticks 1->2, avoid idle canot run one cycle
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:12 +08:00
buxiasen
93a431d19b testing/drivertest: add pm_smp test
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:12 +08:00
buxiasen
7acf0ff314 drivertest_pm: compatible with SMP
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:12 +08:00
liugui
9353bcefa2 skip oneshot timer test
Signed-off-by: liugui <liugui@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-28 22:51:12 +08:00
anjiahao
0b03ca1538 macos:fix sim:module build warning
CP:  /Users/vela/ajh/nuttx/include/nuttx/fs/hostfs.h
CC:  inode/fs_inodebasename.c ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
        ar -m [-TLsv] archive file ...
        ar -m [-abiTLsv] position archive file ...
        ar -p [-TLsv] archive [file ...]
        ar -q [-cTLsv] archive file ...
        ar -r [-cuTLsv] archive file ...
        ar -r [-abciuTLsv] position archive file ...
        ar -t [-TLsv] archive [file ...]
        ar -x [-ouTLsv] archive [file ...]

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-28 21:27:32 +08:00
Leo Chung
c7a905ec0c apps/system/vi: Add missing vi_release before exit.
If VI exit without vi_release, that broken console.

Signed-off-by: Leo Chung <gewalalb@gmail.com>
2024-10-28 10:10:14 -03:00
Leo Chung
c0e04b0251 termcurses: Disable ICANON for serial driver. That was broken VI editor.
The ICANON flag broken VI key input, so disable it.

Signed-off-by: Leo Chung <gewalalb@gmail.com>
2024-10-28 10:10:14 -03:00
dengwenqi
41bc4f7873 testing/stressapptest: fix: git status --ignore normalization check problem
Signed-off-by: dengwenqi <dengwenqi@xiaomi.com>
2024-10-28 00:40:37 +01:00
haopengxiang
df559f1712 fix: git status/git status --ignore normalization check problem
Signed-off-by: dengwenqi <dengwenqi@xiaomi.com>
2024-10-27 22:30:39 +08:00
zhuanglin
5b2397b595 testing/fatutf8:fix Out of bounds writing
Signed-off-by: zhuanglin <zhuanglin@xiaomi.com>
2024-10-27 22:30:39 +08:00
makejian
84292d5013 mbedtls: compile warning fix
- apps/crypto/openssl_mbedtls_wrapper/mbedtls/err.c
- apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c

Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-27 20:57:11 +08:00
xuxin19
597c701518 cmake:add openssl_mbedtls_wrapper cmake build support
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-27 20:57:11 +08:00
makejian
fbcc320321 openssl_mbedtls_wrapper: Implement SHA1 Interface
Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-27 20:57:11 +08:00
makejian
42e0e4c6b2 openssl_mbedtls_wrapper: support X509_new()
Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-27 20:57:11 +08:00
cuiziwei
6721ae3555 fix build warning.
CC:  vfs/fs_lseek.c /home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c: In function ‘HMAC_CTX_new’:
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:57:31: warning: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration]
   57 |       (mbedtls_md_context_t *)malloc(sizeof(mbedtls_md_context_t));
      |                               ^~~~~~
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:28:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
   27 | #include <mbedtls/hmac_drbg.h>
  +++ |+#include <stdlib.h>
   28 | #include <mbedtls/md.h>
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:57:31: warning: incompatible implicit declaration of built-in function ‘malloc’ [-Wbuiltin-declaration-mismatch]
   57 |       (mbedtls_md_context_t *)malloc(sizeof(mbedtls_md_context_t));
      |                               ^~~~~~
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:57:31: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c: In function ‘HMAC_CTX_free’:
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:126:3: warning: implicit declaration of function ‘free’ [-Wimplicit-function-declaration]
  126 |   free(ctx);
      |   ^~~~
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:126:3: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:126:3: warning: incompatible implicit declaration of built-in function ‘free’ [-Wbuiltin-declaration-mismatch]
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:126:3: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-27 20:57:11 +08:00
makejian
f7582e34e5 openssl_mbedtls_wrapper: add ssl wrapper from libwebsockets
Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-27 20:57:11 +08:00
yanghuatao
f1ace3774f apps/crypto: Add project openssl_mbedtls_wrapper
Add openssl mbedtls wrapper project

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-10-27 20:57:11 +08:00
ligd
da83750cd3 netutils: fix compile error when not defined CONFIG_NET_ETHERNET
/home/ligd/platform/dev/apps/netutils/netlib/netlib_obtainipv4addr.c:117: undefined reference to `netlib_getmacaddr'

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-27 20:03:43 +08:00
Xiang Xiao
f8341ab94d Replace getrandom with arc4random_buf to simplify the usage
and follow the kernel side change:
https://github.com/apache/nuttx/pull/14509

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-27 20:03:14 +08:00
Xiang Xiao
e8497e5355 system/libuv: Sync CMakeLists.txt with Makefile
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-27 20:02:07 +08:00
Huang Qi
f9c6e18693 libuv: Don't select PIPES implicitly
To avoid introducing unexpected dependencies,
we should not select any feature implicitly.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-10-27 20:02:07 +08:00
Huang Qi
713cd4d971 libuv: Make stream read buffer size configurable
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-10-27 20:02:07 +08:00
zhangchao53
1ddeaa1468 testing/cmocka: shuffling test sequence and pass seed arg
Signed-off-by: zhangchao53 <zhangchao53@xiaomi.com>
2024-10-27 20:01:51 +08:00
raiden00pl
71d26a5dd1 canutils: change dependency from GPL to BSD
socketCAN utils are dual licence, there is no point in using
GPL licence when we can use BSD.

Also change `select CANUTILS_LIBCANUTILS` to `depends on CANUTILS_LIBCANUTILS`.
We can't `select` that option when `ALLOW_BSD_COMPONENTS` is not set.
2024-10-27 19:46:28 +08:00
zhanghongyu
8b15b267a3 matter: add Kconfig option to control logging
Logs have a great impact on image size, so whether to print logs is
modified as a compilation option and controlled by Kconfig

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-27 19:45:17 +08:00
renzhiyuan1
f1501c56d3 cmake:add ruy CMake build
Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-27 18:12:54 +08:00
renzhiyuan1
b694cbb848 cmake:add gemmlowp CMake build
Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-27 18:12:54 +08:00
renzhiyuan1
2074d04f62 cmake:add kissfft CMake build
Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-27 18:12:54 +08:00
dengwenqi
f7ff338a7b fix: git status/git status --ignore normalization check problem 2024-10-27 18:12:54 +08:00
zhanghongyu
429befe1ed examples/netpkt: add ethercat test example for robot
add a simple example to test ethercat's sending and receiving

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-27 15:59:14 +08:00
xuxingliang
28c3c05c28 example/libtest: add malloc/free to libtest
So we can verify flags like kasan are effective or not.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-27 15:05:36 +08:00
Neo Xu
c4b6fd77be lvgldemo: allow to customize input dev path
Default to /dev/input0, now it's configurable.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-27 14:05:37 +08:00
xuxin19
b4c2e6bf46 build(bugfix):remove unused cmake scrpits
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-27 14:05:17 +08:00
xuxin19
55a955234a cmake:add system gprof CMake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-27 14:05:06 +08:00
renzhiyuan1
469cc11406 cmake:add flatbuffers CMake build
Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-27 14:05:06 +08:00
Petro Karashchenko
7f7bbe236d examples/mqttc: add option to use MBED TLS for connections
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-26 19:11:55 -03:00
liuwei35
3e54ea0aae fix compile warning for fsutils inifile.c
Signed-off-by: liuwei35 <liuwei35@xiaomi.com>
2024-10-26 23:08:53 +02:00
Neo Xu
0109ab39ec lvgldemo: should use nuttx_deinit to free all resources
Memory leak can be detected when simply change the while(1) loop to exit. The lv_nuttx_deinit will free resources including display, input etc.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-26 21:33:00 +08:00
Neo Xu
1506c6f54d lvgl: upgrade to release/v9.2.1
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-25 09:27:15 +02:00
zhanghongyu
2ff75e32e9 netutils/connectedhomeip: use CONFIG_CXX_STANDARD instead of hard code
as c++ versions are upgraded, hard code compilation options can
cause build error

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-24 19:57:59 +08:00
Lup Yuen Lee
b6fb787669 CI: Enable sim-02 build when we create or update a Complex PR
CI Build Job sim-02 was disabled to reduce our usage of GitHub Runners, to comply with ASF Policy: https://github.com/apache/nuttx/issues/14376#issuecomment-2427837859

However this causes the Scheduled Merge Job to fail, due to reduced CI Checks: https://github.com/NuttX/nuttx/actions/runs/11490041505/job/31980056690#step:7:465

This PR re-enables sim-02 when we create or update a Complex PR.
2024-10-24 09:28:08 +07:00
Felipe Moura
f517b66d60 examples/spislv_test: Added app that allows users to test SPI Slave comm
This application continuously reads the file system of the spislv. Each received message will be written to the user in hexadecimal form, and the same received data will be sent back. In this way, the user can test if their spislv driver and hardware setup are working properly before proceeding further.

On a master device, using the SPI tool, when sending the message: spi exch -x 4 deadbeef

The slave device will output:
Slave: 4 Bytes read
 Value in hex form from /dev/spislv2: de ad be ef
Slave: Writing value back to /dev/spislv2
2024-10-22 18:41:12 +02:00
wangmingrong1
a7a03a9e5a kasantest: Add some tests for legitimate and illegitimate operations of memory APIs
1. By printing the results, you can know which libc memory APIs in the
current system support kasan check; for examples:
KASan Test: heap underflow -> PASS
KASan Test: heap overflow -> PASS
KASan Test: heap use after free -> PASS
KASan Test: heap invalid free -> PASS
KASan Test: heap double free -> PASS
KASan Test: heap poison -> PASS
KASan Test: heap unpoison -> PASS
KASan Test: heap illegal memchr -> PASS
KASan Test: heap illegal memcpy -> PASS
KASan Test: heap illegal memcmp -> PASS
KASan Test: heap illegal memmove -> PASS
KASan Test: heap illegal memset -> PASS
KASan Test: heap illegal strcmp -> PASS
KASan Test: heap illegal strcpy -> PASS
KASan Test: heap illegal strlen -> FAIL
KASan Test: heap illegal strncpy -> FAIL
KASan Test: heap illegal strchr -> PASS
KASan Test: heap illegal strncmp -> PASS
KASan Test: heap illegal strnlen -> FAIL
KASan Test: heap illegal strrchr -> PASS
KASan Test: heap legal memchr -> PASS
KASan Test: heap legal memcpy -> PASS
KASan Test: heap legal memcmp -> PASS
KASan Test: heap legal memmove -> PASS
KASan Test: heap legal memset -> PASS
KASan Test: heap legal strcmp -> PASS
KASan Test: heap legal strlen -> PASS
KASan Test: heap legal strlen -> PASS
KASan Test: heap legal strncpy -> PASS
KASan Test: heap legal strchr -> PASS
KASan Test: heap legal strncmp -> PASS
KASan Test: heap legal strnlen -> PASS
KASan Test: heap legal strrchr -> PASS
KASan Test: globals underflow -> PASS
KASan Test: globals overflow -> PASS

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-22 23:14:50 +08:00
simbit18
abcfd74c19 ISSUE_TEMPLATE: fix missing labels
Not all labels are added because there is no match with the label name.

issue_labeler.yml
os: Linux -> os: linux

001_bug_report.yml
Type: bug -> Type: Bug
Corrected label in links

002_feature_request.yml
Type: enhancement -> Type: Enhancement
Corrected label in links

003_help.yml
Type: question -> Community: Question
Corrected label in links
2024-10-22 23:14:15 +08:00
Lup Yuen Lee
1cb45b0d1c CI: Split the targets in sim-01 and add sim-03
This PR syncs the Simulator Targets `sim-01`, `sim-02`, `sim-03` from `nuttx` repo to `nuttx-apps`: https://github.com/apache/nuttx/pull/14428
2024-10-22 08:47:07 +08:00
buxiasen
790be6d639 nshlib/nsh_parse: use sh -c replace pthread detach when nsh background.
pthread & detach will still quit when parent task exit,
cause nsh_parse clone args leak. nsh should use task instead of thread

this case can reproduce the memory leak.
int main(int argc, FAR char *argv[])
{
  printf("Hello, World!!\n");
  system("sleep 1 &");
  return 0;
}

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-22 00:04:09 +08:00
Lup Yuen Lee
ec458f0ec7 CI: Build only Arm32 Targets arm-01 / 03 / 05 / 06 / 07 / 09 / 11 for Complex PRs
This PR updates the Build Rules `arch.yml` to build only these Arm32 Targets when we create or update a Complex PR:
- arm-01, arm-03, arm-05, arm-06, arm-07, arm-09, arm-11

No changes for Simple PRs (arm-01 to arm-14) and for Merging PRs (also arm-01 to arm-14).

This will improve our breadth of CI Checks across Arm32 Targets, as explained here: https://github.com/apache/nuttx/issues/14376
2024-10-21 05:53:04 +07:00
Lup Yuen Lee
52a50ea72a CI: Split the Build Jobs for Arm64 and x86_64
This PR syncs https://github.com/apache/nuttx/pull/14282 from `nuttx` repo to `nuttx-apps`.
2024-10-20 16:19:10 +08:00
cuiziwei
729cc337a1 libuv: Remove GCCVER redefinition
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-19 18:55:01 +08:00
wangjianyu3
e5a1bb1796 nshlib/dd: Add support for reading from/writing to standard input/output
Test
  1. Input from stdin and output to stdout
       Keyboard input: 12345AAAAABBBBB
    nsh> dd bs=5
    1234512345AAAAAAAAAABBBBBBBBBB

  2. Input from file and output to stdout
    nsh> dd if=/etc/init.d/rc.sysinit
    mkrd -m 2 -s 512 1024
    mkfatfs /dev/ram2
    mount -t vfat /dev/ram2 "/tmp"

  3. Input from stdin and output to file
       Keyboard input: QWERT
    dd of=/data/dd_stdout bs=5

    Then, cat the output file in host (based on HostFS):
    $ cat ./dd_stdout
    QWERT

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-10-19 14:07:32 +08:00
Lup Yuen Lee
a799c3e805 CI: Skip half of RISC-V, Xtensa and Simulator targets when a Complex PR is created / updated
When we submit or update a Complex PR that affects All Architectures (Arm, RISC-V, Xtensa, etc): CI Workflow shall run only half the jobs for RISC-V, Xtensa and Simulator:
- `risc-v-01` to `03`
- `xtensa-01`
- `sim-01`

When the Complex PR is Merged: CI Workflow will still run all jobs for RISC-V, Xtensa and Simulator:
- `risc-v-01` to `06`
- `xtensa-01` to `02`
- `sim-01` to `02`

Simple PRs with One Single Arch / Board will build the same way as before:
- `risc-v-01` to `06`
- `xtensa-01` to `02`
- `sim-01` to `02`

We hope to lower drastically our usage of GitHub Runners before the ASF Deadline, as explained here: https://github.com/apache/nuttx/issues/14376
2024-10-19 06:57:33 +07:00
likun17
06181f0b00 uorb:Fixed the abnormal issue of printing uint16 with PRIu16.
The PRIu16 macro in the system is defined as "u", and "hu" is required.
In Linux and Nuttx, PRIu32 PRIu16 PRIu8 are all defined as "u", but %pB
prints the structure and needs its offset. %pB gets the offset through
sizeof(short int)

Signed-off-by: likun17 <likun17@xiaomi.com>
2024-10-18 19:56:58 +08:00
zhangshoukui
8b17cfedf2 drivertest_i2c_spi: Supports incoming device nodes so we can test both iic and spi
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-10-18 19:56:40 +08:00
nuttxs
8d82bd7b76 wireless/wapi.c: Initialize variables to avoid abnormal
data when wapi get country code.
2024-10-18 18:12:22 +08:00
raiden00pl
a7024aea89 examples/foc: protect control loop with critical section
If the controller frequency is high, system timer interrupts will
eventually interrupt the controller function, thereby increasing the
execution time. This may lead to skipping the control cycle, which
negatively affects the control algorithm.

With this option enabled, interrupts are disabled for the duration
of the controller function execution.

Here example results from CONFIG_EXAMPLES_FOC_PERF output
for b-g431b-esc1 board with CONFIG_EXAMPLES_FOC_NOTIFIER_FREQ=10000:

1. CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC=n

  exec ticks=5258
    nsec=30929
  per ticks=21268
    nsec=125105

2. CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC=y

  exec ticks=3428
    nsec=20164
  per ticks=19203
    nsec=112958

The difference is ~12us!
2024-10-18 10:43:46 +08:00
raiden00pl
b85a5ed306 examples/foc: ignore error for align and ident routines when motor controller disabled
CONFIG_EXAMPLES_FOC_RUN_DISABLE option is used for tests and benchmarks, so we don't
care about wrong results for motor identification and sensor alignment routines
2024-10-18 10:43:46 +08:00
raiden00pl
1aacc99491 examples/foc: print aling results only when verbose output enabled
it is a costly operation that takes a lot of time and is not of much value
2024-10-18 10:43:46 +08:00
raiden00pl
103bf83608 examples/foc: fix option that disable motor controller
fix some compiler error when EXAMPLES_FOC_RUN_DISABLE is enabled
2024-10-18 10:43:46 +08:00
raiden00pl
beeec27afd examples/foc: improve perf monitor
improve FOC perf monitor:

- add options to choose when perf result should be printed
- measure the controller thread call period
2024-10-18 10:43:46 +08:00
raiden00pl
5c166edf63 examples/foc: fix compilation error
fix compilatgion error:

foc_motor_f32.c: In function 'foc_motor_init':
foc_motor_f32.c:1574:7: error: label 'errout' used but not defined
 1574 |       goto errout;
2024-10-18 10:43:46 +08:00
raiden00pl
fc863b6cd0 examples/foc: fix snprintf warning
fix snprintf warning:

    foc_thr.c:110:39: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 7 [-Wformat-truncation=]
      110 |   snprintf(mqname, sizeof(mqname), "%s%d", CONTROL_MQ_MQNAME, envp->id);
          |                                       ^~
    foc_thr.c:110:36: note: directive argument in the range [-2147483648, 0]
      110 |   snprintf(mqname, sizeof(mqname), "%s%d", CONTROL_MQ_MQNAME, envp->id);
          |                                    ^~~~~~
    foc_thr.c:110:3: note: 'snprintf' output between 5 and 15 bytes into a destination of size 10
      110 |   snprintf(mqname, sizeof(mqname), "%s%d", CONTROL_MQ_MQNAME, envp->id);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-10-18 10:43:46 +08:00
jihandong
25937282ed ml: follow nxstyle
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
7d87768f78 ml: a cmdline tool to use tflite-micro.
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
b91adbb9f2 ml: useful tflm debug options
print memory plan, and time cost of each operators.

Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
f2eb5cd3c4 ml: tflite extra hardware support.
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
b15e71cd22 ml: update Makefile
-O3: reduce code size.
-DTF_LITE_STATIC_MEMORY: cause bugs on some cores.
+DTFLITE_EMULATE_FLOAT: robuster to emulate float cucalation by fix-point.
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
c585aa147a ml: clean tflite Makefile
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
958d8e03eb Modify the usage error of neon instruction set
The second argument of vgetq_lane_s32(__a, __b) needs to be initialized before compilation, so unroll the for loop. and correct the passed parameters.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
renzhiyuan1
eb56c62dc9 cmake:add tflite-micro CMake build
Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-18 09:40:17 +08:00
renzhiyuan1
8dfd998db1 cmake:add cmsis-nn CMake build
Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
dda8cab335 ml: tflm mean optimization patch
Separate the Int8 implementation of the 'mean' operator to reduce the code size.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
068b2b16bb ml: tflm quantize optimization patch
Separate the 'Float32 to Int8' implementation of the 'quantize' operator to reduce the code size.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
570102c501 delete the neon conv2D
The complete implementation is placed separately in mLearning/tflite-micro/operators/neon, delete this part.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
14a591fab2 ml: tflm dequantize optimization patch
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
67f495e360 Added Cortex-A compilation environment.
Cortex-A compilation options are added to tflite-micro and cmsis-nn, and new operator compilation environments are configured.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
11519fe1ca Update third-party library version
Tflite-micro, ruy and cmsis-nn need to be updated to a new version.
Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
fb17e33894 Neon optimized Add operator
VELAPLATFO-25411

On the basis of CMSIS-NN, neon was used to optimize the Add operator, which calculates the offset and addition of eight input and output data in one loop.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
a37ca36a8a Neon optimized Conv operator
Based on CMSIS-NN, the Conv operator was optimized. Using Neon acceleration, multiply 8 input data and 8 filter data in a single loop; Using Im2col technology, convert the output data into a matrix, calculate 2 rows of input data and 4 rows of filter data in a single large loop, and obtain 2x4 output data.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
754d9e39a8 TFLM Cortex-A NEON Conv
Use neon to accelerate the conv op, and the output results are the same.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
renzhiyuan1
71cbcb2618 Add configurations files.
Add configuration files of TFLite Micro, its dependent third-party libraries and CMSIS_NN.

Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-18 09:40:17 +08:00
xuxin19
bdfce937e9 remove:flatbuffers,gemmlowp,kissfft,ruy repos
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-18 09:40:17 +08:00
dengwenqi
6b6e0783cf fix: git status/git status --ignore normalization check problem
Signed-off-by: dengwenqi <dengwenqi@xiaomi.com>
2024-10-18 09:40:17 +08:00
dengwenqi
06189b556c fix: git status/git status --ignore normalization check problem
Signed-off-by: dengwenqi <dengwenqi@xiaomi.com>
2024-10-18 09:40:17 +08:00
Lup Yuen Lee
0a4170daf7 CI: Skip jobs arm-08 to arm-14 when a Complex PR is created / updated
When we submit or update a Complex PR that affects All Architectures (Arm, RISC-V, Xtensa, etc): CI Workflow shall run only half the jobs. Previously CI Workflow will run `arm-01` to `arm-14`, now we will run only `arm-01` to `arm-07`.

When the Complex PR is Merged: CI Workflow will still run all jobs `arm-01` to `arm-14`

Simple PRs with One Single Arch / Board will build the same way as before: `arm-01` to `arm-14`

This is explained here: https://github.com/apache/nuttx/issues/14376

Note that this version of `arch.yml` has diverged from `nuttx` repo, since we are unable to merge https://github.com/apache/nuttx/pull/14377
2024-10-18 02:10:17 +02:00
chenzihan1
f426265ab2 testing: mm test will be skipped to prevent memory overflow
In the mm test, if the memory requested this time exceeds 3/4 of the remaining memory,
the request will be skipped to avoid insufficient memory.

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2024-10-17 23:29:41 +08:00
Lup Yuen Lee
4b8375ea95 CI: Disable all jobs for macOS and Windows
This PR disables all CI Jobs for macOS and Windows, to reduce GitHub Cost. Details here: https://github.com/apache/nuttx/issues/14376
2024-10-17 23:22:13 +08:00
zhengyu9
697e3bed0a apps/nshlib/cmd_cd: Modify the logic of cd
Modify the implementation logic of changing directory.
There's an error handling the path incluing "../" or "./"

bug examples:

nsh> cd proc/self/group
nsh> cd ../..
nsh: cd: chdir failed: 2

nsh> pwd
/proc/self
nsh> ls
/proc/self:
 status
 cmdline
 stack
 group/
nsh> cd ./group
nsh: cd: chdir failed: 2

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
2024-10-17 18:06:48 +08:00
yinshengkai
59c21c7aee nsh: support watch command
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-17 18:06:32 +08:00
xuxin19
e558c8e028 build(bugfix):fix Make.dep location missing when specifying PREFIX, hide invalid cp output from ar
PREFIX needs to be added to Make.dep to avoid Make.dep regeneration during incremental compilation
AROBJSRULES is just the .o file in the copy archive. Its output content is worthless, so we hide it by default.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-17 18:06:00 +08:00
wangjianyu3
c5c18a2997 nshlib/cmd_cat: Avoid casting -1 to size_t as count of nsh_write()
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-10-17 08:55:51 +08:00
wanggang26
cb24b748a5 coredump app: type of info->time has changed into timespec
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-17 08:55:22 +08:00
makejian
6588ce4840 apps/mbedtls: add compilation configuration
1.Supplement cmake to compile POLY1305/RIPEMD160/Bignum algorithms
2.Add blowfish and arc4 algorithm configuration

Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-17 08:54:55 +08:00
wangjianyu3
0b727d290b examples/sotest: Correct the path in the log
e.g.
  - ERROR: dlopen(/sotest) failed
  + ERROR: dlopen(/mnt/sotest/romfs/sotest) failed

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-10-17 08:53:49 +08:00
yinshengkai
15b081f02d nshlib: fix top command sorting result error
qsort expects the return value to be -1,0,1

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-17 00:00:51 +08:00
cuiziwei
b022a71480 cxxsize: Updata code size.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-16 17:10:33 +02:00
wangjianyu3
4eba6101b4 module/sotest: Using syslog to print log
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-10-16 21:42:39 +08:00
buxiasen
4285c4df73 nsh/ps: fix -heap cut more than 10MB
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-16 18:23:54 +08:00
anjiahao
6979fca4dc nshlib: Support top command
show thread sort by cpuloading:
use `top [-n <num> ][ -d <delay>] [ -p <pidlist>] [ -h ]`

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-16 18:23:54 +08:00
anjiahao
6951b64038 nshlib: Reconstruct ps command for top command
divide data collection and data output into two parts

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 18:23:54 +08:00
yinshengkai
b90899b1d5 nshlib: ps supports noheap parameter
Obtaining the heap usage size requires traversing all memory.
When the number of threads is large, it will become very slow.

ps -heap
PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK              HEAP  STACK   USED  FILLED COMMAND
  0     0   0 FIFO     Kthread   - Ready              0000000000000000  4338432 2162672 0005196   0.2%  Idle_Task

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-16 18:23:54 +08:00
zhushiqshi
a655e067ef apps: added pid list for ps command.
Signed-off-by: zhushiqshi <zhushiqshi@xiaomi.com>
2024-10-16 18:23:54 +08:00
anjiahao
c98439f9a1 coredump:update memory region init
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 17:34:02 +08:00
wangyingdong
47c8d3734a Fix to compile failure after mqttc is enabled
Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2024-10-16 17:25:46 +08:00
wangyingdong
8eb791763c netutils: introduce libwebsockets support
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-16 17:25:46 +08:00
ouyangxiangzhen
880e2661dc apps/testing: Introduce timerjitter test case
This commit introduces the timerjitter test case, designed for assessing timer accuracy quickly. It is a simplified cyclictest implementation, optimized for fast and effective testing of timer precision.
The program sets up a periodic timer and awaits the firing of SIGALRM. Upon signal arrived, it computes the time difference between consecutive periods. A smaller time difference indicates higher time accuracy.
You can execute timerjitter without passing any arguments. Alternatively, you have the option to pass '-p' to print the time difference after each period, or provide additional arguments to customize the timer interval (in microseconds) and the number of test iterations.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-16 17:09:51 +08:00
chao an
43d634ce00 nsh/fsutils: fix build break if CONFIG_NSH_DISABLE_PKILL not disabled
arm-none-eabi/bin/ld: apps/libapps.a(nsh_proccmds.c.obj): in function `cmd_pkill':
apps/nshlib/nsh_proccmds.c:861:(.text.cmd_pkill+0x38): undefined reference to `nsh_getpid'

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-16 14:32:13 +08:00
pengyaozong
63f43e70a9 add LIBUV_HANDLE_BACKTRACE
Signed-off-by: pengyaozong <pengyaozong@xiaomi.com>
2024-10-16 14:30:34 +08:00
anjiahao
c693b3064e system/coredump:support coredump can save board memory
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 14:22:43 +08:00
anjiahao
9752b57714 system/coredump:upload kernal coredump change
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 14:22:43 +08:00
anjiahao
b99f92bac5 system/coredump:fix coverity bug
check read return, avoid dead loop if read return zero

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 14:22:43 +08:00
anjiahao
03f3ce7fd4 system/coredump:Increase coredump swap buffer size to improve speed
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 14:22:43 +08:00
Xiang Xiao
e96f1ca83a system/ymodem: Change #include <nuttx/mm/circbuf.h> to #include <nuttx/circbuf.h>
follow the change in kernel side change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-16 14:20:34 +08:00
yangguangcai
49941f1d57 cmd_date:Set optind to zero in the error case.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-16 12:40:04 +08:00
anjiahao
8130d7e211 zlib:Support using Kconfig to control memory usage in zlib
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 12:39:47 +08:00
Yongrong Wang
3514c6c704 drivertest/Makefile: add CONFIG_BUILD_FLAT limit for drivertest_block.c
If BUILD_FLAT is not enabled, the app and CPU run in user mode and
kernel mode respectively. The kernel and app are in different
memory address spaces. Different apps are in the same memory address
space. drivertest_block.c cannot directly call the kernel API.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-16 12:34:25 +08:00
Bowen Wang
4af9653b1e nshlib/nsh_parse: support use \\ to pass '\' to argument
Now the nsh can use \\ to pass '\' to the command

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-16 10:21:30 +08:00
anjiahao
bb492e789d sotest & chardev:change elf loading method
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 07:38:06 +08:00
anjiahao
bebb7e9a46 module/sotest:use Compile dynamic modules using a unified compilation method
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 07:38:06 +08:00
anjiahao
293c05b5e6 apps/Makefile:Add a postinstall keyword to do something before compilation is completed and linking begin
It is better to package the dynamic module into romfs after it is compiled.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 07:38:06 +08:00
anjiahao
5debbb8d46 Application.mk:unify module compilation
we can build a module like app,
use 'DYNLIB' mark current path is a loadable module

and CFLAGSELF and CMODFLAGS can act on
these compiled as loadable module

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-16 07:38:06 +08:00
jihandong
eca0928319 cxxtest: optional stream test.
Signed-off-by: jihandong <jihandong@xiaomi.com>
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-16 07:20:47 +08:00
Yongrong Wang
a486129907 testing/drivertest_block.c: Fix cmoka driver block test error
1. Fix the problem that pre->source may have memory stampede
2. Fix total block size larger than cache size condition

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-16 07:18:20 +08:00
yintao
0e519328c8 fstest: Add header to fix build issues
Signed-off-by: yintao <yintao@xiaomi.com>
2024-10-16 07:17:20 +08:00
yintao
2d248c1eaa examples/rpsock: fix redefined warning
CC: rpsock_client.c:41:9: warning: 'ALIGN_UP' macro redefined

Signed-off-by: yintao <yintao@xiaomi.com>
2024-10-16 07:16:07 +08:00
yintao
bfde92a3fd examples/rpmsgsocket: fix build warning
Signed-off-by: yintao <yintao@xiaomi.com>
2024-10-16 07:16:07 +08:00
wanggang26
2de1fdcebd thttpd:fix Coding Style Check Failed issue
error: Mixed case identifier found

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-16 07:13:50 +08:00
ouyangxiangzhen
44d2250b6e apps: Fix compilation error after nuttx/arch.h excluded.
This patch fix compilation error after excluding nuttx/arch.h.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-16 07:12:40 +08:00
Gao Jiawei
30215c260b add test for longjump with 0 as return value
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-10-16 07:12:10 +08:00
yangguangcai
3f08d4f11c rtc: change localtime to gmtime.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-16 07:11:40 +08:00
anjiahao
345e303133 nshlib:Add macro restrictions to code that uses floating point numbers
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 07:11:02 +08:00
zhangwenjian
8e7d6cadf4 support filter for each note channel
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-15 12:34:09 +08:00
yinshengkai
2ea062642f nshlib: Add startup process buried points
Used for system startup time profiling

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-15 12:34:09 +08:00
yinshengkai
bcbd092d3e trace: fix trace dump crash
After thread switching is triggered in an interrupt, two notes will be printed.
If the buffer of 256 is not enough, it will cause overflow.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-15 12:34:09 +08:00
yinshengkai
9c51919a1a libuv:add threadpool DEF_THREADPOOL_PRIORITY
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-15 10:32:08 +08:00
guohao15
be85fab47c libuv:Make libuv use epoll runable without fsnotify
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-15 10:32:08 +08:00
guohao15
ed91a3c03c libuv:change LIBUV_BACKEND_EPOLL depends on FS_NOTIFY
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-15 10:32:08 +08:00
guohao15
4e386a955e system/libuv: optimize stack usage
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-15 10:32:08 +08:00
guohao15
5891f7037b libuv:add inotify test for nuttx
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-15 10:32:08 +08:00
dongjiuzhu1
8b6e63c22d libuv: default select epoll backend in libuv
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-15 10:32:08 +08:00
wangming9
8ed046e2d6 apps/benchmarks/dhrystone: Fix compilation errors
Error details:
dhrystone/v2.2/dry.c:714:3: error: 'Int_2_Loc' may be used uninitialized [-Werror=maybe-uninitialized]
  714 |   fprintf (stderr, "Int_2_Loc:           %d\n", Int_2_Loc);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dhrystone/v2.2/dry.c:543:25: note: 'Int_2_Loc' was declared here
  543 |   REG   One_Fifty       Int_2_Loc;
      |                         ^~~~~~~~~

Signed-off-by: wangming9 <wangming9@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-15 10:31:14 +08:00
chenrun1
bb957498cc cjson_test:add define CONFIG_CJSON_NESTING_LIMIT
Summary:
 Added a limit to CJSON_NESTING_LIMIT. The default value is 1000, which can cause stack overflow in some test cases.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-10-15 00:57:11 +08:00
ligd
0e8a6ee2d2 Revert "add test for longjump with 0 as return value"
This reverts commit 63542f83c2.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-14 13:31:47 +08:00
Xiang Xiao
2eeb750055 Fix telnetd.c:57:5: error: 'CONFIG_SYSTEM_TELNETD_SESSION_STACKSIZE' undeclared
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-14 10:44:40 +08:00
raiden00pl
d9cc2c29f2 github/issue: update bug report template
update bug report template issue so that it better reflects the nuttx-apps repo
2024-10-13 23:30:08 +08:00
raiden00pl
f7f4f77e2e github: add auto labeler for PR
this commit adds initial support for auto labeler for PR
based on https://github.com/actions/labeler
2024-10-13 23:30:08 +08:00
wangjianyu3
2bfe2c2ed0 nshlib: Fix a typo error of redirect
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-10-13 15:48:57 +08:00
wangjianyu3
0f5a786347 nshlib: Fix stack-buffer-overflow of nsh_redirect()
Board/Config/Command
  sim:nsh
  cat < /etc/init.d/rc.sysinit

Problem
  The NSH hangs after exec the test command.
  `nsh_redirect()` needs to save three fd but array length is only two, stack buffer overflowed!

Related: https://github.com/apache/nuttx-apps/pull/2469

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-10-13 15:48:57 +08:00
buxiasen
2429b2ef6a ramspeed: fix -r -w parameter ignored, report align issue
We may want to test ramspeed by specific address, it was previous ignored,
and for the not aligned address from user, just report a error.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-13 11:44:58 +08:00
Gao Jiawei
63542f83c2 add test for longjump with 0 as return value
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-10-13 10:50:58 +08:00
yinshengkai
e9b457fca1 telnet: Configure the telnet session stack to be the same as nsh
Using the default 3K stack size will result in insufficient stack when executing certain commands.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 10:49:46 +08:00
yinshengkai
524eb0880f osperf: changes irq_t to irqstat_t
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 10:49:05 +08:00
yinshengkai
dbef7b5f85 examples: fix usrsocktest compiler warning
error: variable 'ret' set but not used [-Werror=unused-but-set-variable]
   112 |   int ret;

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 10:35:20 +08:00
yinshengkai
427b107dac quickjs: fix mp_mul multiple definition
in function `mp_mul':
apps/interpreters/quickjs/quickjs/libbf.c:1179: multiple definition of `mp_mul';
nuttx/staging/libapps.a:apps/math/libtommath/libtommath/bn_mp_mul.c:8: first defined here

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 10:34:43 +08:00
zhanghu5
5f3e3fe655 fix ECHO problem
only when devfd and stdfd both are tty, we call tcsetattr

Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2024-10-13 10:33:22 +08:00
Marco Casaroli
bc19db2c78 ci: use venv for check
To avoid the following CI error:

This environment is externally managed
--> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.12/README.venv for more information.
2024-10-13 10:17:17 +08:00
xuxin19
131ff36842 build.yml:disable CMake Ninja for Msys2
CI in the msys2 environment, the CMake ninja generator
will have a problem with parameters being too long

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-13 00:39:30 +08:00
getian
d874dc21d1 system/adb: Implement ADB function through qemu pipe (1/3)
Signed-off-by: getian <getian@xiaomi.com>
2024-10-12 10:43:11 +08:00
dongjiuzhu1
6116558842 system/adb: using inotify to check usb hotplug event
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-12 10:43:11 +08:00
dongjiuzhu1
7ab6704920 system/adb: add timer to check usb hotplug event
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-12 10:43:11 +08:00
likun17
af214c507a uORB:Fixed the problem that uorb output cannot wrap after deleting lib_libbsprintf automatic wrapping.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-10-12 10:38:50 +08:00
Yongrong Wang
67fa0e89ff driverteset_block.c: Reduce the stack consumption
1. By reducing the use of local variables geometry
2. Use structure pre_build_s pointers instead of using the
structure directly

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-12 10:36:20 +08:00
likun17
3927b33237 examples/bmi160:bmi160 add urob mode example.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-10-12 10:34:22 +08:00
GUIDINGLI
b7261a0270 Revert "libuv: Remove GCCVER and add compilation options directly."
This reverts commit 13ce4707ff.
2024-10-11 21:44:13 +08:00
ligd
c4f3f05bfa lsan: add system cmd lsan support
The Alsans support for the LeakSanitizer (lsan) memory leak detection tool.

ref:
https://github.com/gcc-mirror/gcc/blob/master/libsanitizer/include/sanitizer/lsan_interface.h

This tool used for runtime check memleak on the SIM platfrom.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 19:39:42 +08:00
Bowen Wang
d0a6dd40c4 coremark/Makefile: avoid crc function multiple definition
/data/project/oh2/rel-4.0/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: crc16_sw.c.data.project.oh2.rel-4.0.external.zblue.zblue_1.o (symbol from plugin): in function `crc16':
(.text+0x0): multiple definition of `crc16'; core_util.c.data.project.oh2.rel-4.0.apps.benchmarks.coremark_1.o (symbol from plugin):(.text+0x0): first defined here

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-11 19:32:58 +08:00
Bowen Wang
6ea8f70ca8 osperf/osperf: move close pipefd after pthread_join
Avoid the new thread write the closed pipe

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-11 19:32:27 +08:00
lipengfei28
f15ed311c0 wapi_json_load: the buf need add null character
sched_backtrace+0xd4/0xfffffffffff444e0
sched_dumpstack+0x5c/0xc50a0
_assert+0x1a0/0x11cf380
__assert+0x28/0x4ebd70
kasan_report+0x280/0x5b0
__asan_loadN+0x234/0xfffffffffffffac0
strlen+0x3c/0x838410
cJSON_Parse+0x38/0x1d0
wapi_json_load+0xc4/0x1c0
wapi_load_config+0x50/0x110600
netinit_associate+0x34/0xfffffffffffffe70
netinit_thread+0xbc/0x18ad0
pthread_startup+0x34/0x11660a0
pthread_start+0x84/0xfffffffffeea2520

If the buf no null character, the strlen acces buf maybe out of bounds

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-11 19:26:44 +08:00
Bowen Wang
6f85062019 nshlib/nsh_parse: support use \" and \' to pass " and ' to arguments
Now we can pass symbol " and ' to the nsh command arguments

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-11 19:22:57 +08:00
Bowen Wang
048f9d7720 system/system: add config SYSTEM_SYSTEM_DUMPINFO
In some cases, applicationes use system() to excute the nsh command,
but it's hard to find out who used the system function to execute
the nsh command, so  add this config to print the call backtrace and
the command content.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-11 19:21:41 +08:00
zhangkai25
3fef38c96d Fix issue with return value not being checked
Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2024-10-11 18:35:27 +08:00
cuiziwei
e50627ecd6 apps/testing:Add c++ STL code size test case.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-11 18:31:14 +08:00
Neo Xu
d91e3db9fd noteprintf: fix compile warnings
noteprintf_main.c:52:7: warning: unused variable 'binary' [-Wunused-variable]
   52 |     } binary =

Fix typo of sched.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-11 18:30:33 +08:00
cuiziwei
13ce4707ff libuv: Remove GCCVER and add compilation options directly.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-11 18:29:40 +08:00
Huang Qi
648e25bac1 examples/pipe: Enhance test by different r/w thread priority
By arranging and combining the priorities of read and write
threads to cover more usage scenarios.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-10-11 18:20:29 +08:00
Bowen Wang
0b8a52379c nsh_syscmds/rpmsg: include <nuttx/rpmsg/rpmsg.h> to fix compile error
nsh_syscmds.c: In function ‘cmd_rpmsg_once’:
nsh_syscmds.c:567:13: error: ‘RPMSGIOC_PANIC’ undeclared (first use in this function)
  567 |       cmd = RPMSGIOC_PANIC;
      |             ^~~~~~~~~~~~~~
nsh_syscmds.c:567:13: note: each undeclared identifier is reported only once for each function it appears in
nsh_syscmds.c:571:13: error: ‘RPMSGIOC_DUMP’ undeclared (first use in this function); did you mean ‘FIOC_DUMP’?
  571 |       cmd = RPMSGIOC_DUMP;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-11 14:59:22 +08:00
Yongrong Wang
568310858b nsh_syscmds.c: upadate rpmsg ping help
1. struct rpmsg_ping_s ack change to cmd;
2. Update the help descrption based on the new cmd
   meaning;

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-11 14:59:22 +08:00
Lup Yuen Lee
eedd71f508 CI: Sync the Build Workflow from nuttx repo
This PR syncs the CI Build Workflow from `nuttx` repo to `nuttx-apps`, with the following updates:
- https://github.com/apache/nuttx/pull/13954
- https://github.com/apache/nuttx/pull/14011
- https://github.com/apache/nuttx/pull/14022

To follow the existing convention, `build.yml` from `nuttx` repo was slightly modified for `nuttx-apps`:
- All References to `apache/nuttx/.../arch.yml` were changed to `apache/nuttx-apps/.../arch.yml`
- Removed `pull_request > paths-ignore` and `push > paths-ignore`
2024-10-11 07:45:36 +02:00
zhangwenjian
9003110d7f libc:getline support backspace
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-11 03:02:23 +08:00
shizhenghui
de8fae7119 nxcodec: fix build warning
nxcodec_main.c:143:37: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘uint32_t’ {aka ‘unsigned int’} [-Wformat=]
  143 |             printf("nxcodec size: %lux%lu\n",
      |                                   ~~^
      |                                     |
      |                                     long unsigned int
      |                                   %u
  144 |                    codec.output.format.fmt.pix.width,
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                               |
      |                                               uint32_t {aka unsigned int}
nxcodec_main.c:143:41: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint32_t’ {aka ‘unsigned int’} [-Wformat=]
  143 |             printf("nxcodec size: %lux%lu\n",
      |                                       ~~^
      |                                         |
      |                                         long unsigned int
      |                                       %u
  144 |                    codec.output.format.fmt.pix.width,
  145 |                    codec.output.format.fmt.pix.height);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                               |
      |                                               uint32_t {aka unsigned int}

Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-10-11 01:28:51 +08:00
shizhenghui
8f50bf3867 nxcodec: add rich debugging logs
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-10-11 01:28:51 +08:00
Windrow14
6bebd1bea1 fsutils/mkmbr/mkmbr.c: fix null pointer access when not all device space is defined in mbr
argv[argn] is accessed out of range when there are neither four partitions are specified nor the last partition is of auto size.
Add a number of partition variable based on input argument number.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-10-10 02:24:58 +08:00
Alin Jerpelea
7cabf00380 canutils/libobd2: replace field ch_unused with ch_tcf
https://github.com/apache/nuttx-apps/pull/2635
replaced ch_unused with ch_tcf

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-10-10 02:24:20 +08:00
yinshengkai
1b27b73a99 system/gprof: Support gprof tool
It can perform statistics on running hot spots or record function calls

arm-none-eabi-gprof nuttx/nuttx gmon.out -b
Flat profile:

Each sample counts as 0.001 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls   s/call   s/call  name
 66.41      3.55     3.55       43     0.08     0.08  sdelay
 33.44      5.34     1.79       44     0.04     0.04  delay
  0.07      5.34     0.00                             up_idle
  0.04      5.34     0.00                             nx_start
  0.02      5.34     0.00                             fdtdump_main
  0.02      5.34     0.00                             nxsem_wait
  0.00      5.34     0.00        1     0.00     5.34  hello_main
  0.00      5.34     0.00        1     0.00     0.00  singal_handler

granularity: each sample hit covers 4 byte(s) for 0.02% of 5.34 seconds

index % time    self  children    called     name
                0.00    5.34       1/1           nxtask_startup [2]
[1]     99.9    0.00    5.34       1         hello_main [1]
                3.55    0.00      43/43          sdelay [3]
                1.79    0.00      44/44          delay [4]
-----------------------------------------------
                                                 <spontaneous>
[2]     99.9    0.00    5.34                 nxtask_startup [2]
                0.00    5.34       1/1           hello_main [1]
-----------------------------------------------
                3.55    0.00      43/43          hello_main [1]
[3]     66.4    3.55    0.00      43         sdelay [3]
-----------------------------------------------
                1.79    0.00      44/44          hello_main [1]
[4]     33.4    1.79    0.00      44         delay [4]
-----------------------------------------------
                                                 <spontaneous>
[5]      0.1    0.00    0.00                 up_idle [5]
-----------------------------------------------
                                                 <spontaneous>
[6]      0.0    0.00    0.00                 nx_start [6]
-----------------------------------------------
                                                 <spontaneous>
[7]      0.0    0.00    0.00                 fdtdump_main [7]
-----------------------------------------------
                                                 <spontaneous>
[8]      0.0    0.00    0.00                 nxsem_wait [8]
-----------------------------------------------
                0.00    0.00       1/1           nxsig_deliver [3553]
[9]      0.0    0.00    0.00       1         singal_handler [9]
-----------------------------------------------

Index by function name

   [4] delay                   [6] nx_start                [9] singal_handler
   [7] fdtdump_main            [8] nxsem_wait              [5] up_idle
   [1] hello_main              [3] sdelay

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-09 23:16:13 +08:00
pengyiqiang
f1fc3616d0 testing/monkey: add screen offset config support
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2024-10-09 22:40:15 +08:00
wangmingrong1
a2964c744d gcov.c: deal compile warming
gcov.c:61:6: warning: 'path' may be used uninitialized [-Wmaybe-uninitialized]
   61 |   if (path == NULL || access(path, F_OK) != 0 || atoi(strip) <= 0)
      |      ^
gcov.c: In function 'gcov_main':
gcov.c:79:19: note: 'path' was declared here
   79 |   FAR const char *path;

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-09 21:27:35 +08:00
yinshengkai
aa9d69e224 system: adjust gcov configuration name
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-09 21:27:35 +08:00
yinshengkai
0f74de57cf system/gcov: supports generating device-side code coverage
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-09 21:27:35 +08:00
xuxin19
faea166566 cmake:add system cdcacm/critmom/stackmonitor missing CMake scripts
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-09 20:15:49 +08:00
xuxin19
190926b467 cmake:add romfs/unionfs/tcpblaster/udpblaster exmaple app CMake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-09 20:15:49 +08:00
zhangjun21
cc200c301c Keep the dhcpv6 renew process name the same in cmake and makefile
Signed-off-by: zhangjun21 <zhangjun21@xiaomi.com>
2024-10-09 20:05:11 +08:00
yinshengkai
1b48055286 system: simplify system/note code
delete the note format. This part has been implemented inside the driver.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-09 13:42:31 +08:00
wangjianyu3
98427f67f1 tools/mksymtab.sh: Add symbol table for modlib
Configs:
  +CONFIG_MODLIB_HAVE_SYMTAB=y

  CONFIG_MODLIB_SYMTAB_ARRAY="g_mod_symtab"
  CONFIG_MODLIB_NSYMBOLS_VAR="g_mod_nsymbols"

Link error:
  LD: nuttx
  aarch64-none-elf-ld: /workspace/nuttx/staging/libc.a(modlib_symtab.o): in function `modlib_getsymtab':
  /workspace/nuttx/libs/libc/modlib/modlib_symtab.c:97:(.text.modlib_getsymtab+0xa0): undefined reference to `g_mod_symtab'
  aarch64-none-elf-ld: /workspace/nuttx/libs/libc/modlib/modlib_symtab.c:97:(.text.modlib_getsymtab+0xa4): undefined reference to `g_mod_symtab'
  aarch64-none-elf-ld: /workspace/nuttx/libs/libc/modlib/modlib_symtab.c:98:(.text.modlib_getsymtab+0xa8): undefined reference to `g_mod_nsymbols'
  aarch64-none-elf-ld: /workspace/nuttx/libs/libc/modlib/modlib_symtab.c:98:(.text.modlib_getsymtab+0xac): undefined reference to `g_mod_nsymbols'

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-10-09 12:15:24 +08:00
yinshengkai
30df081276 examples: fix noteprint compile error
The sched_note_string/bprintf/dump interfaces have been removed and replaced with printf and event

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-08 23:35:46 +08:00
Lars Kruse
d35dd65727 system/dhcp6c: add NET_ICMPv6_AUTOCONF dependency
Previously the build failed if NET_ICMPv6_AUTOCONF was disabled
(due to the missing `netlib_obtain_ipv6addr` symbol).

Closes: #2412
2024-10-08 19:56:50 +08:00
Lup Yuen Lee
a14429296e CI: Sync the Build Workflow from nuttx repo
This PR syncs the CI Build Workflow `build.yml` from `nuttx` repo to `nuttx-apps`. The updated `build.yml` consolidates these changes:
- https://github.com/apache/nuttx/pull/13301
- https://github.com/apache/nuttx/pull/13806
- https://github.com/apache/nuttx/pull/13862

`build.yml` from `nuttx` repo was slightly modified for `nuttx-apps`:
- All References to `apache/nuttx/.../arch.yml` were changed to `apache/nuttx-apps/.../arch.yml` (we decouple them so they are easier to update)
- Removed `pull_request > paths-ignore` and `push > paths-ignore` (following the existing convention)
2024-10-08 18:12:07 +08:00
wangmingrong
cc1c4a3722 examples/romfs: Compilation error after enabling options
Enable CONFIG_PROFIG_EXAMPLES_ROMFS compilation error

Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2024-10-08 14:04:39 +08:00
Lup Yuen Lee
0918826561 CI: Sync the Build Rules from nuttx repo
This PR syncs the Build Rules from `nuttx` to `nuttx-apps` repo. The Build Rules were added to `nuttx` repo here: https://github.com/apache/nuttx/pull/13858
2024-10-08 14:04:23 +08:00
wangmingrong
c2597504e0 nsh: Fix PS printing misalignment
When the stack is allocated in megabytes, printing seven bits of ps will not align

Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2024-10-08 07:58:51 +02:00
Xiang Xiao
c30583dda4 system/adbd: Fix typo error(CONFIG_ADB_SERVER->CONFIG_SYSTEM_ADBD)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-07 21:25:42 +08:00
Xiang Xiao
9b8a02749f net: Remove IFF_DOWN flag to compatible with Linux/*BSD
turn off interface by checking IFF_UP flag isn't set:
https://github.com/apache/nuttx/issues/1838

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-07 20:19:47 +08:00
wangjianyu3
58e5bc7e74 apps/Makefile: Passing extra arguments to mksymtab.sh
https://github.com/apache/nuttx-apps/pull/2637

For example, now can passing file(s) contain additional symbols that may be used in the future to mksymtab.sh by using "-a" option to avoid freuent kernel rebuilds:
SYMTABEXT="-a $(XXXX_PREFIX)/platform/nuttx/exports_xxxx_api.txt"
ifneq ($(CONFIG_LIBM),)
    SYMTABEXT+="-a $(XXXX_PREFIX)/platform/nuttx/exports_xxxx_api_math.txt"
endif

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-10-07 18:55:06 +08:00
wangjianyu3
266049bd11 tools/mksymtab.sh: Using getopts to parse parameters
Use the "-a" option to specify additional lists

Examples
  - The basic.txt
    $ cat basic.txt
    basic_func0
    basic_func1
    basic_func2

  - The additional.txt
    $ cat additional.txt
    additional_func0
    additional_func1
    additional_func2

  1. Get symbols from directory "EMPTY_DIR" and additional list basic.txt
    ./tools/mksymtab.sh ./EMPTY_DIR -a basic.txt
    #if defined(CONFIG_EXECFUNCS_HAVE_SYMTAB)
    const struct symtab_s CONFIG_EXECFUNCS_SYMTAB_ARRAY[] =
    #elif defined(CONFIG_NSH_SYMTAB)
    const struct symtab_s CONFIG_NSH_SYMTAB_ARRAYNAME[] =
    #else
    const struct symtab_s dummy_symtab[] =
    #endif
    {
      {"basic_func0", &basic_func0},
      {"basic_func1", &basic_func1},
      {"basic_func2", &basic_func2},
    };

  2. Get symbols from directory "EMPTY_DIR" and two additional lists basic.txt, additional.txt
    ./tools/mksymtab.sh ./EMPTY_DIR -a basic.txt -a additional.txt
    #if defined(CONFIG_EXECFUNCS_HAVE_SYMTAB)
    const struct symtab_s CONFIG_EXECFUNCS_SYMTAB_ARRAY[] =
    #elif defined(CONFIG_NSH_SYMTAB)
    const struct symtab_s CONFIG_NSH_SYMTAB_ARRAYNAME[] =
    #else
    const struct symtab_s dummy_symtab[] =
    #endif
    {
      {"additional_func0", &additional_func0},
      {"additional_func1", &additional_func1},
      {"additional_func2", &additional_func2},
      {"basic_func0", &basic_func0},
      {"basic_func1", &basic_func1},
      {"basic_func2", &basic_func2},
    };

  3. Set prefix and get symbols from directory "EMPTY_DIR" and two additional lists basic.txt, additional.txt
    ./tools/mksymtab.sh ./EMPTY_DIR PREFIX_TEST  -a basic.txt -a additional.txt
    const struct symtab_s PREFIX_TEST_exports[] =
    {
      {"additional_func0", &additional_func0},
      {"additional_func1", &additional_func1},
      {"additional_func2", &additional_func2},
      {"basic_func0", &basic_func0},
      {"basic_func1", &basic_func1},
      {"basic_func2", &basic_func2},
    };

  4. Error: Missing <imagedirpath>
    $ ./tools/mksymtab.sh
    ERROR: Missing <imagedirpath>

    Usage: ./tools/mksymtab.sh <imagedirpath> [symtabprefix] [-a additionalsymbolspath]

UNSUPPORTED usage examples
  # `getopt` supports these, but the usage in GNU and macOS is incompatible.
  - ./tools/mksymtab.sh ./EMPTY_DIR -a basic.txt PREFIX_TEST -a additional.txt
  - ./tools/mksymtab.sh -a basic.txt ./EMPTY_DIR PREFIX_TEST -a additional.txt

References
  BASH(1)   -- getopts
  GETOPT(1) -- getopt

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-10-07 18:55:06 +08:00
wanggang26
d407670115 resetcause:restore to factory, factory to factory_inquiry
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-07 05:10:19 +08:00
ligd
32e8b8e8ae mps2: add zero-latency-interrupt case on mps2
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-07 05:10:07 +08:00
wanggang26
d5d8e9eacb fix build error:
[linguini@pastabox nuttx]$ make -j
CC:  tcpblaster_server.c
LN: platform/board to
/home/linguini/cuinspace/pico-nuttx/apps/platform/dummy
tcpblaster_server.c: In function ‘tcpblaster_server’:
tcpblaster_server.c:159:14: error: implicit declaration of function
‘accept4’; did you mean ‘accept’? [-Wimplicit-function-declaration]
  159 |   acceptsd = accept4(listensd, (FAR struct sockaddr *)&myaddr,
&addrlen,
      |              ^~~~~~~
      |              accept
make[3]: *** [Makefile:92: tcpblaster_server.hobj] Error 1
make[2]: *** [Makefile:53:
/home/linguini/cuinspace/pico-nuttx/apps/examples/tcpblaster_context]
Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:180: context] Error 2
make: *** [tools/Unix.mk:457:
/home/linguini/cuinspace/pico-nuttx/apps/.context] Error 2
make: *** Waiting for unfinished jobs....

from https://github.com/apache/nuttx-apps/issues/2632

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-05 09:06:43 +08:00
Petro Karashchenko
86f367132a netutils/ptpd: add missing FAR
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-04 08:17:51 +08:00
Petro Karashchenko
66b79a7c89 style: fix indentation issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-04 08:17:51 +08:00
xucheng5
76d419ca45 example/can: replace field ch_unused with ch_tcf
Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2024-10-02 21:22:14 +08:00
anjiahao
c916f163f2 nsh:support wait command to wait task exit.
usage like:
  nsh> sleep 10 &
  [5:100]
  nsh>set pid1=$!
  nsh>sleep 15 &
  [6:100]
  nsh>set pid2=$!
  nsh>wait $pid1 $pid2

'wait' command will block nsh from running until pid1 and pid2 finish.
This is useful for parallel requirements to perform certain tasks

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-02 21:13:54 +08:00
W-M-R
8d1966e9fc kasantest: Fix compilation warning
signed-off-by: W-M-R <Mike_0528@163.com>
2024-10-02 21:10:22 +08:00
wangmingrong1
94a6f1837a kasantest: add CMakeLists.txt
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-02 21:10:22 +08:00
wangmingrong1
1fb3687eaa kasantest.c: fix the size passed by mm_initialize is incorrect
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-02 21:10:22 +08:00
raiden00pl
8fc7004f5b github: sync labels with nuttx repo
sync github lables with main NuttX repo
2024-10-02 20:55:54 +08:00
Petro Karashchenko
4f09da79cf system/uniqueid: remove FAR from int variables
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-02 10:40:05 +02:00
Petro Karashchenko
1dabdfa0ba lte: add missing FAR
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-02 10:40:05 +02:00
Petro Karashchenko
161c996079 apps: use sizeof array in snprintf
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-02 10:40:05 +02:00
dongjiuzhu1
6c88a1ad76 examples/elf/sotest: enable and run them simultaneously
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:53:14 +08:00
dongjiuzhu1
15c90ac17e examples/sotest/elf: rename romfs_img to run test with CONFIG_NSH_ROMFSETC
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:53:14 +08:00
dongjiuzhu1
fdc35d0bad examples/elf: remove unnecessary config CONFIG_EXAMPLES_ELF_DEVPATH
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:53:14 +08:00
dongjiuzhu1
a5516121e2 uorb/flush: support flush operation
After you call orb_flush(), you can determine whether the
flush is completed by listening to the POLLPRI event
of fd and getting the event in orb_get_events.

After calling orb_get_events, the flush events will be cleared.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:48:47 +08:00
dongjiuzhu1
b0b4ac0f39 system/uORB: return subscibe latency/interval
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:48:47 +08:00
dongjiuzhu1
6c237cfbc0 system/uorb: add O_DIRECT to access sensor as wachers
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:48:47 +08:00
dongjiuzhu1
925efc2314 system/uORB: using lib_sprintf to output va_format and printf normal info in aosp adb shell
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:48:47 +08:00
dongjiuzhu1
aa5a38399a system/uorb: fix compile warning
1. add string.h becuase strlen in uORB.c
2. add inttypes.h becuase PRIu64/... in sensor/*.c

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:48:47 +08:00
dongjiuzhu1
686bab3160 system/uorb: fix compile warning
apps/system/uorb/listener.c:543:38:
warning: unused parameter 'file' [-Wunused-parameter]
                           FAR FILE *file)

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:48:47 +08:00
dongjiuzhu1
5732c76f39 system/uorb: fix memory leak report by coverity
nsh> uorb_unit_test
uORB note: try single-topic support
uORB note: PASS single-topic test
uORB note: PASS orb 10-instances
uORB note: try multi-topic support
uORB note: ---------------- LATENCY TEST ------------------
mean:    0 us
std dev: 0 us
min:     0 us
max:     0 us
missed topic updates: 0
uORB note: PASS multi-topic test
uORB note: try multi-topic support subscribing before publishing
uORB note: PASS multi-topic reversed
uORB note: Testing unadvertise
uORB note: Testing multi-topic 2 test (queue simulation)
uORB note: PASS multi-topic 2 test (queue simulation)
uORB note: Testing orb queuing
uORB note:   Testing to write some elements...
uORB note:   Testing overflow...
uORB note:   Testing underflow...
uORB note: PASS orb queuing
uORB note: Testing orb queuing (poll & notify)
PASS

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:48:47 +08:00
dongjiuzhu1
5b729162ad system/uorb: support build in aosp
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:48:47 +08:00
dongjiuzhu1
44239f11ff apps/uorb: change nuttx/list to posix queue
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:48:47 +08:00
yangguangcai
302c1f9dca drivertest_watchdog:change busyloop after capture.
busyloop should be after sem_init and WDIOC_CAPTURE.

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-01 21:55:02 +08:00
yangguangcai
19a63bdc19 watchdog: change usleep to up_udelay.
change uleep to up_udelay prevent system into lower
power mode and watchdog be pause stop count.

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-01 21:55:02 +08:00
yangguangcai
6358b481fb test/watchdog:add test case for capture.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-01 21:55:02 +08:00
yangguangcai
5d9d27d505 drivertest:fix compile error.
arm-none-eabi-ld: /home/ygc/ssd/vela_n62_4.0/nuttx/staging/libapps.a(drivertest_watchdog.c.home.ygc.ssd.vela_n62_4.0.apps.testing.drivertest.o): in function `cmocka_driver_watchdog_main':
/home/ygc/ssd/vela_n62_4.0/apps/testing/drivertest/drivertest_watchdog.c:480: multiple definition of `cmocka_driver_watchdog_main'; /home/ygc/ssd/vela_n62_4.0/nuttx/staging/libapps.a(drivertest_watchdog.c.home.ygc.ssd.vela_n62_4.0.apps.testing.drivertest.o):/home/ygc/ssd/vela_n62_4.0/apps/testing/drivertest/drivertest_watchdog.c:480: first defined here

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-01 21:55:02 +08:00
yangguangcai
d02596835f drivertest/watchdog:add parameter to avoid testing api getstatus.
some vendor hardware not support get watchdog status.

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-01 21:55:02 +08:00
xuxingliang
3eb2124ca9 system/dhcpc: fix cmake program name
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-01 21:50:08 +08:00
xuxingliang
8e6b13489f system/fdt: add cmake support
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-01 21:50:08 +08:00
xuxingliang
9cc9a830eb ostest/smpcall: add smp call from interrupt test
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-01 12:27:25 +08:00
ouyangxiangzhen
34e70e7f0c testing/ostest: Fix timing assertions in wdog_test
This patch removed timing assertions in wdog_test.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-01 11:39:49 +08:00
ouyangxiangzhen
3d6785bcaf testing/ostest: Fix busyloop on tee platform
This patch fixed busyloop on tee platform.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-01 11:39:49 +08:00
ouyangxiangzhen
b01765c57d testing/ostest: Add recursive watchdog callback testcase
This patch added wdog recursive test cases.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-01 11:39:49 +08:00
zhangyuan29
54a8915f29 ostest: test wdog only in flat mode
Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-10-01 11:39:49 +08:00
cuiziwei
e13d37f4d0 ostest:Ignore runtime error.
wdog.c:190:3: runtime error: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long int'
    #0 0x40e35d3a in wdog_test_run /home/cuiziwei/ska/vela/vela-dev2/apps/testing/ostest/wdog.c:190
    #1 0x40e35e75 in wdog_test_thread /home/cuiziwei/ska/vela/vela-dev2/apps/testing/ostest/wdog.c:207
    #2 0x40773ffa in pthread_startup pthread/pthread_create.c:59
    #3 0x4495e037 in pthread_start pthread/pthread_create.c:139
    #4 0x40301864 in pre_start sim/sim_initialstate.c:52

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-01 11:39:49 +08:00
ouyangxiangzhen
cc13d4b742 ostest/wdog: Fix Coverity problems
This patch is to make Coverity happy.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-01 11:39:49 +08:00
ouyangxiangzhen
8c22bb267b testing/ostest: Add wdog_test to ostest
This patch introduces wdog_test, which is used to ensure the functional correctness of the wdog module.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-01 11:39:49 +08:00
Kevin Zhou
23bf7fb449 usbserial: Add config for customize direction, message and wait time 2024-10-01 11:37:45 +08:00
dulibo1
b20f023ab7 pmconfig:fix coverity scan issue which is unsigned_compare
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-30 18:31:03 +08:00
dulibo1
23dd23373d drivertest:add include file depended by cmocka
from the cmocka.h:
 * These headers or their equivalents MUST be included prior to including
 * this header file.
 * @code
 * #include <stdarg.h>
 * #include <stddef.h>
 * #include <stdint.h>
 * #include <setjmp.h>
 * @endcode

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-30 18:31:03 +08:00
dulibo1
b295d5de91 batterydump:move to system dir
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-30 18:31:03 +08:00
dulibo1
46768fc85d gpio:add example for wakeup gpio type
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-30 18:31:03 +08:00
dulibo1
cd9d8bbfa9 test case update follow the regualtor framework
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-09-30 18:31:03 +08:00
xuxingliang
cb812cb2da luasyslog: add cmake support
nsh>
nsh> lua
Lua 5.4.0  Copyright (C) 1994-2020 Lua.org, PUC-Rio
> for k,v in pairs(lsyslog)
>> do
>> print(k,v)
>> end
open    function: 0x402d49c0
FACILITY_LOCAL4 0.0
FACILITY_AUTH   0.0
_COPYRIGHT      Copyright (C) 1994-2021 Nicolas Casalini (DarkGod)
FACILITY_DAEMON 0.0
FACILITY_LOCAL1 0.0
LOG_WARNING     4.0
close   function: 0x402d4990
FACILITY_AUTHPRIV       0.0
LOG_ALERT       1.0
_DESCRIPTION    LuaSyslog allows to use log to an unix Syslog daemon, direct or via LuaLogging
FACILITY_CRON   0.0
FACILITY_FTP    0.0
LOG_DEBUG       7.0
FACILITY_LOCAL0 0.0
LOG_NOTICE      5.0
FACILITY_LOCAL5 0.0
LOG_EMERG       0.0
FACILITY_LPR    0.0
_VERSION        LuaSyslog 2.0.1
FACILITY_LOCAL7 0.0
FACILITY_KERN   0.0
log     function: 0x402d4944
FACILITY_LOCAL2 0.0
LOG_INFO        6.0
FACILITY_NEWS   0.0
FACILITY_LOCAL6 0.0
FACILITY_SYSLOG 0.0
FACILITY_USER   0.0
FACILITY_LOCAL3 0.0
FACILITY_UUCP   0.0
LOG_ERR 3.0
FACILITY_MAIL   0.0
LOG_CRIT        2.0
> lsyslog.log(lsyslog.LOG_EMERG, "Hello")
Hello
>

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-09-30 15:27:03 +08:00
makejian
e42de5d36d mbedtls-alt/bignum: add bignum alternative implementation via /dev/mpi
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-30 15:26:42 +08:00
makejian
194269dbb8 mbedtls-alt/poly1305-alt: add poly1305 alternative implementation
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-30 15:26:42 +08:00
makejian
83d3256f91 mbedtls-alt/ripemd160: add ripemd160 alternative implementation
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-30 15:26:42 +08:00
makejian
4fc6e7ca0c mbedtls-alt/aes-alt: Illegal parameter detection for aes related functions
(1)aes-xts sets the key length to only 256 and 512 bits
(2)when the key length of aes-xts is 512 bits, MAX_KEY_SIZE needs to be expanded to 64 bytes.
(3)check invalid input length and mode

Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-30 15:26:42 +08:00
makejian
b05c967ae6 mbedtls-alt/dev-alt: complement cloning capability
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-30 15:26:42 +08:00
xuxin19
fff767e2ef app build:enhance apps to support independent out-of-tree builds
by defining the `PREFIX` variable and setting it to an external path,
`make -C /some/app` can be called independently to build a separate application out_tree.

modify Make.defs and Application.mk so that their dependent variables can be overwritten.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-30 14:18:08 +08:00
Neo Xu
4a2809ffc0 ostest: fix smp call test
CONFIG_SMP_CALL has been removed from https://github.com/apache/nuttx/pull/13282

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-09-30 14:17:20 +08:00
dongjiuzhu1
97a33e7491 nshlib: support dd with conv=notrunc,nocreat
refs to: https://man7.org/linux/man-pages/man1/dd.1.html

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-30 14:16:40 +08:00
makejian
28aa8a99d0 testing/hash: add hash test case for updating huge block once
The previous test case was relatively small( < 1k), and may only need to do data processing once. The encryption ability of large blocks of data cannot be tested.

Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-30 14:15:21 +08:00
makejian
b9764fd479 testing/aesctr: counter block should be initially set to one.
According to RFC-3686, the least significant 32 bits of the counter block are initially set to one in ctr mode of aes.

Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-30 14:15:21 +08:00
makejian
4cc575ebc5 crypto/libsodium: fix libsodium compilation warning
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-29 22:57:49 +02:00
makejian
ddf9a7a2de system/adb: fix build warning
adb_banner.c:60:47: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]

Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-29 22:33:32 +02:00
wangjianyu3
c9223afe7e tools/mksymtab.sh: Support multiple additional symbols` file
Test
```
  $ cat basic.txt
  test_a
  test_b
  test_c

  $ cat math.txt
  acosf
  asinf
  atan2f
  ceilf
  cosf
  expf

  $ ./mksymtab.sh ./ g_TEST basic.txt
  #include <nuttx/compiler.h>
  #include <nuttx/symtab.h>

  extern void *test_a;
  extern void *test_b;
  extern void *test_c;

  const struct symtab_s g_TEST_exports[] =
  {
    {"test_a", &test_a},
    {"test_b", &test_b},
    {"test_c", &test_c},
  };

  const int g_TEST_nexports = sizeof(g_TEST_exports) / sizeof(struct symtab_s);

  $ ./mksymtab.sh ./ g_TEST basic.txt math.txt
  #include <nuttx/compiler.h>
  #include <nuttx/symtab.h>

  extern void *acosf;
  extern void *asinf;
  extern void *atan2f;
  extern void *ceilf;
  extern void *cosf;
  extern void *expf;
  extern void *test_a;
  extern void *test_b;
  extern void *test_c;

  const struct symtab_s g_TEST_exports[] =
  {
    {"acosf", &acosf},
    {"asinf", &asinf},
    {"atan2f", &atan2f},
    {"ceilf", &ceilf},
    {"cosf", &cosf},
    {"expf", &expf},
    {"test_a", &test_a},
    {"test_b", &test_b},
    {"test_c", &test_c},
  };

  const int g_TEST_nexports = sizeof(g_TEST_exports) / sizeof(struct symtab_s);
```

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-29 22:20:30 +02:00
makejian
c6f00c09c9 mbedtls: 'MBEDTLS_X509_CRT_POOL' depends on 'MBEDTLS_THREADING_C'
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-29 22:09:56 +02:00
makejian
54d388bb64 mbedtls/Kconfig: MBEDTLS_DEBUG_C depends on DEBUG_CRYPTO_INFO
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-29 22:09:56 +02:00
Huang Qi
2ecaf0ec48 examples: Add wamr_module
This example demonstrates how to register a external module
into WAMR runtime.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-28 15:47:40 +08:00
Huang Qi
9320597c00 wamr: Add external module registration mechanism
This patch adds module registration mechanism for WAMR runtime.

To register a module, these steps are required:
1. Include Module.mk in your module's Makefile
2. Define WAMR_MODULE_NAME as the module name
3. Implement bool wamr_module_WAMR_MODULE_NAME_register(void) function in your module's source file
4. Enable INTERPRETERS_WAMR_EXTERNAL_MODULE_REGISTRY in menuconfig

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-28 15:47:40 +08:00
yangguangcai
df4cdbaae9 ntp:fix parameter is negative numbers.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-09-28 13:45:43 +08:00
yangguangcai
fb37ef3671 test timer:change deviation to be pass as parameter.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-09-28 13:45:33 +08:00
anjiahao
5dcfe93a95 nsh:support $! get last pid use nsh run
test:
    nsh> hello &
    hello [4:100]
    nsh> Hello, World!!

    nsh> echo $!
    4
    nsh> echo $!
    3
    nsh> ps
      PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK           STACK COMMAND
        0     0   0 FIFO     Kthread   - Ready              0000000000000000 0069616 Idle_Task
        1     1 224 FIFO     Kthread   - Waiting  Signal    0000000000000000 0067536 loop_task
        2     2 224 FIFO     Kthread   - Waiting  Semaphore 0000000000000000 0067504 hpwork 0x45ae80 0x45aea8
        3     3 100 FIFO     Task      - Running            0000000000000000 0067536 nsh_main
    nsh>

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-09-28 11:28:15 +08:00
anjiahao
55df3019f9 ymodem/sbrb.py:fix a bug sendto not use
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-09-28 11:27:03 +08:00
anjiahao
85ae6f0dfd ymodem:set the transport retry as optional
The waiting duration of the rb/sb command can be determined based on
the number of retransmissions, so that ymodem can restart to the normal
system after running in the bootloader for a short period of time.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-09-28 11:27:03 +08:00
jianglianfang
e4e46c3f53 fb_main: fix draw_rect24
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-09-28 10:51:34 +08:00
yanghuatao
909e479d7f toolchain/ghs: Fix green hills toolchain build Vela warnings
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-09-28 10:47:32 +08:00
makejian
8545512dd7 testing/crypto: add ECDSA P256 testing case for asynchronous call
1. Add asynchronous call test into ecdsa test case.
2. Add command line parameters to facilitate subsequent expansion.
Now can test synchronous call through 'ecdsa -s SECP256R1' and test asynchronous call through 'ecdsa -a SECP256R1'

Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-28 10:46:53 +08:00
chenrun1
06d54466fd coremark:Fix renaming issues with other libraries
The crc16 naming implemented in coremark is duplicated in zblue.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-28 09:35:33 +08:00
Huang Qi
dca6c0cd91 nshlib: Add missing newline in cmd_pidof output
Add newline at the end of cmd_pidof to show nsh
prompt correctly.

Before this patch:
```
nsh> pidof wifi
3 nsh>
```

After:
```
nsh> pidof wifi
3
nsh>
```
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-27 23:24:22 +08:00
likun17
d2214c28c5 uorb:Added 6dof motion and gesture related types.
For details,see: https://developer.android.com/reference/android/hardware/SensorEvent#values

Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-27 13:59:30 +08:00
likun17
b28a4b4ab7 uORB: Add topic information acquisition and setting interface.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-27 13:59:30 +08:00
likun17
bccb6c6b45 uorb:Added urob loop function module and supported epoll.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-27 09:53:06 +08:00
YAMAMOTO Takashi
c03e3d0b9e toywasm: regen
```
REF=d7bb4aaef08be2d7821891f17bd9ef82ac1ba358 ./regen.sh
```
2024-09-27 01:15:04 +08:00
YAMAMOTO Takashi
9656e44c9e toywasm: bump to v63.0.0 2024-09-27 01:15:04 +08:00
wanggang26
eab2cba4a1 enable SOCK_CLOEXEC explicit
leaking here means fork/vfork will duplicate fd without O_CLOEXEC flag
to the child process.

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-26 16:13:29 +08:00
dependabot[bot]
3f0c9306d3 build(deps): bump codelytv/pr-size-labeler from 1.10.0 to 1.10.1
Bumps [codelytv/pr-size-labeler](https://github.com/codelytv/pr-size-labeler) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/codelytv/pr-size-labeler/releases)
- [Commits](https://github.com/codelytv/pr-size-labeler/compare/v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: codelytv/pr-size-labeler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-26 16:12:26 +08:00
likun17
778ae8495b monkey: monkey_log.c add LIBC_PRINT_EXTENSION dependency.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-23 23:13:55 +08:00
likun17
4253d031f0 adb: add LIBC_PRINT_EXTENSION dependency.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-23 23:13:55 +08:00
likun17
97221aa433 uORB: DEBUG_UORB add LIBC_PRINT_EXTENSION dependency.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-23 23:13:55 +08:00
simbit18
27c1720687 build.yml: Workflow aligned with nuttx repo
build.yml: Limit the GitHub Runners

see https://github.com/apache/nuttx/pull/13412
2024-09-23 20:42:10 +08:00
likun17
ac11e3cba9 Adapt the new header file path of va_format.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-23 14:54:06 +08:00
xuxin19
b4d794cbd5 Makefile:complete missing DEPPATH
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-23 08:41:29 +08:00
Michal Lenc
f81a094283 nshlib: add support for pkill command
This command looks through the currently running processes and kills
the those that match the selection criteria. This way system can send
signal to processes by name and without knowing the IDs.

Example (kill application hello):
	pkill -15 hello

The command can be turned off by NSH_DISABLE_PKILL option and depends
on FS_PROCFS.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-09-23 08:40:54 +08:00
wanggang26
767c8ea6ce uorb: enable O_CLOEXEC explicit
to avoid potential fd leak which means fork/vfork will duplicate fd
without O_CLOEXEC flag to the child process.

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-23 08:34:38 +08:00
wanggang26
bae15dfd58 nshlib: enable O_CLOEXEC explicit to avoid potential fd leak
leaking here means fork/vfork will duplicate fd without O_CLOEXEC flag
to the child process.

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-23 08:34:16 +08:00
raiden00pl
f27e755ad7 github/workflows: add PR size labeler
add workflow that assigns labels based on the PR's size
2024-09-23 08:33:33 +08:00
wanggang26
864371cc10 nshlib:enable O_CLOEXEC expliciti to avoid potential fd leak
leaking here means fork/vfork will duplicate fd without O_CLOEXEC flag
to the child process.

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-22 01:44:06 +08:00
likun17
3144c14947 listener.c: Support data saving to csv file.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-21 23:07:33 +08:00
likun17
b428af2cad uORB: Add formatted string ("o_format") parameters and remove callback log ("cb") printing.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-21 23:07:33 +08:00
likun17
296a6b3cac gas.c:Adapt to uORB new macro definition content.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-21 10:55:24 +08:00
Alan Carvalho de Assis
21f5bc9b70 testing/ramtest: Fix not updated CMake file
This issue was preventing ramtest to be displayed into
nsh (this is why all modifications need to be tested!!
"should work" doesn't work).

This is was discovered by user @nonpawite

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-09-20 10:55:06 +08:00
wangjianyu3
b1c4e39205 examples/gps: Add default case for switch-warning of vendor extended sentence
Vendor may add extended sentence may not handled in switch, error if -Werror=switch enabled.
And extended sentence should not added to general examples.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 22:11:39 +08:00
dongjiuzhu1
abdcb33f14 uORB/uORB; using array to save path for sensor_reginfo_s
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-19 11:45:49 +08:00
makejian
9a1a8d3ca3 mbedtls/psa: provides PSA method for using hardware random driver
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-19 08:36:46 +08:00
makejian
96b220659d apps/mbedtls-alt: support cmac
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-19 08:36:46 +08:00
xuxin19
d3942fa1b0 module build:replace BUILD_LOADABLE with MODULES
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-19 08:32:26 +08:00
wangjianyu3
d1fc46d978 tools/mksymtab.sh: Support symbol name overriding
The lines start with "," make no effects(as comments)

e.g.
  $ cat exports.txt | grep atan2
  atan2Override,atan2

  $ /PATH/TO/APPS/tools/mksymtab.sh FOO BAR exports.txt | grep atan2
  extern void *atan2Override;
    {"atan2", &atan2Override},

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:46:46 +08:00
wangjianyu3
7f7ff8c7d4 tools/mksymtab.sh: Support adding additional symbols that are not in undefined list
e.g. For CHRE dynamic nanoapps, pre-saving symbols that may be used later, no need recompiling.

Test: (unique & sorted)
    $ nm ./hello_world.o | grep " U "
             U __aeabi_unwind_cpp_pr1
             U chreGetTime
             U chreGetVersion
             U chreLog
             U __stack_chk_fail
             U __stack_chk_guard

    $ cat additional.txt -n
         1  test_symbol
         2  test_symbol

    $ /PATH/TO/APPS/tools/mksymtab.sh ./hello_world.o MY_PREFIX -a additional.txt
    #include <nuttx/compiler.h>
    #include <nuttx/symtab.h>

    extern void *__aeabi_unwind_cpp_pr1;
    extern void *__stack_chk_fail;
    extern void *__stack_chk_guard;
    extern void *chreGetTime;
    extern void *chreGetVersion;
    extern void *chreLog;
    extern void *test_symbol;

    const struct symtab_s MY_PREFIX_exports[] =
    {
      {"__aeabi_unwind_cpp_pr1", &__aeabi_unwind_cpp_pr1},
      {"__stack_chk_fail", &__stack_chk_fail},
      {"__stack_chk_guard", &__stack_chk_guard},
      {"chreGetTime", &chreGetTime},
      {"chreGetVersion", &chreGetVersion},
      {"chreLog", &chreLog},
      {"test_symbol", &test_symbol},
    };

    const int MY_PREFIX_nexports = sizeof(MY_PREFIX_exports) / sizeof(struct symtab_s);

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:46:46 +08:00
wangjianyu3
da83fa8ab2 tools/mksymtab.sh: Check sed expression
sed: -e expression #1, char 0: no previous regular expression

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:46:46 +08:00
anjiahao
ddaec5f188 apps/tools/mksymtab.sh:When generating symbols, exclude symbols that dynamic modules in bin/ call each other.
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-09-19 03:46:46 +08:00
pengyiqiang
c0d8a07042 lvgl/Makefile: support multiple options for LV_OPTLEVEL
This configuration is added to put LVGL into PSRAM for execution, and the lv_*.o file needs to be matched in the link script. Since LTO optimization will cause the file name to be modified, resulting in a matching failure, it will only take effect if LTO optimization is removed during compilation.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2024-09-19 03:46:34 +08:00
pengyiqiang
eee2a2ef6b lvgl: add customize compilation optimization level config
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2024-09-19 03:46:34 +08:00
wangjianyu3
aaf4e9d480 nshlib: Support "-f" option for command "rm"
In below two cases "rm" command with "-f" option will return 0:
  a. Bad arguments
  b. File not exists

Following "rm" of GNU coreutils 8.32

GNU coreutils
  $ rm --version
  rm (GNU coreutils) 8.32
  Copyright (C) 2020 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.

  Written by Paul Rubin, David MacKenzie, Richard M. Stallman,
  and Jim Meyering.

  $ rm /FILE_NOT_EXISTS
  rm: cannot remove '/FILE_NOT_EXISTS': No such file or directory
  $ echo $?
  1

  $ rm -f
  $ echo $?
  0

  $ rm -f /FILE_NOT_EXISTS
  $ echo $?
  0

Without this patch
  nsh> rm
  nsh: rm: missing required argument(s)

  nsh> rm /FILE_NOT_EXISTS
  nsh: rm: unlink failed: 2
  nsh> echo $?
  1

With this patch
  nsh> rm -f
  nsh> echo $?
  0

  nsh> rm -f /FILE_NOT_EXISTS
  nsh> echo $?
  0

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:45:37 +08:00
wangjianyu3
d94aa77e19 uORB/sensor: Add GNSS Geofence, Measurement & Clock.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:42:31 +08:00
wangjianyu3
ad2514fc6f examples/gps: Fix switch error
Log:
  gps_main.c:83:7: error: enumeration value 'MINMEA_SENTENCE_LOR_LSQ' not handled in switch [-Werror=switch]
     83 |       switch (minmea_sentence_id(line, false))
        |       ^~~~~~

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:42:31 +08:00
wangjianyu3
8764f502d5 testing/sensortest: Rename GPS to GNSS
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:42:31 +08:00
wangjianyu3
2f280f4dc8 uORB/sensor: Rename GPS to GNSS
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:42:31 +08:00
likun17
027ded4d4e sensor:Add sensor gas log output.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-19 03:42:31 +08:00
likun17
d0e15a7450 uorb:Adapt to new macro definition content.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-19 03:42:31 +08:00
wangjianyu3
dae4d7572f module/sotest: Try devminor of romdisk
For case that /dev/ram${EXAMPLES_SOTEST_DEVMINOR}(e.g. /dev/ram0) already exists, and users may not care which device to use.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-18 12:16:02 +08:00
wangjianyu3
758ed55722 examples/sotest: Fix warning of unused variable 'devname'
Config:
  +CONFIG_EXAMPLES_SOTEST=y
  +CONFIG_EXAMPLES_SOTEST_BINDIR="/data"
Log:
  sotest_main.c: In function 'sotest_main':
  sotest_main.c:105:8: error: unused variable 'devname' [-Werror=unused-variable]
    105 |   char devname[32];
        |        ^~~~~~~

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-18 11:36:27 +08:00
wangjianyu3
74b05468d6 module/sotest: Fix depends of SOTEST_BUILTINFS
Log:
  sotest_main.c: In function 'sotest_main':
  sotest_main.c:116:29: error: storage size of 'desc' isn't known
    116 |   struct boardioc_romdisk_s desc;
        |                             ^~~~
  sotest_main.c:116:29: error: unused variable 'desc' [-Werror=unused-variable]
  cc1: all warnings being treated as errors

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-18 11:36:27 +08:00
Huang Qi
140647cf8c Minor code style fixes
Fix issue in these files:
examples/flowc/flowc_mktestdata.c
examples/nxhello/nxhello_listener.c
examples/system/system_main.c
fsutils/passwd/passwd_append.c
graphics/ft80x/ft80x_gpio.c
graphics/pdcurs34/pdcurses/pdc_keyname.c
graphics/pdcurs34/pdcurses/pdc_touch.c
modbus/functions/mbfuncdiag.c

Fixed by AI and checked by manual

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-15 02:27:41 +08:00
wangjianyu3
b5f8520d36 system/adb: Set threashold of syslog device to "1" for polling
Boards may set default(CONFIG_RAMLOG_POLLTHRESHOLD) to a very large value, causes logcat "can not" get poll notify.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 02:26:55 +08:00
ligd
ef95bd8d29 pthread_cleanup: move clenup down to tls
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-14 20:15:31 +08:00
Leandro Zungri
0c734ca62b ppp: Reformat to match nuttx coding style 2024-09-14 13:49:08 +08:00
Leandro Zungri
800b93de9f ppp: Fix wrong lcp_state handling on peer reconnection
If a PPP peer disconnects and then tries to reconnect it will send an 'LCP configure request' packet. The code that handles that scenario seems to be clearing the wrong lcp_state flag (LCP_RX_UP instead of LCP_TX_UP) and thus the nuttx ppp client will keep sending IPCP packets which are rightfully dropped by the new peer since it is still in the LCP negotiation phase.
2024-09-14 13:49:08 +08:00
xuxin19
f96461c385 cmake:refine libyuv CMakeLists
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-13 23:16:26 +08:00
xuxin19
683f25af15 cmake:support romfs prog for SIM CMake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-13 23:16:26 +08:00
xuxin19
cfe229c67f cmake:bugfix fix mbedtls missing source and depend issue
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-13 23:16:26 +08:00
xuxin19
d4becc8e46 cmake:bugfix export uORB headers fix compile error
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-13 23:16:26 +08:00
xuxin19
0fdab21fd9 cmake:sync LIBUV_HANDLE_BACKTRACE fix build break
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-13 23:16:26 +08:00
xuxin19
9b8d8d0c4f cmake:fix testing cxx_main suffix error
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-13 23:16:26 +08:00
xuxin19
3a2b74d701 cmake:port benchmarks to CMake build for testing
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-13 23:16:26 +08:00
xuxin19
3fe177825a cmake:export tinycrypt headers
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-13 23:16:26 +08:00
wangmingrong1
7c94d13be4 kasantest: Add performance testing for Kasan, including pile insertion testing and algorithm testing
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-09-13 23:14:08 +08:00
wangmingrong1
f2c21b11d8 kasantest: Add a test set for global variable out of bounds detection
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-09-13 23:14:08 +08:00
wangmingrong1
277c968b6a kasantest: Add the ability to run a single program
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-09-13 23:14:08 +08:00
wangmingrong1
797fd04796 kasantest: Fix errors running on 64 bit
1. Change 'heap' to a global variable. When using the software tag 'kasan', the base of 'heap' is dynamically changing, which may result in runtime errors
2. Modify the length of the argv array to ensure that all 64 bit addresses can be copied
3. After initialization, the registration of the heap must be canceled

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-09-13 23:14:08 +08:00
yinshengkai
85ad50c39e testing: refactor kasan test
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-13 23:14:08 +08:00
makejian
7cd9919a46 testing/crypto: add rsa testcase
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-13 23:10:19 +08:00
makejian
b1f2e63a6b testing/crypto: Add test cases for Diffie-Hellman algorithm
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-13 23:10:19 +08:00
makejian
ce58e85aa6 testing/crypto: add ecdsa testing
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-13 23:10:19 +08:00
makejian
b53ee36d47 testing/crypto: add aes-128-cmac testcase
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-13 23:10:19 +08:00
makejian
6db82199a6 testing/crypto: add crc32 testcases
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-13 23:10:19 +08:00
yangsen5
524caec5a0 nxcodec: Modify the logic of judging the correctness of the incoming pixformat
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2024-09-13 12:33:45 +08:00
Shoukui Zhang
dad9b5afa3 drivertest: Modify output format
before:
slave size 4slave poll read     0       1       2       3
master write    0       1       2       3

now:
read size = 4
slave poll read         0       1       2       3
master write    0       1       2       3

Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-09-13 12:33:25 +08:00
yuyun1
ed5ca1c512 i2c slave: add i2c slave test code
Signed-off-by: yuyun1 <yuyun1@xiaomi.com>
2024-09-13 12:33:25 +08:00
xuxin19
3d8dc5dce5 cmake:implement CMake build for NuttX Lua interpreter
add CMake module for register lua mod
nsh> lua
Lua 5.4.0  Copyright (C) 1994-2020 Lua.org, PUC-Rio
> hello.say_hello()
Hello World!
> io.write("abs is =",math.abs(-10),"\n")
abs is =10
> os.exit()
nsh>

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-13 12:31:10 +08:00
meijian
1f51bfe64d apps/ipforward: fix ci check failure
note: static declaration of 'chksum' follows non-static declaration

Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 13:38:38 +08:00
meijian
e25f89d2d6 app/netstatistics: Add net statistics api for user
Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 13:38:38 +08:00
meijian
7bf20f1a89 [wireless] add set/get pmksa api for fast-auth
Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 12:43:52 +08:00
meijian
cf7491a1fe [wireless][wapi] add powersave cmd of wapi for Low-power modules
Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 12:43:52 +08:00
meijian
c5541bfb56 [wireless][wapi] add extend api for private needs
Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 12:43:52 +08:00
meijian
002e31c56d apps/dhcpd: fix dhcpd set dip error
dhcpd will set dip routing table 0.0.0.0|0.0.0.0|10.0.0.1 (TARGET|NETMASK|ROUTER) which will cover other's router 0.0.0.0|0.0.0.0|10.1.10.1.
And will cause shell/apps to internet failure.

Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-12 01:11:30 +08:00
wangjianyu3
6b1062a64e system/fastboot: Fix Out-of-bounds Write
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
caa47f282e system/fastboot: Fix that total_chunks of sparse_header maybe error
when size of image passed to command "fastboot flash" is not 4KB aligned.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
a413f6bcac system/fastboot: Fix error that download_size always be zero
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
e6cedb8da7 system/fastboot: Init total_imgsize to zero
otherwise random value, sometimes zero
And, close file if flash failed.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
78c11c31e8 system/fastboot: Fix fd leak of fastboot_filedump_upload()
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
c3488c5b47 system/fastboot: Support upload & oem(memdump, filedump) command
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
22f055472c system/fastboot: Retry if open EP failed
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
wanggang26
e55666f90e fastboot:enable O_CLOEXEC explicit
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
f1ce26162b system/fastboot: Replace printf with syslog
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
anjiahao
53563b67e7 fastbootd:add delay ms for bootloader
usage in bootloader
if [flag == bootloader]
  fastbootd
else
  fastbootd 500
fi

host:
$fastboot flash app app.bin
 < waiting for any device >

let board enter booloader,use <reboot bootloader> or hard reset

then will flash it.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-09-11 23:20:48 +08:00
dongjiuzhu1
95abb3628c system/fastboot: fix crash when free invalid pointer
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
e3400b2555 Reduce the number of open() and close() to improve performance
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
6ac7cbf4d2 system/fastboot: fastboot flash - call fsync()
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
6b53e1fae9 system/fastboot: erase - add driver independent
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
4d0b9d61de system/fastboot: Support USB boardctl
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
1752726479 system/fastboot: Complete the erase command
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
wangjianyu3
25ba30986f fastboot tool: Status read failed while rebooting into bootloader
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-11 23:20:48 +08:00
Huang Qi
0b3e5f2339 .gitignore: Add .aider* to .gitignore
Aider is AI pair programmer: https://aider.chat

The .aider* files is not a part of NuttX but used by
Aider as temporary files.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-11 15:05:56 +08:00
Xiang Xiao
2e01a7c7af Revert "ltp: handle low accuracy of time in some platfrom"
This reverts commit 142df1a001.
2024-09-10 23:33:37 +08:00
dongjiuzhu1
dfa3ce5f5d system/uorb: using uorb.h to replace sensors header file
Sensors are just a part of uORB, and there are many virtual topics used
within uORB as well. For the library apps/system/uorb/, the nuttx/uorb.h
version is more preferable. So, move public type and definition to
nuttx/uorb.h.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-10 15:58:15 +08:00
Luchian Mihai
0a4c97ac09 examples/amg88xx: add example for amg88xx driver
Simple example for the amg88xx driver
2024-09-09 19:45:44 +08:00
Alexey Matveev
0fc0cb2888 Thttpd Fix: wrong calc offset 2024-09-09 19:45:03 +08:00
dependabot[bot]
f4d21b0360 build(deps): bump github/super-linter from 6 to 7
Bumps [github/super-linter](https://github.com/github/super-linter) from 6 to 7.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/super-linter/compare/v6...v7)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 15:29:30 +08:00
dongjiuzhu1
433ca0ff89 testing/fftest: add Force feedback driver test
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-09 14:16:16 +08:00
Huang Qi
2f5dc9c24d system: Rename debug to debugpoint
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-08 21:41:23 +08:00
Huang Qi
c7c76534af testing/debug: Enhancement for watch address by cmd line
This patch add some command line arguments for debug
program, then you can use it to insert watchpoint or
breakpoint to arbitrary address at runtime.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-08 10:39:37 +08:00
ligd
142df1a001 ltp: handle low accuracy of time in some platfrom
some platform use TICK to calculate the time, for example
1tick = 1ms, when the test may run less then 1ms, then gettime()
before + sleep = after

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-07 17:10:48 -03:00
Fukui Daichi
982636ac4a benchmark: Build osperf only when pipes and hpwork are enabled
Building osperf requires pipes and hpwork, which are disabled
by default. These features should be enabled before osperf is
built. The select directive could cause issues and should be
avoided, so we use the depends on directive.

Signed-off-by: Fukui Daichi <a.dog.will.talk@akane.waseda.jp>
2024-09-05 13:52:35 +08:00
wangmingrong
396290962f tests: add kasan test
-u: This option is used to test the use of freed memory
-h: This option is used to test heap memory out-of-bounds access errors.
-g: This option is used to test global variables for out-of-bounds access errors.
-s: This option is used to test the Memory Stampede phenomenon.

Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2024-09-05 09:51:06 +08:00
chao an
8ad39537dd nshlib: move g_builtin_prompt from data to rodata
1. move g_builtin_prompt from data to rodata
2. add g_ prefix to some global variables

Signed-off-by: chao an <anchao@lixiang.com>
2024-09-05 09:49:44 +08:00
hujun5
0b26b04081 ostest: smp_call only valid in FLAT BUILD
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-05 09:47:53 +08:00
Tim Hardisty
4ebd68f7d8 Update settings.c 2024-08-30 21:29:50 +08:00
raiden00pl
d71046c139 examples/nimble: fix example after update to latest master
this example is broken since bc68d954a

since bf76183741
ble_hci_sock_init is called from nimble code, so we can't call it again in example code
2024-08-30 21:29:25 +08:00
renjianguang
246d1d0225 system/nxrecorder: Add opus support in nxrecorder.
Signed-off-by: renjianguang <renjianguang@xiaomi.com>
2024-08-30 01:25:16 +08:00
wurui3
cc17167c7a system/nxrecorder: Add mp3 support in nxrecorder.
add mp3 support in nxrecorder and improve code.

Signed-off-by: wurui3 <wurui3@xiaomi.com>
2024-08-30 01:25:16 +08:00
Michal Lenc
75d5f63f14 can: add support for FD frames if FD mode is configured
This enhances can example application with the possibility to send
CAN FD frames if FD mode is configured. Both EDL and BRS flags are
now correctly set with the latter one configurable with application's
arguments. Also data bytes are now correctly switched to DLC.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-08-30 01:16:04 +08:00
fangpeina
93348ca1ca system/uorb: fix err when using the -n 1 parameter
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-08-27 22:08:31 +08:00
shizhenghui
fd40e25e67 lame: update CMakeLists.txt
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-08-27 22:08:13 +08:00
shizhenghui
cf4847c4fe libmad: Add download libmad.zip to CMakeLists.txt
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-08-27 22:08:13 +08:00
yezhonghui
01964c6460 pci: add pcitest tool
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2024-08-27 22:07:57 +08:00
jianglianfang
73f26ca084 fb: supported bpp = 24
Added new draw_rect24 function to support bpp=24 devices.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-27 02:46:41 +08:00
jianglianfang
2305255373 fb: select the FB_NO_OVERLAY because it will be showed on the main surface
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-27 02:46:41 +08:00
jianglianfang
009fc1a28a fix: uninitialized pointer read
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-27 02:46:41 +08:00
jianglianfang
72e186f64a apps/examples: fb_main need ioctl(FBIOPAN_DISPLAY) to update and adapt to double buffer mode.
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-27 02:46:41 +08:00
gaohedong
481d4b6e23 can: Merge netpacket/can.h into nuttx/can.h
This patch is associated with 'https://github.com/apache/nuttx/pull/13048', so it cannot be verified separately by CI. Please help to associate and review it. Thank you!

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2024-08-26 05:05:41 -04:00
Matheus Catarino
89dd0c29e2 Zig & D examples clean & refactor
dlang: use importC to get NuttX include
zig: leds_zig added
2024-08-26 10:22:16 +08:00
meijian
c91a1817aa netlib/setroute: fix dhcpd stack-overflow when calls netlib_set_dripv4addr with debug info-level
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-26 01:54:46 +08:00
buxiasen
05def1befc testing: add case for irqprio, should only work with qemu MPS2_AN500
MPS2_AN500 have UART1,2,3,4, TIMER0,1, is a great board to do irqprio
test.
enable CONFIG_ARCH_IRQPRIO, and use
'qemu-system-arm -M mps2-an500 -nographic -kernel nuttx.bin'
to lauch qemu

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-08-26 01:52:06 +08:00
zhangkai25
39d053ef74 apps/examples: Add test of edges counting at capture
Description: Add test of the function of counting cap edges

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2024-08-26 01:29:08 +08:00
zhangkai25
4e3f77d884 Fixed the problem of memory trampling caused by not initializing the structure
Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2024-08-24 11:14:47 +08:00
wangzhi16
f638a21f89 [BugFix]Command "critmon" error
Command "critmon" has some format errors and information errors, such as:

PRE-EMPTION CALLER            CSECTION CALLER               RUN         TIME             PID   DESCRIPTION
1.679000000                   3.704000000
                         None None             0     CPU0 IDLE
0.002000000                   0.003000000
                         None None             1     CPU1 IDLE
0.000000000                   0.000000000
                         None None             2     CPU2 IDLE
0.000000000                   0.000000000
                         None None             3     CPU3 IDLE
0.001000000                   0.001000000
                         None None             4     hpwork
0.002000000                   0.006000000
                         None None             5     nsh_main
0.000000000                   0.000000000
                         None None             6     critmon

After bug fix:

PRE-EMPTION CALLER            CSECTION CALLER               RUN              TIME             PID   DESCRIPTION
None                          None                          ---------------- ---------------- ----  CPU 0
None                          None                          ---------------- ---------------- ----  CPU 1
None                          None                          ---------------- ---------------- ----  CPU 2
None                          None                          ---------------- ---------------- ----  CPU 3
None                          None                          0.238000000      6.982000000      0     CPU0 IDLE
None                          None                          0.461000000      13.089000000     1     CPU1 IDLE
None                          None                          0.000000000      0.000000000      2     CPU2 IDLE
None                          None                          0.000000000      0.000000000      3     CPU3 IDLE
None                          None                          0.000000000      0.001000000      4     hpwork
None                          None                          0.000000000      0.010000000      5     nsh_main
None                          None                          0.000000000      0.000000000      46    critmon

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2024-08-24 11:14:06 +08:00
zhangkai25
c2d478a93a apps/testing/drivertest_pwm.c: Fix apps/testing/drivertest_pwm.c compile_error
Description: Divide info.duty into two parts: multi-channel and single-channel

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2024-08-24 11:13:42 +08:00
buxiasen
09b114e884 testing/cpuload: increase thread prio
make simulate load can be more accurate in normal business code.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-08-24 11:12:16 +08:00
buxiasen
fdfb2b2804 cpuload: make load more accurate
The 10 times is too short and can only support 10% step, make cpuload
delay based on 100 times, can decrease the influence of sched cost.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-08-24 11:12:16 +08:00
dulibo1
92b916ab47 cpuload:testing program compile error when use CONFIG_SCHED_CPULOAD_SYSCLK
log:
CC:  setjmp.c cpuload_main.c: In function ‘cpuload_main’:
cpuload_main.c:38:45: error: ‘CONFIG_SCHED_CPULOAD_TICKSPERSEC’ undeclared (first use in this function); did you mean ‘CONFIG_SCHED_CPULOAD_TIMECONSTANT’?
   38 | #define CPULOAD_US          (USEC_PER_SEC / CONFIG_SCHED_CPULOAD_TICKSPERSEC)
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cpuload_main.c:42:35: note: in expansion of macro ‘CPULOAD_US’
   42 | #define CPULOAD_DELAY       (10 * CPULOAD_US)

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-08-24 11:12:16 +08:00
guanyi
60aea922a5 [testcase] add driver pm testcase
Signed-off-by: guanyi <guanyi@xiaomi.com>
2024-08-24 11:08:54 +08:00
zhangshuai39
6d52a0fbc1 netutils/netlib: Encapsulate the dhcp configuration network code and modify at all calling locations
The DHCP configuration network code is called multiple times, so it is encapsulated

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2024-08-23 22:10:04 +08:00
chao an
054edfc653 testing/ostest: add nxevent test into ostest
Signed-off-by: chao an <anchao@lixiang.com>
2024-08-23 22:08:44 +08:00
Matheus Catarino
7c4590b818 hello_swift added
required: swift 6 (embedded module)
2024-08-23 09:04:31 +08:00
yinshengkai
d37b326cb1 ostest: delete the code that accesses the internal fields of mutex
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-23 01:41:35 +08:00
ssssenai
5e5f518822 testing/himem_test: Verify the creation of himem and read/write character devices,
read/write multi block character devices, etc.
2024-08-22 15:18:24 +08:00
shizhenghui
309f42ea21 apps: add lame Makefile & CMakeLists.txt
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-08-22 08:37:03 +02:00
Kevin Zhou
ab67cb1911 examples/usbserial: Check if usbserial device exist before register 2024-08-22 04:28:53 +02:00
yangjianqing
5a04b9a7c9 tcpdump:fix tcpdump stack overflow bug
Signed-off-by: yangjianqing <yangjianqing@xiaomi.com>
2024-08-22 01:28:27 +08:00
zhanghongyu
b883eb5929 mbedtls: fix build error when libcxx is enabled.
if  !defined(unix) && !defined(__unix) && !defined(__unix__) && \
    !defined(__APPLE__) && !defined(_WIN32) && !defined(__QNXNTO__) && \
    !defined(__HAIKU__) && !defined(__midipix__)
error
   "Platform entropy sources only work on Unix and Windows, see MBEDTLS_NO_PLATFORM_ENTROPY in mbedtls_config.h"

nuttx/libs/libxx/libcxx/include/__config
nuttx/libs/libxx/libcxx/include/limits.h:40,
apps/crypto/mbedtls/mbedtls/include/mbedtls/check_config.h:31,
apps/crypto/mbedtls/mbedtls/include/mbedtls/build_info.h:151,
apps/crypto/mbedtls/mbedtls/library/common.h:26,
apps/crypto/mbedtls/mbedtls/library/entropy_poll.c:25

if defined(__NuttX__)
undef __linux__
undef __APPLE__
undef __FreeBSD__
undef __GLIBC__
undef __NetBSD__
undef _WIN32
undef __sun__
undef _AIX
/ For the current use of the __unix__ macro in this library,
/ NuttX is not __unix__.
/ This might need to be revisited in future.
undef __unix__
endif

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-22 01:27:59 +08:00
zhanghongyu
a1dbc8f37d examples/telnetd: fix compile telnetd multi definition error
Compiling system/telnetd and examples/telnetd at the same time could not
generate two builtin commands, Because the name is the same, one will be
overwritten, but there will be no compilation errors.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-21 17:08:07 +08:00
guohao15
909ab76eae app:port stressapptest to nuttx
stressapptest is a userspace test, primarily composed of threads doing memory copies
and directIO disk read/write. It allocates a large block of memory (typically 85% of
the total memory on the machine), and each thread will choose randomized blocks of
memory to copy, or to write to disk. Typically there are two threads per processor,
and two threads for each disk. Result checking is done as the test proceeds by
CRCing the data as it is copied.
https://github.com/stressapptest/stressapptest

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-21 17:07:52 +08:00
yangsen5
c4d97cd8f8 system/nxcamera: add CMakeLists.txt
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2024-08-21 04:27:17 +08:00
wangchen
4940303bd8 util.c:Add mode when creating files in the wapi_save_config
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-08-21 01:28:29 +08:00
cuiziwei
62e2011e48 apps/audioutils:Add libmad library.
libmad0-dev and libmad0-dev cannot be installed simultaneously, which causes conflicts when compiling sim m32 and sim m64. Therefore, the libmad library has been ported to apps/audioutils and will be compiled with NuttX.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-08-21 01:24:44 +08:00
liqinhui
c326677f7a netlib: Delete the redundancy code.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 01:24:29 +08:00
liqinhui
f4141998dd netlib: Use the netlib_add_ipv6addr to set the IPv6 address after obtaining the address.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2024-08-21 01:24:29 +08:00
Daniel Jasinski
7ff3bc4674 build: Fix rpserver and rpproxy CMake builds
argtable3 include directories are appended as NUTTX_INCLUDE_DIRECTORIES
property, symlink creation is no longer needed.

Signed-off-by: Daniel Jasinski <jasinskidaniel95szcz@gmail.com>
2024-08-20 11:25:48 -03:00
cuiziwei
dcf1a05956 fix build warning to [-Wstringop-overflow=].
mbedtls/library/alignment.h:98:5: warning: writing 4 bytes into a region of size 0 [-Wstringop-overflow=]
   98 |     memcpy(p, &x, sizeof(x));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
mbedtls/library/cmac.c: In function 'mbedtls_cipher_cmac_finish':
mbedtls/library/cmac.c:288:19: note: at offset 20 into destination object 'M_last' of size 16
  288 |     unsigned char M_last[MBEDTLS_CIPHER_BLKSIZE_MAX];
      |                   ^~~~~~

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-08-20 15:27:34 +08:00
SPRESENSE
fb17471673 netutils/webclient: Fix the coding style 2024-08-20 15:23:59 +08:00
SPRESENSE
66f6e5f048 netutils/webclient: Fix bug that the socket is not close
Fix to close socket when it fails to resolve hostname.
2024-08-20 15:23:59 +08:00
liuhongchao
913792c7be libyuv: Export libyuv include
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 14:48:50 +08:00
liuhongchao
c054dfef76 libyuv: Add CMake for libyuv
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 14:48:50 +08:00
xuxin19
b79727c985 cmake:change lvgl CMake porting scripts
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-08-20 14:48:50 +08:00
Xu Xingliang
9bffd840b9 lvgl/cmake: export lvgl header
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-08-20 14:48:50 +08:00
Xu Xingliang
5165ad8422 lvgl/cmake: link external library if required
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-08-20 14:48:50 +08:00
pengyiqiang
bdc0c006bd lvgl/Makefile: add LV_SYSMON_GET_IDLE and LV_PROFILER porting
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2024-08-20 13:37:56 +08:00
meijian
a9ff36b2a4 nng/clock: fix the timer clock is affected by UTC update bug
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-19 16:49:57 -03:00
meijian
68577f76f0 netutils/nng: add cmake for nng
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-19 16:49:57 -03:00
meijian
35a26eafea netutils/nng: fix nng compile warnings on some platforms
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-19 16:49:57 -03:00
meijian
8fa5fd8adc netutils: porting NNG-v1.5.2 for nuttx
1.fix build warings
2.add thread name for nuttx
3.add config to set thread stack-size
4.fix urandom memleak

Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-19 16:49:57 -03:00
xuxin19
cfa6c5deb8 Make.dep:ensure that Make.dep in the .depend phase is always regenerated
according to the dependency of the .depend target, Make.dep is always generated additionally when src is modified.
this will cause the Make.dep file to gradually increase in size during each incremental compilation, causing the Makefile to take longer to load.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-08-19 16:48:45 -03:00
xuxin19
6770bcc61d Application.mk:bugfix mkdep result was Overwritten when there are too many files
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-08-19 16:48:45 -03:00
liuhongchao
ad95f7306f apps: Fix input simulates touch reporting error
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 02:51:01 +08:00
liuhongchao
3291c43db3 drivertest: Fix cmocka_driver_framebuffer is not displayed
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 02:50:29 +08:00
liuhongchao
23278f4558 apps/dirvertest: Fix cmocka --list serial port hang
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 02:50:29 +08:00
liuhongchao
7efa80aa51 apps/drivertest: Fix run cmocka_driver_framebuffer No display on the screen
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 02:50:29 +08:00
liuhongchao
0d9b8a8fbf drivertest: Fix run cmocka_driver_touchpanel crash
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 02:50:29 +08:00
liuhongchao
6ec9d880c4 drivertest: Fix No display when running cmocka_driver_framebuffer
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2024-08-20 02:50:29 +08:00
guoshichao
573008244c greenhills: fix the variable unused warning
"nsh_parse.c", line 1565: warning #550-D: variable "quoted" was set but never
          used
    bool quoted;
         ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-20 02:50:13 +08:00
guoshichao
fa22160cb0 apps: update .gitignore rule to exclude "*.inf" file
the "*.inf" file are intermediate compilation output from greenhills
compiler, we do not need to trace these files

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-20 02:50:13 +08:00
guoshichao
7b5e54cd7b ostest/fpu.c: fix the greenhills compile warning
CC:  binfmt_unregister.c "fpu.c", line 98: warning #1160-D: a reduction in alignment without the
          "packed" attribute is ignored
    uintptr_t save1[XCPTCONTEXT_REGS] aligned_data(XCPTCONTEXT_ALIGN);
              ^

"fpu.c", line 99: warning #1160-D: a reduction in alignment without the
          "packed" attribute is ignored
    uintptr_t save2[XCPTCONTEXT_REGS] aligned_data(XCPTCONTEXT_ALIGN);
              ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-20 02:50:13 +08:00
jianglianfang
7abd0a7303 lvgldemo: fix uninit_use_in_call
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-20 02:49:34 +08:00
zhanghongyu
acf9e3679e netutils/iptables: add cmake support.
add cmake support for xtables.c, solves the problem of missing symbols
when compiling with cmake

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-20 02:48:49 +08:00
meijian
2e929bdf15 netutils/mqttc: add cmake support
Signed-off-by: meijian <meijian@xiaomi.com>
2024-08-20 02:48:22 +08:00
zhanghongyu
972594604c libcoap: fix makefile compile error after menuconfig
correct the LIBCOAP_VERSION format

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-20 02:46:43 +08:00
jinxiuxu
8ebab7657f apps/nxplayer: add ioctl stop when play completed
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-20 01:43:20 +08:00
guoshichao
9bfe138087 greenhills: fix the unknow build options warning
CC:  symtab_apps.c ccarm: Warning: Unknown option "-fno-lto" passed to linker
ccarm: Warning: Unknown option "-fno-builtin" ignored.  Did you mean "-fno-common"?

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-18 20:15:10 +08:00
guoshichao
a6094d81bb apps/canutils: fix the build warning on greenhills compiler
CC:  stdlib/lib_srand.c "candump.c", line 231: warning #550-D: variable "ret" was set but never used
  	int opt, ret;
  	         ^

"candump.c", line 101: warning #550-D: variable "cmdlinename" was set but
          never used
  static char *cmdlinename[MAXSOCK];
               ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-18 20:05:46 +08:00
guoshichao
8cb59a75ea ltp: fix the build warning
the warning are:
ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c:163: warning: "NSIG" redefined
  163 | #define NSIG (sizeof(signals)/sizeof(int))
      |
In file included from /home/guoshichao/work_profile/vela_os/vela_ltp_1/nuttx/include/pthread.h:35,
                 from ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c:31:
/home/guoshichao/work_profile/vela_os/vela_ltp_1/nuttx/include/signal.h:53: note: this is the location of the previous definition
   53 | #define NSIG            _NSIG           /* _NSIG variant commonly used */

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-18 20:00:57 +08:00
guoshichao
4e9ae2d45a ltp: fix the link error raised by "proc.h" inclusion error
the link error are:
arm-none-eabi-ld: /home/guoshichao/work_profile/vela_os/vela_ltp_1/nuttx/staging/libapps.a(1-4.c.home.guoshichao.work_profile.vela_os.vela_ltp_1.apps.testing.ltp_3.o): in function `tst_process_state_wait3':
/home/guoshichao/work_profile/vela_os/vela_ltp_1/apps/testing/ltp/ltp/testcases/open_posix_testsuite/include/proc.h:63: multiple definition of `tst_process_state_wait3'; /home/guoshichao/work_profile/vela_os/vela_ltp_1/nuttx/staging/libapps.a(1-3.c.home.guoshichao.work_profile.vela_os.vela_ltp_1.apps.testing.ltp_3.o):/home/guoshichao/work_profile/vela_os/vela_ltp_1/apps/testing/ltp/ltp/testcases/open_posix_testsuite/include/proc.h:63: first defined here

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-18 20:00:57 +08:00
chenrun1
12012f2276 cachespeed:Fixed the problem of printing variables in 32/64-bit environment
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-18 03:14:24 +08:00
chenrun1
57cb20b63a ramtest:Fixed the problem of printing variables in 32/64-bit environment
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-18 03:14:24 +08:00
zhangchao53
204326c236 porting fake function framework 2024-08-17 13:46:03 +08:00
zhangchao53
f841ca16eb enable superpi cmake 2024-08-17 00:08:22 +08:00
Shoukui Zhang
7df20ea1bb nshlib: Optimize the size of the recursive stack
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-08-16 19:48:18 +08:00
zhangshoukui
7503f7bf33 popen: Replace fcntl with ioctl
The fcntl interface sets the O_CLOEXEC property by calling the ioctl interface. Let's call the ioctl interface directly.

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-08-16 19:48:18 +08:00
zhangshoukui
ff85c8c0d9 fstest: If the file is deleted it will not be opened
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-08-16 19:48:18 +08:00
Xin Xu
fe51fed1e6 Revert "cmake:builtin register support NONE srcs target"
This reverts commit bcf655e196.
2024-08-16 15:21:50 +08:00
xuxin19
bcf655e196 cmake:builtin register support NONE srcs target
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-08-15 13:37:24 +08:00
Daniel Jasinski
1fdf13478f build: Missing CMakeLists.txt for bas
This correctly enables BASIC interpreter in CMake based
build for at least sim:bas board configuration.

Signed-off-by: Daniel Jasinski <jasinskidaniel95szcz@gmail.com>
2024-08-11 10:22:34 +08:00
Marco Casaroli
0797ee2312 fix(nsh_parse): handle env variables correctly
The PR #2469 broke handling of environment variables because an
error in the if/else if control flow.

This fixes it.
2024-08-10 11:08:18 -03:00
Marco Casaroli
e46347ec1b nsh_fileapp: handle input redirection 2024-08-08 19:19:18 -03:00
Marco Casaroli
8fba726a7d feat(nsh_cat): allow cat to read from stdin
Now, if we run cat without arguments, it will just read from stdin.

It can be used with redirect like `cat < infile > outfile`.
2024-08-08 19:19:18 -03:00
Marco Casaroli
4104019e1c feat(nsh): add console read
This allows programs such as `cat` to read from the console (that could be redirected).
2024-08-08 19:19:18 -03:00
Marco Casaroli
96100b30f2 feat(nsh): input (stdin) redirection
This adds support for `<` to redirect input on nsh commands.
2024-08-08 19:19:18 -03:00
chenrun1
875f2fcc1e ramspeed:Fix memleak due to double malloc.
if (allocate_rw_address)
    {
      info->dest = malloc(info->size);
      info->src = malloc(info->size);
    }
  if ((info->dest == NULL && !info->allocate_rw_address) || info->size == 0)
    {
      printf(RAMSPEED_PREFIX "Missing required arguments\n");
      goto out;
    }
  else
    {
      /* We need to automatically apply for memory */
      printf(RAMSPEED_PREFIX "Allocate RW buffers on heap\n");
      info->dest = malloc(info->size);
      if (info->dest == NULL)
        {
          printf(RAMSPEED_PREFIX "Dest Alloc Memory Failed!\n");
          goto out;
        }
      info->src = malloc(info->size);
      if (info->src == NULL)
        {
          printf(RAMSPEED_PREFIX "Src Alloc Memory Failed!\n");
          goto out;
        }
    }

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-08 09:51:55 +08:00
chenrun1
e04782816f ramspeed:Add log printing & improve test accuracy & optional test cases
1.Add more print logs

ramspeed -w 0x61ba15c0 -s 524288 -n 10000 -i
RAM Speed: Write address: 0x0x61ba15c0
RAM Speed: Read address: 0x0
RAM Speed: Size: 524288 bytes
RAM Speed: Value: 0x00
RAM Speed: Repeat number: 10000
RAM Speed: Interrupts disabled: true

2.Improve test accuracy, now print in double type in us time unit

______Perform 32 Bytes access______
RAM Speed: system memset():      Rate = 625000.000 KB/s [cost: 0.500 ms]
RAM Speed: internal memset():    Rate = 240384.615 KB/s [cost: 1.300 ms]

3. Optional test item, if we do not pass in the src address, only memset will be executed

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-08 09:51:55 +08:00
chenrun1
3b6f6ab4e6 ramspeed:Fix the mem leak caused by not releasing memory when the task exits under the -a option
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-08 09:51:55 +08:00
chenrun1
c87c7c24a8 iozone:add CMakefile.txt
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 15:59:52 +08:00
chenrun1
09fda56f19 fio:add fio CMakelist.txt
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 15:59:52 +08:00
chenrun1
ffcee721ce nshlib/ddcmd:Fixed NSH_CMDOPT_DD_STATS output format warning in 64-bit environment
In file included from nsh_ddcmd.c:44:
nsh_ddcmd.c: In function 'cmd_dd':
nsh_ddcmd.c:456:20: error: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' {aka 'long unsigned int'} [-Werror=format=]
  456 |   nsh_output(vtbl, "%llu bytes copied, %u usec, ",
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  457 |              total, (unsigned int)elapsed);
      |              ~~~~~
      |              |
      |              uint64_t {aka long unsigned int}
nsh_console.h:55:49: note: in definition of macro 'nsh_output'
   55 | #  define nsh_output(v, ...)   (v)->output(v, ##__VA_ARGS__)
      |                                                 ^~~~~~~~~~~
nsh_ddcmd.c:456:24: note: format string is defined here
  456 |   nsh_output(vtbl, "%llu bytes copied, %u usec, ",
      |                     ~~~^
      |                        |
      |                        long long unsigned int
      |                     %lu
cc1: all warnings being treated as errors

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 15:04:39 +08:00
chenrun1
8c0100b193 dhrystone:Ignore warnings. Warnings have no impact on the program itself.
The function implementation does not specify a return type, and is treated as a void return value function during use, so it is ignored.
CC:  icmpv6_ping.c dhrystone/v2.1/dhry_2.c:30:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
   30 | Proc_6 (Enum_Val_Par, Enum_Ref_Par)
      | ^~~~~~

2. The implementation of some functions is opposite to the calling position, and the processing can be ignored
dhrystone/v2.1/dhry_2.c:39:9: warning: implicit declaration of function ‘Func_3’ [-Wimplicit-function-declaration]
   39 |   if (! Func_3 (Enum_Val_Par))

3. This function is called from dhry_2.c and void behavior is expected.
dhrystone/v2.1/dhry_2.c:30:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
   30 | Proc_6 (Enum_Val_Par, Enum_Ref_Par)

4. In the old version of C language, if the function declaration return value is not set, the default is void; in the new version, it is int, but in dhrystone, these functions are called as void type functions by default.
dhrystone/v2.2/dry.c:738:1: warning: control reaches end of non-void function [-Wreturn-type]
  738 | }
      | ^
dhrystone/v2.2/dry.c: In function ‘Proc_1’:
dhrystone/v2.2/dry.c:772:1: warning: control reaches end of non-void function [-Wreturn-type]
  772 | } /* Proc_1 */
      | ^
dhrystone/v2.2/dry.c: In function ‘Proc_2’:
dhrystone/v2.2/dry.c:795:1: warning: control reaches end of non-void function [-Wreturn-type]
  795 | } /* Proc_2 */
      | ^
dhrystone/v2.2/dry.c: In function ‘Proc_3’:
dhrystone/v2.2/dry.c:810:1: warning: control reaches end of non-void function [-Wreturn-type]
  810 | } /* Proc_3 */
      | ^
dhrystone/v2.2/dry.c: In function ‘Proc_4’:
dhrystone/v2.2/dry.c:822:1: warning: control reaches end of non-void function [-Wreturn-type]
  822 | } /* Proc_4 */
      | ^
dhrystone/v2.2/dry.c: In function ‘Proc_5’:
dhrystone/v2.2/dry.c:831:1: warning: control reaches end of non-void function [-Wreturn-type]
  831 | } /* Proc_5 */
      | ^

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 13:57:15 +08:00
chenrun1
09ec04760f cachetest:Tools for testing cache and uncacheable
Summary:
  A tool is provided to test the case of data correctness after cache flush. It requires an uncacheable offset to check whether the uncacheable address is consistent with the data in the buffer after calling up_dcache_flush.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 10:03:16 +08:00
chenrun1
1d9f045068 testing/memstress:Fix FAR prefix
Summary:
  Add FAR before some pointer declarations

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 10:02:59 +08:00
chenrun1
74a8d98a32 testing/memstress:Support enabling multi-threaded stress testing in the program
Summary:
  Added "-x" to set the number of threads, the default is 1

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-07 10:02:59 +08:00
chenrun1
15ef9781c5 coremark-pro:Ignore the implementation warning
Summary:
  Avoiding warnings caused by source code implementation leads to build failure. Most warnings are undef and the value is 0. We think it is not enabled.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-06 19:30:39 -03:00
chenrun1
f126adb5fc nshlib/fscmds:Fix write overflow during cp -r process
Summary:
      do
        {
          nbyteswritten = write(wrfd, iobuffer, nbytesread);
          if (nbyteswritten >= 0)

The write return type is ssize_t, which is different in size from the originally declared type, so the unified type is ssize_t

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-06 19:30:12 -03:00
chenrun1
2413a2a4c8 testing/memstress:Initialize the pointer to avoid the pointer being unknown when the memory alloc fails
Summary:
  fix warning

In function 'memorystress_iter',
    inlined from 'memstress_main' at memorystress_main.c:475:10:
memorystress_main.c:289:10: error: 'ptr' may be used uninitialized [-Werror=maybe-uninitialized]
  289 |       if (ptr == NULL)
      |          ^
memorystress_main.c: In function 'memstress_main':
memorystress_main.c:248:20: note: 'ptr' was declared here
  248 |       FAR uint8_t *ptr;
      |                    ^~~

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-06 19:29:40 -03:00
Rushabh Gala
437c903c47 examples/leds_rust: Add Rust App for blinking the LED
- This PR adds `examples/leds_rust` to call NuttX POSIX APIs like `open()` and `ioctl()`, so that it blinks an LED
- The `leds_rust` app is also used for testing the GPIO and LED Drivers for Ox64 BL808 SBC and QEMU RISC-V Emulator in Google Summer of Code
- `leds_rust` be executed locally on Linux / macOS / Windows, by commenting out the first 2 lines of code
- The code is based on `examples/leds` in C, and `examples/hello_rust` in Rust

Co-Authored-By: Lup Yuen Lee <9960133+lupyuen@users.noreply.github.com>
2024-08-06 00:26:44 +08:00
simbit18
b4999fa916 Issues: Added Issue templates
**-Template**
 Bug report
Report a bug to improve NuttX stability

Feature request
Request an enhancement for NuttX

General Help
Get general support regarding NuttX

Of course, others can be added. !!! :)

**-Action**
An action for automatically labelling issues

 **Keywords**

Keywords are present in the dropdowns (the user can select more than one option) of the form Bug report and are:

    - Linux, Mac, Windows, Other
    - all, arm, arm64, avr, ceva, hc, mips, misoc, openrisc, renesas, risc-v, simulator, sparc, tricore, x86, x86_64, xtensa, z16, z80
    - Applications, Api, Board support, Build System, Configuring, Debugging, Drivers, File System, Installing, Kconfig, Kernel, Memory Management, Native port, Networking, OS Components, Posix, Sensors, Specific Peripheral

**To work, the labels must have the same name as the keywords !!!**

**So before the merge it is necessary to add them.**

Of course these keywords are examples so you can add, edit or delete them.

[Creating a label](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels#creating-a-label)

see https://github.com/apache/nuttx/issues/12748

none
CI
2024-08-06 00:23:01 +08:00
Yanfeng Liu
ab2e45a86c ostest/fpu_test: enable for FLAT mode only
As per the `HAVE_FPU` in `fpu.c`, fpu_test is only available for
FLAT build. So user_main should enable fpu_test for FLAT build also,
otherwise ostest will fail for PROTECTED build.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-08-03 21:09:33 +08:00
Ville Juven
38ae8e7827 ostest: Enable vfork test for BUILD_KERNEL
The test was disabled because of a bug in the NuttX kernel, which is now
fixed. Obviously depends on the fix.
2024-08-01 23:25:19 +08:00
Denis Ryndine
a15403958d nsh_dd: fix lseek return check.
- As was merged in commit 1852731df8 on
   dd_main.c: lseek returns -1 on error.

   Should be consistent in nsh_ddcmd.c and nsh_main.c.
2024-08-01 09:52:03 +08:00
simbit18
3d8536f380 build.yml: Added jobs to speed up CI checks.
Divided jobs risc-v and xtensa to finish workflow under 2 hours.
2024-07-30 11:15:52 +08:00
Pressl, Štěpán
1a7da54a9b examples/qencoder: obtain samples using the QEIOC_GETINDEX ioctl call
Normally, the qencoder position is obtained using the QEIOC_POSITION
ioctl call. Adding the -i argument uses the QEIOC_GETINDEX to
obtain the qe_index_s struct containing the position alongisde
other fields.

Signed-off-by: Stepan Pressl <pressste@fel.cvut.cz>
2024-07-29 22:28:56 +08:00
simbit18
366d8db436 build.yml: fix error: externally-managed-environment 2024-07-29 22:28:07 +08:00
YAMAMOTO Takashi
9a375abc08 toywasm: regen
```
REF=4db87d399cc871845237557020dae595cd6384dc ./regen.sh
```
2024-07-28 15:52:36 +08:00
YAMAMOTO Takashi
7570eae2ce toywasm: bump to v57.0.0 2024-07-28 15:52:36 +08:00
SPRESENSE
8a82400929 examples/camera: Fix wrong device file path
In camera_main.c, the dev paths of capture_initialize() and open()
are different. So open could always failed.
2024-07-28 15:52:26 +08:00
simbit18
00e77de94f build.yml: Updated the workflow to use version v4 of the actions/upload-artifact and actions/download-artifact
Sync the version of the macOS runner on GitHub with the version used in the nuttx repository.

runs-on: macos-12 -> runs-on: macos-13
2024-07-23 01:30:43 +08:00
Matteo Golin
2fce155def i2ctool dev has a -z option to use a zero-byte write request for
scanning the bus, which allows detection of more sensors such as the
MS5611 and SHT41 to be detected.
2024-07-20 08:51:59 -03:00
YAMAMOTO Takashi
2ef3eb25c0 wamr: add a few missing options to match the wamr repo counterpart 2024-07-18 23:02:20 +08:00
simbit18
c9ce47b33d github/workflows/build.yml: added option -N job docker (Linux)
added option -N Use CMake with Ninja as the backend.

depends on this PR https://github.com/apache/nuttx/pull/12721
2024-07-18 23:00:42 +08:00
shizhenghui
836aecb10d videoutils/x264: clone from github if no x264 source
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-07-17 12:06:51 -03:00
shizhenghui
7704254f68 videoutils/openh264: fix CI error since no sys/sysctl.h
Add sys/sysctl.h to apps/videoutils/openh264

Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-07-17 12:06:51 -03:00
shizhenghui
697aa8f43e apps: move x264 to apps/videoutils/x264
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-07-17 12:06:51 -03:00
shizhenghui
639da1a1d6 openh264: add CMakeLists.txt
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-07-17 12:06:51 -03:00
shizhenghui
def2002dc0 apps: add videoutils to CMakeLists.txt
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-07-17 12:06:51 -03:00
shizhenghui
0ff647af4d apps/openh264: add Makefile
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-07-17 12:06:51 -03:00
shizhenghui
1840668e29 apps/videoutils: add Makefile
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-07-17 12:06:51 -03:00
SPRESENSE
b0cfc93ba7 lte/alt1250: Select NET_USRSOCK_ICMP if LTE_ALT1250 is enabled
The change by https://github.com/apache/nuttx/pull/12639
to enable CONFIG_NET_ICMP as default has made it necessary
to enable CONFIG_MM_IOB which is unnecessary for usrsock.

CONFIG_NET_USRSOCK_ICMP should be enabled if usrsock is used.
2024-07-16 21:46:23 +08:00
Rodrigo Sim
4aea0dff38 examples/telnetd: Add support to reset command
Signed-off-by: Rodrigo Sim rcsim10@gmail.com
2024-07-16 09:06:16 +08:00
YAMAMOTO Takashi
437cf845fa wamr: bump the default version
There is little reason to prefer the ancient version from 2021.
2024-07-15 09:39:26 +08:00
YAMAMOTO Takashi
a0d98f1951 wamr: add an option for exception-handling 2024-07-12 12:08:05 +08:00
YAMAMOTO Takashi
9715b813d3 toywasm: regen for v54.0.0
```
REF=034952e424600381b45d9d400735bfeb96fd5848 ./regen.sh
```
2024-07-12 12:07:44 +08:00
YAMAMOTO Takashi
a9e7b84c81 toywasm: bump to v54.0.0 2024-07-12 12:07:44 +08:00
Denis Ryndine
1852731df8 dd_main.c: Add oseek optional argument.
- If oseek=N passed, will seek N*bs on output file before writing.
2024-07-10 00:16:25 +08:00
shizhenghui
ea64cefa33 nxcodec: improve Kconfig help
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-07-10 00:16:14 +08:00
shizhenghui
ae9f4e2231 nxcodec: update log information
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-07-09 16:32:21 +08:00
yangsen5
69a56e7260 system/nxcodec: modify print usage
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2024-07-09 16:32:21 +08:00
yangsen5
b3a424613b system/nxcodec: add CMakeLists.txt
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2024-07-09 16:32:21 +08:00
yangsen5
9312a74004 add m2m decoder/encoder test
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2024-07-09 16:32:21 +08:00
Alan Carvalho de Assis
6b9d51793f Fix error caused by netinit code assuming CONFIG_NETINIT_DNS was enabled
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-07-07 10:35:49 +08:00
Windrow14
0989d820ed testing/[sd_bench|sd_stress]: make print compatible for both 32-bit and 64-bit environment.
Use size_t and %zu in printf of sd modules to fix compilation errors in 64-bit environment.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-07-04 17:43:32 +08:00
Windrow14
5330306aca testing/smart_test/smart_test.c: fix wrong offset in fseek
To seek to the last 30 bytes of the file, offset from SEEK_END
should be negative.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
2024-07-04 01:12:44 +08:00
raiden00pl
5d779386c8 lpt/Kconfig: hide TESTING_LTP_STACKSIZE option
hide TESTING_LTP_STACKSIZE option when TESTING_LTP=n
2024-07-04 01:12:27 +08:00
Alan Carvalho de Assis
e9f60d85b9 examples/telnetd: Make it clear the goal of this telned
Signed-of-by: Alan C. Assis <acassis@gmail.com>
2024-07-03 17:47:10 +08:00
xuxin19
cbcf9ec168 cmake:add CMake build for libuv
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-06-30 21:40:25 +08:00
xuxin19
8e15514955 cmake:add zlib CMake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-06-30 21:40:25 +08:00
xuxin19
2e133feb09 cmake:support system apps CMake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-06-30 21:40:25 +08:00
Alan Carvalho de Assis
c7072b45bb examples/stepper: Fix typo inside for() loop 2024-06-30 13:29:01 +08:00
xuxin19
20c0a7243c cmake:port testing applications to CMake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-06-29 22:31:03 +08:00
p-szafonimateusz
097ed5c27d oneshot/oneshot_main.c: fix printf warning
fix printf warning in examples/oneshot

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-06-29 11:08:14 -03:00
SPRESENSE
42b16e3004 examples: Remove unnecessary descriptions from Makefile
Remove unnecessary SDKDIR variable from some Makefiles.
And fix audio_rttl to pass cmake build.
2024-06-28 20:17:13 +08:00
SPRESENSE
4957c2be8d lte: Add CMakeLists.txt
Add CMakeLists.txt to lte alt1250 and lapi.
2024-06-28 20:17:04 +08:00
SPRESENSE
97d399dcb8 system/spi: Add CMakeLists.txt
Add CMakeLists.txt to system SPI tool.
2024-06-28 20:17:04 +08:00
SPRESENSE
8cd8866d87 audioutils/fmsynth: Fix CMakeLists.txt
Fix a configuration name used in CMakeLists.txt.
2024-06-28 20:17:04 +08:00
Huang Qi
2e5a269e7f testing: Add simple debug test program
It is a simple test case of the NuttX debugging facilities (breakpoint and watchpoint).

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-06-26 00:19:26 +08:00
Yanfeng Liu
832cd28e52 testing/ostest: fpu.c for rv64ilp32
This revises fpu.c to support rv64ilp32

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-06-24 22:03:58 +08:00
Yanfeng Liu
2a2c5a420e system/telnetd: add CMake script
This adds CMake support for the `telnetd` command

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-06-24 22:03:43 +08:00
buxiasen
cda5140c4d pm_rumtime: test shorten time, make compatible with SMP.
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-06-21 10:20:11 +08:00
Zhe Weng
f620353507 system/iptables: Support ip6tables & filter table
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-06-21 10:16:01 +08:00
Zhe Weng
3022f836dc netlib/ip6tables: Add functions for ip6tables & filter table
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-06-21 10:16:01 +08:00
Zhe Weng
8ae06462eb system/iptables: Support filter table
Add supports for filter table, usage is same as Linux's iptables, including:
- [!] -p/--protocol
- [!] -s/--source -d/--destination
- [!] -i/--in-interface -o/--out-interface
- [!] --sport/--source-port --dport/--destination-port
- [!] --icmp-type

Examples:
> iptables -P FORWARD DROP
> iptables -I INPUT -i eth0 ! -p icmp -j DROP
> iptables -t filter -A FORWARD -p tcp -s 10.0.1.2/24 -d 10.0.3.4/24 -i eth0 -o eth1 --sport 3000:3200 --dport 123:65535 -j ACCEPT
> iptables -t filter -I FORWARD 2 -p icmp ! -s 123.123.123.123 ! -i eth0 -o eth1 ! --icmp-type 255 -j REJECT

> iptables -L
Chain INPUT (policy ACCEPT)
target        prot  idev  odev  source              destination
DROP         !icmp  eth0  any   anywhere            anywhere

Chain FORWARD (policy DROP)
target        prot  idev  odev  source              destination
ACCEPT        tcp   eth0  eth1  10.0.1.2/24         10.0.3.4/24        tcp spts:3000:3200 dpts:123:65535
REJECT        icmp !eth0  eth1 !123.123.123.123/32  anywhere           icmp !type 255

Chain OUTPUT (policy ACCEPT)
target        prot  idev  odev  source              destination

Note:
- We're dropping dependency of argtable3, since it is difficult to support command like '! -p tcp ! -i eth0'

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-06-21 10:16:01 +08:00
Zhe Weng
4283e57013 netlib/iptables: Add functions for filter table
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-06-21 10:16:01 +08:00
Zhe Weng
9fcde632a7 netlib/iptables: Change matching to memcmp all related structs
Compare both the struct ipt_ip, the match and the target, to support
more entry types other than NAT entry.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-06-21 10:16:01 +08:00
raiden00pl
bc68d954ad nimble: update to the latest master 2024-06-20 12:42:41 +08:00
YAMAMOTO Takashi
72150f5035 toywasm: regen
```
REF=b43dd5312988a6dbc2b165c5956697d7f1d16000 ./regen.sh
```
2024-06-19 13:22:04 +08:00
YAMAMOTO Takashi
1b48e80955 toywasm: bump to v48.0.0 2024-06-19 13:22:04 +08:00
raiden00pl
00f9894778 benchmark: update gitignore for superpi and dhrystone
ignore downloaded files for superpi and dhrystone
2024-06-12 23:24:29 +08:00
YAMAMOTO Takashi
364f8cd411 toywasm: regen
```
REF=7c60b048825b821a9398529d3af55514a62a3b7c ./regen.sh
```
2024-06-10 14:26:53 +08:00
YAMAMOTO Takashi
9ce5ebb611 toywasm: Bump to v46.0.0 2024-06-10 14:26:53 +08:00
Matheus Catarino
6db9d5e582 dlang-app added 2024-06-07 03:27:41 +08:00
raiden00pl
b32cf5f0b7 libcurl4nx: fix compilation 2024-06-06 03:21:19 +08:00
raiden00pl
c644ef477b cmake: add missing netlib_set_ipv4dnsaddr.c file 2024-06-06 03:21:19 +08:00
raiden00pl
920bd8fed8 industrial/foc: add dependences to Kconfig 2024-06-06 03:21:19 +08:00
raiden00pl
e9991bc8ec foc_feedforward.c: fix compilation 2024-06-06 03:21:19 +08:00
Tiago Medicci Serrano
3086dcbcf0 Revert "Add loading of ET_DYN shared object test to sotest"
This reverts commit 72eaed8fdd.
2024-05-30 19:13:28 -03:00
Neale Ferguson
72eaed8fdd Add loading of ET_DYN shared object test to sotest
* examples/sotest/lib/Makefile
  - Add dynload directory to build

* examples/sotest/lib/dynload/Makefile
  - Build the dynload shared object test
  - Use SHMODULEFLAGS and not SHLDFLAGS

* examples/sotest/lib/dynload/dynload.c
  - Test case for loading of ET_DYN shared objects

* examples/sotest/lib/dynload/.gitignore
  - Exclude built object from git

* examples/sotest/sotest_main.c
  - Load and invoke the dynload test
2024-05-29 19:17:15 -03:00
Xiang Xiao
2d4233c825 examples/usrsocktest: Fix error: variable 'ret' set but not used
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-05-27 10:30:19 -03:00
YAMAMOTO Takashi
90a745b520 toywasm: regen for v45.0.0
```
REF=9f77f3519f84e9bb0074d855a04d731a5f56ce84 ./regen.sh
```
2024-05-26 00:41:12 +08:00
YAMAMOTO Takashi
edb8138e04 toywasm: enable TOYWASM_ENABLE_WASM_CUSTOM_PAGE_SIZES 2024-05-26 00:41:12 +08:00
YAMAMOTO Takashi
dd03701494 toywasm: bump to v45.0.0 2024-05-26 00:41:12 +08:00
dongjiuzhu1
ee76427938 testing/ostest: temporary remove vfork test on arch/sim
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-05-24 15:41:32 +08:00
Xiang Xiao
f228ee1e4f Fix Error: usrsocktest_basic_connect.c:112:7: error: variable 'ret' set but not used
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-05-23 11:53:26 +08:00
raiden00pl
72635a88ca system: add sensor streaming tool based on nxscope
This tool allows you to send sensor data via the nxscope interface.
Useful when we test sensors or when we just need a tool to visualize
data from sensors.

Works only with the new sensor framework.
2024-05-23 11:50:08 +08:00
raiden00pl
e3110d3ea7 examples/nxscope: add static to private functions 2024-05-23 11:50:08 +08:00
Tiago Medicci Serrano
a09521ed55 system/nxdiag: Remove unnecessary --depth parameter
This commits removes the unnecesary `--depth` parameter: Espressif
common headers do not require it.
2024-05-23 11:49:08 +08:00
hujun5
a9bd4dbe01 Fix compiler errors
taskset.c: In function 'taskset_main':
Error: taskset.c:141:48: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'cpu_set_t' {aka 'long unsigned int'} [-Werror=format=]
  141 |       printf("pid %d's current affinity mask: %x\n", pid, cpuset);
      |                                               ~^          ~~~~~~
      |                                                |          |
      |                                                |          cpu_set_t {aka long unsigned int}
      |                                                unsigned int
      |                                               %lx
cc1: all warnings being treated as errors
make[2]: *** [/github/workspace/sources/apps/Application.mk:271: taskset.c.github.workspace.sources.apps.system.taskset.o] Error 1
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:51: /github/workspace/sources/apps/system/taskset_all] Error 2
make[1]: Target 'all' not remade because of errors.
make: *** [tools/LibTargets.mk:232: /github/workspace/sources/apps/libapps.a] Error 2
make: Target 'all' not remade because of errors.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-05-22 19:09:22 +08:00
Stuart Ianna
8b8094ea35 benchmarks/ramspeed: Don't expose interrupt control with kernel
configuration.

enter_critical_section and leave_critical_section aren't reliable
interfaces to expose in usermode, as they aren't available if
CONFIG_IRQCOUNT is enabled.
2024-05-21 09:05:57 +08:00
Xiang Xiao
ca310eb295 Fix Error: logcat_service.c:69:11: error: variable 'ret' set but not used
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-05-21 08:54:56 +08:00
YAMAMOTO Takashi
a9ab5ec8a6 wamr: rename a few recently-added nuttx options
from:
ARCH_TEXT_HEAP_SEPARATE_DATA_ADDRESS
ARCH_TEXT_HEAP_WORD_ALIGNED_READ

to:
ARCH_HAVE_TEXT_HEAP_SEPARATE_DATA_ADDRESS
ARCH_HAVE_TEXT_HEAP_WORD_ALIGNED_READ
2024-05-21 08:52:46 +08:00
buxiasen
b9a7353a43 add include to handle when PM_NDOMAINS from pm.h
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-05-18 22:08:14 +08:00
Stuart Ianna
cb7dd37f78 system/spi: Set SPI delay characteristics to zero when enabled.
Previously, when delay control was enabled, spi_transfer would pass junk
values down to the underlying driver because these values where not
initialized.

Setting them to zero provides a predictable result considering they are
not controlled by this tool.
2024-05-17 19:01:20 +08:00
yinshengkai
13cc85c055 toywasm: ignore compile warnings
Will cause compilation warning if NDEBUG is defined We can't modify the code of the external library, so let's ignore it

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-05-17 13:41:31 +09:00
SPRESENSE
2ce6be617b testing/ostest: Fix config name
CONFIG_ARCH_HAVE_VFORK -> CONFIG_ARCH_HAVE_FORK
2024-05-16 10:49:22 -03:00
Xiang Xiao
af1071ba5f Revert "system/adb: Ignore warnings for using variables"
This reverts commit d372099242
since the mainline already fix this problem
2024-05-16 10:48:45 -03:00
Xiang Xiao
b00041a9b0 system/adb: Always download the last microADB from github
to get the update automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-05-16 10:48:45 -03:00
YAMAMOTO Takashi
bc68ce993b wamr: tweak the defaults according to the new ARCH kconfig options 2024-05-15 18:41:43 -03:00
simbit18
d0e030ff00 fix nxstyle
fix Relative file path does not match actual file.
2024-05-15 23:53:05 +08:00
YAMAMOTO Takashi
385e2f0904 wamr: remove esp32s3 dependencies from a few options
While they are esp32s3 specific right now,
we can make them more generic later.
2024-05-14 22:07:45 +08:00
YAMAMOTO Takashi
f50fbe78aa wamr: Add a few options for esp32s3
The corresponding WAMR change:
https://github.com/bytecodealliance/wasm-micro-runtime/pull/2348
2024-05-14 22:07:45 +08:00
yinshengkai
aaa835340a mcuboot: Ignore mcuboot compile warnings
Will cause compilation warning if NDEBUG is defined We can't modify the code of the external library, so let's ignore it

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-05-14 22:07:09 +08:00
meijian
8d1bb4cfe8 [app][netlink_route] fix get route netlink bugs
Signed-off-by: meijian <meijian@xiaomi.com>
2024-05-14 22:06:47 +08:00
YAMAMOTO Takashi
02f88fbcaa wamr: flip the default of INTERPRETERS_WAMR_DISABLE_HW_BOUND_CHECK
Also, add a help text to explain the current situation.

cf. https://github.com/bytecodealliance/wasm-micro-runtime/pull/3419
2024-05-14 18:02:44 +08:00
YAMAMOTO Takashi
41f891f9ba toywasm: bump to v44 2024-05-14 00:36:11 +08:00
YAMAMOTO Takashi
649a863d4d toywasm: regen for v44
```
REF=76b9d7088ab321e329b6f958360fb05cebd3df9f ./regen.sh
```
2024-05-14 00:36:11 +08:00
yinshengkai
c9b62db723 nimble: Ignore nimble compile warnings
Will cause compilation warning if NDEBUG is defined We can't modify the code of the external library, so let's ignore it

services/ans/src/ble_svc_ans.c:450:9: error: variable 'rc' set but not used [-Werror=unused-but-set-variable]
  450 |     int rc;
      |         ^~

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-05-13 18:05:26 +08:00
simbit18
a59797bbdd fix nxstyle
fix Relative file path does not match actual file.
2024-05-11 01:20:08 +08:00
yinshengkai
d372099242 system/adb: Ignore warnings for using variables
Will cause compilation warning if NDEBUG is defined
We can't modify the code of the external library, so let's ignore it

microADB/hal/hal_uv_client_usb.c:90:13: warning: unused variable 'ret' [-Wunused-variable]
   90 |         int ret = uv_read_start((uv_stream_t*)&client->pipe,

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-05-11 01:19:42 +08:00
simbit18
94ccbf0577 testing/ramtest/CMakeLists.txt: fix the names of the config entry
CONFIG_SYSTEM_ -> CONFIG_TESTING_
fix Relative file path does not match actual file.
2024-05-11 01:19:27 +08:00
simbit18
3ff320756a benchmarks/cachespeed/CMakeLists.txt: fix the names of the config entry
CONFIG_TESTING_ -> CONFIG_BENCHMARK_
fix Relative file path does not match actual file.
2024-05-10 20:59:08 +08:00
simbit18
2bff210cdf /examples/lp503x: Removed the execute permissions. 2024-05-09 23:47:14 +08:00
Yanfeng Liu
5a0be0fe8c tools/mkimport.sh: enrich help message
This enrichs the help message for `tools/mkimport.sh`

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-05-09 17:29:39 +08:00
zhanghongyu
673dcb8df8 wapi: use strlen to calc the length of ssid
Avoid wrq.u.essid.length being different from the actual length

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-05-08 16:53:19 +08:00
Stuart Ianna
5f166c09be testing/sd_stress: Restrict variable and function scope to file only.
Add the static keyword to required function and variable delcaration to reduce their scope. Stops namespace pollution in CONFIG_BUILD_FLAT.
2024-05-08 16:52:28 +08:00
Stuart Ianna
cc8c3357f1 testing/sd_bench: Restrict variable and function scope to file only.
Add the static keyword to required function and variable delcaration to reduce their scope. Stops namespace pollution in CONFIG_BUILD_FLAT.
2024-05-08 16:52:28 +08:00
zhanghongyu
c6051e4c41 connectedhomeip: supports specifying CHIP_ROOT from the cmake parameter.
support CI compilation for the matter community
https://github.com/project-chip/connectedhomeip/pull/31236

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-05-07 14:53:26 +08:00
Xu Xingliang
943aa68069 apps/lvgl: fix distclean warnings
Cleaning...
find: '/github/workspace/sources/apps/graphics/lvgl/lvgl/src': No such file or directory
find: '/github/workspace/sources/apps/graphics/lvgl/lvgl/src': No such file or directory
find: '/github/workspace/sources/apps/graphics/lvgl/lvgl/src': No such file or directory
find: '/github/workspace/sources/apps/graphics/lvgl/lvgl/demos': No such file or directory
find: '/github/workspace/sources/apps/graphics/lvgl/lvgl/examples': No such file or directory
find: '/github/workspace/sources/apps/graphics/lvgl/lvgl/src': No such file or directory

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-04-30 17:39:07 +08:00
dependabot[bot]
ac93ce58ed build(deps): bump github/super-linter from 5 to 6
Bumps [github/super-linter](https://github.com/github/super-linter) from 5 to 6.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/super-linter/compare/v5...v6)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-30 10:02:07 +08:00
simbit18
dadbea7e3b fix nxstyle
fix Relative file path does not match actual file.
Add missing Apache Foundation copyright header
2024-04-30 00:02:31 +08:00
Xu Xingliang
4b35eec39a apps/lvgl: fix compile warning
Add patch to fix the compile warning, which is already fixed in upstream: https://github.com/lvgl/lvgl/pull/6100

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-04-29 19:33:23 +08:00
p-szafonimateusz
9088634e96 testing/ostest/fpu.c: align FPU context
some architectures requires FPU context to be aligned,
for example x86-64 when used with XSAVE instruction must be aligned to 64

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-29 10:10:07 +08:00
Xu Xingliang
8c7323cc8b examples/lvglterm: upgrade to lvgl v9
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-04-29 10:04:34 +08:00
Neo Xu
c53abc5fdb apps/lvgl: upgrade to lvgl version v9
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-04-29 10:04:34 +08:00
YAMAMOTO Takashi
29028d480b toywasm: Regen
```
REF=aaf74d68b6c57060da62ef9fc056f9f3a776e845 ./regen.sh
```
2024-04-25 13:48:35 +08:00
YAMAMOTO Takashi
f6f996d1f3 toywasm: Bump to v42 2024-04-25 13:48:35 +08:00
Yanfeng Liu
f243dfda79 build/import: matching nuttx/pull/12201
This matches the entry name change in nuttx/pull/12201.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-25 00:55:45 +02:00
Michal Lenc
a9fdc0baea mcuboot: add option to specify MCUboot source git repository
Configuration option MCUBOOT_REPOSITORY adds possibility to configure
MCUboot GIT repository to be downloaded (for specified hash commit or
version). This allows to use different forks and personal repositories.

MCUboot main repository is kept as default option.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-04-24 12:21:40 +08:00
meijian
255df7c01f [ping] fix ping error busyloop add goto wait
Signed-off-by: meijian <meijian@xiaomi.com>
2024-04-22 23:03:39 +02:00
meijian
a7cffe03b5 [ping] fix ping early return when ping is interrupted by ifdown
During a long ping, the tester will repeatedly switch the dev interface on and off.
When the interface is down and ping is in sendto sem_wait state,ifdown will trigger event of sendto and post sem.
in func of sendto_eventhandler:
if ((flags & NETDEV_DOWN) != 0)
{
  nerr("ERROR: Interface is down\n");
  pstate->snd_result = -ENETUNREACH;
  goto end_wait;
}

Signed-off-by: meijian <meijian@xiaomi.com>
2024-04-22 23:03:39 +02:00
meijian
c0c9a6007c [ping] fix ping early return when ping is interrupted by ifdown and poll return
During a long ping, the tester will repeatedly switch the dev interface on and off.
When the interface is down and ping is in poll sem_wait state,ifdown will trigger event of poll and post sem.
The poll will return and revent is 0x18 POLLHUP | POLLERR.Then recvfrom will process and return error to stop ping.
if ((flags & NETDEV_DOWN) != 0)
{
  eventset |= (POLLHUP | POLLERR);
}

Signed-off-by: meijian <meijian@xiaomi.com>
2024-04-22 23:03:39 +02:00
Filipe Cavalcanti
ad7f69d25e Add support for protocol buffers (nanopb)
Adding nanopb download and compilation

Improvements and example running

Working distclean

Check for win/linux/mac
2024-04-22 10:46:39 -03:00
Andre Heinemans
cecc2e762b controlse: add accesslib for the se05x secure element 2024-04-21 11:20:12 +08:00
Andreea Luca
fe12ad9444 examples/mqttc: Add QOS argument option
Add QOS argument option. Users can optionally
change QOS to 0/1/2.
2024-04-20 22:10:50 -03:00
Michael Jung
3dc64d9a26 netutils/dhcp6c: Fix printf-style format strings
Signed-off-by: Michael Jung <michael.jung@secore.ly>
2024-04-20 12:01:19 -03:00
Zhe Weng
43a8e862e0 apps/system: Add conntrack command
A simple tool like Linux's 'conntrack', only supports printing NAT connections now.

nuttx> conntrack -E
    [NEW] icmp  src=192.168.21.66 dst=1.2.3.4 type=8 code=0 id=26739 src=1.2.3.4 dst=192.168.11.1 type=0 code=0 id=26739
    [NEW] tcp   src=192.168.21.66 dst=1.2.3.4 sport=38446 dport=80 src=1.2.3.4 dst=192.168.11.1 sport=80 dport=38446
[DESTROY] icmp  src=192.168.21.66 dst=1.2.3.4 type=8 code=0 id=26739 src=1.2.3.4 dst=192.168.11.1 type=0 code=0 id=26739

nuttx> conntrack -L
tcp   src=192.168.21.66 dst=1.2.3.4 sport=38446 dport=80 src=1.2.3.4 dst=192.168.11.1 sport=80 dport=38446
icmp  src=192.168.21.66 dst=1.2.3.4 type=8 code=0 id=26739 src=1.2.3.4 dst=192.168.11.1 type=0 code=0 id=26739
conntrack: 2 flow entries have been shown.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-18 09:57:01 +08:00
Zhe Weng
7e7b108ef9 netutils/netlib: Add netfilter conntrack functions
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-18 09:57:01 +08:00
simbit18
000a8bcdf1 Fix nuttx coding style
fix
error: Relative file path does not match actual file
error: Long line found
error: Operator/assignment must be preceded with whitespace
error: Missing blank line after comment
2024-04-18 09:56:48 +08:00
Huang Qi
7159f09375 benchmarks: Change options from bool to tristate
This patch changes the enable options of coremark,
coremark-pro and cachespeed from bool to tristate.

This allows the user to select the benchmark to be built
as a elf module, which can be loaded and executed on the
target dynamically.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-04-17 22:47:22 +08:00
zhaoxingyu1
3cbda8a24c mtd_config_fs: support align size test
Originally 1-byte alignment, now supports n-byte alignment

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2024-04-16 19:05:44 +08:00
Alan Carvalho de Assis
b4ec000dec apps/nsh_commands: Use quit to poweroff
Currently new users when try to run NuttX using the SIM
get stuck into simulator, because they have no idea that
poweroff command is used to leave it. Let use KISS approach
and use quit as an alias to poweroff command.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-04-13 15:17:50 +08:00
Xiang Xiao
9d67f38062 canutils: Fix minor style issue found in canlib
no functional change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-04-12 15:48:21 -03:00
GC2020
f633d11b63 examples/pipe:removes useless data from test cases 2024-04-10 23:12:10 +08:00
simbit18
7e30c0e4c9 Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
Add comments
2024-04-09 08:16:40 +02:00
chao an
78a8dd27c9 Revert "testing/ostest/cancel: joining a detached/canceled thread should return EINVAL, not ESRCH"
This reverts commit 69e497f681.

In order to ensure the detached thread obtain the correct return
value from pthread_join()/pthread_cancel(), the detached thread
will create joininfo to save the detached status after thread
destroyed.  If there are too many of detached threads in the
process group, the joininfo will consume too much memory.
This is not friendly to embedded MCU devices.
This commit keep the semantics as #11898 was introduced,
will no longer save joininfo for detached threads to avoid wasting memory.

Refer PR:
https://github.com/apache/nuttx/pull/12106

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-09 13:45:39 +08:00
pengyiqiang
92d922a108 testing/monkey: fix unsigned zero comparison
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2024-04-08 14:32:08 +08:00
chenrun1
da0c870b94 dhrystone:Add dhrystone download link
Source Code:https://github.com/Keith-S-Thompson/dhrystone

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-04-08 14:11:31 +08:00
chenrun1
e9172a3195 fio:Added fio download link and corresponding fix patch
Source code:https://github.com/ldorau/fio

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-04-08 14:11:31 +08:00
chenrun1
b1e8fc784f coremark-pro:Added coremark-pro download link.
Source Code:https://github.com/eembc/coremark-pro

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-04-08 14:11:31 +08:00
chenrun1
270fa07cbd benchmarks:Move the performance tools to benchmark.
1.dhrystone
2.fio
3.coremark-pro

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-04-08 14:11:31 +08:00
chenrun1
e6c3930b2d apps:Move the performance tools to benchmark.
1.ramspeed
2.cachespeed
3.osperf
4.iozone
5.superPI

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-04-08 14:11:31 +08:00
simbit18
4d6f4d00b0 Minor improvement for tools/ci: Fixed cmake build of bloaty and installation in darwin.sh script.
function bloaty() Add  -D CMAKE_INSTALL_PREFIX="${NUTTXTOOLS}"/bloaty.
Improves workflow execution time because it is now cached.

Changed reference file to calculate the hash for key of actions/cache@v4. Now it is darwin.sh.
2024-04-07 22:09:28 +02:00
Alan Carvalho de Assis
8d14f4eaac apps/nshlib: Never disable HELP and ? 2024-04-06 13:34:56 +08:00
xuxin19
77a1599e44 cmake:migrate wamr to CMake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-04-04 12:09:26 +08:00
zhangchao53
322ce121a2 ignore zip file
Signed-off-by: zhangchao53 <zhangchao53@xiaomi.com>
2024-04-04 12:07:21 +08:00
xuxin19
96baf98862 Make.defs:make all AROBJS and OBJS batch cleaned in Application
application `OBJS` clean call `CLEAN` macro defined in nuttx/tools/Config.mk
variables are expand directly within the marco, that has potential issue
this patch clean and reset these variables

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-04-02 17:04:02 -03:00
chao an
20c90d5b43 nshlib/irqaff: add irq affinity command
add support for set an IRQ affinity to CPUs by software

qemu-armv7a/bmp: switch uart irq to different CPUs

nsh> ps
  PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK           STACK   USED  FILLED COMMAND
    0     0   0 FIFO     Kthread   - Ready              0000000000000000 004080 000536  13.1%  CPU0 IDLE
    1     1 192 RR       Kthread   - Waiting  Semaphore 0000000000000000 004032 000296   7.3%  hpwork 0x4013f51c 0x4013f530
    2     2 100 RR       Task      - Running            0000000000000000 004056 001168  28.7%  nsh_main
nsh> irqaff 33 0x2
nsh> ps
  PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK           STACK   USED  FILLED COMMAND
    0     0   0 FIFO     Kthread   - Ready              0000000000000000 004080 000736  18.0%  CPU1 IDLE
    1     1 192 RR       Kthread   - Waiting  Semaphore 0000000000000000 004032 000296   7.3%  hpwork 0x4013f544 0x4013f558
    2     2 100 RR       Task      - Running            0000000000000000 004056 001288  31.7%  nsh_main
nsh> irqaff 33 0x4
nsh> ps
  PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK           STACK   USED  FILLED COMMAND
    0     0   0 FIFO     Kthread   - Ready              0000000000000000 004080 000736  18.0%  CPU2 IDLE
    1     1 192 RR       Kthread   - Waiting  Semaphore 0000000000000000 004032 000296   7.3%  hpwork 0x4013f56c 0x4013f580
    2     2 100 RR       Task      - Running            0000000000000000 004056 001168  28.7%  nsh_main
nsh> irqaff 33 0x8
nsh> ps
  PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK           STACK   USED  FILLED COMMAND
    0     0   0 FIFO     Kthread   - Ready              0000000000000000 004080 000736  18.0%  CPU3 IDLE
    1     1 192 RR       Kthread   - Waiting  Semaphore 0000000000000000 004032 000296   7.3%  hpwork 0x4013f594 0x4013f5a8
    2     2 100 RR       Task      - Running            0000000000000000 004056 001168  28.7%  nsh_main

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-29 16:16:07 +08:00
vela-mib
84e186c9d1 fix build warning for kernel testsuites
Signed-off-by: vela-mib <vela-mib@xiaomi.com>
2024-03-28 18:18:58 +08:00
zhanghongyu
e2805fc9c4 matter: use a fixed version of pigweed
Otherwise, the compilation may fail due to changes in the pigweed code

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-03-26 01:19:37 +08:00
raiden00pl
12f91b7cee cmake: add support for Unity 2024-03-23 22:12:46 +01:00
vela-mib
74cf82f995 fix build warning for kernel testsuites
Signed-off-by: vela-mib <vela-mib@xiaomi.com>
2024-03-22 18:39:15 +08:00
Saurav Pal
f4092962df apps/testing/nand_sim: Adds NAND virtual device.
Adds a NAND virtual device daemon.

Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
2024-03-21 22:46:49 +08:00
Adam Comley
c15a6970c9 Derive MAC Address from board unique_id 2024-03-21 22:46:28 +08:00
rushabhvg
b311c46778 apps/examples/hello_rust/Makefile: Add -O flag 2024-03-21 22:45:33 +08:00
Sebastien Lorquet
8cb0bf3eab dhcpc: reset the state of the "cancel" variable when restarting the async dhcpc thread. 2024-03-20 02:25:33 +08:00
Huang Qi
c138651300 tools: New CMake based Wasm build system
Introduce a new CMake based build system for Wasm.
And target the Wasm ABI to wasm32-wasi, it should
be a more commnly used and standard ABI for Wasm.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-03-15 11:15:25 -03:00
Juha Niskanen
ec4d7a19f7 ostest: add test for libc memmem() function
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2024-03-15 19:46:42 +08:00
zhangchao53
5519de826f fix compile error: list_initialize
Signed-off-by: zhangchao53 <zhangchao53@xiaomi.com>
2024-03-15 19:46:00 +08:00
xuxin19
38d30f9984 matter cmake:fix matter_generate_args_tmp_file call error
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-03-15 01:26:22 +08:00
chao an
69e497f681 testing/ostest/cancel: joining a detached/canceled thread should return EINVAL, not ESRCH
Reference:
https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_join.html
  [EINVAL]
    The value specified by thread does not refer to a joinable thread.

https://docs.oracle.com/cd/E19120-01/open.solaris/816-5137/tlib-25/index.html

  EINVAL
    The thread corresponding to the given thread ID is a detached thread.

https://linux.die.net/man/3/pthread_join

  EINVAL
    thread is not a joinable thread.

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-13 18:06:36 +09:00
shizhenghui
a00ba19eb4 camera_example: modify initialize interface after v4l2 refactor
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-03-13 09:50:58 +08:00
Juha Niskanen
767642b4ea testing/getprime: allow running with zero threads
getprime can now run without creating any additional threads. This helps
testing pthreads and measuring performance of directly searching primes
from main thread versus creating one thread.

Also don't misuse ASSERT() for checking command-line input coming
from user.

Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2024-03-12 19:40:17 +08:00
vela-mib
fec49af501 add cm_fs_test source code
Signed-off-by: vela-mib <vela-mib@xiaomi.com>
2024-03-11 11:24:13 +08:00
yinshengkai
663b54e833 database: fix compile failure 2024-03-05 13:46:01 +08:00
yinshengkai
c8e0d7a02c database: add sqlite support
enable UTILS_SQLITE configuration, use the sqlite3 command line tool

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-03-04 15:34:33 -03:00
Xiang Xiao
110fa8264d ci: Remove the codecheck from build.yml
the check isn't really enabled and enforce before
due to a mass of false alarm, but recently it break
ci frequently, so it's better to remove it now.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-04 12:17:44 +08:00
Xiang Xiao
30b3744b4e Ignore all *.lock in apps folder
to fix the ci break reported by:
https://github.com/apache/nuttx/actions/runs/8124056482/job/22205151164?pr=11829

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-03 10:13:39 +01:00
Michał Łyszczek
d17f554355 examples/embedlog: update example for embedlog-v0.7.0
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2024-03-03 12:03:54 +08:00
Michał Łyszczek
e6047b296e logging/embedlog: update to version v0.7.0
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2024-03-03 12:03:54 +08:00
TimJTi
169beaeef7 Add Settings Utility and example app 2024-03-03 02:36:56 +08:00
Michał Łyszczek
8669861312 examples/hx711: add new program to test hx711 chip
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2024-03-02 12:34:39 +08:00
zhangchao53
7ad4a3dcb7 fix patch error:no such file
Signed-off-by: zhangchao53 <zhangchao53@xiaomi.com>
2024-03-01 17:06:01 +08:00
Takayoshi Koizumi
17539f1340 Fix illegal coding style on nxaudio.c
Make it as 2 lines
2024-02-28 15:30:26 +08:00
SPRESENSE
2b4a25c8d5 examples/fmsynth: Fix freaze when execute it in 2nd time
Fix a freaze BUG when the example is executed again after 1st execution.
2024-02-28 15:30:26 +08:00
Peter van der Perk
2d6f5f230e netinit: Add check mount path retry option for delayed mounts 2024-02-28 10:21:40 +08:00
Xiang Xiao
ea29af94c7 testing/fmemopen: Remove the back slash from long literal string
since the back slash is only needed for the long macro definition

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-02-26 17:39:29 -03:00
Tomáš Pilný
9776786e0c examples/dac: Add test mode
Implements simple function generating triangular pattern / saw tooth.
2024-02-26 17:38:51 -03:00
chenrun1
bac8aab243 cmd_cp:Skip mkdir when mkdir is not available
The behavior of mkdir is used during the cp -r process, and the mkdir behavior is skipped when mkdir is unavailable (this may cause unpredictable behavior of cp -r)

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-02-25 21:59:57 -08:00
chenrun1
e8470f7d0e cp:support -r recursive copies
The cp command supports recursive copying. Use "cp -r" to copy a folder.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-02-25 21:59:57 -08:00
Junbo Zheng
9e71031a09 graphics/lvgl: remove unused code
Since it has beed used from https://github.com/apache/nuttx-apps/blob/master/graphics/lvgl/CMakeLists.txt#L72-L74

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2024-02-25 09:16:42 -08:00
Jorge Guzman
0cc42d6e45 sensor/lm75: fix C syntax error
Signed-off-by" Jorge Guzman jorge.gzm@gmail.com
2024-02-25 10:38:51 -05:00
chenrun1
bd1cc85ad4 dd:support "seek"
Now the dd command can use the "seek" parameter to adjust how many bytes need to be skipped before being written to the target.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-02-25 06:36:43 -08:00
Yanfeng Liu
31908b3128 nshlib/prompt: extend NSH prompt string management
Currently NSH prompt is defined at build time, thus improper for AMP cases
where the same NSH binary is used on different nodes as the same NSH prompt
shows on all nodes.

This patch attempts to support runtime prompt string population from ordered
sources:
  - the environment variable defined by NSH_PROMPT_ENV plus suffix
  - the NSH_PROMPT_STRING
  - the HOSTNAME plus suffix
The suffix is defined by NSH_PROMPT_SUFFIX so that to clearly separate the
command inputs.

Changes in `nshlib/`

- Kconfig:       add configs NSH_PROMPT_MAX/ENV/SUFFIX etc
- nsh.h:         adjust g_nshprompt defs, add nsh_update_prompt
- nsh_parse.c    relocate g_nshpromt to nsh_prompt.c
- nsh_init.c     revise to use nsh_update_prompt once
- nsh_session.c  revise to use methods in nsh_prompt.c
- Makefile       add nsh_prompt.c
- CMakeLists.txt add nsh_prompt.c

New additions in `nshlib/`

- nsh_prompt.c   prompt related data structures and methods.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-02-25 00:55:47 -08:00
Alan Carvalho de Assis
f1137b3b55 apps: Make /dev/temp0 as default to system/lm75
The stm32 common logic board uses /dev/temp0 as
default, but system/lm75/lm75.c is trying to
open /dev/temp instead

Signed-off-by: Alan C Assis <acassis@gmail.com>
2024-02-23 19:21:40 -08:00
vela-mib
02d212e829 fix pthread_sigmask_4_1 sigprocmask_4_1 build warning
Signed-off-by: vela-mib <vela-mib@xiaomi.com>
2024-02-23 04:11:17 -08:00
Neo Xu
c1dfeae0b3 cmake: add lvgl cmake support
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-02-22 21:22:41 -08:00
Zhe Weng
9236d9a2f4 apps/tcpdump: Support capture RAW IP interfaces like TUN
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-02-22 21:22:00 -08:00
vela-mib
be74e34ede add mm/sched and open posix on CI
Signed-off-by: vela-mib <vela-mib@xiaomi.com>
2024-02-22 06:55:01 -08:00
YAMAMOTO Takashi
60cd8ff592 toywasm: regen
```
REF=4ccb44f9f6477412c289f7ffad6a0f660e99d5a5 ./regen.sh
```
2024-02-21 18:39:06 -08:00
YAMAMOTO Takashi
e3205459af toywasm: update to v41 2024-02-21 18:39:06 -08:00
Yanfeng Liu
b32abfab39 build/ci: fix CI blocking unused variables/functions issues
This patch attempts to fix the blocking issues encountered with build
6374 of apps/pull/2300.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-02-21 18:38:53 -08:00
Yanfeng Liu
3dd35cb549 nshlib/syscmds: guard help mesg for rpmsg ping
This patch guards help message for ping sub-command so that it only
shows when the sub-command is enabled.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-02-21 05:31:45 -08:00
rongyichang
1e9daf0200 apps/graphics: add lcddev_obj initialization to fix crash in lcd_dev mode.
Reference: https://github.com/apache/nuttx/issues/11683

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2024-02-20 21:55:39 -08:00
Jorge Guzman
90ea9821df modbus_master: fix cmake build warning
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2024-02-20 08:58:30 -08:00
simbit18
faa8f6666f tools/ci: add initial support for MSYS2
build.yml  -> add msys2 job
2024-02-19 08:32:54 -08:00
wangyongrong
25e8c1c9c4 cmd rptun: Strip rpmsg ioctl and rptun ioctl.
cmd_rptun handles RPTUNIOC_START, RPTUNIOC_STOP, RPTUNIOC_RESET,
cmd_rpmsg handles the public ioctl commands part.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-02-19 05:59:34 -08:00
chao an
05ffbabca7 nsh/uname: improve compatibility for non-GNU compilers
The alloca() function is machine- and compiler-dependent.  For certain
applications, its use can improve efficiency compared to the use of
malloc(3) plus free(3).  In certain cases, it can also simplify memory
deallocation in applications that use longjmp(3) or siglongjmp(3).
Otherwise, its use is discouraged.

Signed-off-by: chao an <anchao@lixiang.com>
2024-02-19 03:49:22 -08:00
raiden00pl
1cb991cce7 i8sak: add support for tracedump command
used to dump trace log from radio
2024-02-18 04:10:48 -08:00
Jorge Guzman
49204e1389 modbus_master: fix modbus master example 2024-02-17 05:01:18 -08:00
zhangchao53
f9f63dc8e1 add cmocka tools and fix __WORDSIZE not defined warning 2024-02-15 04:56:13 -08:00
Abhishek Akkabathula
da9903fe57 elf/tests/helloxx: fix build break with elf cpp exceptions example
fix the below build error by correcting the typo (tring -> string)

hello++5.cxx: In member function 'virtual void CThingSayer::ThrowMyThing(const char*)':
hello++5.cxx:157:21: error: 'tring' was not declared in this scope
  157 |   throw MyException(tring(czSayThis));
      |                     ^~~~~

Signed-off-by: Abhishek Akkabathula <a.akkabathul@samsung.com>
2024-02-15 08:31:51 +01:00
SPRESENSE
90c9364b3b lte/alt1250: Force change modem parameter
In some conditions, LTE connection has issue.
To fix it, need to change a modem parameter.
2024-02-15 08:14:10 +01:00
Tiago Medicci Serrano
9fd1251dcb examples/rmtchar: Increase initial duration time
With higher RMT source clocks, small durations are hard to be
detected. Increasing it makes it easier to enable automated tests.
2024-02-14 10:53:40 -05:00
SPRESENSE
3650251c5e lte/alt1250: Fix bug that caused stack when executing the socket API
Fix a bug that caused the application to get stuck when executing
the socket API after waking up from hibernation and before executing
lte_hibernation_resume().
2024-02-09 14:52:05 +02:00
SPRESENSE
2ac0adf37d lte/alt1250: Correspond to ALT1250_EVTBIT_RESTARTAPI event
If the ALT1250_EVTBIT_RESTARTAPI event is received,
the ALT1250 daemon changes its state to handle LAPI normally.
2024-02-08 23:52:47 +02:00
raiden00pl
4c3dcb2044 cmake: add ieee802154 tools 2024-02-05 08:46:22 -08:00
raiden00pl
89cf6b4ce6 cmake: add smp test 2024-02-05 08:46:22 -08:00
raiden00pl
9921571674 cmake: add cachespeed 2024-02-05 08:46:22 -08:00
raiden00pl
364ca42837 cmake: fix spinlock_bench compilation 2024-02-05 08:46:22 -08:00
YAMAMOTO Takashi
46888aa8e4 toywasm: regen for v38
```
REF=b3e060f308db23e21aaa3004484bf9335e4d3fcc ./regen.sh
```
2024-02-05 03:37:32 -08:00
YAMAMOTO Takashi
aba3e27c6c toywasm: update to v38 2024-02-05 03:37:32 -08:00
Ville Juven
0f31a8d98e nsh_fscmds.c: Fix CONFIG_FS_SHM -> CONFIG_FS_SHMFS
The define macro was wrong
2024-01-31 08:52:05 -08:00
chao an
0968264ac0 nshlib: fix build break if CONFIG_CPP_HAVE_VARARGS if undefined
ctc E272: ["nsh_ddcmd.c" 197/7] undeclared identifier "vtbl"

Signed-off-by: chao an <anchao@lixiang.com>
2024-01-30 20:44:05 -08:00
wangyongrong
32f269a079 nsh_syscmds: update rptun_ping to rpmsg_ping, add cmd_rpmsg.
To support rpmsg ioctl, add cmd_rpmsg function, and update rptun ping to rpmsg ping.
depends on apache/nuttx#11618

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-30 20:42:49 -08:00
YAMAMOTO Takashi
b43340b0aa toywasm: regen
```
REF=15e6585cecd8049a03a901a4ed8a6b2dd3c18e48 ./regen.sh
```
2024-01-30 04:09:27 -08:00
YAMAMOTO Takashi
df573bb024 toywasm: bump the version 2024-01-30 04:09:27 -08:00
Yanfeng Liu
d381699ac1 testing/getprime: add cmake support
add CMakeLists.txt to support building with CMake

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-27 00:56:13 -08:00
yangjian11
09122debe9 nsh_timcmds: display date using set format
Reference: https://www.geeksforgeeks.org/date-command-linux-examples/?ref=gcse#9-list-of-format-specifiers-used-with-date-command

Signed-off-by: yangjian11 <yangjian11@xiaomi.com>
2024-01-26 19:13:25 -08:00
Michal Lenc
61d1f37f5f nsh_timcmds: show RTC time in timedatectl command only if CONFIG_RTC_DRIVER is set
NuttX build fails otherwise as required structures are not included.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-01-26 09:45:03 -08:00
Junbo Zheng
c699b05f74 nshlib: add expr command support
It is a mini version for the `expr` command, which implements the features of addition, subtraction, multiplication, division and mod.

Reference: https://www.geeksforgeeks.org/expr-command-in-linux-with-examples/

bl2>
bl2> expr 1 + 2
3
bl2> expr
Usage: expr <operand1> <operator> <operand2>
bl2> expr 5 - 2
3
bl2> set hello 10
bl2> expr $hello - 2
8
bl2> expr 8 a 9
Unknown operator
bl2> expr 20 / 5
4
bl2> expr 10 % 4
2
bl2> expr 10 / 0
operand2 invalid
bl2>
bl2> expr mi + 100
invalid parameter
bl2> expr 100 + mi
invalid parameter
bl2> expr 100 + 0
100

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2024-01-25 18:12:28 -08:00
Yanfeng Liu
596328ccca nshcmd/rptun: align help mesg with impl
the ping subcommand is guarded with RPTUN_PING in its handler.
its help mesg should have same guard to avoid confusing user.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-25 18:11:39 -08:00
xuchaojie
ca5293629f wapi: Add pscan cmd to trigger a passive scan.
Added scanning in passive mode without affecting the scan command.

Signed-off-by: xuchaojie <xuchaojie@xiaomi.com>
2024-01-25 03:10:06 -08:00
SPRESENSE
a16fb23dd7 lte/alt1250: Notice instance information
Notice instance information of LwM2M server operation to application.
2024-01-24 22:21:56 +01:00
Takeyoshi Kikuchi
c82aa9f683 config.nims: fix NimSuggest crash.
When editing in VSCode, NimSuggest refers to config.nims and tries
to find the NuttX .config.
Fixed a problem that .config cannot be read because the environment
variable "TOPDIR" is not defined.

Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2024-01-23 04:03:59 -08:00
dependabot[bot]
dabdad732e build(deps): bump actions/cache from 3 to 4
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 23:17:06 -08:00
Yanfeng Liu
14d4059159 Zig: revise apps build support
This requires nuttx/pull/11548 to work.

- Zig apps can use normal entrance "main()" now as we
- added RENAMEMAIN for none BUILD_MODULE case.
- enabled Zig program building in BUILD_MODULE case.

Note the Zig main source need to have "fn main(" pattern as
renaming is implemented via `sed`.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-21 06:21:18 -08:00
Huang Qi
dbcbec363d wamr: Add new option to enable quick aot entry
Enable AOT quick entry to improve performance for call
AOTed function from host side in some cases with simple
signature.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-01-19 01:02:59 -08:00
YAMAMOTO Takashi
70108ae59e wamr: bump the default stack guard size
using 0 by default seems a bit too aggressive to me.

1024 here is what would have been used before this kconfig knob
was introduced by https://github.com/apache/nuttx-apps/pull/1259.
It also matches some expectations in the recent wamrc.
40b430fd24/core/iwasm/compilation/aot_emit_aot_file.c (L2672-L2678)
2024-01-19 09:08:10 +01:00
zhanghongyu
9c48a8d4fc iperf: add parameters to support dynamic device bind
In addition to the CONFIG_NETUTILS_IPERFTEST_DEVNAME configuration, you can specify network cards by parameter to support devices with multiple network interface

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-01-17 00:54:31 -08:00
Xiang Xiao
e4e43a1ca0 adb: Don't declare variables in the middle of function
and unify the prefix from ADB to ADBD

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-01-15 19:29:57 +08:00
Xiang Xiao
db0e0b9bfe adbd/logcat: Change alog_ prefix to logcat_
to unify the prefix usage in the code base

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-01-15 19:29:57 +08:00
YAMAMOTO Takashi
8930743831 Wasm.mk: disable by default
Fixes partly: https://github.com/apache/nuttx-apps/issues/2046

Also, this fixes warnings like:
```
spacetanuki% ./tools/configure.sh -E sim:wamr
  Copy files
  Select CONFIG_HOST_MACOS=y
  Refreshing...
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory              /usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
CP: arch/dummy/Kconfig to /Users/yamamoto/git/nuttx/nuttx/arch/dummy/dummy_kconf
ig
CP: boards/dummy/Kconfig to /Users/yamamoto/git/nuttx/nuttx/boards/dummy/dummy_k
config
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory

```
2024-01-13 02:16:16 -08:00
wangyongrong
7047fa5bde nsh syscmds: add CONFIG_RPTUN_PING when use rptun_ping
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-13 02:15:55 -08:00
wangyongrong
5f1de35936 rpsock_client.c: fix printf format warning
rpsock_client.c:203:30: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ [-Wformat=]
  203 |                       printf("client check fail total %d, \
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  204 |                               i %d, %08" PRIx32 ", %08x\n",
      |                               ~~~~~~~~~~
  205 |                               ALIGN_UP(total), i, intp[i],
  206 |                               (ALIGN_UP(total) / sizeof(uint32_t) + i));
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                   |
      |                                                                   long unsigned int

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-12 01:22:23 -08:00
fangxinyong
385f707382 nshlib: move etc romfs mount from nsh to nuttx
This commit corresponds to apache/nuttx#11498 in nuttx.

Move etc romfs mount to sched/init for compatibility with kernel/protected mode.

changes:
- move etc romfs mount from nsh to Nuttx, but keep the script to parse and execute.
- move and rename the related CONFIG, move customized nsh_romfsimg.h to etc_romfs.c
  in boards, and no need declaration for romfs_img/romfs_img_len.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-01-09 21:25:19 -08:00
Huang Qi
c4e78cd10a wamr: Add new option to enable tail call support
See also:
https://github.com/bytecodealliance/wasm-micro-runtime/pull/2975

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-01-06 04:34:50 -08:00
Bowen Wang
2a08d17ed6 nsh_mmcmds: support "memdump -h/help" to show usage and sequence number
Compare with "cat /proc/memdump", use "memdump -h/help" is more
convenient.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-01-06 04:34:27 -08:00
Bowen Wang
3d4442207d nsh_ddcmd: print errno instead the return value when dd failed
Print the errno gives more information to debug the dd failed
problem.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-01-06 04:34:07 -08:00
wangyongrong
51762a8958 nsh cmd rptun: add rptun ping useage description
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-01-06 04:33:48 -08:00
zhanghongyu
d9f467dd8e libcoap: add cmake script
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-01-06 04:32:41 -08:00
zhanghongyu
ce735f4136 libcoap: add makefile and Kconfig
server:
when ipv6 is enable:
ap> coap_server
only ipv4 is enable, we need to specify the ip address of the network card:
ap> coap_server -A [ipv4 address]

client:
ap> coap_client -m get coap://[ipv4/6 address]/time
Dec 26 06:41:12

Other Examples:
	coap_client -m get coap://[::1]/
	coap_client -m get coap://[::1]/.well-known/core
	coap_client -m get coap+tcp://[::1]/.well-known/core
	coap_client -m get coap://%2Funix%2Fdomain%2Fpath%2Fdgram/.well-known/core
	coap_client -m get coap+tcp://%2Funix%2Fdomain%2Fpath%2Fstream/.well-known/core
	coap_client -m get coaps://[::1]/.well-known/core
	coap_client -m get coaps+tcp://[::1]/.well-known/core
	coap_client -m get coaps://%2Funix%2Fdomain%2Fpath%2Fdtls/.well-known/core
	coap_client -m get coaps+tcp://%2Funix%2Fdomain%2Fpath%2Ftls/.well-known/core
	coap_client -m get -T cafe coap://[::1]/time
	echo -n 1000 | coap-client -m put -T cafe coap://[::1]/time -f -

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-01-06 04:32:41 -08:00
Yanfeng Liu
cf27f085f5 add const for romfs_img_len
this makes both declarations read-only as they are corelated.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-04 09:12:48 -08:00
Lee Lup Yuen
41a4963515 config.nims: Support Nim Apps for RISC-V 32-bit and 64-bit
NuttX Build fails when it compiles `examples/hello_nim` for RISC-V (32-bit and 64-bit). That's because the Nim Config Script `config.nims` couldn't identify the Nim Target Platform: `riscv32` or `riscv64`.

This PR fixes `config.nims` so that Nim Compiler correctly derives the Nim Target Platform (`riscv32` or `riscv64`), by searching NuttX `.config` for `CONFIG_ARCH_FAMILY=rv32` or `rv64`.

This logic is slightly different from the Nim Targets `arm` and `arm64`, which are currently derived from `CONFIG_ARCH=arm` and `arm64`.

`config.nims` is explained in this article: https://lupyuen.github.io/articles/nim#inside-nim-on-nuttx
2024-01-04 09:11:34 -08:00
Xiang Xiao
e55c0d9aa5 Remove @ tag from all comments
and format the multiple line comments

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-01-04 10:26:49 +01:00
Zhe Weng
9489659890 netutils/ping: Optimize stack usage of icmp_ping
Can reduce 88~144 Bytes on ARMv7-A depending on optimization level.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-01-02 19:47:23 +01:00
Lee Lup Yuen
16bca8b568 examples/hello_nim: Fix nimcache location
The Nim Example App fails to build because the `.nimcache` is located 2 folders up. This PR fixes the location of `.nimcache` in the `Makefile` of the Nim Example App.

`.nimcache` is explained in this article: https://lupyuen.github.io/articles/nim#inside-nim-on-nuttx
2024-01-02 09:52:54 -08:00
Zhe Weng
4c0bd143eb nshlib/ifconfig: Let "dns" option depends on CONFIG_NETDB_DNSCLIENT
"dns" option of `ifconfig` can work just with `CONFIG_NETDB_DNSCLIENT`,
no need to depend on `CONFIG_NETINIT_DNS` or `CONFIG_NETINIT_DHCPC`.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-12-30 01:40:05 -08:00
renjianguang
d9b8a0ee62 drivertest: Fix drivertest_audio crash
1.call AUDIOIOC_RELEASE when finished
2.make sure the driver dequeue all buffers before free the buffers

Signed-off-by: renjianguang <renjianguang@xiaomi.com>
2023-12-28 05:38:58 -08:00
Yanfeng Liu
4d9f2e3692 optional argument for generated ROMFS file path.
existing headerfile path is used when argument is missing.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2023-12-28 05:36:18 -08:00
fangxinyong
ba075747be ostest: Add initial support for CONFIG_BUILD_KERNEL
task_* APIs are unavailable in kernel build mode, replacing with
posix_spawn or pthread_* API to pass the case. But posix_spawn requires
some dependency, for example CONFIG_BUILTIN and CONFIG_LIBC_EXECFUNCS,
so pthread_* APIs are used in most scenarios. Some tests should be
re-visited because the intent is to user another task (in this case
another process) to e.g. receive signals.
That will require quite a bit of extra work.

Tests that had to be disabled:
- restart: task_restart() does not work at all with kernel mode so it is
  disabled entirely
- fpu: make sure the FPU test is not even attempted, because it will cause
  ASSERT() and stop the test
- vfork: vfork() does not work for some reason in CONFIG_BUILD_KERNEL,
  there is something missing on the kernel side, so just disable the test for now

Tests that should be re-visited:
- The signal tests, now they signal the process itself while before the
  signal was sent to another task. This will require building the part
  that receives the signal as a separate process
- waitpid: Like stated above, waitpid does not work for pthreads
- suspend: kill to send signal does not work for pthreads

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
Co-authored-by: Ville Juven <ville.juven@unikie.com>
2023-12-27 10:01:05 -08:00
YAMAMOTO Takashi
f12586c51e interpreters/wamr: add INTERPRETERS_WAMR_DEBUG_AOT option
At least it's sometimes useful for nuttx sim.

eg. (modified a bit to avoid github autolinks)
```
spacetanuki% lldb ./nuttx
(lldb) target create "./nuttx"
Current executable set to '/Users/yamamoto/git/nuttx/nuttx/nuttx' (x86_64).
(lldb) settings set plugin.jit-loader.gdb.enable on
(lldb) b foo
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) r
Process 37011 launched: '/Users/yamamoto/git/nuttx/nuttx/nuttx' (x86_64)

NuttShell (NSH) NuttX-10.4.0
nsh> mount -t hostfs -o fs=/tmp/wasm /mnt
nsh> iwasm /mnt/test.aot
1 location added to breakpoint 1
Process 37011 stopped
* thread #_1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #_0: 0x0000000105800673 JIT(0x1058002d4)`foo(exenv=0x0000000101284280) at test.c:5
   2
   3    __attribute__((noinline))
   4    void foo()
-> 5    {
   6        printf("hello from %s\n", __func__);
   7    }
   8
Target 0: (nuttx) stopped.
(lldb) bt
* thread #_1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #_0: 0x0000000105800673 JIT(0x1058002d4)`foo(exenv=0x0000000101284280) at test.c:5
    frame #_1: 0x000000010580077a JIT(0x1058002d4)`bar(exenv=0x0000000101284280) at test.c:12:2
    frame #_2: 0x000000010580086a JIT(0x1058002d4)`baz(exenv=0x0000000101284280) at test.c:19:2
    frame #_3: 0x0000000105800972 JIT(0x1058002d4)`__main_argc_argv(exenv=<unavailable>, argc=<unavailable>, argv=<unavailable>) at test.c:26:3
    frame #_4: 0x00000001058061aa JIT(0x1058002d4)`aot_func#14 + 278
    frame #_5: 0x00000001058005cd JIT(0x1058002d4)`aot_func#2 + 153
    frame #_6: 0x00000001000e250f nuttx`push_args_end at invokeNative_em64.s:61
    frame #_7: 0x000000010013851a nuttx`wasm_runtime_invoke_native(exec_env=0x0000000101284280, func_ptr=0x0000000105800534, func_type=0x00000001011e2e20, signature=0x0000000000000000, attachment=0x0000000000000000, argv=0x0000000000000000, argc=0, argv_ret=0x0000000000000000) at wasm_runtime_common.c:4631:9
    frame #_8: 0x00000001000da1ae nuttx`aot_call_function(exec_env=0x0000000101284280, function=0x00000001011e1fb0, argc=0, argv=0x0000000000000000) at aot_runtime.c:1654:15
    frame #_9: 0x0000000100134b56 nuttx`wasm_runtime_call_wasm(exec_env=0x0000000101284280, function=0x00000001011e1fb0, argc=0, argv=0x0000000000000000) at wasm_runtime_common.c:2048:15
    frame #_10: 0x00000001000fbad4 nuttx`execute_main(module_inst=0x00000001011e3890, argc=1, argv=0x00000001011b63f8) at wasm_application.c:112:15
    frame #_11: 0x00000001000fb995 nuttx`wasm_application_execute_main(module_inst=0x00000001011e3890, argc=1, argv=0x00000001011b63f8) at wasm_application.c:238:11
    frame #_12: 0x00000001000ea1a0 nuttx`app_instance_main(module_inst=0x00000001011e3890) at main.c:113:5
    frame #_13: 0x00000001000e9d60 nuttx`iwasm_main(argc=1, argv=0x00000001011b63f8) at main.c:947:21
    frame #_14: 0x0000000100023275 nuttx`nxtask_startup(entrypt=(nuttx`iwasm_main at main.c:545), argc=2, argv=0x00000001011b63f0) at task_startup.c:70:8
    frame #_15: 0x000000010001065a nuttx`nxtask_start at task_start.c:134:7
    frame #_16: 0x000000010003a15f nuttx`pre_start at sim_initialstate.c:52:3
(lldb)

```
2023-12-25 04:47:07 -08:00
Takumi Ando
730370e565 fsutils: passwd: Fix wrong macro
passwd_update/adduser/deluser should be enabled
if CONFIG_FSUTILS_PASSWD_READONLY is NOT defined.

Signed-off-by: Takumi Ando <t-ando@advaly.co.jp>
2023-12-21 16:16:20 +01:00
Huang Qi
afa282ca4f WASI-SDK.defs: Simplify CFLAGS filters
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-20 21:24:20 -08:00
Tiago Medicci Serrano
11f2d5e5e4 examples/rmtchar: Implement RX and/or TX using the RMT char driver
The RMT (remote control) character driver is used to send and/or
receive data packets. Eventually, this app can be used to perform
a loopback test to validate the RMT driver implementation.
2023-12-19 03:34:28 -08:00
yuanyongjian
dcfb4d0662 nshlib:dmesg add '-c|-C' opt
Signed-off-by: yuanyongjian <yuanyongjian@xiaomi.com>
2023-12-14 20:14:25 -08:00
Zhe Weng
b7c5bdbdc9 nshlib/ifconfig: Add error print for inet_pton fail
> ifconfig wlan0 inet6 add fb
nsh: ifconfig: argument invalid

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-12-12 22:17:05 -08:00
dependabot[bot]
7768e72d94 build(deps): bump actions/setup-python from 4 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 17:41:23 -08:00
anjiahao
ffbf920623 gdbstub:update gdb_process api
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-12-11 08:43:34 -08:00
Xiang Xiao
d6a5307270 Fix nuttx/porttimer.c:71:24: error: a function declaration without a prototype is deprecated
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-12-11 14:03:06 +08:00
Xiang Xiao
f28797cddf interpreters/bas: Fix compiler warning after gcc upgrade to version 12
bas_token.l: In function 'yylex':
Error: bas_token.l:1210:31: error: 'strcpy' writing 1 or more bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
 1210 |                             }
      |                               ^
In file included from bas_auto.h:77,
                 from bas_token.l:16:
bas_token.h:103:8: note: at offset 2 into destination object 'name' of size 2
  103 |   char name[2/* ... */];
      |        ^~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-12-10 06:40:51 -08:00
anjiahao
1334306585 coredump:support coredump command restore coredump form block device
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-12-08 19:28:09 -08:00
Petteri Aimonen
fcd0729e21 ptpd: Fix reserved word 'class'
When ptpd.h is included in C++ code, the use of identifier 'class'
caused a compilation error. Changed to "clockclass".
2023-12-07 18:26:39 -08:00
Zhe Weng
9abc82c792 nshlib/ifconfig: Generate default IPv4 gateway with netmask
Generate default gateway using configured netmask instead of fixed
255.255.255.0, which may be more flexible under certain situations.
e.g. A subnet like 10.0.23.16/28 may not contain the .1 address.

Before:

ifconfig eth0 10.0.23.22 netmask 255.255.255.252 => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 netmask 255.255.255.240 => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 netmask 255.255.255.0   => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 netmask 255.255.0.0     => DRaddr:10.0.23.1

ifconfig eth0 10.0.23.22 => Mask:255.255.255.0      DRaddr:10.0.23.1

After:

ifconfig eth0 10.0.23.22 netmask 255.255.255.252 => DRaddr:10.0.23.21
ifconfig eth0 10.0.23.22 netmask 255.255.255.240 => DRaddr:10.0.23.17
ifconfig eth0 10.0.23.22 netmask 255.255.255.0   => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 netmask 255.255.0.0     => DRaddr:10.0.0.1

ifconfig eth0 10.0.23.22 => Mask:255.255.255.0      DRaddr:10.0.23.1

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-12-07 07:16:43 -08:00
Zhe Weng
fb72849089 nshlib/ifconfig: Set network mask before setting gateway
Switch the order of setting network mask and gateway, re-order only, no
logic change.

In IPv6 cases, we may set `addr6` and prefix length together to an
interface, but the gateway logic may change the value in `addr6`, and
result in wrong address set to the interface.

The order doesn't change behavior in network stack, so we just need to
make sure the value is correct.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-12-07 07:16:43 -08:00
liqinhui
91a697a3f4 renew6: Optimize the process of obtaining an IPv6 address.
If Managed Address Congfiguration flag in the Router Advertisement
Messsage is set, we would obtain the IPv6 address though the stateful
DHCPv6 procedure.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-12-07 06:26:50 -08:00
Huang Qi
f57cd2cf0c tools: Move final wasm module to bin/wasm as elf
And leave all intermediate file in apps/wasm,
such as .map file, entry object etc used in
wasm module build.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-06 08:29:00 -08:00
Huang Qi
3c624d38cd tools: Allow customize ld flags for each wasm module
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-06 08:29:00 -08:00
Huang Qi
bd159e103c tools: Split origin Wasm.mk into Wasm.mk and WASI-SDK.defs
Try to follow current NuttX's toolchain parttern:
Wasm.mk: Provide target rule for building wasm module
WASI-SDK.defs: Provide compile flags for building

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-06 08:29:00 -08:00
Huang Qi
f55b8face6 wamr: Add support for thumb target triple in Toolchain.defs
Before WAMR 1.3.0, eabihf in wamrc is `gnueabihf`, so without
this patch call wamrc will failed with target abi was `eabihf`,
we should convert the standard llvm target to wamrc required.

Both `eabihf` and `gnueabihf` supported after WAMR 1.3.0.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-06 08:29:00 -08:00
Huang Qi
3129b7a465 tools: Emit map file for wasm module
Emit map file like NuttX's `System.map` for more
debug information.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-06 08:29:00 -08:00
YAMAMOTO Takashi
733b6de818 toywasm: regen for v35
```
REF=e2ec1b60e06dbe360ae638970d01906ded5ab497 ./regen.sh
```
2023-12-06 08:17:42 -08:00
YAMAMOTO Takashi
282f9a744c toywasm: update to v35 2023-12-06 08:17:42 -08:00
Alan Carvalho de Assis
454426547c examples/modbus: Fix modbus example to keep running 2023-12-04 06:52:14 -08:00
Petteri Aimonen
6dd9adbb5b ptpd: Code quality improvements 2023-12-04 00:30:26 -08:00
Xiang Xiao
083eb5e993 Fix the wrong comment banner
"Private Type"->"Private Types"
"Public Data Type"->"Public Types"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-12-03 14:27:14 -03:00
raiden00pl
6a8344bf37 examples/nxscope: change the vector data sent by nxscope to be a 3-phase sin waveform
A changing waveform is nicer to visualize than a static vector.
2023-12-02 20:11:21 -08:00
raiden00pl
e7bb97cb5f examples/nxscope: make channel 19 configurable
Channel 19 uses an additional thread to send a text message.
This commit makes this behaviour configurable.
2023-12-02 20:11:21 -08:00
raiden00pl
5cfcd769bf examples/nxscope: make main interval configurable 2023-12-02 20:11:21 -08:00
Michal Lenc
aa49523bb3 testing: add open_memstream test tool
Test tool application for open_memstream for CI testing. Performs basic
write/seek operations.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-11-29 02:12:58 -08:00
chao an
f289cdb2ec lvgl/makefile: workaround for lvgl.v8
Since this change is only merged into the lvgl.v9, let us workaround for v8:
 37835260ca

 ./lvgl/src/core/lv_obj.c:363:25: warning: variable 'x' set but not used [-Wunused-but-set-variable]
   363 |         static uint32_t x = 0;
       |                         ^
 1 warning generated.

CFLAGS += -Wno-unused-but-set-variable

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-28 03:52:27 -08:00
Petteri Aimonen
af6e4d2cb9 ptpd: Code style and FAR pointer fixes 2023-11-24 20:15:38 -08:00
Petteri Aimonen
0adce22400 ptpd: Implement status & stop interfaces 2023-11-24 20:15:38 -08:00
Petteri Aimonen
efc6cfddb4 ptpd: Fix compilation error when debug messages disabled
The debug macros did not get declared in all setups.
2023-11-24 20:15:38 -08:00
Petteri Aimonen
e2168abe9a ptpd: Implement delay reqs, fix timing bugs
Fixed bug where negative offsets were not properly handled because
clock_timespec_subtract clamps values to zero.

Implement support for SO_TIMESTAMP to get accurate packet
reception timestamp.

Implemented delay requests for measuring packet transfer delay.

Implemented clock drift estimation to bring the clocks closer to
sync and to filter out measurement jitter.
2023-11-24 20:15:38 -08:00
Petteri Aimonen
8dbf26016a ptpd: Re-join multicast group after timeout
If multicast PTP packets are not being received, rejoin the multicast group.
This automatically recovers from situations such as rebooting a network switch.
2023-11-24 20:15:38 -08:00
zhanghongyu
ae59177279 matter: download chip and dependent source for open source version
The community version needs to dynamically fetch the matter source code at compile time and apply the required nuttx adaptation patch

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-23 00:19:37 -08:00
zhanghongyu
72e67e9d6d jsoncpp: add cmake scripts for jsoncpp
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-23 00:19:37 -08:00
zhanghongyu
891c5e0cc8 matter: add cmake support
A nuttx with the matter command can be compiled using cmake and enable CONFIG_MATTER option.
The matter compiled by the current script is just a lighting example of
a limited number of commands that can be tested by chip-tool.

After nuttx is connected to the LAN and the matter command is executed, other devices in the LAN, such as linux PCS, can run the following commands to scan, connect, turn on and off, adjust brightness and contrast, and so on.

chip-tool pairing onnetwork 1 20202021
chip-tool onoff on 1 1
chip-tool levelcontrol move-to-level 128 10 0 0 1 1
chip-tool colorcontrol move-to-hue-and-saturation 240 100 0 0 0 1 1

Depends on the following configuration options:
CONFIG_CRYPTO_MBEDTLS=y
CONFIG_DEV_URANDOM=y
CONFIG_LIBCXX=y
CONFIG_LIBM=y
CONFIG_NET_IPv6=y
CONFIG_NET_ICMPv6=y
CONFIG_NET_ICMPv6_AUTOCONF=y
CONFIG_NET_ICMPv6_NEIGHBOR=y
CONFIG_NET_ICMPv6_ROUTER=y
CONFIG_NET_ICMPv6_SOCKET=y
CONFIG_NET_IGMP=y
CONFIG_NET_MLD=y
CONFIG_NET_MLD_ROUTER=y

This initial version does not yet have Bluetooth and OTA support.

The community version needs to dynamically fetch the matter source code at compile time and apply the required nuttx adaptation patch.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-23 00:19:37 -08:00
Huang Qi
097411de49 wamr: Add support for custom section loading
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-11-21 08:11:59 -08:00
Marco Casaroli
ba43911a77 libtest: add PRIVATE to CMakeLists.txt
It looks like this word is needed for this build to work with cmake
2023-11-21 08:05:02 -08:00
raiden00pl
27588be53e examples/foc: replace CONFIG_INDUSTRY_FOC_* with CONFIG_EXAMPLES_FOC_*
Decouple the FOC example configuration from the FOC lib configuration.
Purely cosmetic change, without affecting functionality.
2023-11-18 08:40:16 -08:00
raiden00pl
d589443980 industry/foc: fix direction alignment
CCW direction wasn't properly detected when we start alignment from near zero position
2023-11-18 08:39:40 -08:00
Huang Qi
1cf9640bb6 Wasm.mk: Allow application defined linker flags
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-11-17 18:46:51 -08:00
raiden00pl
cdbd14eb5f cmake: support for system/uorb 2023-11-17 03:32:54 -08:00
simbit18
6a35182033 Fix Kconfig style
Remove spaces from Kconfig files
Replace help => ---help---
Add TABs
Add comments
2023-11-16 20:31:08 -08:00
Masayuki Ishikawa
79c7962af6 apps: Replace CONFIG_ARCH_HAVE_VFORK with CONFIG_ARCH_HAVE_FORK
Summary:

- Resolves an issue where `vfork_test` was not executed following
  the renaming from CONFIG_ARCH_HAVE_VFORK to CONFIG_ARCH_HAVE_FORK,
  as detailed in https://github.com/apache/nuttx/pull/9755.

Impact:
- Please merge https://github.com/apache/nuttx/pull/11200 before
  merging this PR.

Testing:
- Successfully tested with rv-virt:smp64, spresense:smp, and sim:smp.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-11-16 07:58:57 -08:00
raiden00pl
144bf0bd1f examples/foc: remove obsolete CONFIG_EXAMPLES_FOC_IPHASE_ADC option 2023-11-15 18:49:42 +01:00
chao an
6754d42715 system/popen: popen should depends on pipe()
Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-15 08:27:28 -08:00
raiden00pl
fa19b71ba4 examples/foc: get iphase scale from the FOC device interface 2023-11-15 03:48:53 -08:00
raiden00pl
9eb5bd4091 examples/foc: pass from velocity controller to torque controller 2023-11-14 09:46:07 -08:00
raiden00pl
ce53f0fc4c examples/foc: add torque saturation 2023-11-14 09:46:07 -08:00
raiden00pl
dc4330476d examples/foc: add velocity saturation 2023-11-14 09:46:07 -08:00
raiden00pl
32a8c29753 examples/foc: don't raise error when EXAMPLES_FOC_IPHASE_ADC isn't set
This is the first step towards getting rid of CONFIG_EXAMPLES_FOC_IPHASE_ADC completely
2023-11-14 04:42:13 -08:00
raiden00pl
eeacbdde3a examples/foc: get velocity from observer if sensored mode 2023-11-14 10:30:52 +01:00
raiden00pl
c5314b54a4 examples/foc: fix active brake for sensored mode 2023-11-14 10:30:52 +01:00
raiden00pl
cb36d9c8b2 examples/foc: fix compilation for open-loop without angle observer 2023-11-14 10:30:52 +01:00
raiden00pl
b52f7dae0c examples/foc: set direction when updating new setpoint 2023-11-13 08:49:21 -08:00
raiden00pl
1095aec162 examples/foc: start from the beginning if control loop is started
After the start request to FOC device, we should return to the
beginning of the loop and wait for the first synchronization event.

This also fixes the problem with the extended first loop cycle,
so we can remove the workaround in foc_perf.
2023-11-13 08:48:22 -08:00
raiden00pl
f9a4ace59a examples/foc: fix warning for sensored configurations 2023-11-13 08:47:21 -08:00
raiden00pl
87dcf877e7 examples/foc: raise error if both sensorless and sensored modes enabled 2023-11-13 08:47:21 -08:00
raiden00pl
8a04e2b282 examples/foc: add #error messages 2023-11-13 08:47:21 -08:00
raiden00pl
3c541c496b examples/foc: allow sensored velocity mode 2023-11-13 08:47:21 -08:00
zhangchao53
ac64c7d144 add short command-line arguments and record execution time 2023-11-11 11:23:04 +08:00
Ville Juven
f32b4c7f9c examples/thttpd: Remove TCB_FLAG_CANCEL stuff
The flags are removed from kernel side
2023-11-11 11:22:24 +08:00
Huang Qi
07bbbd541c testing: Fix cmocka_driver_block give more than once
Fix:
```
/home/huang/Work/vela/sifli/apps/Application.mk:273: target 'drivertest_block.c.home.huang.Work.vela.sifli.apps.testing.drivertest.o' given more than once in the same rule
/home/huang/Work/vela/sifli/apps/Application.mk:297: target '/home/huang/Work/vela/sifli/apps/builtin/registry/cmocka_driver_block.bdat' given more than once in the same rule
CC:  romfs_main.c /home/huang/Work/vela/sifli/apps/Application.mk:273: target 'drivertest_block.c.home.huang.Work.vela.sifli.apps.testing.drivertest.o' given more than once in the same rule
/home/huang/Work/vela/sifli/apps/Application.mk:297: target '/home/huang/Work/vela/sifli/apps/builtin/registry/cmocka_driver_block.bdat' given more than once in the same rule
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-11-09 23:53:30 +08:00
Ritvik
6798294129 Fix #2181 : LELYCANOPEN_UNPACKNAME comes from extracted tarball directory 2023-11-09 14:48:15 +01:00
SPRESENSE
efdbaaefdd lte/alt1250: Fix some bugs in alt1250 daemon
Fix alt1250 daemon to return -ENOTTY when receiving ioctl
request and in the state of using kernel's network stack.
Fix alt1250 daemon to return -ENOTSUP when receiving socket
request and in the state of using kernel's network stack.
Fix alt1250 daemon to set dummy subnet mask in network devices.
This allows the correct network device to be selected when two
network devices exist.
2023-11-09 20:11:07 +08:00
Zhe Weng
56ef320d6f nshlib/ifconfig: Add support for add/del a single IPv6 address
Note: We're using similar error codes as Linux:
```
linux> sudo ifconfig eth0 inet6 add fc00::2/64
linux> sudo ifconfig eth0 inet6 del fc00::2/112
SIOCDIFADDR: Cannot assign requested address
linux> sudo ifconfig eth0 inet6 del fc00::3/64
SIOCDIFADDR: Cannot assign requested address
linux> sudo ifconfig eth0 inet6 add fc00::2/64
SIOCSIFADDR: File exists

nuttx> ifconfig eth0 inet6 add fc00::2/64
nuttx> ifconfig eth0 inet6 del fc00::2/112
Failed to manage IPv6 address: Cannot assign requested address
nuttx> ifconfig eth0 inet6 del fc00::3/112
Failed to manage IPv6 address: Cannot assign requested address
nuttx> ifconfig eth0 inet6 add fc00::2/64
Failed to manage IPv6 address: File exists
```

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-08 00:20:19 +08:00
Zhe Weng
2f9d98cab2 netutils/netlib: Add support for add/del a single IPv6 address
Note:
The `SIOCSIFADDR` and `SIOCDIFADDR` uses different params for `AF_INET` and `AF_INET6` (`struct ifreq` vs `struct in6_ifreq`) as defined by https://man7.org/linux/man-pages/man7/netdevice.7.html

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-08 00:20:19 +08:00
pengyiqiang
8cc06ac5cf testing/monkey: refact monkey test
1. Simplify kconfig configuration items.
2. Use events to control the status of virtual devices and improve testing efficiency.
3. Add adaptive screen resolution support.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-11-07 18:26:04 +08:00
GC-20-20
0c572e1675 Update serialrx_main.c
Add missing variables
2023-11-06 09:02:42 +08:00
raiden00pl
9ba7092000 examples/foc: add support for control loop performance measurements
also format CMakeLists.txt
2023-11-06 09:02:28 +08:00
raiden00pl
73ab7dedd4 examples/foc: refactor control loop
1. get FOC device state at the beginning of the loop
2. simplify if-else block
2023-11-05 13:56:52 +08:00
TaiJu Wu
388256b7d7 feature: spinlock benchmark
Use multi-threads to measure spinlock.
You can get related setting with make menuconfig.

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
2023-11-05 13:36:14 +08:00
raiden00pl
57f98ee20e industrial/foc: add options to configure foclib logs 2023-11-05 12:15:03 +08:00
Bowen Wang
d6522be9b5 testing/epoll: add epoll test case
This commid add an epoll testcase to test the epoll
Test case 1: epoll_wait timeout test.
Test case 2: epoll_wait with driver call poll_notify()
             many times simultaneously.
Test case 3: epoll_wait with some driver/socket need call
             poll_setup() again when it's internal state
             changed.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-11-02 14:49:54 +08:00
yinshengkai
647db6393d nsh: rename CONFIG_SCHED_CPULOAD to CONFIG_SCHED_CPULOAD_NONE
Explicitly select dependencies to avoid automatically selecting inappropriate configurations.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-11-01 09:23:07 +08:00
raiden00pl
b8c35f667e remove nshlib/README.md which is already in Documentation/applications/nsh 2023-10-30 20:33:41 +08:00
Stuart Ianna
8f56bc1de2 testing/sd_bench: Port sdbench testing utility for PX4-Autopilot.
Add port of the sdbench utility from PX4-Autopilot: https://github.com/PX4/PX4-Autopilot

This tool is useful for evaluating and testing peformance of SD cards,
block devices or mount points.
2023-10-30 16:58:10 +08:00
raiden00pl
532bcc5061 remove logging/xxx/README.md. Migrated to Documentation/applications/logging 2023-10-30 10:00:01 +08:00
raiden00pl
a0b34e89d2 remove fsutils/xxx/README.md. Migrated to Documentation/applications/fsutils 2023-10-30 10:00:01 +08:00
raiden00pl
a6d30540fb remove crypto/xxx/README.md. Migrated to Documentation/applications/crypto 2023-10-30 10:00:01 +08:00
raiden00pl
2fac780f37 remove boot/xxx/README.md. Migrated to Documentation/applications/boot 2023-10-30 10:00:01 +08:00
raiden00pl
397da8f752 remove audioutils/xxx/README.md. Migrated to Documentation/applications/audioutils 2023-10-30 10:00:01 +08:00
raiden00pl
26f1b07955 remove interpreters/xxx/README.md. Migrated to Documentation/applications/interpreters 2023-10-30 10:00:01 +08:00
raiden00pl
4dfd474ae9 remove industry/xxx/README.md and modbus/README.md. Migrated to Documentation/applications/industry 2023-10-30 10:00:01 +08:00
raiden00pl
24338bb477 remove tools/README.md. Migrated to Documentation/applications/tools 2023-10-30 10:00:01 +08:00
raiden00pl
008aba12d4 remove netuitls/xxx/README.md. Migrated to Documentation/applications/netutils 2023-10-30 10:00:01 +08:00
raiden00pl
d313bbad9c remove graphics/xxx/README.md. Migrated to Documentation/applications/graphics 2023-10-30 10:00:01 +08:00
raiden00pl
7e918964e4 remove examples/xxx/README.md. Migrated to Documentation/applications/examples
part of examples/bastest is moved to examples/bastest.testcases.md
2023-10-30 10:00:01 +08:00
raiden00pl
14f19f0e7d remove testing/xxx/README.md. Migrated to Documentation/applications/testing 2023-10-30 10:00:01 +08:00
raiden00pl
0f57c32561 remove wireless/xxx/README.md. Migrated to Documentation/applications/wireless 2023-10-30 10:00:01 +08:00
raiden00pl
4acad717fe remove system/xxx/README.md. Migrated to Documentation/applications/system 2023-10-30 10:00:01 +08:00
raiden00pl
292b0cbc28 examples/foc: change the velocity ramp parameters scale to x1
controlling the ramp with greather accuracy makes no practical sense
2023-10-29 10:40:27 +08:00
raiden00pl
8568439b80 examples/foc: configure acceleration and deceleration from command line 2023-10-29 10:40:27 +08:00
jinxiuxu
518b1aea61 system/nxrecorder: add amr offload record support
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2023-10-27 21:00:59 +08:00
xuxin19
4439b242d8 Application.mk:ensure that the order when AROBJS is compiled multiple times
sort the target files to ensure that the files in each batch are the same every time
and clean AROBJS.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-10-27 11:52:29 +08:00
xuxin19
efa1f51915 archive:create a copy rule for the ojbs with the same name
when there are too many target files in archive and need to be processed in batches,
in order to avoid file replacement due to duplicate names,
we dynamically rename the target files here.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-10-27 11:52:29 +08:00
chenrun1
09bb3b5853 apps:move test tools to testing.
1.memstress
2.ramtest
3.ramspeed
4.cachespeed

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-10-26 13:17:28 +02:00
Ville Juven
3ff49e86f5 nshlib/nsh_fileapps.c: Remove sched_lock() from nsh_fileapp()
Locking the scheduler prior to calling posix_spawn() might lock the
scheduler for a relatively long time, if the file to be loaded is large.

posix_spawn() loads the process into memory, possibly linking it as well
if the binary format is linkable (elf). This can take tens / hundreds of
milliseconds, which basically destroys the OS's real time performance.

Missing the death-of-child signal is a very trivial penalty considering
the alternative.
2023-10-26 00:24:58 +08:00
Junbo Zheng
c0da2b2a0e nshlib: correct ls -l command output format
Since the output format will be messed up with a size of GB.

before
```
ap> ls -l
/dev:
 brw-rw-rw-       0       0314572800 app
 dr--r--r--       0       0       0 audio/
 crw-rw-rw-       0       0       0 buttons
 crw-rw-rw-       0       0       0 console
 brw-rw-rw-       0       0104857600 coredump
 crw-rw-rw-       0       0       0 crypto
 brw-rw-rw-       0       02214592512 data
```

after
```
ap> ls -l
/dev:
 brw-rw-rw-       0       0   314572800 app
 dr--r--r--       0       0           0 audio/
 crw-rw-rw-       0       0           0 buttons
 crw-rw-rw-       0       0           0 console
 brw-rw-rw-       0       0   104857600 coredump
 crw-rw-rw-       0       0           0 crypto
 brw-rw-rw-       0       0  2214592512 data
```

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2023-10-26 00:24:40 +08:00
dongjiuzhu1
e61ff51e67 system/popen: remove O_CLOEXEC if mode exinclude 'e'
refs: https://man7.org/linux/man-pages/man3/popen.3.html

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-10-26 00:24:28 +08:00
dongjiuzhu1
cc66e34fbf rexecd: avoid socket/pipe/socketpair dup to new task
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-10-26 00:24:28 +08:00
Ville Juven
57011d2313 import/Make.defs: Fix erroneous formatting of make condition
Fixes:

/apps/import/Make.defs:79: extraneous text after 'else' directive
2023-10-25 17:23:03 +03:00
liqinhui
5ae44f9bc4 wapi: Fix disconnect crash.
The ssid string has no terminator, which causes a out of bounds.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-10-25 14:58:41 +03:00
Stuart Ianna
4576b3923c testing/sd_stress: Port sdstress testing utility from PX4-Autopilot.
Add port of the sdstress utility from PX4-Autopilot:  https://github.com/PX4/PX4-Autopilot

This tool is useful for verifying correct operation of SD, EMMC, or other mountpoints.
2023-10-25 15:41:27 +08:00
Stuart Ianna
877509762c import/mk: Use libm from the export package when defined.
Nuttx exports libm.a when `CONFIG_LIBM` is enabled. Adjust the application import makefile to pick this up when linking.
2023-10-25 15:40:19 +08:00
Stuart Ianna
a21476beab netutils/netinit: Reduce net monitor delay on platforms without 64 bit time type.
Waiting for an hour can cause the calculated tick count in nxsem_clockwait to overflow due to the default width of sclock_t.

Reduce the long wait period on platforms not using 64-bit time.
2023-10-25 15:39:25 +08:00
Michal Lenc
d3508b6acd testing: add fmemopen function test tool
Test tool application for fmemopen for CI testing. Performs basic
read/write/seek/append operations.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-10-25 00:27:14 +08:00
Alan Carvalho de Assis
dfea0aad48 apps/games: Rename Shift game to Brickmatch 2023-10-24 13:53:51 +08:00
Stuart Ianna
e55f28594c examples/calib_udelay: Allow the number of delay loop iterations to be specified by kconfig.
The calibration test can take a long time on platforms with less
processing power. Allow the default value to be changed with kconfig.
2023-10-24 12:38:45 +08:00
Stuart Ianna
7605197f9d netutils/netinit: Perform icmpv6 autoconfiguration when link transitions from down to up.
Without this addition, icmpv6 is never configured in the case that the
device is powered on without an ethernet cable connected.
2023-10-24 12:38:24 +08:00
chenrun1
15ad46fff9 ramspeed:Fix the problem that the "-i" option doesn't work.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-10-24 09:36:36 +08:00
chenrun1
2d7bfa2390 memorystress:Enhanced debugging capabilities
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-10-24 09:35:59 +08:00
chenrun1
daae92ea92 memtester:Modify the misnaming in Kconfig
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-10-23 19:25:29 -03:00
Xiang Xiao
f2fcbe7ccf testing: Swith up_perf_xxx to perf_xxx
follow up the the kernel change:
https://github.com/apache/nuttx/pull/10834

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
2023-10-23 11:52:07 -03:00
raiden00pl
e65a4500e8 wolfssl depends on ALLOW_GPL_COMPONENTS 2023-10-23 22:26:23 +08:00
raiden00pl
6a3a180e1e examples/bmp180: remove references to bmp280 which already has its own example 2023-10-23 22:26:13 +08:00
raiden00pl
fdabc7eccc netutils/netinit/Kconfig: cosmetics 2023-10-23 22:26:13 +08:00
raiden00pl
2ac77e3e98 system/ntpc/Kconfig: cosmetcis 2023-10-23 22:26:13 +08:00
raiden00pl
67c58a3263 system/ptpd/Kconfig: cosmetics 2023-10-23 22:26:13 +08:00
raiden00pl
11907f7056 remove empty examples/canard 2023-10-23 22:26:13 +08:00
raiden00pl
dbdd59e52f remove empty netutils/usrsock_rpmsg 2023-10-23 22:26:13 +08:00
Philippe Leduc
3d80541769 Add stepper example 2023-10-21 11:04:41 +08:00
raiden00pl
aad2bcb621 examples/foc: use the current configuration values when printing the help message
This is useful when tuning the controller and running application many times with different parameters from the NSH
2023-10-19 19:18:48 -04:00
Filipe Cavalcanti
36a9ccc3a8 Makefile - library download and compilation ok
Working read from mpu6050 - fixed makefile issues

Succesfull yaw pitch roll reads

Linter fixes - still erroring on mixed case

Added inertial lib

Fixed makefile to use inertial lib

Kconfig fix
2023-10-19 19:18:28 -04:00
raiden00pl
ce2ee9bb3f industry/foc: use b16sign() instead of custom ABS() macro
fixedmath now supports sign functions so we no longer need to use a dedicated macro
2023-10-19 19:34:04 +08:00
raiden00pl
1c922f2d2d examples/foc: add phase angle observer support (sensorless mode)
This app can work now as sensorless ESC.

Also introduce a cmd line option that force open-loop control
which is useful when tuning angle/velocity observers
2023-10-19 19:33:43 +08:00
Michal Lenc
a4ceb82d67 testing/fstest: add number of correct/incorrect tests
Verbose output for CI testing with OK and FAILED number of tests.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-10-18 16:52:24 -04:00
Michal Lenc
cd1d855a71 testing/scanftest: add number of correct/incorrect tests
Verbose output for CI testing with OK and FAILED number of tests. File
name is also now configurable with TESTING_SCANFTEST_FNAME.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-10-18 16:52:24 -04:00
raiden00pl
8398297518 examples/foc: add an option to call nxscope work from control thread
This alows nxscope data to be sent with every cycle of the control loop,
which increases the execution time of the control loop, but allows data
to be sent at a highier frequency using the small nxscope buffer.

Useful when tuning and debuging using RTT transfer.
2023-10-19 01:24:07 +08:00
zhangyuan21
ef86a99093 ostest: Add smp function call test case
This is test case for PR#10934.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-10-18 22:20:48 +08:00
makejian
8c95ab94d3 crypto/mbedtls: Unified configuration with mbedtls default configuration
The configuration of Kconfig used by the nuttx before is not consistent with the mbedtls default configuration. This patch update configuration is consistent with the default configuration.
Signed-off-by: makejian <makejian@xiaomi.com>
2023-10-18 21:18:35 +08:00
makejian
9fa9c5b0a2 netutils/dhcpc: Add configuration check for getrandom
Calling getrandom depends on 'CONFIG_DEV_URANDOM' or 'CONFIG_DEV_RANDOM'
depends on patch https://github.com/apache/nuttx/pull/10925
Signed-off-by: makejian <makejian@xiaomi.com>
2023-10-18 19:47:48 +08:00
raiden00pl
f117860a16 industry/foc/ramp: fix acceleration in CCW direction and simplify code 2023-10-18 14:16:53 +08:00
raiden00pl
4652c5516d examples/foc: rename SETPOINT_ADC_SCALE to SETPOINT_INTF_SCALE
SETPOINT_INTF_SCALE is more appropriate name because this definition is not only used for ADC scale
2023-10-18 14:15:47 +08:00
raiden00pl
de6a384668 examples/foc: add velocity PI controller 2023-10-18 14:15:12 +08:00
raiden00pl
9dde6983e6 examples/foc: add support for feedforward compensation 2023-10-17 22:45:26 +08:00
raiden00pl
c8a4abfcb2 examples/foc: remove align configuration checks
these are already done when you configure the align routine
2023-10-17 22:42:42 +08:00
raiden00pl
fd0da7d4df examples/foc: open-loop needs initial phase alignment 2023-10-17 22:42:42 +08:00
raiden00pl
8e0819df04 examples/foc: add velocity observers 2023-10-17 22:42:42 +08:00
raiden00pl
9bcca69967 examples/foc: initialize motor phy 2023-10-17 22:42:42 +08:00
raiden00pl
9ee4daea43 examples/foc: configure active breake current 2023-10-17 14:24:58 +08:00
raiden00pl
6cf6a73fc0 industry/foc: add support for PMSM feedforward compensation
reference: https://electronics.stackexchange.com/questions/386246/field-oriented-control-feed-forward-term
2023-10-17 14:24:23 +08:00
raiden00pl
e8ff9ad005 foc/example/Kconfig: cosmetics 2023-10-17 14:23:42 +08:00
raiden00pl
969607ac44 examples/foc: fix setpoint scale for char interface 2023-10-17 14:23:42 +08:00
raiden00pl
4c4976a4e9 examples/foc: add warning if no controller enabled 2023-10-17 14:23:42 +08:00
raiden00pl
5dd4813b34 examples/foc: fix wrong nxscope functions for fixed16 2023-10-16 13:53:40 -04:00
raiden00pl
53b7486528 industry/foc: reset velocity observer output foc_velocity_zero_xx() is called 2023-10-16 13:46:09 -04:00
raiden00pl
5a65f3d48f industry/foc: reset align data when align is finished
this allows the align procedure to be run multiple times
2023-10-16 13:44:37 -04:00
raiden00pl
8ee684e586 industry/foc: make direction alignment configurable
for sensorless velocity controller (ESC) we don't need to align the direction,
but we have to align the initial motor phase each time the motor start
2023-10-16 13:44:37 -04:00
raiden00pl
768d5b29f1 industry/foc: force angle observers output to zero if motor stopped
this prevents junk data from the observer when the motor is stopped
2023-10-16 13:42:57 -04:00
Xiang Xiao
fe7f217497 nshlib: losetup/lomtd change "-s <sectsize>" to "-b <sectsize>"
to follow host tool usage:
https://github.com/util-linux/util-linux/blob/master/sys-utils/losetup.c#L473

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-16 13:14:48 -04:00
raiden00pl
baa23afbd3 industry/foc/openloop: don't use direction argument, instead use signed velocity
otherwise, when dir=-1 and the velocity value is negative, the output from
velocity is in the opposite direction than the intended one
2023-10-16 13:11:49 -04:00
raiden00pl
a36318c536 industry/foc/fixed16/foc_ang_onfo.c: use b16abs operation
we get rid of custom ABS() macro
2023-10-16 22:36:34 +08:00
chao an
929f1009c7 system/readline: correct the readline(3) prototype
Reference:
https://man.openbsd.org/readline.3

Signed-off-by: chao an <anchao@xiaomi.com>
2023-10-16 22:04:18 +08:00
raiden00pl
6a814dd41f industry/foc/nfo: use float numbers in all calculations
we want to use FPU instructions in calculations not __aeabi
2023-10-15 22:45:13 +08:00
SPRESENSE
7de8d0603f wireless/gs2200m: Fix handling of ioctl except SIOCDENYINETSOCK
When running a dual stack (usrsock daemon and kernel stack),
ioctl requests that should be handled by the kernel stack are being
processed by the usrsock daemon. This causes ifconfig and ifup to fail.
The usrsock daemon that receives an ioctl request that should be
handled by the kernel stack should reply with ENOTTY.
Replying with ENOTTY means that the ioctl request can fall back to the
kernel stack.
2023-10-13 08:48:25 +02:00
liqinhui
79e8722743 dhcp6c: Add the renew6 command for dhcp6c.
Support Stateless and Stateful. The renew6 is used as follows:
 - Stateless: renew6 eth0
 - Stateful: renew6 eth0 1

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-10-12 10:15:55 +08:00
Michal Lenc
91a682f11b testing: add test application for fopencookie utility
Adds test application for fopencookie utility. The test tool performs
write/read/seek operations on custom stream defined at user space.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-10-10 01:03:42 +08:00
Michal Lenc
529c0f1fc9 system: use fileno to get stream file descriptor
There is a POSIX defined interface to get file descriptor from file_struct
stream. Applications should use it and not access the structure directly.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-10-10 01:03:42 +08:00
xuxin19
a3bbea86ff remove the check that progname matches mainsrc
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-10-10 01:02:50 +08:00
xuxin19
77a5666cb7 Revert "fix progname do not match issue"
This reverts commit c230321cae.
2023-10-10 01:02:50 +08:00
Huang Qi
1e5e755ba2 examples: Split hello example into hello and hello_wasm
Decouple the hello example into hello and hello_wasm. The hello_wasm
example is a minimal example to show how to build a wasm application
by using the NuttX build system, and avoid disturbing the hello
(native build).

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-10-08 14:53:08 +08:00
Junbo Zheng
3177a9be84 crypto/mbedtls: fix kconfig typo
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2023-10-06 20:49:06 +08:00
Petteri Aimonen
5a992d4e18 Add basic IEEE-1588 PTP server/client
What works:
- Basic server & client operation
- Transmission and reception of announce, sync and follow-up

Still missing:
- SO_TIMINGS for getting more precise packet timestamps
- Implementation of delay_req and delay_resp packets
- Status and stop interfaces for the daemon
2023-10-06 17:25:23 +08:00
Petteri Aimonen
c340d735ec adjtime: Fix wrong printf format when using CONFIG_SYSTEM_TIME64 2023-10-06 17:25:23 +08:00
ThomasNS
06b4911db4 add shm example using fs shm 2023-10-06 17:24:44 +08:00
raiden00pl
b88057fffd examples/foc: support svm3 state with nxscope 2023-10-05 20:42:46 +08:00
raiden00pl
a56f0922c5 industrial/foc: add an interface that returns the modulation state
Useful for debugging and demonstrating FOC operation
2023-10-05 20:42:46 +08:00
raiden00pl
97e2be0033 logging/nxscope/nxscope.c: fix indentation 2023-10-05 20:42:46 +08:00
SPRESENSE
719d03a8c1 lte/alt1250: Change error code from ENOTSUP to EAFNOSUPPORT
ENOTSUP is now a special error code to fallback to the kernel network stack.
Therefore, change the error code from ENOTSUP to EAFNOSUPPORT.
2023-10-03 10:32:18 +02:00
raiden00pl
5cbd9b2b7b examples/foc: allow nxscope transfer over RTT interface
For UART serial interface TERMIOS is required, but for RTT serial interface it's not.
2023-10-02 21:46:52 +03:00
raiden00pl
f505b6cb08 nxscope/serial: ignore baud configuration if set to 0 2023-10-02 21:46:52 +03:00
Eren Terzioglu
85eb37c62b examples/can: TX and RX structs assigned 0 at startup 2023-09-28 19:14:21 +08:00
anjiahao
ddaa1411a3 system/zlib:fix makefile rule
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-09-28 08:50:55 +02:00
Xiang Xiao
2d6d199c49 Fix drivertest_watchdog.c:284:33: error: storage size of 'reset_cause' isn't known
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-26 00:45:16 +03:00
halyssonJr
02db9c7612 create app for wiegand protocol
update app for wiegand protocol

improve wiegand app

app improvement and fix Kconig
2023-09-25 16:21:40 -04:00
anjiahao
a48810f4a5 zlib:add support for zlib
We can use zip & unzip commands in nuttx

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-09-26 02:28:46 +08:00
Xiang Xiao
9e31a26edc Fix nsh_altconsole.c:152:41: error: implicit declaration of function 'strlen'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-26 00:31:09 +08:00
Xiang Xiao
610ba20527 Fix ./drivertest_rtc.c:43:10: fatal error: nuttx/time.h: No such file or director
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-25 23:03:00 +08:00
Ville Juven
e9f4e87786 nsh_alias.c: unalias -a command does not work correctly
getopt returns the argument if it is found, so testing against != ERROR is
wrong.
2023-09-25 21:05:37 +08:00
makejian
851a4aa904 crypto/mbedtls: load certificate memory optimization
Reducing the use of memory due to multiple network links loading certificates
Signed-off-by: makejian <makejian@xiaomi.com>
2023-09-25 14:49:39 +08:00
Xiang Xiao
483e6bae27 build: Remove staging folder in distclean
forgot in pr: https://github.com/apache/nuttx-apps/pull/1509

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-25 01:10:29 +03:00
Xiang Xiao
99a8c5937c Fix drivertest_watchdog.c:207:30: error: 'struct wdg_state_s' has no member named 'infopath'
Remove the unsupported -p option

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-25 01:08:49 +03:00
yinshengkai
3e870833ab testing: fix osperf running error in SMP mode
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-09-23 15:10:23 +08:00
yinshengkai
9d8a364e16 testing/osperf: fix qemu-armv8a compilation error
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-09-23 15:10:23 +08:00
likun17
009c9ad13f apps/system/uorb/test/unit_test.c: add orb_copy return judgment.
Signed-off-by: likun17 <likun17@xiaomi.com>
2023-09-23 13:18:52 +08:00
hujun5
5c5c6653fd libuv: fix build error
If UV_ONCE_INIT is a struct, the following errors will occur:

libuv/src/unix/nuttx.c: In function 'uv__global_get':
/home/hujun5/downloads1/vela_sim/apps/system/libuv/libuv/include/uv/unix.h:136:22: error: expected expression before '{' token
  136 | #define UV_ONCE_INIT PTHREAD_ONCE_INIT
      |                      ^~~~~~~~~~~~~~~~~
libuv/src/unix/nuttx.c:287:26: note: in expansion of macro 'UV_ONCE_INIT'
  287 |           global->once = UV_ONCE_INIT;
      |                          ^~~~~~~~~~~~
/home/hujun5/downloads1/vela_sim/apps/system/libuv/libuv/include/uv/unix.h:136:22: error: expected expression before '{' token
  136 | #define UV_ONCE_INIT PTHREAD_ONCE_INIT
      |                      ^~~~~~~~~~~~~~~~~
libuv/src/unix/nuttx.c:288:50: note: in expansion of macro 'UV_ONCE_INIT'
  288 |           global->uv__signal_global_init_guard = UV_ONCE_INIT;

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-09-23 13:18:27 +08:00
raiden00pl
1050d3028b libsodium depends on ICS license 2023-09-22 20:42:18 +08:00
SPRESENSE
d6ed8880d8 lte/alt1250: Correspond to shutdown
ALT1250 daemon to support shutdown.
2023-09-22 16:25:09 +08:00
dulibo1
049aaa4c96 pmconfig: check domain if invaild return error avoid to crash
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-09-22 09:16:54 +08:00
dulibo1
dd9290b6bd pm:add pm runtime testcase
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-09-22 09:16:24 +08:00
Daniel P. Carvalho
e62e1e91fe Fixes compiler warnings while printing uint32_t and int32_t values. 2023-09-22 09:14:20 +08:00
zhangchao53
60778f6f8c support xml report and generate tool
Signed-off-by: zhangchao53 <zhangchao53@xiaomi.com>
2023-09-21 12:14:12 +08:00
0528Mike
a46a661b34 Update nshlib/nsh_codeccmd.c
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-21 10:48:29 +08:00
wangmingrong
2459476b65 nshlib: Implementation of modifying command md5
Simplify the "cmd_codecs_proc" md5 related framework and modify the implementation of the command md5:

Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2023-09-21 10:48:29 +08:00
daniellizewski
a4ab405faa Fix typo in uint8_t 2023-09-21 10:45:17 +08:00
SPRESENSE
6a69f0e96f wireless/gs2200m: Add support SIOCDENYINETSOCK ioctl command
Support SIOCDENYINETSOCK ioctl command to set usrsock status.
If usock_enable is false, its means application wants to create
a socket with other network stack.
2023-09-21 01:13:39 +08:00
Xiang Xiao
dbdba4c254 interpreters/duktape: Add -Wno-unused-but-set-variable to CLAGS
To fix error: variable 'num_stmts' set but not used [-Werror,-Wunused-but-set-variable]
                duk_int_t num_stmts;

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-19 11:27:21 +08:00
Xiang Xiao
17692ffc5f Revert "interpreters/duktape: Fix error: variable 'num_stmts' set but not used"
This reverts commit 801046cd78.
2023-09-19 11:27:21 +08:00
guoshichao
68b3030f23 testing/ltp: add config.h file
this config.h using to control the test procedure of the relative
test cases. this config.h file is generated by ltp project internal
build file, as we are nuttx build system, so need to manage this file
by manual

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-09-19 11:13:44 +08:00
dependabot[bot]
bf44d4b1bb build(deps): bump docker/login-action from 2 to 3
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-19 11:13:16 +08:00
Huang Qi
a22aeb00ed tools: Lock wasm archive during ar rcs
Fix issues with multi thread compilation.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-09-19 11:10:13 +08:00
makejian
ab7fd12e1d mbedtls: use 'getrandom' to get system entropy
use getrandom to get system entropy and not dependent on config DEVURANDOM
Signed-off-by: makejian <makejian@xiaomi.com>
2023-09-19 00:41:24 +08:00
Huang Qi
08a4b76a2f libuv: Upgrade to v1.46.0
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-09-18 12:40:13 +08:00
Xiang Xiao
801046cd78 interpreters/duktape: Fix error: variable 'num_stmts' set but not used
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-17 22:50:08 +03:00
Daniel Appiagyei
b37e84b05f c++ compatibility: rename usages of reserved c++ keywords 'this' and 'public' 2023-09-16 19:45:52 +08:00
SPRESENSE
a9a8fbbc4a lte/alt1250: Fix bug that name resolution failed for a long time
Fix bug that name resolution failed for a long time under particular cases.
If a DNS query for IPv6 succeeds and IPv4 fails, only the answer of the
IPv6 query is saved in the cache. If only IPv4 is given from LTE,
name resolution will fail while the answer is saved in the cache.
Therefore, the ALT1250 daemon sets the given IP type to the DNS client,
which can only send DNS queries for that IP type.
2023-09-16 18:09:29 +08:00
TaiJuWu
9f2f86441d Fix sigprocmask
1. SIGSTOP and SIGKILL should not be used as test. In g_some_signals,
SIGKILL is used.

2. The SIGSTOP and SIGKILL flags of current task are set so we need to
delete them.
2023-09-16 00:08:34 +03:00
wangyingdong
2e5139eba4 dhcpd:Optimize the data area memory and reduce it by about 1k bytes
If a daemon app(e.ot_client) starts dhcpd by calling dhcpd_start and needs to shut it down after use,
then the global static variables ds_inpacket and ds_outpacket will always occupy the data area,
causing unnecessary waste.

Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-09-13 21:49:49 +08:00
Xiang Xiao
8f58d34e06 system/adb: Download the latest package
to fix error: microADB/hal/hal_uv.c:32:38: error:
a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-13 21:08:23 +08:00
chao an
1f96e32fcd makefile/archive: fix build break if object target is split to multi-part
Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-13 17:15:05 +08:00
Xuxingliang
facc9ddc63 testing/mm: use unified name for macros
All macros in mm.h start with MM_

Signed-off-by: Xuxingliang <xuxingliang@xiaomi.com>
2023-09-12 22:09:43 +08:00
chao an
52353a7eb2 apps/build: Restore ARLOCK to improve compile speed in incremental case
To solve the issue of carrying object files from previous builds,
Matias changed the archiving process to re-archive libapps.a on every compilation,
if libapps.a carries more object files, incremental compilation will waste too
many time in re-archiving, compared with the previous implement, this is a degradation
of the build system.  Referring to mature engineering projects such as cmake, if there
is configuration or source file changed, the best solution should be to reconfigure
the environment.

Revert this PR to ensure the compilation speed during incremental compilation.

|  commit 18137c0fec
|  Author: Matias N <matias@protobits.dev>
|  Date:   Sat Sep 12 00:36:23 2020 -0300
|
|      Fix: ensure archive files do not carry object files from prior builds
|
|      This is the corresponding change to the one on main NuttX repo. In this
|      case this involves splitting the build of libapps.a into: a) building
|      all applications (which is safely parallelizable), b) adding each
|      application's object files to the archive in turns (serial by nature).
|
|      This removes the need for the flock used to protect the parallel build.

Testing:

sim:nsh
-------------------------------
|   Patched    |  Current
-------------------------------
|$ time make   |  $ time make
|real 0m1.270s |  real 0m1.728s
|user 0m0.971s |  user 0m1.276s
|sys  0m0.363s |  sys  0m0.530s
-------------------------------

Private project (20+ 3rd library needs archive to libapps.a)
-------------------------------
|   Patched     |  Current
-------------------------------
|$ time make    |  $ time make
|real 0m21.181s |  real 0m39.721s
|user 0m14.638s |  user 0m24.837s
|sys  0m6.919s  |  sys  0m14.394s
-------------------------------

Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-12 21:55:39 +08:00
wangjianyu3
bf4d873985 system/fastboot: Fix command comparation
e.g. The command is "reboot-bootloader", but will match and break when
     compared  with "reboot"

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2023-09-12 16:26:09 +08:00
Xiang Xiao
2bfb9760ad Fix Error: configdata_main.c:402:14: error: variable 'iteration' set but not used [-Werror,-Wunused-but-set-variable]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-12 10:10:16 +08:00
yangsen5
d2fd626780 nxcamera: Fix compilation warnings caused by format issues
nxcamera_main.c:160:26: warning: format '%d' expects argument of type 'int *', but argument 5 has type 'uint32_t *' {aka 'long unsigned int *'} [-Wformat=]
  160 |   sscanf(parg, "%hd %hd %d %4s", &width, &height, &framerate, cc);
      |                         ~^                        ~~~~~~~~~~
      |                          |                        |
      |                          int *                    uint32_t * {aka long unsigned int *}
      |                         %ld

Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-09-12 10:08:58 +08:00
zhangchao53
791d1fc08d add superpi fold and nist-sts fold to gitignore 2023-09-12 10:08:35 +08:00
makejian
71276b6181 mbedtls-alt/md5: add md5 alternative implementation
add md5 alternative implementation via /dev/crypto
Signed-off-by: makejian <makejian@xiaomi.com>
2023-09-12 10:01:16 +08:00
xuxin19
0ddcedcf6e ignore specific waring on MacOS for CI break
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-09-11 20:40:22 +08:00
xuxin19
258d637df3 Makefile:resolve Mac make error block
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-09-11 20:40:22 +08:00
Xiang Xiao
fc5351b4b9 Fix coremark/core_util.c:210:17: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-11 16:40:53 +08:00
xuxin19
c230321cae fix progname do not match issue
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-09-11 16:37:05 +08:00
xuxin19
55647b8458 Application.mk:upgrade warning to error
for the case where MAINSRC and PROGNAME do not match

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-09-11 16:37:05 +08:00
chao an
7dda7f1dee crypto/mbedtls: fix build break on sha256.c
Build break on Assemble compiler if -fno-omit-frame-pointer and -O3 enabled at same time

{standard input}: Assembler messages:
{standard input}:2560: Error: branch out of range
make[2]: *** [apps/Application.mk:170: mbedtls/library/sha256.o] Error 1

Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-11 16:33:05 +08:00
zhangchao53
28d4c58448 run testsuites where name match pattern value of --suite 2023-09-08 16:01:06 +03:00
wangmingrong
5e59b0b384 nshlib: Fix static scanning errors
Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2023-09-08 18:49:31 +08:00
guoshichao
b7e08d4fba ltp/makefile: rm the ltp.zip file after unzipped
the ltp.zip file is not tracked in git record, so after download and
unzip finished, we do not need to keep this ltp.zip file.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-09-08 17:24:34 +08:00
wangmingrong
a9f0fc55d1 codecs: add md5_file API
Add the API for 'md5_file' to directly obtain the digest value by passing in the file path

Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2023-09-08 02:11:23 +08:00
xucheng5
723b91851f app/ltp : enable can_filter/can_rcv_own_msgs
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-09-07 11:24:47 +03:00
SPRESENSE
0f9605e143 lte/alt1250: Fix usrsock_bind error by uninitialized value
Fix usrsock_bind error by an undefined events variable which is caused
by NuttX usrsock update.
2023-09-07 14:07:43 +08:00
SPRESENSE
9a11ede5ff lte/alt1250: Fix issue that ifconfig does not work
Add SIOCGIFFLAGS support for ifconfig command.
2023-09-07 14:07:43 +08:00
guohao15
a8598aa8d2 app:ramspeed the result of repeat_cnt * step has been truncated
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2023-09-07 13:52:09 +08:00
chenrun1
2639f044cc drivertest_block:Fix insufficient number of erasures for mtd devices
when operating multiple rwblocks.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-09-07 13:51:29 +08:00
makejian
16a1655bba testing/crypto: fix aescbc crash when update iv
iv content always should be updated when performing encryption operation, so need update testing case
Signed-off-by: makejian <makejian@xiaomi.com>
2023-09-07 13:15:35 +08:00
fengxuesong
ee0bc579c1 solve CI compilation error problem
Signed-off-by: fengxuesong <fengxuesong@xiaomi.com>
2023-09-06 19:21:19 +03:00
Xiang Xiao
a5ef6d57c1 system/cu: Remove the dependence on stdio FILE * function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-06 14:29:34 +02:00
Xiang Xiao
5f9d9bb1c2 system/cu: Support the custom escape char
note: -f could be achieved with -E '' like https://linux.die.net/man/1/cu

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-06 14:29:34 +02:00
Xiang Xiao
b60cdf4927 system/cu: Skip the terminal related stuff if dev isn't a tty
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-06 14:29:34 +02:00
Xiang Xiao
3ff51d108b system/cu: Merge infd and outfd into devfd
to avoid opening the same device twice since
some special device can't work in this case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-06 14:29:34 +02:00
dinglongfei
5cced37a1b system: support system fastbootd
Add the fastbootd program to support the flash, getvar, and reboot commands.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-06 17:27:26 +08:00
yangguangcai
de82824fbf add test atomic
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-09-05 22:10:48 +08:00
dependabot[bot]
14d06ea011 build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 22:09:33 +08:00
Tomáš Pilný
ecded726ce WS2812ESP32 example name is configurable and default name shortened 2023-09-05 12:37:07 +08:00
wangyingdong
21e7a9dc9e Fixed the error that when the driver scan result is empty, iwe_stream->len is a random number because the user data buf is not initialized.
Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-09-05 12:34:13 +08:00
xuxin19
2432a62ab6 fix cmake code smell issues
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-09-04 23:19:26 +08:00
guoshichao
c57794fe1f ltp/makefile: apply that patch that to fix the build warning in ltp
the origin ltp testcases has many build warnings which consider error in
Nuttx, thus to apply the patches to fix these build warnings

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-09-03 22:12:57 +08:00
Xiang Xiao
6aa05b5855 Replace strlen with sizeof for kconfig string
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-02 16:26:51 +03:00
zhanghongyu
956b935511 mqttc: add mbedtls MQTTC support
The mqttc demo under example path can not support mbedtls api.
Because of the MQTT-C source code already contains many types of
link examples, so we added the corresponding makefile to
support mbedtls mqttc connections publisher and posix mqttc
connections publisher and subscriber.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-01 23:21:34 +08:00
Tiago Medicci Serrano
9a68248f29 system/nxlooper: Initialize audio_caps_s to 0
This avoids unspecified values to be passed to the lower interfaces
of the audio subsystem.
2023-09-01 23:20:51 +08:00
simbit18
17a497492a Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
Add comments
2023-09-01 01:21:54 +08:00
xuxin19
a2e6e6c243 Application.mk:execute archive in batches
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-31 11:41:04 +08:00
jianglianfang
201a57440c system/nxcamera: add pan_display when it is not single buffer.
After optimizing the vync mechanism, it is necessary to use ioctl (display) to refresh the display in dual buffer mode.

run nxcamera.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-08-30 20:51:58 +03:00
renzhiyuan1
fece67ee4b Fix wrong parameter size
Type int expects 4 bytes for function write(). Type char expects 1 byte which matches the real usage of function write().

Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2023-08-30 19:42:57 +03:00
makejian
53878a53db mbedtls: set most of the functions of mbedtls to be configurable
(1)reduce size and improve compilation efficiency
(2)provide more options for greater flexibility
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-30 20:40:11 +08:00
wurui3
4981dbe32b apps/examples/pipe:can't print info to screen after calling redirect_test func.
reason:stdin/stdout was redirected and closed in redirect_test.c.
measures:change all printf() to fprint(stderr,...) in pipe_main.c,
and modify fflush(stdout) to fflush(stderr) in line 231.

Signed-off-by: wurui3 <wurui3@xiaomi.com>
2023-08-30 13:56:33 +08:00
anjiahao
8d7497f7fb memdump:fix bug with space does not parse correctly
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-08-29 23:14:06 +08:00
xuxin19
9f7784ea4d cmake:migrate apps CMakeLists for fsutils
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-29 18:20:37 +08:00
Lingao Meng
518e455dce add macro for ecc
application may use micro-ecc for some ecc operation, which may be
faster than tinycrypt, due to assamble code, but both of them have
same function defination, cause build error on there case.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-08-29 12:19:26 +03:00
chenrun1
844a31b24c memtester:update format
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-08-29 17:07:58 +08:00
chenrun1
56045e8e3d memtester:Two new bit-width test items
Because it may cause unaligned access problems with some hardware, these
two tests are not turned on by default, and are enabled or disabled
through Kconfig.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-08-29 17:07:58 +08:00
chenrun1
de3746e2ba memtester:Adaptation of memtester
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-08-29 17:07:58 +08:00
chao an
6923c9cf57 testing: fix visual studio Compiler Error C2057
expected constant expression
The context requires a constant expression, an expression whose value is known at compile time.
The compiler must know the size of a type at compile time in order to allocate space for an instance of that type.

Reference:
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2057?view=msvc-170

Signed-off-by: chao an anchao@xiaomi.com
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 15:44:09 +08:00
dulibo1
afcc8d8f62 regulator:add testcase for regualtor register
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-29 13:41:08 +08:00
Niklas Hauser
78a6d07a90 nshlib/nsh_consolemain: detect null pointer
Returning with an error from nsh_consolemain prevents dereferencing a
NULL pointer later in the code.
2023-08-29 03:11:28 +08:00
wangmingrong
7981278021 apps/nshlib: Add the pidof command and API nsh_getpid
Add the API "nsh_getpid" in "nsh_fsutils. c" and the nsh command pidof. Temporarily support two parameters, - s, and process name

Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2023-08-29 02:58:45 +08:00
yanghuatao
658b847384 apps/rpsock_client: Fix rpsock_client.c [-Wformat=] warning
Fix warning:
CC:  rpsock_client.c rpsock_client.c: In function 'rpsock_unsync_test':
rpsock_client.c:203:30: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
  203 |                       printf("client check fail total %d, \
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  204 |                               i %d, %08x, %08x\n",
      |                               ~~~~~~~~~~~~~~~~~~~
  205 |                               ALIGN_UP(total), i, intp[i],
      |                                                   ~~~~~~~
      |                                                       |
      |                                                       uint32_t {aka long unsigned int}

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2023-08-28 17:34:02 +03:00
wanggang26
75c8580238 nshlib: fix a typo
painc to panic

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-08-28 17:33:15 +03:00
yinshengkai
5a0bc863dd setlogmask: fix uncloseed handle
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-28 17:09:18 +03:00
makejian
11de514217 mbedtls: update Kconfig
update Kconfig for adapting version v3.4.0
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-27 21:44:10 +08:00
haopengxiang
26e2736863 benchmarks/coremark: apply SEED_METHOD/MEM_METHOD update
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2023-08-26 20:03:06 +08:00
liaoao
1243c0ba4d libfdt: modify makefile
update LIBFDT to LIBC_FDT
move version_gen.h and place it under nuttx/libs/libc/fdt/
change include path to nuttx/libs/libc/fdt/dtc/

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-26 17:06:55 +08:00
liuhongchao
a3dfef117b apps/examples:Add keyboard example
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2023-08-26 17:02:48 +08:00
fangxinyong
512af7fbd7 ltp/makefile: filter testcases based on defconfig
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-25 21:17:56 +03:00
SPRESENSE
5058a0dba7 Application.mk: Remove warning that program names mismatch
Avoid warning when PROGNAME contains space blank.
2023-08-26 01:18:10 +08:00
raiden00pl
0cd1901da9 boot/miniboot: hide miniboot options if not enabled 2023-08-26 01:17:42 +08:00
Ville Juven
94d477b3df nshlib/nsh_console.h: Add nsh_none, where any empty output can be forwarded
Add nsh_none to consume all empty traces from nsh.

For the variadic argument case need to add a (inline) function to eat
away the __VA_ARGS__ list, there is no good / portable way to do this by
pre-processor macros, but a function will eat the variadic list whatever
its size is.
2023-08-25 17:18:35 +08:00
Ville Juven
1668c3e97d Revert "nshlib/nsh_timcmds.c: Suppress warning about unused variable (errfmt)"
This reverts commit 4ca9b518fa.
2023-08-25 17:18:35 +08:00
makejian
1274aa5c8a mbedtls: mbedtls_selftest depends on MBEDTLS_SSL_DTLS_CONNECTION_ID
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-25 17:02:44 +08:00
haopengxiang
a4f0349813 benchmarks/coremark: fix no coremark in bin
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2023-08-25 08:23:53 +02:00
xuxin19
a091b91d83 cmake:replace custom_patch_target with PATCH_COMMAND
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-24 17:49:12 +02:00
xuxin19
4765cc3411 Application.mk:define main entry MAINNAME relatively
when a program has multiple MAINSRC for incremental compilation,
the PROGNAME of the compiled file may generate errors
-------------------- compile definition error ---------------------
cc -c -g CFLAGS INCLUDEDIR -Dmain=funA_main funB.c -o funB.c.path.o
                             ^^^^  ^^^^^^    ^^^^
-------------------------------------------------------------------
use the MAINOBJ:PROGNAME mapping variable to define the main entry name

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-24 23:36:30 +08:00
chao an
8aa3c1e4b9 system/libuv: export GCCVER to environment
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-24 20:49:22 +08:00
chao an
77e6c39cbd system/libuv: strict GCC version check from GCC-12.2 to GCC-12
Toolchain related detection errors are still not resolved on GCC-12.3

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-23 23:51:14 +08:00
YAMAMOTO Takashi
73f27b7cae toywasm: regen for v33
```
REF=e03d1f61d3f3163da76b33c4c770dbf0d2024324 ./regen.sh
```
2023-08-23 03:02:12 +08:00
YAMAMOTO Takashi
816b499ef8 toywasm: bump to v33 2023-08-23 03:02:12 +08:00
Ville Juven
b65b577ad3 nshlib/nsh_timcmds.c: Suppress warning about unused variable (errfmt)
Fixes following warning:

CC:  grp/lib_getgrbufr.c nsh_timcmds.c: In function 'cmd_date':
nsh_timcmds.c:370:19: warning: variable 'errfmt' set but not used [-Wunused-but-set-variable]
  370 |   FAR const char *errfmt;
      |
2023-08-23 00:17:25 +08:00
dongjiuzhu1
d73e6412b7 apps/gpsutils: move gpsutils to nuttx/libs/libc/gpsutils
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-08-22 23:05:53 +08:00
Zhe Weng
87838bb62c ostest/wqueue: Check return value for pthread ops.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-22 13:55:03 +08:00
Andre Heinemans
8757c6934c Added tools for NXP SE05x (secure element) 2023-08-22 10:12:31 +08:00
Petro Karashchenko
189d0c803f net/ip: print ip addresses using ip4_addrN macro
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-22 01:36:42 +08:00
raiden00pl
2b58cc6578 rptun/ping: fix invalid use of nsh_error after 31421db6f 2023-08-21 18:47:01 +03:00
Xiang Xiao
6716f15d7b testing: Check CONFIG_TLS_NELEM is defined before using it
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-21 15:08:17 +03:00
makejian
18280fdc25 mbedtls-alt: add aes alternative implementation
aes module of mbedtls use alternative implementation via /dev/crypto
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-21 16:10:48 +08:00
raiden00pl
31421db6fa rptun/ping: print invalid arguments error 2023-08-20 22:58:07 +08:00
simonatoaca
4739b18cb1 examples/bme680: Added test program for the BME680 sensor
The program is an example on how to poll the sensor for data when
all its sub-sensors are enabled.

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>
2023-08-18 23:00:32 +08:00
simbit18
00a093e108 Fix Kconfig style
Replace help => ---help---
Add comments
2023-08-18 20:19:22 +08:00
xucheng5
15edd28a69 example/capture : fixed build warning
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-08-18 14:08:33 +08:00
Xiang Xiao
7251645685 Fix some coding style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-17 22:51:51 +03:00
Xiang Xiao
856416540c Remove the definition of MIN/MAX
use the macro in sys/params.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-17 22:51:51 +03:00
Xiang Xiao
054cf3b1cb Change all sizeof(arr)/sizeof(arr[0]) to nitems
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-17 22:51:51 +03:00
xuxin19
8e8d58a915 cmake:migrate apps CMakeLists for libsodium
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-17 14:35:02 +08:00
makejian
c25f5e1955 crypto: fix formatting issues in commit #1932
(1) add 'FAR' in mbedtls_hardware_poll
(2) fix indentation issues in hash testcase
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-17 14:31:41 +08:00
makejian
024a7eeec3 crypto/libsodium: fix libsodium compilation problem
(1)fix unable to pull source code
(2)fix compile warning
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-17 14:31:23 +08:00
huangkai8
323c16a5fb Wrong start and end values would make dead cycle. Exchange the values when start value is bigger than end value. 2023-08-16 20:20:03 +03:00
xuxin19
32b417a8f7 cmake:refine cmake build for apps/examples
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-17 01:15:17 +08:00
Shoukui Zhang
9cf473c88c mtd_config_fs: Default select MTD_CONFIG_NAMED config
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2023-08-16 22:06:28 +08:00
yangjiao
37ac7f923a Update cmocka_main.c to support following functions:
1. list all the testcases with "--list";
2. run some testcases with "--test";
3. show cmocka help message;
4. skip some testcases with "--skip";

Signed-off-by: yangjiao <yangjiao@xiaomi.com>
2023-08-16 01:00:36 +08:00
yangjiao
4b521051d3 cmocka/Kconfig: add the depends on item "LIBC_REGEX".
The "regex" library will be used in cmocka test, so add the dependency relationship for this config.

Signed-off-by: yangjiao <yangjiao@xiaomi.com>
2023-08-16 01:00:36 +08:00
yangjiao
f0f94a1235 testing/cmocka:add a patch.
cmocka modification upload Nuttx community preparation: upload a patch with recent changes for cmocka source code.

Signed-off-by: yangjiao <yangjiao@xiaomi.com>
2023-08-16 01:00:36 +08:00
xuxin19
817ea66e9f cmake:migrate apps CMakeLists for tinycrypt
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-16 00:59:04 +08:00
fengxuesong
3f556c8df4 Fix the bug of i2c_dev
Signed-off-by: fengxuesong <fengxuesong@xiaomi.com>
2023-08-14 13:40:15 +08:00
fengxuesong
c6ee7baca7 Fix the bug of i2c_bus
Signed-off-by: fengxuesong <fengxuesong@xiaomi.com>
2023-08-14 13:40:15 +08:00
liuhongchao
e5bf64d792 apps/examples:Edit arm64 compilation error
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2023-08-14 13:39:59 +08:00
wanggang26
eb815c48d7 ofloader: startup ofloader directly
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-08-14 13:39:42 +08:00
fangxinyong
b0933fe431 builtin: uid and gid configuration for builtin app
File uid and gid configuration for builtin fs, if set-user-ID bit is set
in the file permissions, then the euid of process set as file uid. Use
the confiuration to emulate builtin app set.

MODE must octal number and use similar with linux chmod OCTAL-MODE FILE
UID  = 2000
GID  = 3000
MODE = 06555

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-14 11:47:55 +08:00
liuhongchao
75f04dd775 drivertest:Add touch panel test case.
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2023-08-14 09:05:52 +08:00
Xiang Xiao
2db68e26c4 Fix Error: luv/src/constants.c:674:11: error: implicit declaration of function 'getprotobyname'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-12 15:58:11 +03:00
Xiang Xiao
b586ab839d nshlib: Don't select LIBC_NETDB automatically
since nshlib always call netdb API inside #ifdef CONFIG_LIBC_NETDB

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-12 15:58:11 +03:00
xuxin19
dbfe1a33f1 cmake:migrate libopencyphal for cmake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-12 15:16:15 +08:00
xuxin19
28a5ecfed1 cmake:migrate libdronecan for cmake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-12 15:16:15 +08:00
xuxin19
6e8d83e783 cmake:migrate lely-canopen for cmake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-12 15:16:15 +08:00
huxiandong
5a4e9e4389 nxrecorder: mode is required when oflags include O_CREAT or O_WRONLY
Refer -- fs_open.c:
/* If the file is opened for creation, then get the mode bits */

  if ((oflags & (O_WRONLY | O_CREAT)) != 0)
    {
      mode = va_arg(ap, mode_t);
    }

Signed-off-by: huxiandong <huxiandong@xiaomi.com>
2023-08-12 01:11:35 +08:00
simbit18
e501f784c3 Fix Kconfig style
Add TABs
Add comments
2023-08-11 22:13:17 +08:00
yangjiao
910409b4fb resolve the compile error.
Update the test cases' source code to solve the conflict of test function name,like below:"/home/yangjiao/Vela_Project/vela_TinyCrypt/apps/crypto/tinycrypt/tinycrypt/tests/test_sha256.c:149: multiple definition of `test_5'; /home/yangjiao/Vela_Project/vela_TinyCrypt/nuttx/staging/libapps.a(test_hmac_prng.c.home.yangjiao.Vela_Project.vela_TinyCrypt.apps.crypto.tinycrypt.o):/home/yangjiao/Vela_Project/vela_TinyCrypt/apps/crypto/tinycrypt/tinycrypt/tests/test_hmac_prng.c:316: first defined here".

Signed-off-by: yangjiao <yangjiao@xiaomi.com>
2023-08-11 21:47:47 +08:00
yangjiao
30e56fd6a0 porting tinycrypt tests.
Signed-off-by: yangjiao <yangjiao@xiaomi.com>
2023-08-11 21:47:47 +08:00
anjiahao
34f71ec25b fstest:fix build break
fstest_main.c:340:47: note: expected ‘struct fstest_ctx_s *’ but argument is of type ‘fsblkcnt_t’ {aka ‘long long unsigned int’}
  340 | static int fstest_gc(FAR struct fstest_ctx_s *ctx, size_t nbytes)
      |                          ~~~~~~~~~~~~~~~~~~~~~^~~
fstest_main.c:1168:13: error: too few arguments to function ‘fstest_gc’
 1168 |       ret = fstest_gc(buf.f_bfree);
      |             ^~~~~~~~~
fstest_main.c:340:12: note: declared here
  340 | static int fstest_gc(FAR struct fstest_ctx_s *ctx, size_t nbytes)
      |            ^~~

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-08-11 21:04:44 +08:00
xucheng5
6196e03337 testing/drivertest : fix build error
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-08-11 20:15:28 +08:00
zhangchao53
ba19e5b92b porting superPi to vela,add makefile
Signed-off-by: zhangchao53 <zhangchao53@xiaomi.com>
2023-08-11 18:25:07 +08:00
makejian
af3ea2af03 mbedtls: add mbedtls sha256/sha512 alternative implementation
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-11 18:13:11 +08:00
makejian
558450f0ab mbedtls: add hardware entropy source via /dev/random
add hardware entropy from /dev/random
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-11 18:13:11 +08:00
makejian
4e016e2260 mbedtls: add nuttx crypto alternative implementation in mbedtls
(1)add dev_alt to manage /dev/crypto
(2)add sha_alt to alternate sha1 algorithm
(3)use new mbedtls_config.h to admin configs of mbedtls
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-11 18:13:11 +08:00
makejian
fcbf7cc1aa testing/crypto: add md5/sha1/sha256/sha512 testcases
add hash test cases to test the support for the hash algorithm in crypto device
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-11 18:13:11 +08:00
zhangchao53
f1154b5be2 Memory leaks can be checked using cmocka
Signed-off-by: zhangchao53 <zhangchao53@xiaomi.com>
2023-08-11 18:09:40 +08:00
zhangchao53
d3d704fddb porting libtomcrypt tests cases,update make config.
Signed-off-by: zhangchao53 <zhangchao53@xiaomi.com>
2023-08-11 15:57:59 +08:00
ligd
12a2e14a83 example/poll: add delay for poll testcase
for should setup the fifo firstly

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-11 15:35:06 +08:00
yinshengkai
bdc522bad7 trace: move trace_dump to noteram
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-11 13:52:12 +08:00
yinshengkai
95b0515c30 trace: unify ftrace and atrace output formats
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-11 13:52:12 +08:00
xucheng5
c7955e5faf drivertest/adc : support cmocka_driver_adc
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-08-11 13:51:30 +08:00
Xiang Xiao
d420036cbc testing/drivertest: Fix typo error in drivertest_uart.c
Made by:
commit 5659906fdfdac0a363aecb329c39c936324dcc55
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Mar 24 12:02:04 2023 -0600

    Changes to apps needed by nutts PR 8885

    needby:965551

    ostest contains some logic that depends on internal implementation of signal sets and ostest must be updated to match those changes.

    There is no particular impact from this PR.  This PR is the result of impact from nuttx 8885.

    Tested with nuttx 8885

    Change-Id: I2550888ee29aadcfcf8a98bfe5690920ee2b17d1

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-11 13:50:55 +08:00
fengxuesong
fad26cb3ae Add function is missing FAR
Signed-off-by: fengxuesong <fengxuesong@xiaomi.com>
2023-08-11 13:50:38 +08:00
yangsen5
78792120cd nxcamera: Solve compilation errors caused by type mismatch
CC:  nxcamera.c nxcamera.c: In function 'show_image':
nxcamera.c:85:20: error: initialization of 'uint32_t *' {aka 'unsigned int *'} from incompatible pointer type 'uint8_t *' {aka 'unsigned char *'} [-Werror=incompatible-pointer-types]
   85 |   uint32_t *pbuf = pcam->bufs[buf->index];
      |                    ^~~~
cc1: all warnings being treated as errors

Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-08-11 13:50:28 +08:00
dulibo1
3c674fb4d8 add test case for regulator
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-11 00:45:16 +08:00
yinshengkai
d090da6b91 examples/watcher: get the thread name using pthread_getname_np
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-10 22:50:58 +08:00
dulibo1
6534f3d87c add batterydump tool for dump the battery info
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-10 20:44:03 +08:00
yangguangcai
5c6ffe1a4d drivertest:fix timer testcase
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:41:05 +08:00
yangguangcai
1dc7845c06 drivertest/timer:test interface getstatus.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:41:05 +08:00
yangguangcai
ffebcfbb9f testing/drivertest:fix variable may be negative
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:41:05 +08:00
liaoao
126faafb6e fdttools: add fdt utility tools
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-10 20:39:11 +08:00
rongyichang
9abb0a2592 apps/testing: support alignment for lcd driver test
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-10 20:36:36 +08:00
rongyichang
6d11e1e7e2 drivertest/lcd: fix draw area calc error in LCD rect
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-10 20:36:36 +08:00
rongyichang
694fbd2f77 apps/testing : correct the dependency option of fb driver test
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-10 20:36:36 +08:00
rongyichang
49f81d387a apps/testing/driver_test:fix warning
drivertest_lcd.c:234:12: warning: assignment to 'uint16_t *' {aka 'short unsigned int *'} from incompatible pointer type 'uint8_t *' {aka 'unsigned char *'} [-Wincompatible-pointer-types]

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-10 20:36:36 +08:00
rongyichang
b2d3fb726d testing/drivertest:add testcase for LCD driver
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-10 20:36:36 +08:00
rongyichang
7c18361faf testing/drivertest:add testcase for framebuffer driver
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-10 20:36:36 +08:00
yangguangcai
3717ce2094 watchdog:input watchdog deviation.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:34:47 +08:00
yangguangcai
16872c582c test/watchdog:call board_ioctl from board_reset_cause.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:34:47 +08:00
yangguangcai
d4b202ec7e test/watchdog:test interface getstatus.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:34:47 +08:00
yangguangcai
76dff2b924 watchdog:test watchdog not depend on fs.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-10 20:34:47 +08:00
anjiahao
79e481d093 resetcause:show reset string not number
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-08-10 13:51:43 +08:00
Huang Qi
712d008f66 tools: Using math.h from NuttX for wasm build
wasm clang can't find math.h if using libm from toolchain.

It's OK to using math.h from NuttX since only declaration is needed for wasm build.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-08-10 12:14:03 +08:00
xuxin19
8e71885ee5 Enhance Makefile to avoid "Argument list too long"
define a macro for split long variable and redefine variable in batch.
see details in `apps/Make.defs` `SPLITVARIABLE`.
replace the variable reference that caused the error.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-10 11:16:07 +08:00
jinxudong
6bea926ef2 sensor: add force sensor
A sensor of this type measures the force on it, and additionally
compares the force with one or more specified thresholds. The sensor
can output the force value directly. Moreover, it's usually applied
as a press key. In that case, when it detects a force greater than
some given threshold, a corresponding event is reported.

Signed-off-by: jinxudong <jinxudong@xiaomi.com>
2023-08-10 03:33:22 +08:00
haopengxiang
aa38c44b3b testing/unity: adjust unity download pack to 'Unity'
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2023-08-10 03:33:12 +08:00
haopengxiang
bdedf648c5 uorb/topics: update delicated match of listener topics
bug: if user input obr_topic is sensor_gps_sate(wrong topic, which does not exist), the using of `strncmp` will assign idx=8 (as sesnor_gps) in the first.

However, there is no match in the `g_sensor_list`, hence idx=8 will give  out value of `sensor_gps` as output(wrong).

Change: This update aims to match the whole value of sensor name in `g_sensor_list`, while keeping `sensor_name+number` match in this condition.

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2023-08-10 02:01:09 +08:00
haopengxiang
6b5038ef7a uorb/sensor/gps: fix uorinfo_raw print error
[   15.979300] [24] [  INFO] [ap] sensor_gps_satellite: timestamp: 15979200 (100 us ago)
[   15.979400] [24] [  INFO] [ap] sensor_gps_satellite: number:0 svid: 13elevation: 54azimuth: 253 snr: 0
[   15.979600] [24] [  INFO] [ap] sensor_gps_satellite: number:1 svid: 21elevation: 43azimuth: 77 snr: 0
[   15.979700] [24] [  INFO] [ap] sensor_gps_satellite: number:2 svid: 22elevation: 9azimuth: 35 snr: 0
[   15.979800] [24] [  INFO] [ap] sensor_gps_satellite: number:3 svid: 23elevation: 23azimuth: 268 snr: 0

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2023-08-10 02:01:09 +08:00
jinxiuxu
4f7abe0231 apps/testing/drivertest:add audio drivertest
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2023-08-10 00:51:07 +08:00
zhangyuan21
7dcb0c79c3 adb: add adb log level
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-10 00:50:50 +08:00
simbit18
2e98005608 crypto: Fix Kconfig style
Replace help => ---help---
Add comments
2023-08-09 19:24:17 +03:00
yangguangcai
41388daf74 rtc test:add delay after set time.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 23:47:09 +08:00
yangguangcai
768ce91296 drivertest/rtc:input rtc alarm deviation.
Some vendor hardware precision cannot meet the requirements,
and the deviation needs to be input at this time.

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 23:47:09 +08:00
yangguangcai
0c8579151f drivertest/rtc:fix rtc testcase.
deviation from (-10,0) to (-10,10)

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 23:47:09 +08:00
yangguangcai
cd802f6a8f drivertest/rtc:add test case.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 23:47:09 +08:00
yangguangcai
89ad9c6527 test/drivertest:fix rtc settime incorrect.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 23:47:09 +08:00
xuxin19
24319beed3 cmake:migrate apps CMakeLists for canutils
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-09 23:46:21 +08:00
makejian
6cd890e843 testing/crypto: add configs of crypto testing cases
crypto testing cases managed by respective config

Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-09 21:37:36 +08:00
chenxiaoyi
0c6016475b system: dd: add standalone dd command
enabling SYSTEM_DD will disable nsh_dd by selecting NSH_DISABLE_DD

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2023-08-09 20:59:40 +08:00
shipei
b63c56cefa audio:Resolve compilation errors in nxplayer/nxrecorder/nxlooper on ARM64 architecture
resolve compilation errors: '%0lx' directive output may be truncated
writing between 1 and 16 bytes into a region of size 11 [-Werror=format-truncation=]

Signed-off-by: shipei <shipei@xiaomi.com>
2023-08-09 20:59:19 +08:00
yangsen5
4d2fb8a6cf nxcamera: Add logic to convert to rgb565
Since the current fb display format of vela qemu is rgb565, it is necessary to convert the frame obtained by v4l2 to rgb565

Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-08-09 18:22:39 +08:00
yinshengkai
105fd2aac5 nsh: fix a buffer overflow in help
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-09 18:22:09 +08:00
yangguangcai
902a1d7ece test/oneshot:fix oneshot testcase.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 18:21:55 +08:00
yangguangcai
667d03f184 test/oneshot:fix compile warning.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 18:21:55 +08:00
yangguangcai
ed87aa242d drivertest:fix compile error.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 18:21:55 +08:00
yangguangcai
2782ed0721 test/drivertest:add oneshot test and posix timer test.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-09 18:21:55 +08:00
cuiziwei
4d6527ec8c testing/drivertest: add watch dog irq test
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-09 17:55:36 +08:00
cuiziwei
6c3e2f0aa0 drivertest_rtc:fix RTC_HAVE_SET_TIME is false.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-09 17:11:13 +08:00
Xu Xingliang
cd7869001f interpreters/luajit: use section name for custom heap
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2023-08-09 09:49:23 +02:00
Xu Xingliang
6bfdddca39 interpreter/luajit: use uppercase LUAJIT_ARCH_ARM
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2023-08-09 09:49:23 +02:00
YanXiaowei
b2d5d3f51c apps/examples/pwfb : fix compiling error
fix compiling warning and error when CONFIG_NX=y, EXAMPLES_PWFB=y and EXAMPLES_PWFB_DEFAULT_FONT=y
fix CI-Precheck for pwfb_motion.c

Signed-off-by: YanXiaowei <yanxiaowei@xiaomi.com>
2023-08-09 15:08:44 +08:00
hujun5
79a111fc1a ostest/mutex: mut need to be destroyed
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-08-09 15:07:25 +08:00
fangxinyong
2234c3a2e6 nshlib: support list numeric user and group IDs
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-09 15:06:09 +08:00
chao an
3b2b73de88 coredump/priority: Increase the default priority of coredump to 254
Increase coredump priority to avoid unnecessary task switch during dump

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-09 15:00:45 +08:00
yinshengkai
d0f790e166 testing: add os performance measurement
Measure the performance of core system functions
such as thread switching and the time required for semaphore execution

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-09 14:59:41 +08:00
田昕
5449126959 examples/mtdpart:fix compiling warning in printf.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2023-08-09 14:58:19 +08:00
fengxuesong
2909e8d7a0 Add function missing FAR information
Signed-off-by: fengxuesong <fengxuesong@xiaomi.com>
2023-08-09 14:47:00 +08:00
rongyichang
6fecb56aee apps/examples: fix fb example show error
For screens with transparency, the alpha value should be set to 0xFF

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-09 08:34:36 +02:00
cuiziwei
53cb2a947d apps/tools:fix build warning.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-09 13:52:22 +08:00
Peter Bee
04e86fc2d5 graphics/libyuv: refine patching logic
Only stable branch need custom patch, main is fixed by upstream

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2023-08-09 13:51:50 +08:00
Peter Bee
24caccbd02 graphics/libyuv: add -Wno-undef
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2023-08-09 13:51:50 +08:00
raiden00pl
6b98aec34a wakaama: update wakaama to a commit that includes a fix for wakaama examples under NuttX 2023-08-09 00:02:46 +08:00
shipei
5aaf4136bf nxplayer:add sbc simple parser in nxplayer
Usage:
device /dev/audio/compress0p
play /data/test.sbc

This function requires the platform to support compress decoding and playback

Signed-off-by: shipei <shipei@xiaomi.com>
2023-08-08 21:41:15 +08:00
zhangyuan21
987cb1ebd9 adb: support adb boardctl when not composite device
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-08 00:11:54 -07:00
Petro Karashchenko
3648c0cc5c testing/ostest: call up_idle() only in case of CONFIG_SIM_WALLTIME_SLEEP=y
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-07 18:58:46 -07:00
Petro Karashchenko
6acf345296 testing/ostest: add test case for task priority change with locked scheduler
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-07 18:58:46 -07:00
Petro Karashchenko
e30a0602a0 testing/ostest: add missing section comments
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-07 18:58:46 -07:00
YAMAMOTO Takashi
ee71af840f toywasm: regen for v31
```
REF=6f67aec18ce8f824479e305c17464bd4df1dd7ae ./regen.sh
```
2023-08-07 01:12:58 -07:00
YAMAMOTO Takashi
6fb38bc246 toywasm: bump the version to v31 2023-08-07 01:12:58 -07:00
xuxin19
646a30fe7c cmake:migrate apps CMakeLists for libtomcrypt
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-05 06:48:17 -07:00
makejian
ff6df40e3c fix -Wmaybe-uninitialized compile warning in nist-sts
fix compile warning as following:
nist-sts/sts/src/cusum.c:15:23: warning: 'zerv' may be used uninitialized in this function[-Werror=maybe-uninitialized]

Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-03 22:43:59 -07:00
yanghuatao
89a1255dc2 ltp: follow linux on pthread_rwlock_unlock
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2023-08-03 22:43:50 -07:00
chenrun1
5645b82b74 memorystress:Fix some warnings and make the index randomized.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-08-03 10:55:12 -07:00
chenrun1
4a78dedbae memorystress:For pressure detection of memory stability
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-08-03 10:55:12 -07:00
yanghuatao
1309990d6c ltp/makefile: nuttx on github download ltp code failed fix
Fix github download ltp code error:
Cloning into 'ltp'...
*** Please tell me who you are.
Run
  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'root@33ba2a4a6fc5.(none)')

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2023-08-03 10:54:44 -07:00
makejian
e109319a2e fix memory leak in aesctr test case
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-03 10:54:25 -07:00
guoshichao
bc3fada2ce apps/testing/ltp: conditional build the testcases based on defconfig
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-08-03 07:30:28 -07:00
guoshichao
bc8d77fdbd apps/testing/ltp: filter the testcases based on config
control the testcases build rules based on the config that current
enabled

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-08-03 07:30:28 -07:00
yangyalei
fd261d839d test: modify stacksize and priority
Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-08-03 07:26:49 -07:00
makejian
383ca3bcf9 crypto/libsodium: fix libsodium compile warning
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-03 07:26:16 -07:00
makejian
53620b91c8 crypto/libsodium: porting libsodium into nuttx
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-03 07:26:16 -07:00
zhanghongyu
768993fb15 ntpclient: change sendto/recv timeout to Kconfig
Change the timeout period of ntpclient to configurable to reduce the impact
The NTP packet is lost during the first TLS connection after the board is started.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-03 06:16:54 -07:00
zhanghongyu
216df60208 usrsocktest: correct the parameter when pthread_kill is called
When the value of the signal is modified, the function will be faulty

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-03 06:16:19 -07:00
xuxin19
c93c0da4b0 cmake:migrate apps CMakeLists for mbedtls
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-03 05:53:05 -07:00
Michal Lenc
95fcece2a5 mcuboot: update mcuboot to support swap using move
Older versions of mcuboot did not support swap using move and therefore
the build would have failed CONFIG_MCUBOOT_SWAP_USING_MOVE=y.

Newer mcuboot contains initial support of swap using move for NuttX. Also
Makefile was updated to as some bootutil files were removed from mcuboot.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-03 05:31:27 -07:00
wanggang26
ccd6aec427 ofloader: fix warning and typo
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-08-01 23:22:52 -07:00
anjiahao
d0ad047f81 support openflashloader for nuttx
wiki:https://wiki.segger.com/SEGGER_Flash_Loader

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-01 23:22:52 -07:00
simbit18
85988dc77f Fix nuttx coding style
Remove TABs
2023-08-01 23:10:32 -07:00
makejian
4b0a3d92ff Porting NIST-Statistical-Test-Suite in nuttx to test quality of rng
(1)add nist-sts init nuttx
(2)Fix possible memory bug
(3)Fix double free memory
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-01 10:06:45 -07:00
Zhe Weng
396ab2e931 nsh/alias: Fix compiler warning
Got use-after-free warning under GCC 12 with `-O3` option, and I found
that `nsh_strcat` may realloc `ptr`, then `cmdline` may point to invalid
memory.

Let `cmdline` point to the reallocated `ptr` may solve the problem.
Tested by `alias ll='ls -l'` and `ll /` on sim.

GCC output:

CC:  binfmt_unloadmodule.c In function 'nsh_aliasexpand',
    inlined from 'nsh_argument' at nsh_parse.c:1879:20:
nsh_parse.c:1196:23: error: pointer 'ptr' used after 'realloc' [-Werror=use-after-free]
 1196 |               ptr     = cmdline + len;
      |               ~~~~~~~~^~~~~~~~~~~~~~~
In function 'nsh_strcat',
    inlined from 'nsh_aliasexpand' at nsh_parse.c:1190:21,
    inlined from 'nsh_argument' at nsh_parse.c:1879:20:
nsh_parse.c:1100:27: note: call to 'realloc' here
 1100 |   argument  = (FAR char *)realloc(s1, allocsize);
      |                           ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-01 08:13:23 -07:00
guanyi
f50d2cdbe3 fix ostest sigprocmask testcase
problem: ostest may fail at procmask test, because signals:sigkill/sigstop should not be added in signal mask
solution: skip checking whether sigkill/sigstop are in signal mask

Signed-off-by: guanyi <guanyi@xiaomi.com>
2023-08-01 21:02:52 +09:00
SPRESENSE
4a4c550ced audioutils/fmsynth: Add create instance for static
To use this with static instance, add create function with
arguments.
2023-07-31 22:48:52 -07:00
YAMAMOTO Takashi
5365fc9ffd toywasm: regen for v30.0.0
```
REF=bfcc5be6eb25c9581c6c3b443ac38c1a814f8e18 ./regen.sh
```
2023-07-31 10:26:30 -07:00
YAMAMOTO Takashi
23691fd422 toywasm: bump to v30.0.0 2023-07-31 10:26:30 -07:00
wanggang26
cb684097b8 nshlib: add print negative number support for echo command
Fix issue that "echo -1" will give "argument invalid" error

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-07-31 07:58:41 -07:00
Huang Qi
74db485277 tools: Raise error if wasm module build failed
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-07-31 07:14:59 -07:00
makejian
32aefa44c5 crypto/mbedtls: Bump Mbed TLS to version 3.4.0
Signed-off-by: makejian <makejian@xiaomi.com>
2023-07-30 22:21:52 -07:00
wanggang26
f585d74b8c nshlib: refine dd verify printing format
before:
infile sector 0
7f454c46010101000000000000000000
02002800010000007d13001834000000
8cbd2a00000400053400200004002800

now:
infile sector 0:
0000: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 .ELF............
0010: 02 00 28 00 01 00 00 00 7d 13 00 18 34 00 00 00 ..(.....}...4...
0020: 8c bd 2a 00 00 04 00 05 34 00 20 00 04 00 28 00 ..*.....4. ...(.

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-07-30 22:21:34 -07:00
wanggang26
9621aca73c nshlib: add negative number logical judgement support for test and [ command
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-07-30 22:20:02 -07:00
dongjiuzhu1
100db2a678 examples/sotest: fix issue about running multiple times
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-30 22:19:03 -07:00
dongjiuzhu1
f890a0b1cb examples/sotest: remove unnecessary config
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-30 22:19:03 -07:00
Xiang Xiao
c9f13d698c examples: Change unionfs_mount to mount
since unionfs_mount isn't exported through syscall

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-30 18:50:24 -03:00
Victor Benso
52ec336c55 Example for controlling a chain of WS2812 LEDs using ESP32 RMT peripheral 2023-07-30 11:40:04 -03:00
anjiahao
c08feedcfd ymodem:fix compile warnings
rb_main.c:219:42: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
  219 |           snprintf(temp, PATH_MAX, "%s/%s", priv->foldname,

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-07-30 01:20:36 -07:00
anjiahao
55b0d4a110 ymodem:support sbrb.py use serial to transport
Get help to use ./sbrb.py -h
./sbrb.py -h
usage: sbrb.py [-h] [-k KBLOCKSIZE] [-t TTY] [-b BAUDRATE] [-r [RECVFROM ...]] [-s SENDTO] [--debug DEBUG] [filelist ...]

positional arguments:
  filelist              if filelist is valid, that is sb, else is rb

options:
  -h, --help            show this help message and exit
  -k KBLOCKSIZE, --kblocksize KBLOCKSIZE
                        This opthin can set a customsize block size to transfer
  -t TTY, --tty TTY     Serial path
  -b BAUDRATE, --baudrate BAUDRATE
  -r [RECVFROM ...], --recvfrom [RECVFROM ...]
                        recvfile from board path like this: ./sbrb.py -r <file1 [file2 [file 3]...]> -t /dev/ttyUBS0
  -s SENDTO, --sendto SENDTO
                        send file to board path like this: ./sbrb.py -s <path on board> -t /dev/ttyUBS0 <file1 [file2 [file3] ...]>
  --debug DEBUG         This opthin is save debug log on host

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-07-30 01:20:36 -07:00
anjiahao
8fd4b4d45b ymodem:fix ymodem bug
1.Timeout processing
2.clear error count when received successfully once
3.fix the bug of insufficient header memory application

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-07-30 01:20:36 -07:00
dongjiuzhu1
fb7dafc7e0 netutils/rexec/rexecd: supports remote execution and interaction
using popen with r+,w+ mode to interact with the remote service on
the command line, supporting input and output until the local
voluntarily exits or the remote service ends.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-29 20:29:54 -07:00
dongjiuzhu1
e86f6c12a5 system/popen: support r+, w+ mode
The standard popen uses the pipeline internally, so the stream
returned by it can only support read-only or write-only.
Now this patch is expanded through sockpair, which can support both
read and write. Therefore, we can use the stream to read and write
access this task (posix_spawn start).

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-29 20:29:54 -07:00
yuexinyi
c10e78869b examples/camera: Video driver multi-instance adaptation
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-07-29 07:42:33 -07:00
wangjianyu3
fc8c425cc0 Fix dependents of nsh_foreach_direntry
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2023-07-28 21:51:50 -07:00
xuxin19
c34bbb9935 cmake:migrate apps CMakeLists for libtommath
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-07-28 21:51:38 -07:00
dongjiuzhu1
718fcfac1e system/uorb: Solve the problem of wrong use of return value
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 21:51:10 -07:00
dongjiuzhu1
963d0680bd fsutils/mkgpt: dump partition when verify failed
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 21:50:31 -07:00
zhangyuan21
7277a48482 uorb: Avoiding GCC VCVT Issue When MVE is Enabled
https: //sourceware.org/git/?p=binutils-gdb.git;a=commit;h=656412a7a4da0aef43ead1ea976ba0235a7ec30a

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-07-28 21:49:58 -07:00
dongjiuzhu1
78590a55ea system/uorb: Support frequency less than 1hz
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 21:49:58 -07:00
raiden00pl
7b066ed0d8 netutils: add Eclipse Wakaama support 2023-07-27 09:33:10 -07:00
raiden00pl
81f9fb5e08 crypto: add Eclipse tinydtls support 2023-07-27 09:33:10 -07:00
xuxin19
7f3246cfdf cmake:migrate apps CMakeLists for [audioutils benchmarks]
audioutils
  ├── fmsynth
  ├── mml_parser
  └── nxaudio
 benchmarks
  └── coremark

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-07-27 07:22:21 -07:00
hujun5
13d3b3d26c ostest/rmutex: mutex need to be destroyed
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-07-26 08:33:26 -07:00
hujun5
7daeca62b0 testing/mm: add maxsize parameter
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-07-26 08:33:09 -07:00
chao an
7afa9b51ea ci/check: install format tool before run style check script
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-25 10:48:01 +02:00
chao an
c0707b5fc3 system/artable3: add cmake build support
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-25 10:48:01 +02:00
Xiang Xiao
8083b094c3 Kconfig: Simplify the conditional default statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-25 09:51:09 +08:00
Xiang Xiao
d46dce5819 testing/ostest: Remove the unnecessary defined(CONFIG_PTHREAD_CLEANUP_STACKSIZE)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-25 09:51:09 +08:00
YAMAMOTO Takashi
33987a76a9 regen for toywasm v29.0.0
```
REF=12b9e518cd18c9fee09a521afa96eb15cd11edac ./regen.sh
```
2023-07-23 01:08:45 +08:00
YAMAMOTO Takashi
f41873223c toywasm: bump the version to v29.0.0 2023-07-23 01:08:45 +08:00
YAMAMOTO Takashi
7cacd569e5 Revert "toywasm: disable tail call and explain why"
This reverts commit fcda92ebc7.

because it isn't necessary for the latest versions of toywasm.
2023-07-23 01:08:45 +08:00
Huang Qi
56a20a202d Move Wasm.mk to end of file since it need definition from Application.mk itself.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-07-20 08:10:52 +02:00
raiden00pl
dda21ad57e cmake: support for nimble 2023-07-20 01:44:39 +08:00
raiden00pl
b129ddd6e0 cmake: include examples after apps modules
This allows you to set dependency for the examples on configured apps libs
2023-07-20 01:44:39 +08:00
chenrun1
10baddee07 system/cachespeed:Modifying kconfig depends on
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-20 01:42:38 +08:00
chenrun1
d0349a3bd4 system/cachespeed:Optimize the number of tests
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-20 01:42:38 +08:00
chenrun1
f3b1ac089b system/cachespeed:Redesign of the overall test tool.
Compared to the previous version, the following factors have been taken into account in the new version of cachespeed:
1. the user needs to care about getting a piece of available memory (even if this piece of memory may memory stomp during use)
2. High repetition of test code, poor readability, and overall high test coupling
3. Not taking into account the alignment cache line situation
4. When comparing values between different test tools, there is a little error because of the different ways to get the values (different fine reading)
Therefore, in the new version according to the above problems have been improved:
1. Provide a "test_skeleton", which contains the overall testing process
2. The user only needs to execute, not to care about how to get the available memory address, and the memory allocated by the program also ensures the memory security and data accuracy
3. The system to obtain the data required for the test reduces the difficulty of use and the possibility of inaccurate results due to data errors.
4. Provide two kinds of precision data results, which can be configured through Kconfig
5. Optimize the output log, now more intuitive and concise, to help the subsequent data organization and observation
6. New test items for aligned/unaligned cache line
7. Better readability and extensibility, making it easier to add/remove test items

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-20 01:42:38 +08:00
Lucas Saavedra Vaz
6f56e69a14 system/nxdiag: Fix race condition during build
This commit fixed a race condition that might happen by only unshallowing the Espressif HAL only after it was completely cloned.
2023-07-18 23:43:29 +08:00
chenrun1
4bc06d9a4b drivertest_block:New test items about cache and memory alignment
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-17 23:15:32 +08:00
chenrun1
9768cfab79 drivertest_block:Give redundant space for bad blocks in nand flash
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-17 23:15:32 +08:00
chenrun1
3cb5d475ae drivertest_block:Test the availability of each sector of the block.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-17 23:15:32 +08:00
Huang Qi
5d37383457 examples: Build both native app and wasm app for hello to pass CI test
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-07-17 23:14:47 +08:00
Huang Qi
3d5183f404 tools: Merge WASM_BUILD and WASM_BUILD_ONLY
By make WASM_BUILD as a three state variable: y , n or both.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-07-17 23:14:47 +08:00
Xiang Xiao
ff276e422f ostest: Skip test_dev_null when CONFIG_DEV_NULL isn't enabled
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-17 16:28:02 +09:00
zhanghongyu
1bc2e93124 iptables: modify the formatting of some definitions in xtables.h
Based on the previous patch comments, some changes were made to make it more
nuttx style.
https://github.com/apache/nuttx-apps/pull/1829

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-07-17 07:56:48 +02:00
chenrun1
046fe00b96 nsh_fscmd.c:fix "implicit declaration" warning.
Fix error: implicit declaration of function 'nsh_foreach_direntry' [-Werror=implicit-function-declaration] on file nsh_fscmds on some compiler versions.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-16 16:39:11 +08:00
chenrun1
415168dde6 nshlib: Add fdinfo to get information about the process associated fd
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-16 16:39:11 +08:00
raiden00pl
ed370ec674 cmake: port nxscope and foc and add missing directories 2023-07-14 22:04:35 +08:00
Petro Karashchenko
5dba460f5f wireless/bluetooth/nimble: increase number of ACL buffers available for controller
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-14 09:49:51 +08:00
Petro Karashchenko
4ac830ef1e wireless/bluetooth/nimble: add option to configure stack size of NimBLE NPL callout thread
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-14 09:49:51 +08:00
Petro Karashchenko
0c7788cf26 wireless/bluetooth/nimble: fix build issue with nimBLE example
The NimBLE source code is downloaded at the first pass of the
make system so some makefiles to include might be not in place
initially, but included after code is fetched

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-14 09:49:51 +08:00
Petro Karashchenko
355153cff5 examples/nimble: fix assertion during pthread create with zero priority
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-14 09:49:51 +08:00
raiden00pl
4df395bfc4 cmake: add support for boot utils 2023-07-13 23:50:49 +03:00
Huang Qi
b4ec3d7d4a tools: Don't register app into nsh if WASM_BUILD_ONLY == y
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-07-14 01:29:54 +08:00
chao an
b18cf9aab3 testing/ostest: fix Compiler Warning (level 1) C4716: 'function' must return a value
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4716?view=msvc-170
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-14 01:28:25 +08:00
Lucas Saavedra Vaz
0a7c308f1b examples/pwm: Fix PWM range
This commit fixes the overflow that happens when setting the duty cycle to 100% in the PWM example.
It now correctly passes the value 0xffff rather than 0x0000 when setting the duty cycle to 100 and makes sure that no underflow happens when setting the duty cycle to 0.
2023-07-14 01:25:05 +08:00
chao an
7cfcb49213 cmake/apps: add more applications into cmake support
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-13 19:00:18 +02:00
anjiahao
73b888869b gdbstub:Support a general gdbstub, support serial port and network link
Partially implement the gdb rsp protocol,
you can debug the nuttx kernel through the serial port or the network

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-07-13 19:31:57 +08:00
zhanghongyu
bbb2b289cf iptables: add iptables libary
Add xtables.c and xtables.h
In order to support the compilation of third-party utils, we encounter some
situations where the macro is not defined, refer to the common implementation
of other systems, add relevant definitions and empty function.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-07-13 15:52:36 +08:00
yinshengkai
a7c6b20e89 syste/setlogmask: add syslog channel filtering function
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-13 00:47:23 +08:00
chao an
391b643855 apps/cmake: add some note on cmake header
| # Important note:
| # This CMakeLists.txt is not meant as a top-level CMakeLists.txt. Instead,
| # CMake must be run using the top-level CMakeLists.txt from the nuttx
| # repository and point to this directory via NUTTX_APPS_DIR. For example:
| #   cmake -S <nuttx-dir> -B <build-dir> [...] -DNUTTX_APPS_DIR=<apps-dir>

Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-10 14:02:14 +03:00
Xiang Xiao
dab972b907 Remove the const cast from the initialization of boardioc_symtab_s::symtab
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-08 16:01:52 +03:00
chao an
4d79a5cbaf add initial cmake build system
Co-authored-by: Daniel Agar <daniel@agar.ca>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:52:02 +08:00
YAMAMOTO Takashi
c078b2ee7a wamr: add a kconfig to control wasi-threads
cf. https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/pthread_impls.md
2023-07-06 09:25:14 -03:00
raiden00pl
41868f5061 boot: add support for a minimal NuttX-based bootloader
This can be useful for development purposes when you don't need any complex bootloader yet,
but just want to jump to the app image.

Can be helpful when we need to switch from secure environment to non-secure environment.
2023-07-06 00:26:08 +08:00
Huang Qi
be0e677699 interpreters/wamr: New option for configurable bounds checks
Works with https://github.com/bytecodealliance/wasm-micro-runtime/pull/2289

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-07-05 16:25:56 +08:00
Junbo Zheng
9de5a2550e nshlib: add -h option for ls command
config: ./tools/configure.sh sim:nsh
CONFIG_LIBC_FLOATINGPOINT=y
```
nsh> ls -l /dev
/dev:
 crw-rw-rw-       0 console
 crw-rw-rw-       0 gpio0
 crw-rw-rw-       0 gpio1
 crw-rw-rw-       0 gpio2
 crw-rw-rw-       0 gpio3
 crw-rw-rw-       0 loop
 crw-rw-rw-       0 null
 crw-rw-rw-       0 oneshot
 brw-rw-rw- 1048576 ram0
 brw-rw-rw-    1024 ram1
 brw-rw-rw-  524288 ram2
 crw-rw-rw-       0 zero
nsh> ls /lh /dev
nsh: ls: too many arguments
nsh> ls -lh /dev
/dev:
 crw-rw-rw-       0 console
 crw-rw-rw-       0 gpio0
 crw-rw-rw-       0 gpio1
 crw-rw-rw-       0 gpio2
 crw-rw-rw-       0 gpio3
 crw-rw-rw-       0 loop
 crw-rw-rw-       0 null
 crw-rw-rw-       0 oneshot
 brw-rw-rw-    1.0M ram0
 brw-rw-rw-    1.0K ram1
 brw-rw-rw-  512.0K ram2
 crw-rw-rw-       0 zero
```

config: ./tools/configure.sh ../vendor/sim/boards/miwear/configs/miwear -j16
```
nsh> ls -l /resource/misc/media
/resource/misc/media:
 -rwxrwxr-x  384044 AlexaTimer.wav
 -rwxrwxr-x   57001 AlexaReminder.mp3
 -rwxrwxr-x  384132 AlexaAlarm.wav
 -rw-rw-r--   20733 Clank.mp3
 -rw-rw-r--   45183 NotificationXylophone.mp3
 -rw-rw-r--   27420 Robot.mp3
 -rw-rw-r--   21986 FadeIn.mp3
 -rw-rw-r--   42049 Flute.mp3
 -rw-rw-r--  362748 Latona-15s.mp3
 drwxrwxr-x    4096 .
 -rw-rw-r--   47198 alarm_volume_adjust.mp3
 -rw-rw-r--   95338 Expect.mp3
 drwxrwxr-x    4096 ..
 -rw-rw-r--  409435 Sunrise.mp3
 -rw-rw-r--   55841 Fresh.mp3
 -rw-rw-r--   36685 Bells-1s.mp3
 -rw-rw-r--    4432 camera_click.mp3
 -rw-rw-r--  469621 MiRemix.mp3
nsh>
nsh> ls -lh /resource/misc/media
/resource/misc/media:
 -rwxrwxr-x  375.0K AlexaTimer.wav
 -rwxrwxr-x   55.7K AlexaReminder.mp3
 -rwxrwxr-x  375.1K AlexaAlarm.wav
 -rw-rw-r--   20.2K Clank.mp3
 -rw-rw-r--   44.1K NotificationXylophone.mp3
 -rw-rw-r--   26.8K Robot.mp3
 -rw-rw-r--   21.5K FadeIn.mp3
 -rw-rw-r--   41.1K Flute.mp3
 -rw-rw-r--  354.2K Latona-15s.mp3
 drwxrwxr-x    4.0K .
 -rw-rw-r--   46.1K alarm_volume_adjust.mp3
 -rw-rw-r--   93.1K Expect.mp3
 drwxrwxr-x    4.0K ..
 -rw-rw-r--  399.8K Sunrise.mp3
 -rw-rw-r--   54.5K Fresh.mp3
 -rw-rw-r--   35.8K Bells-1s.mp3
 -rw-rw-r--    4.3K camera_click.mp3
 -rw-rw-r--  458.6K MiRemix.mp3
```

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2023-07-05 16:25:27 +08:00
chao.an
85fe229de0 apps/libtest: add libtest demo
Redefine the name of BIN to support static library:

BIN = $(APPDIR)/libtest$(LIBEXT)

Signed-off-by: chao.an <anchao@xiaomi.com>
2023-07-02 07:48:50 -06:00
fangxinyong
7faebbd425 libuv: fix compile warning
CC:  pthread/pthread_mutexinconsistent.c libuv/src/unix/getaddrinfo.c:103:9: warning: implicit declaration of function ‘getaddrinfo’; did you mean ‘uv_getaddrinfo’? [-Wimplicit-function-declaration]
  103 |   err = getaddrinfo(req->hostname, req->service, req->hints, &req->addrinfo);
      |         ^~~~~~~~~~~
      |         uv_getaddrinfo
libuv/src/unix/getaddrinfo.c: In function ‘uv_freeaddrinfo’:
libuv/src/unix/getaddrinfo.c:222:5: warning: implicit declaration of function ‘freeaddrinfo’; did you mean ‘uv_freeaddrinfo’? [-Wimplicit-function-declaration]
  222 |     freeaddrinfo(ai);
      |     ^~~~~~~~~~~~
      |     uv_freeaddrinfo
CC:  misc/lib_crc16ccitt.c libuv/src/unix/getnameinfo.c: In function ‘uv__getnameinfo_work’:
libuv/src/unix/getnameinfo.c:45:9: warning: implicit declaration of function ‘getnameinfo’; did you mean ‘uv_getnameinfo’? [-Wimplicit-function-declaration]
   45 |   err = getnameinfo((struct sockaddr*) &req->storage,
      |         ^~~~~~~~~~~
      |         uv_getnameinfo

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-07-01 13:27:02 +08:00
Mingjie Shen
e94e1e59f3 rexec: warn users about cleartext password transmission
Close apache/nuttx#9642.

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2023-07-01 13:23:04 +08:00
Stuart Ianna
3e8f7e33fc tools/mkimport: Add system map to mkimport script.
The `make export` target from the Nuttx repository correctly packs the
System.map file. This change ensure that ./tools/mkimport.sh extracts
this file correctly into the `import`correctly.
2023-06-30 16:18:44 +08:00
Stuart Ianna
44ae5cc14a import/mk: Update ELF flags to represent build configuration type.
Allows board configuration to select the output ELF format for application built using the `make import` target.
2023-06-30 02:17:10 +08:00
pengyiqiang
cb9cba8d3f testing/monkey: add file permission settings
Add missing file permission setting, fix file read failure.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-06-29 20:08:05 +08:00
Gregory Nutt
6d9259f334 Add small test of pthread_exit()/pthread_self() on main thread. 2023-06-29 13:53:02 +08:00
Lucas Saavedra Vaz
7bfd623616 system/nxdiag: Add Espressif's HAL version
Adds the currently used ESP HAL version to NXdiag's output.
2023-06-29 00:57:53 +08:00
raiden00pl
f7072ceea8 examples: add NimBLE example, based on nimble/porting/examples/nuttx
It's better to keep this example as part of nuttx-apps instead of relying on an external project
2023-06-27 22:28:32 +03:00
raiden00pl
d8ea8e3d1f nimble: improve integration with NuttX
1. add Makefile.nimble that helps integrate NimBLE with custom applications
  To enable NimBLE for an custom application, user needs to include Makefile.nimble in the app's Makefile:
    include $(APPDIR)/wireless/bluetooth/nimble/Makefile.nimble

2. add NuttX specific syscfg.h
  - file based on nimble/porting/examples/nuttx/include/syscfg/syscfg.h
  - all unnecessary definitions was removed
  - definitions are configurable from Kconfig

3. add NuttX specific logcfg.h
  - bind NimBLE logging with debug.h macros
2023-06-27 22:28:32 +03:00
raiden00pl
93c8cb29ea nimble: make nimble porting example optional
Enabled by default for the moment to avoid CI errors
2023-06-27 22:28:32 +03:00
SPRESENSE
86efbcbee7 Change the way of definition of SUFFIX
When archiving, if the number of files is large, the full path
in SUFFIX may exceed the command line limit for Cygwin and other
programs. To avoid this, the SUFFIX can be changed in the Makefile
in each application or library.
2023-06-26 10:20:40 +02:00
chenrun1
fd38b95467 system/ramtest.c:New automatic memory acquisition function.
In this change, we have added a malloc from the heap to get the address when the user does not pass an address.
We took into account that the user would be testing the memory after the device was started, but this required them to focus on how to get a piece of address available. To improve the experience of tool users, we can simply ask them to get a size for testing purposes, while also keeping the ability to test for a given address
This change is mainly in the 'parse_commandline' function, so there are a few changes in the way it is used, see usage for details.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-06-26 13:57:11 +08:00
Stuart Ianna
53e837e357 nshlib/dd: Increase the integer width for sector size in dd.
On some systems, using sector sizes larger than 65536 is needed for
profiling performance or testing.
2023-06-26 13:56:29 +08:00
Stuart Ianna
a549668439 system/ramspeed: Allow read and write buffers to be allocated from the heap.
This change makes it much easier to use the ramspeed test in BUILD_KERNEL,
as one does not need to know which virtual address is safe to use.
2023-06-23 17:06:09 +08:00
Stuart Ianna
40886698fb mk: Attempt to silence "Nothing to be done for xx" messages.
When rebuilding, it's not really useful to see reams of "Nothing to be done for" for every application being built. This change attempts to silence these messages.
2023-06-23 17:05:56 +08:00
Petro Karashchenko
c9c4cc13e6 apps: correct print specifiers to fix compilation warnings
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-23 12:05:54 +08:00
Xiang Xiao
a2f01f5e64 build: Replace "$(shell $(DEFINE) $(CC) ...)" with $(DEFINE_PREFIX)
to unify the way to define macros in Makefile

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-22 23:27:26 +03:00
Xiang Xiao
7986f66006 build: Replace "$(shell $(INCDIR) $(CC) ...)" with $(INCDIR_PREFIX)
to unify the way to get include directories

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-22 23:27:26 +03:00
YAMAMOTO Takashi
3bd106081f toywasm: regen after bumping the version
```
REF=99468253ca11c9b8df444e3e23865b5030f6af69 ./regen.sh
```
2023-06-22 09:52:02 +03:00
YAMAMOTO Takashi
5c9e8d6352 toywasm: bump the version 2023-06-22 09:52:02 +03:00
raiden00pl
caed582ea9 bluetooth/btsak: add dependency on WIRELESS_BLUETOOTH_HOST=y 2023-06-22 11:57:33 +08:00
simbit18
83bddd86c5 Fix Kconfig style
Remove TABs from Kconfig files
Add comments
2023-06-21 00:36:52 +08:00
Xiang Xiao
e89409cfe6 Remove the unnecessary cast from pid_t to int
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-19 09:05:54 +02:00
YAMAMOTO Takashi
3d598fce6c toywasm: regen after a change to the script
```
REF=031ac96574bf95c5ec31e5aeb02787a84e6d4af0 ./regen.sh
```
2023-06-17 22:59:32 +03:00
YAMAMOTO Takashi
fcda92ebc7 toywasm: disable tail call and explain why 2023-06-17 22:59:32 +03:00
SunJ
b8856479ef netutils/iperf: Fix possible precision loss
Signed-off-by: SunJ <jsun@bouffalolab.com>
2023-06-17 17:12:45 +08:00
Zhe Weng
3e68694bdf netutils/dhcpc: Set BOOTP BROADCAST flag when IPFORWARD is enabled
Socket binded to INADDR_ANY is not intended to receive unicast traffic before being fully configured, at least dhclient configured with socket-only won't do so on Linux and BSDs (https://github.com/isc-projects/dhcp/blob/v4_4_3/common/socket.c#L1201).
We can sometimes receive unicast traffic before being fully configured, it's good, but not always, so we need to set the broadcast flag under some situations.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-06-15 10:10:05 +08:00
raiden00pl
400951b7de nsh_usbconsole.c: add support for NSH console over a composite device 2023-06-15 03:23:04 +08:00
yanghuatao
cb179e4ed2 testing/ostest: adjust PTHREAD_CLEANUP_STACKSIZE with nuttx project
in project nuttx "remove PTHREAD_CLEANUP, and use PTHREAD_CLEANUP_STACKSIZE to enable or disable interfaces pthread_cleanup_push() and pthread_cleanup_pop()", project apps also needes adjust code.

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2023-06-14 08:49:13 +02:00
chao an
ec63217b48 nshlib: disable nsh error print if NSH_DISABLE_ERROR_PRINT enabled
text	   data	    bss	    dec	    hex	filename
 398953	  27088	   4128	 430169	  69059	nuttx    /* before */
 389241	  27072	   4128	 420441	  66a59	nuttx    /* after  */
  -9712     -16

Signed-off-by: chao an <anchao@xiaomi.com>
2023-06-12 13:37:27 +08:00
YAMAMOTO Takashi
900b32c908 toywasm: regen
```
REF=031ac96574bf95c5ec31e5aeb02787a84e6d4af0 ./regen.sh
```
2023-06-12 13:36:48 +08:00
YAMAMOTO Takashi
2c9939920b toywasm: bump version
this includes SIMD support.
2023-06-12 13:36:48 +08:00
Petro Karashchenko
aed0e2873e apps: fix style issues in code
Add missing FAR and CODE to pointers
Remove FAR for non-pointer variables
Remove extra spaces and align the parameters
Add do {} while(0) wrapper in macro
Use nitems to calculate number of elements in arrays

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-11 18:47:50 +08:00
Petro Karashchenko
f4d3e549b6 wireless/bluetooth/btsak: fix help messages
Currently the help messages use "private" string while code
expects "random".
Remove not needed (CODE void *) cast.
Use 'nitems' macro to calculate number of elements in array
Align output in `btsak_cmd_scanget` command.
Fix style issues

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-11 14:09:18 +08:00
chao an
65ee6bea44 system/cu: disable error print if SYSTEM_CUTERM_DISABLE_ERROR_PRINT enabled
Test on sim/nsh (CONFIG_SYSTEM_CUTERM_DISABLE_ERROR_PRINT=y):

   text	   data	    bss	    dec	    hex	filename
 397049	  26704	   4128	 427881	  68769	nuttx      /* before */
 396481	  26704	   4128	 427313	  68531	nuttx      /* after */
   -568

Signed-off-by: chao an <anchao@xiaomi.com>
2023-06-10 02:29:47 +08:00
chao an
e4cf94b509 nshlib/command: exclude usage to reduce data size
Test on sim/nsh (CONFIG_NSH_DISABLE_HELP=y):

   text	   data	    bss	    dec	    hex	filename
 393746	  26824	   4000	 424570	  67a7a	nuttx     /* before */
 391858	  26440	   4000	 422298	  6719a	nuttx     /* after */
  -1888    -384

Signed-off-by: chao an <anchao@xiaomi.com>
2023-06-10 02:20:49 +08:00
SPRESENSE
4a9b3a5881 lte: Add usrsock daemon for ALT1250 LTE modem
Add usrsock daemon for ALT1250 LTE modem.
2023-06-07 01:51:33 +08:00
Roy Feng
ea0501387f Add interface to configure DHCP daemon 2023-06-06 17:17:08 +08:00
Lucas Saavedra Vaz
890524c86f system/nxdiag: Fix issues introduced by #1776
Fix compilation issue by properly providing the defconfig name
2023-06-03 02:26:33 +08:00
Huang Qi
e1fdbd7936 tools/Wasm.mk: Link compiler-rt into wasm module
Link `libgcc.a` like compiler intrinsics library into wasm module.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-06-01 23:50:12 +08:00
Xiang Xiao
c45a7c8ccd wireless/wapi: Return -errno in all fail path
to avoid some return -1, otheer return -errno

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-31 10:41:09 +02:00
Huang Qi
a06e53b1f9 tools/Wasm.mk: Generate object file name with full path
For example, before this patch, object file is like:
```
apps/examples/hello/hello_main.wo
```
With this patch, it will be:
```
apps/examples/hello/hello_main.c.home.huang.Work.nx.apps.examples.hello.wo
'''
Follow the native build:
'''
apps/examples/hello/hello_main.c.home.huang.Work.nx.apps.examples.hello.o
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-05-31 10:04:28 +08:00
Lucas Saavedra Vaz
9cc710e954 testing/nxdiag: Move to "system" and improve info generated
Move the application to the "System" category. Improve host OS info by using platform.uname() and get current config file using CONFIG_BASE_DEFCONFIG
2023-05-27 13:48:32 +08:00
jinxiuxu
df418bea81 system/audio: check if channels are valid
check ac_channels upper four bits which means min channels.

Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2023-05-26 02:24:28 +08:00
Lucas Saavedra Vaz
eb36c15171 testing: Add application to gather debug information (nxdiag)
This commit aims to add an application to gather debug information about the host and target systems. It can also perform some diagnostic checks on the host and target systems.
This will facilitate the process of users seeking assistance for solving some problem.

Current capabilities:
- Get host OS version;
- Get host python modules;
- Get host system packages;
- Get host PATH;
- Get host compilation flags for the target;
- Get target NuttX configuration;
- Get target OS version, hostname, build and architecture;
- Capable of adding custom, vendor specific, information. Currently gathering only Espressif related info:
  - Get the bootloader version of detected image files;
  - Get the version of different toolchains used by Espressif chips;
  - Get Esptool version.
2023-05-25 11:04:39 -03:00
chao an
6f4546f597 system/coredump: add coredump tool to capture system status
Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-25 11:46:22 +08:00
hujun5
97a38b2b1f ostest/cond_test: cond and mutex need to be destroyed
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-23 13:11:07 +08:00
simbit18
ca4ff01cf9 nshlib/Kconfig: Fix Kconfig style
Remove spaces from Kconfig file
2023-05-23 02:52:17 +08:00
Zhe Weng
f671c004df netlib: set addr.sin_zero to 0 in netlib_set_ipv4dnsaddr
In dns_add_nameserver, the dns_check_nameserver is comparing addresses
with addrlen = sizeof(struct sockaddr_in) for IPv4 addresses, so the
trailing sin_zero field should be 0, otherwise it may fail to figure out
same nameserver address.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-05-22 17:09:33 +03:00
Xiang Xiao
e81227f99d Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-22 11:57:40 +02:00
Xiang Xiao
7032c72f2f Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 07:39:53 +03:00
anjiahao
e68d5ffb98 support memdump can dump by seq number
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-05-21 00:08:48 +08:00
hujun5
db767b6f45 ostest/sighand_test: sem need to be destroyed
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-20 12:42:35 +08:00
Huang Qi
23948824b2 tools: Disable wasm build if no wasm runtime enabled
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-05-19 20:21:23 +08:00
raiden00pl
7e5a436ff9 examples/foc: add real time data capture with the NxScope library 2023-05-19 20:18:38 +08:00
raiden00pl
55b296a5c6 examples/foc/foc_thr: get controller type from controller ID 2023-05-19 20:18:38 +08:00
raiden00pl
54bcf3afdd examples/foc/foc_thr: fix mutex logic 2023-05-19 20:18:38 +08:00
simbit18
e15db0c21b crypto/tinycrypt/Kconfig: Fix indentation
Replace help => ---help---
Add TABs
2023-05-19 01:00:38 +08:00
simbit18
d0cb5afc2f testing/cmocka/Kconfig: Fix indentation
Remove spaces from Kconfig
2023-05-19 01:00:38 +08:00
simbit18
487d541f36 examples/mlx90614/Kconfig: Fix indentation
Remove spaces from Kconfig
2023-05-19 01:00:38 +08:00
Takumi Ando
baf5509b59 nshlib: Add support for disabling echoback
If CONFIG_NSH_DISABLE_ECHOBACK is selected,
the NSH disables echoback prompt.

Signed-off-by: Takumi Ando <t-ando@advaly.co.jp>
2023-05-18 17:22:14 +08:00
simbit18
c356fe92bc netutils/ping/Kconfig: Fix Kconfig style
Remove spaces from Kconfig file
2023-05-18 00:38:54 +08:00
simbit18
a60a5567f4 examples/mqttc/Kconfig: Fix Kconfig style
Remove spaces from Kconfig file
2023-05-18 00:38:54 +08:00
Brennan Ashton
6655c99341 CI: set-output command is deprecated
CI currently runs with the warning:

The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2023-05-17 17:50:17 +08:00
raiden00pl
111e02dbdb examples/foc: improve the readability of the motor structures 2023-05-17 13:45:24 +08:00
chao an
28973a37b3 nshlib: fix memory leak found out by -fanalyzer
Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-16 22:43:21 -07:00
hujun5
aea9b50dc8 add fdsan unit test
Due to the current Nuttx not supporting death test, we removed death test from the original test cases of Android

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-16 22:42:23 -07:00
hujun5
70a4010635 ostest: sem need to be destroyed
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-16 11:59:08 +08:00
John Bland
6b01cce1aa add wolfssl integration files 2023-05-15 13:24:47 -03:00
Alan Carvalho de Assis
6b720033cc examples/mqttc: Check for MQTT ACK and avoid passing '\0'
This patch will force wait for MQTT ACK (connection) and also
fix the issue caused by "strlen(mqtt_cfg.msg) + 1" that will
include the "\0" in the payload. It's forbidded by MQTT spec.

Some MQTT servers will ignore it, others like TagoIO will refuse
the packet.
2023-05-15 19:20:28 +03:00
Alan Carvalho de Assis
04243050f7 net/mqttc: Add support to detect MQTT connection
This is a fix implemented by Pieter Conradie as described here:
https://github.com/LiamBindle/MQTT-C/issues/163
2023-05-15 19:20:28 +03:00
raiden00pl
caba5a0a6f examples/foc: add missing deinit calls 2023-05-15 13:19:34 -03:00
raiden00pl
f358bdfcb3 examples/foc: send messages only to active control threads 2023-05-15 13:19:34 -03:00
raiden00pl
beb5369a0d examples/foc/foc_main.c: fix de-initialization sequence 2023-05-15 13:19:34 -03:00
raiden00pl
cc189ef170 examples/foc: add controller IDLE mode 2023-05-15 13:19:34 -03:00
raiden00pl
5eebfbb441 logging/nxscope: do not complete the stream frame if the previous send failed
In this case, the buffer already contains a frame ready to be send
2023-05-15 13:17:47 -03:00
raiden00pl
8726e530d5 logging/nxscope: add an option to disable lock in channels put interfaces
With this option enabled the user can speed up adding a large amount of data to the stream buffer
by minimizing the usage of the nxscope lock interface:

  nxscope_lock(&nxs->nxs);
  nxscope_put_vfloat(&nxs, 0, data0, 1);
  nxscope_put_vfloat(&nxs, 1, data1, 1);
  nxscope_put_vfloat(&nxs, 2, data2, 1);
  nxscope_put_vfloat(&nxs, 3, data3, 1);
  nxscope_unlock(&nxs->nxs);
2023-05-15 13:17:47 -03:00
raiden00pl
a906a76734 logging/nxscope: fix invalid zalloc size for rxbuf 2023-05-15 13:17:47 -03:00
jinxiuxu
ceba53402e nxlooper: set default format for nxlooper
set default format as AUDIO_FMT_PCM for nxlooper.

Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2023-05-15 17:30:57 +08:00
Xiang Xiao
0acd68b391 Indent the include statement by two spaces
follow the coding style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-13 10:16:26 -03:00
Huang Qi
dec2cd9635 tools/Wasm: Decouple the wasm compilation and runtime specific AOT compilation
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-05-13 10:15:40 -03:00
Huang Qi
f99209215d tools: Provide a defualt RUSTELFFLAGS if not defined
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-05-13 10:15:40 -03:00
Huang Qi
e287e4bb9e wamr: Simplify target handling by LLVM style arch info
Depends on: https://github.com/apache/nuttx/pull/8928

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-05-13 10:15:40 -03:00
raiden00pl
d521d2ea57 telnetd/Kconfig: cosmetic change
With this change `# CONFIG_SYSTEM_TELNETD_PORT is not set` will not be present
in the generated `.config` file if telnetd is disabled.
2023-05-13 10:15:02 -03:00
hujun5
dd20ae28cb ostest: rwlock need to be destroy
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-12 15:32:18 -03:00
zhanghongyu
44e5a5ecd7 dhcpc: adds errno to the dhcpc internal error
add errno to help analyze possible causes of dhcp failures

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-12 22:30:38 +08:00
simbit18
b810ac0b7e system: Fix nxstyle errors
error: Long line found
2023-05-10 15:40:06 +02:00
wangchen
cb292d0608 nshlib/netcmds:modify the description of setting MTU
modify the description of setting MTU

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-05-10 19:56:04 +08:00
Michal Lenc
f270ef644e examples: add adjtime example application
This application demonstrates the usage of adjtime() interface.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-05-10 00:46:53 +08:00
Xiang Xiao
f95d60366a Fix the nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Xiang Xiao
575582ca85 system/vi: Replace strncat with strlcat
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Xiang Xiao
73701cd7cd Replace all strncpy with strlcpy
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Xiang Xiao
7c37421266 Replace all sprintf with snprintf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Xiang Xiao
134b8b538f Replace all strcat with strlcat
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Filipe Cavalcanti
f60d23fdb9 Added example for Bosch BMP280 pressure sensor 2023-05-08 13:02:59 +08:00
hujun5
02efb15b57 ostest:fix signal test fail
If the same signal is quickly repeated multiple times, the signal may be ignored.
In SMP since we cannot control thread scheduling to ensure timely signal processing,
it is best to use semaphores to wait for signal processing to complete, which can also shorten the ostest time

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-06 23:37:07 +03:00
Radek Pesina
be55ea7869 spitool: add support for 32-bit SPI BUS width
Link: https://git.motec.com.au/id/I62920d28ab9804d52d25af3bcdd0f1ceb87be93f
2023-05-06 03:23:02 +08:00
simbit18
6a5912c76c system/termcurses: Fix nxstyle errors
error: Long line found
2023-05-04 20:19:56 +08:00
Xiang Xiao
bebae28bdd nsh: Fix the typo error cmd_swtichboot -> cmd_switchboot
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 17:40:49 +03:00
simbit18
1707be3977 graphics: Fix nxstyle errors
error: Bad alignment
error: Right brace must be followed by a blank line
error: Long line found
2023-05-03 17:35:05 +08:00
Tiago Medicci Serrano
b5fb80c0cd apps/netutils/rtptools: fix warning while building with clang
The flag '-Wno-maybe-uninitialized' is not known by clang, so a
workaround substitutes it for '-Wno-uninitialized' when clang is
being used as C compiler.
2023-05-03 00:28:55 +08:00
Tiago Medicci Serrano
a6c41fbaeb apps/netutils: Add RTP tools 2023-05-02 13:42:41 +08:00
halyssonJr
b00f612470 nxwidget: Fix incorrect #endif position
remove space
2023-05-02 13:41:53 +08:00
Xiang Xiao
a38acd685f examples: Enable cxxinfo output if CONFIG_DEBUG_FEATURES is defined
fix the wrong logic

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-30 09:33:54 +03:00
Xiang Xiao
0786563bba examples/module: Add g_ prefix to chardev_fops
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-30 09:32:21 +03:00
anjiahao
fd42d811c2 support ymodem transfer on a custom blocksize
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-04-29 21:23:55 +08:00
anjiahao
32e597a136 support ymodem send/recve can asynchronous
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-04-29 21:23:55 +08:00
Tiago Medicci Serrano
3516a5d2ee wireless/wapi: support WPA3 on wapi psk command
Similarly to the alg_flag (which can be set by text), the ver_flag
is able to select the WPA version which will be sent to the Wi-Fi
driver through the `IW_AUTH_WPA_VERSION` command. A new bit field
(IW_AUTH_WPA_VERSION_WPA3) was created to indicate WPA3 is set.

It's up to the arch's Wi-Fi driver to implement handling of this
new bit field and config the underlying driver to handle WPA3 on
AP and/or STA mode.

This implementation doesn't interfere with commonly used commands.

`wapi psk wlan0 mypasswd 3` still selects CCMP algorithm and WPA2
and is equivalent to `wapi psk wlan0 mypasswd 3 WPA_VER_2`.

One can use `wapi psk wlan0 mypasswd 3 WPA_VER_3` to set WPA3.
2023-04-29 10:02:52 -03:00
Tiago Medicci Serrano
fe8232fba0 wireless/wapi: change wapi_psk_cmd error code for invalid alg 2023-04-29 10:02:52 -03:00
Tiago Medicci Serrano
f1557dafd3 wireless/wapi: add textual flag of WAPI_ESSID_DELAY_ON
Add the `WAPI_ESSID_DELAY_ON` member of the `wapi_essid_flag_e`
enum to its textual counterpart in `g_wapi_essid_flags`. This
enables `wapi`'s usage to describe it properly.
2023-04-29 10:02:52 -03:00
simbit18
bfd4cbc743 apps/testing/ostest/roundrobin.c: Fix nxstyle errors
error: Long line found
2023-04-29 14:54:40 +08:00
Alan Carvalho de Assis
679dbdac0a Add a simple TinyCBOR Test Example 2023-04-28 12:04:20 +08:00
Alan Carvalho de Assis
98dde40a88 fsutils: Add TinyCBOR Library 2023-04-28 12:04:20 +08:00
wangchen
c2f75330f7 nshlib/netcmds:support to set MTU
Usage:ifconfig interfacename mtu ***

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-04-27 18:02:23 +08:00
yinshengkai
08bfc4e9c7 system/critmon: fix warning
critmon.c:269:3: warning: 'runtime' may be used uninitialized in this function [-Wmaybe-uninitialized]
  269 |   printf("%11s %11s %11s %-16s %-5s %s\n",
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  270 |          maxpreemp, maxcrit, maxrun, runtime, entryp->d_name, name);

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-04-25 20:00:54 +08:00
Peter van der Perk
fa26bab6b2 DroneCAN add socketcan support, rename to DroneCAN
Rename canardv1 to OpenCyphal

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-25 18:24:41 +08:00
Zhe Weng
e935f153bc apps/system: Call arg_freetable before iptables/tcpdump exit
Forget to free argtable before exit.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-04-24 23:47:45 +08:00
YAMAMOTO Takashi
15df04083e toywasm: regen
REF=80d43dfa3377810fff0ff143b2e8be2e229bf7f2 ./regen.sh
2023-04-24 23:47:13 +08:00
YAMAMOTO Takashi
b7ac752cca bump toywasm version 2023-04-24 23:47:13 +08:00
yinshengkai
3877c31b2f critmon: add total time running time of task
PRE-EMPTION   CSECTION      RUN         TIME         PID   DESCRIPTION
0.000000000   0.000000000   0.001237000 28.421047000 0     Idle Task

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-04-24 04:44:52 -04:00
hujun5
5b2a89e174 ostest: fix smp ostest fail
In SMP we need improve thread waiting strategy

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-04-24 09:55:54 +02:00
hujun5
f0f98c3d73 ostest: fix smp ostest fail
In SMP we need improve thread waiting strategy

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-04-24 09:55:54 +02:00
Xiang Xiao
fe1d701b71 system/adb: Replace adb special reset cause with boardctl.h's value
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-23 10:44:43 -07:00
Fotis Panagiotopoulos
c50ff7ff61 Fixes in asprintf usage. 2023-04-23 17:16:34 +08:00
chenrun1
cf54069487 nshlib/nsh_fscmds.c:Add whether or not to pass in empty arguments when rm -r
When rm -r is passed with no address specified, it will automatically recursively unlink all files under the root path ('/') until unlinking to the mounted folder causes the unlink to fail. In this change, rm -r without a specified path will prompt for missing arguments
2023-04-22 12:47:57 +08:00
Huang Qi
3a28933ca8 nshlib: Don't show passwd in telnet login
Current implementation is broken, in this patch ECHO is
disabled by termios.

This patch works with https://github.com/apache/nuttx/pull/8950

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-04-22 12:47:16 +08:00
dependabot[bot]
5abae22fd4 build(deps): bump github/super-linter from 4 to 5
Bumps [github/super-linter](https://github.com/github/super-linter) from 4 to 5.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/v4...v5)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-22 01:32:50 +08:00
Tiago Medicci Serrano
0a9b983e90 apps/examples/pipe: check POSIX-compliant behavior of NuttX's FIFOs
Adjust the test considering the POSIX-compliant behavior of the
NuttX's FIFO (mkfifo), which should block `open` for read-only
and write-only. This test's result is expected to be the same with
any other POSIX-compliant system.

This commit also:

 * Fix redirect test;
 * Use pthread instead `task_create` to be able to run this test
on POSIX-compliant systems;
 * General fixes regarding formatting and error messages;
2023-04-22 01:28:25 +08:00
Zhe Weng
f2819b71e5 netutils/iperf: Support RPMsg socket test
Usage:
iperf -s --rpmsg <name>
iperf -c <cpu> --rpmsg <name>

Note:
RPMsg with SOCK_DGRAM (`-u`) doesn't have server mode (bind) yet, iperf
may not work in this case before rpsock is enhanced.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-04-22 01:16:49 +08:00
Zhe Weng
213219f30a netutils/iperf: Support local socket test
Usage:
iperf -s --local <path>
iperf -c <path> --local || iperf -c <whatever> --local <path>

Can combine with other options, e.g. '-u' will result in local
UDP (DGRAM).

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-04-22 01:16:49 +08:00
Zhe Weng
411c98acec netutils/iperf: Split out sockaddr from general logic
We'll add local/rpmsg sockets later, they're mainly different in
sockaddr, we can reuse other current logic.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-04-22 01:16:49 +08:00
Zhe Weng
e3e3cc28a6 netutils/iperf: Use argtable's builtin glossary to print usage
Argtable's builtin glossary can produce same output and we do not need
to maintain two sets of help string. Then we're easier to add more
options to iperf.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-04-22 01:16:49 +08:00
Ville Juven
4ce809e7d4 nsh/nsh_parse: Fix handling of back-quotes
The logic that handles back-quotes was faulty, i.e. example command
set FOO `ls -l` would be split into two tokens as follows:
- set FOO `ls
- -l`

This results in nsh: `: no matching ` error, this fixes that issue.
2023-04-19 03:12:18 +08:00
Petro Karashchenko
700b0ed235 netutils/netlib: fix typos in comments
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-19 03:11:19 +08:00
Petro Karashchenko
a926c8bf12 include/netutils: fix code alignments
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-19 03:11:19 +08:00
Petro Karashchenko
f7448f848b netutils/webserver: improve modularity of httpd single server
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-19 03:11:19 +08:00
Petro Karashchenko
f15605da2f nuttx: add missing FAR and CODE
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-19 03:11:19 +08:00
chenrun1
69d5f960fc system/ramspeed:Fix the problem that irq_disable is often opened.
Fix the problem that "when repeat_num!=0, there is no break, so irq_disable will be configured to true by default".
2023-04-19 03:10:05 +08:00
Petro Karashchenko
4159fa197b testing/ostest: make sure that pthread_rwlock timeout test is executed properly
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-17 15:54:32 +02:00
Petro Karashchenko
2655f80dd7 testing/ostest: fix tasks priority assignment in nested signal test
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-04-17 15:54:32 +02:00
raiden00pl
6b35ff323a github/linters/setup.cfg: ignore E203 for flake8 to fix compatibility issues with black
For more details, see https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
2023-04-17 01:47:31 -07:00
Ville Juven
0914c20c0d nsh/alias: Add support for alias arguments
This adds support for more complex alias handling, such as:

$ alias ls='ls -l'

Previously such an alias was not split into the command verb and the
argument correctly, instead the full alias string was handled as the
verb, which obviously fails.

This commit fixes this by expanding the alias, checking whether it has
arguments and if so, it merges the expanded alias + the old command line
together, resulting in a completely new command line.

Example (assuming the alias above has been created):

$ ls /bin

Results in a new command line: "ls -l /bin" which is then parsed and
executed.
2023-04-17 15:09:38 +09:00
simbit18
90c963677c apps/examples/wgetjson/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
simbit18
9201c3e8e1 apps/examples/djoystick/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
simbit18
a7889e122c apps/examples/ajoystick/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
simbit18
c99a1fd2a5 apps/examples/pty_test/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
simbit18
1fb35350b9 apps/examples/ipforward/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
simbit18
c647fc63de apps/examples/sht3x/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
simbit18
d4ac7cc816 apps/examples/ina219/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-04-14 11:04:06 +03:00
raiden00pl
9f3f6a4b3b system/usbmsc: set stack size to DEFAULT_TASK_STACKSIZE 2023-04-07 13:45:07 +03:00
Xiang Xiao
1d3e6510e6 nshlib: Add switchboot command
switchboot <image path>

Switch to the updated or specified boot system. This command depends on
hardware support CONFIG_BOARDCTL_SWITCH_BOOT. `<image path>` point to a
partion or file which contain the firmware to boot.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-07 13:44:49 +03:00
Xiang Xiao
aa99d267b7 Change the private default signal number to 32
and remove the unused private signal number macro

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-05 03:38:24 -07:00
Xiang Xiao
417b87a0a0 testing/ostest: Remove the unreal used SIG_WAITCANCEL
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-05 03:38:24 -07:00
Xiang Xiao
3ac86cc6f1 testing/ostest: Define the private used signal to SIGRTMIN
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-05 03:38:24 -07:00
Fotis Panagiotopoulos
b93aa0cb8d ostest: Fixed use of uninitialized variable. 2023-04-05 03:57:00 +03:00
zhengjunbo1
f58c87e7ed nshlib/README.md: add uptime command description
Signed-off-by: zhengjunbo1 <zhengjunbo1@xiaomi.com>
2023-04-04 12:19:15 -04:00
Xiang Xiao
49418d6de5 nshlib: Align the command table
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-04 13:53:28 +03:00
Xiang Xiao
4f7dd7be7c nshlib: Add boot command
boot [<image path> [<header size>]]

Boot a new firmware image. This command depends on hardware support
CONFIG_BOARDCTL_BOOT_IMAGE. <image path> may point to a partion or file
which contain the firmware to boot. The optional, numeric argument
<header size> may be useful for skipping metadata information preprended
to the firmware image.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-04 13:53:28 +03:00
Ville Juven
c694d8d90f system/composite_main.c: Convert fprintf -> dprintf
CONFIG_FILE_STREAMS now defaults to 'n' when DEFAULT_SMALL is enabled. This
is a good change, but this source file fails to compile when file streams
are disabled.

Fix this by using dprintf.
2023-04-03 21:33:19 +03:00
wangchen
93105568c0 examples/ftpd: Add support for choosing address family
choose the network protocol (ipv4 or ipv6) to bind network in setting ftpd

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-04-03 16:18:15 +03:00
simbit18
75ddde9c56 apps/examples/mqttc/Makefile: Add missing Apache Foundation copyright header
Add missing Apache Foundation copyright header
2023-04-03 16:14:35 +03:00
Masayuki Ishikawa
125cf7abe2 nshlib: Fix the ps command format
Summary:
- I noticed that the ps command shows the wrong format due to
  recent changes on sigmask length from 32bits to 64bits
- This commit fixes this issue

Impact:
- None

Testing:
- Tested with sabre-6quad:smp on qemu-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-03-29 14:50:26 +03:00
Xiang Xiao
fd9c92e2e9 system/cu: Move fd_std_tty, g_tio_std and g_tio_dev to cu_globals_s
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-29 14:50:11 +03:00
Gustavo Henrique Nihei
d650d3276f luamodules: Fix implicit declaration warning for strncasecmp
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-28 14:54:16 -03:00
Gustavo Henrique Nihei
ce68d7a738 examples/popen: Fix NxStyle long line warning
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-28 14:54:16 -03:00
Gustavo Henrique Nihei
efb4e0bc91 Add another batch of missing headers throughout the repository
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-28 14:54:16 -03:00
Gregory Nutt
a1bca5070c Changes to apps needed by nutts PR 8885
ostest contains some logic that depends on internal implementation of signal sets and ostest must be updated to match those changes.

There is no particular impact from this PR.  This PR is the result of impact from nuttx 8885.

Tested with nuttx 8885
2023-03-27 16:58:52 +03:00
Petro Karashchenko
75b4720a6e industry/scpi: fix compilation of SCPI library
Expose SCPI library API to application

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-03-27 09:15:48 +02:00
Xiang Xiao
35edbf02f5 system/cu: Remove the duplicated SIGINT definition
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-26 09:12:45 -06:00
Petro Karashchenko
6833a8c0cc netutils/pppd: fix indentations in ppp.h
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-03-26 08:33:05 -06:00
Petro Karashchenko
07d229f514 canutils: fix indentation in Kconfig files
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-03-26 08:33:05 -06:00
simbit18
386e077525 apps/system/ymodem/Makefile: fix nxstyle
Remove LF first line
2023-03-24 15:04:43 -03:00
simbit18
1adc70fe43 apps/system/ymodem/Make.defs: fix nxstyle
Remove LF first line
2023-03-24 15:04:43 -03:00
simbit18
e533df52cc apps/testing/smart_test/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-24 15:04:43 -03:00
simbit18
ef7e2a8636 apps/wireless/ieee802154/libutils/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-24 15:04:43 -03:00
simbit18
6766327cde apps/wireless/wapi/src/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-24 15:04:43 -03:00
Stuart Ianna
0ed95bbe97 tools/mkimport: Allow additions LDELFFLAGS from exported Nuttx builds. 2023-03-24 15:03:53 -03:00
Huang Qi
95acf6c904 interpreters/wamr: New option to dump call stack
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-24 11:37:22 +08:00
Ville Juven
e20d2688ab nsh/alias: Do not expand argument lists, only the command
A resulting word that is identified to be the command name word of a
simple command shall be examined to determine whether it is an unquoted,
valid alias name.

The keyword here being "a simple command", arguments are not subject to
expansion.
2023-03-23 22:10:19 +02:00
Ville Juven
ad18a50282 nsh/nsh_parse.c: Fix variable expansion inside double quotes
This also prevents expanding anything when inside single quotes, for
full POSIX compliance.
2023-03-23 22:10:19 +02:00
Ville Juven
f9dfb51001 nsh/nshlib: Add alias support for nsh
This adds support for string aliases into nsh. There are some nuances that
are not handled correctly yet:

- Reserved words can be overloaded, which is a clear POSIX violation
2023-03-23 22:10:19 +02:00
Ville Juven
bf40833d2e nsh/nsh_parse.c: Add support for single ('') and double ("") quotes
The parser is modified to detect, handle and remove quotes from the
command string. Whatever is inside the quotes is treated as a string
literal. If no matching end quote is found, the terminal prints out
and error.
2023-03-23 22:10:19 +02:00
simbit18
800f1f4bae apps/examples/adc/adc.h: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-23 00:52:38 +02:00
simbit18
ad8478045e apps/examples/charger/Makefile: fix nxstyle
Add missing Apache Foundation copyright header
2023-03-23 00:52:38 +02:00
simbit18
d80b08d07e apps/examples/flash_test/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-23 00:52:38 +02:00
simbit18
c86b154677 apps/examples/fboverlay/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-23 00:52:38 +02:00
Huang Qi
4079f6d613 system/cu: Let remote machine handle special character except Ctrl-C
Let remote machine handle special character except Ctrl-C, make cu's behavior more close to linux/bsd system.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-22 11:51:04 -03:00
chao an
b3cfcee47d netutils/iperf: guaranteed precision before division
Iperf test on photon/wlan
Before:
   0.00-   1.08 sec      65536 Bytes    0.00 Mbits/sec
After:
   0.00-   1.04 sec      74970 Bytes    0.58 Mbits/sec

Signed-off-by: chao an <anchao@xiaomi.com>
2023-03-22 11:47:01 -03:00
Zhe Weng
412505d286 ostest: Introduce basic work queue test
The test consists of two parts:
- A tester that tries to trigger wrong states of work queue
- A verifier that checks whether the wqueue is still working properly

The tester is trying to queue and cancel work several times with
priority lower/same/higher than the work queue.

Most wrong cases are likely to happen with high priority like:
- If `cancel` never decreases semcount, the count may keep growing
  and finally overflow
- If `cancel` is decreasing semcount too much, the `work_thread` may
  be waken up less times than expected

The lower/same priority testers are just added for covering other
unexpected situations.

The verifier is trying to queue some works and check they are called as
expected:
- Frist queue a 'sleep' worker, to let a work queue thread be in busy
  status and not waiting on sem, while other work queue thread(s) (if
  any) still waiting for sem. If sem is in wrong state, it may cause
  wrong behavior in either thread waiting/not waiting on the sem.
- Then queue a few count works, if the work queue(s) are still working
  properly, these works should finally be all called once.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-03-22 12:56:01 +02:00
Huang Qi
8ae5a1b148 Fix some hard coded buffer len of snprintf
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-21 20:57:56 -03:00
Zhe Weng
86d084fe21 netutils/ftpc: Cancel wdog on error state in ftpc_reconnect.
The timer is for connect timeout, but is not cancelled on connect error,
then it may be triggered after ftpc quit and cause heap-use-after-free.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-03-21 20:40:38 -03:00
Xu Xingliang
f32aa2df59 lua: download tarball from github release tag
The tarball from github has same file layout as git repo while the tarball from ftp doesn't.
Update Makefile to accommodate this change.

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2023-03-21 20:38:29 -03:00
simbit18
48928e1c68 apps/system/dumpstack/Makefile: fix style
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
0e04cd75f8 apps/system/dumpstack/Make.defs: fix style
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
d65c51b0c6 apps/platform/bin/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
04c31b820c apps/testing/crypto/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
ab675c5b7d apps/testing/crypto/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
Tiago Medicci Serrano
3a1893ba7e nxplayer: read file completely until 0 bytes are returned
Previously, if the read bytes were less than the requested, the
file was closed immediately. This behavior, however, does not
consider the fact that the read operation may be blocking when
no bytes are available at the moment. That is true for a named pipe
(FIFO), for instance. Thus, reading it again lets to the underlying
file system the decision of 1) blocking until bytes become
available or 2) return 0 immediately (the case for actual files) or
3) read available bytes.
2023-03-21 07:51:18 +09:00
simbit18
d3c3a6ebe0 apps/netutils/xmlrpc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
7560a5e80d apps/netutils/webserver/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
79b72c0302 apps/netutils/webclient/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
b2f1ab31c7 apps/netutils/thttpd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
b2d24f7688 apps/netutils/tftpc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
98a1618202 apps/netutils/telnetd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
4b401d95b1 apps/netutils/telnetc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
17103a6b3d apps/netutils/smtp/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
27a17df69d apps/netutils/rexecd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
19d6f40767 apps/netutils/rexec/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
af4e177722 apps/netutils/pppd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
257719d65a apps/netutils/ntpclient/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
804762c72d apps/netutils/netlib/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
e1357fa6c9 apps/netutils/netinit/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
6529e74326 apps/netutils/libcurl4nx/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
2c2577fc75 apps/netutils/ftpd/Make.defs: nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
8bc93e07ce apps/netutils/ftpc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
a75dd4be40 apps/netutils/esp8266/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
cf0ee4354c apps/netutils/discover/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
585d0e083b apps/netutils/dhcpd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
5137e6f3db apps/netutils/dhcpc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
5736d2adfd apps/netutils/dhcp6c/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
6978a65293 apps/netutils/codecs/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
Xiang Xiao
f3c104b99a Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-19 14:53:44 -06:00
Xiang Xiao
86080a110e apps: Remove the check of CONFIG_SERIAL_TERMIOS
If the code only change c_oflag, c_iflag and c_lflag, not c_cflag in termios.
Follow up the change from kernel: https://github.com/apache/nuttx/pull/8843

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-19 14:53:44 -06:00
anjiahao
369c354dc7 support ymodem protocal and sb rb application
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-03-17 12:17:14 -03:00
yinshengkai
fb0ab1b4c6 nshlib: one-time output uname
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-17 12:10:00 -03:00
Huang Qi
0af64dc045 system/cle: Remove cle_getcursor()
Fix https://github.com/apache/nuttx/issues/8731, don't rely on the vt100 to report
the cursor position.

This avoid the implicit input (response of get cursor command) during the user inputs.

Notice: This assume that the nsh prompt is always shown at line start.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-17 12:08:04 -03:00
YAMAMOTO Takashi
04a156e0d0 toywasm: regen config-dependent files
With the regen script:

```
REF=7c6ff3925d0b0f4d5122df9b1b5761bc2954e014 ./regen.sh
```
2023-03-17 12:07:02 -03:00
YAMAMOTO Takashi
b962c02c05 toywasm: add a script to regenerate config-dependent files
This is a manual step mainly because it involves extra
tools including cmake.
2023-03-17 12:07:02 -03:00
Huang Qi
4b1d59d40d bas: Don't ECHO input in repl
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-17 12:00:55 -03:00
Xiang Xiao
503b4ccf82 Fix the indent issue found in build script
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-17 12:00:17 -03:00
Ville Juven
5d9811a03d nshlib/nsh_vars.c: Add missing stdio.h
nsh_vars.c: In function 'nsh_setvar':
nsh_vars.c:285:3: error: incompatible implicit declaration of built-in function 'sprintf' [-Werror]
  285 |   sprintf(pair, "%s=%s", name, value);
2023-03-17 11:59:37 -03:00
XinStellaris
7ab1f2a957 Add Arch-specific libc test case.
Signed-off-by: XinStellaris <tianxin7@xiaomi.com>
2023-03-17 11:59:13 -03:00
zhangyuan21
4454c8d02f apps: remove unnecessary sem_setprotocol code
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-03-17 11:58:03 -03:00
simbit18
0d34e55d9e apps/graphics/nxglyphs/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
d8dd8ff61e apps/graphics/nxglyphs/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
da6998434b apps/fsutils/mkmbr/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
a37267e644 apps/examples/xbc_test/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
3a912b8778 apps/examples/watcher/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
5578539c88 apps/examples/sht3x/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
826b95a377 apps/examples/posix_spawn/filesystem/hello/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
1a0cd7211a apps/examples/nxscope/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
311e1edbdb apps/examples/nxflat/tests/struct/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
478ad2c782 apps/examples/noteprintf/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
e4f0a55673 apps/examples/mount/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
63a80df4e2 apps/examples/hello_zig/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
de4c99f870 apps/examples/hello_rust/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
0a187004c1 apps/examples/hello_nim/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
2235f33033 apps/examples/hello/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
4713edf5a8 apps/canutils/lely-canopen/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
bfdb76c609 apps/examples/cordic/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
Huang Qi
ea4437fc76 termios: Fix wrong ECHO flag
Follow https://github.com/apache/nuttx/pull/8800

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-17 03:22:08 +01:00
Xiang Xiao
fc1045271a Directory.mk: Always generate and remove .kconfig
since .kconfig is required to trigger the recursive processing

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-17 03:21:43 +01:00
jturnsek
e599bbcd24 Initial LuaJIT interpreter load 2023-03-17 09:28:58 +08:00
zhangyuan21
922f9932a6 apps: add <assert.h> header file
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-03-16 12:00:28 +01:00
jturnsek
b67b56111a Using poll instead of epoll by default 2023-03-10 14:59:16 +08:00
jturnsek
699b7c6a22 Adding sdr group with liquid-dsp library 2023-03-09 01:43:53 +08:00
simbit18
e8dcb60d71 apps/testing/ltp/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-09 01:43:09 +08:00
simbit18
75b2519827 apps/testing/unity/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-09 01:43:09 +08:00
simbit18
5cee3eebd9 uclibcxx_test/Make.defs Fix mistakes in comments
apps/testing/uclibcxx_test/Make.defs:  Fix mistakes in comments
2023-03-09 01:43:09 +08:00
simbit18
77cc8c96b1 apps/testing/mtd_config_fs/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-09 01:43:09 +08:00
simbit18
e8bf439105 apps/testing/cxxtest/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-09 01:43:09 +08:00
simbit18
6d7ed39a0d apps/testing/cxxtest/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-09 01:43:09 +08:00
Lucas Saavedra Vaz
005a4c60c9 benchmarks/coremark: Improve CoreMark result message 2023-03-09 01:42:54 +08:00
Huang Qi
dbf7d34a2a nsh: Fix a potential buffer overflow in cmd help
Follow https://github.com/apache/nuttx-apps/pull/1621, fix issue of builtin command list.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-09 01:42:38 +08:00
Fotis Panagiotopoulos
dd2c3b3f6a nsh: Added conditional include of netinit. 2023-03-09 01:41:10 +08:00
YAMAMOTO Takashi
ad9a44d606 interpreter/toywasm: Update toywasm version
Tested on esp32-devkitc.
2023-03-09 01:40:38 +08:00
chao an
d33c9d3669 application.mk: add extera objects into $(OBJS) depends
Added support for extra object files to describe compilation rules
in private libraries to support some special compilers, especially
they contain some special compilation rules (eg: X86 nasm/yasm)

Signed-off-by: chao an <anchao@xiaomi.com>
2023-03-08 18:53:03 +02:00
simbit18
73301dd16d apps/interpreters/bas/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-08 13:50:23 -03:00
simbit18
2a255db413 apps/interpreters/ficl/Make.defs: Add missing Apache Foundation copyright header
Add missing Apache Foundation copyright header
2023-03-08 13:50:23 -03:00
simbit18
c1d859c249 apps/interpreters/bas/Make.defs: Add missing Apache Foundation copyright header
Add missing Apache Foundation copyright header
2023-03-08 13:50:23 -03:00
Zhe Weng
098f5836f9 apps/system: Add tcpdump command
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-03-08 19:47:53 +08:00
chao an
7ad9525c35 Application: fix multiple main target mismatch during incremental compile
MAINSRC will fail to match with PROGNAME if one of main source is changed in incremental compilation
this PR will correct this issue.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-03-08 08:56:09 +01:00
jturnsek
b13f70ca59 Nng library and pubsub example 2023-03-08 10:49:13 +08:00
simbit18
d325cf048a apps/system/uorb/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 21:45:12 +02:00
simbit18
a62f09136e apps/system/setlogmask/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 21:45:12 +02:00
simbit18
7b8cc4e74b apps/system/nxrecorder/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 21:45:12 +02:00
simbit18
ef908dd83b apps/system/cachespeed/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 21:45:12 +02:00
simbit18
dd607dbd11 apps/modbus/ascii/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 21:45:12 +02:00
simbit18
ab26b11bbc apps/modbus/functions/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 21:45:12 +02:00
Huang Qi
96cd66cf51 system/cu: Disable echo if it's enabled to avoid double input character
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-07 09:50:54 +01:00
simbit18
4a9752ed3d Update pwm.h
Fix nxstyle
2023-03-07 10:00:43 +08:00
simbit18
5854208e55 apps/examples/dac/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
943fda1aa8 apps/examples/audio_rttl/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
9fc5fea946 apps/examples/audio_rttl/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
2bfa344cc0 apps/examples/relays/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
853e574800 apps/examples/etl/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
15b24123f5 apps/examples/nxdemo/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
b85bd22fe1 apps/examples/esp32_himem/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
82c78c6734 apps/examples/esp32_himem/Make.def:sFix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
b6cd7679e4 apps/examples/pwm/pwm.h: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
71bbfbea43 apps/examples/mtdrwb/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
24667d219e apps/examples/tcp_ipc_server/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
7c803d28e6 apps/examples/tcp_ipc_server/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
2792127849 apps/examples/tcp_ipc_client/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-07 10:00:43 +08:00
simbit18
13315255e5 apps/examples/tcp_ipc_client/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-07 10:00:43 +08:00
Gustavo Henrique Nihei
f500c64962 Include missing headers throughout the repository
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-07 09:58:13 +08:00
Gustavo Henrique Nihei
da7d9e3737 system/nsh: Include missing "unistd.h" header
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-06 18:52:31 +02:00
Gustavo Henrique Nihei
b61686b866 nshlib: Include missing "sched.h" header
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-06 18:52:31 +02:00
simbit18
02d293d4b7 qe.h: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-06 05:19:02 -08:00
simbit18
baf15a1a89 apps/examples/qencoder/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-06 05:19:02 -08:00
chao an
4f11f38c38 interpreters/wamr: add compile role of WebAssembly
Add compilation rules to support WebAssembly(WASM/WAMR):

1. Compile Toolchain
 1> Download WASI sdk and export the WASI_SDK_PATH path:

$ wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz
$ tar xf wasi-sdk-19.0-linux.tar.gz
Put wasi-sdk-19.0 to your host WASI_SDK_PATH environment variable, like:
$ export WASI_SDK_PATH=`pwd`/wasi-sdk-19.0

 2> Download Wamr "wamrc" AOT compiler and export to the PATH:
$ mkdir wamrc
$ wget https://github.com/bytecodealliance/wasm-micro-runtime/releases/download/WAMR-1.1.2/wamrc-1.1.2-x86_64-ubuntu-20.04.tar.gz
$ tar xf wamrc-1.1.2-x86_64-ubuntu-20.04.tar.gz
$ export PATH=$PATH:$PWD

2. Configuring and running

 1> Configuring sim/wamr and compile:

nuttx$ ./tools/configure.sh  sim/wamr
nuttx$ make
...
Wamrc Generate AoT: /home/archer/code/nuttx/n5/apps/wasm/hello.aot
Wamrc Generate AoT: /home/archer/code/nuttx/n5/apps/wasm/coremark.aot
LD:  nuttx

 2> Copy the generated wasm file(Interpreter/AoT)

nuttx$ cp ../apps/wasm/hello.aot .
nuttx$ cp ../apps/wasm/hello.wasm .
nuttx$ cp ../apps/wasm/coremark.wasm .

 3> Run iwasm

nuttx$ ./nuttx
NuttShell (NSH) NuttX-10.4.0
nsh> iwasm /data/hello.wasm
Hello, World!!
nsh> iwasm /data/hello.aot
Hello, World!!
nsh> iwasm /data/coremark.wasm
2K performance run parameters for coremark.
CoreMark Size    : 666
Total ticks      : 12000
Total time (secs): 12.000000
Iterations/Sec   : 5.000000
Iterations       : 60
Compiler version : Clang 15.0.7
Compiler flags   : Using NuttX compilation options
Memory location  : Defined by the NuttX configuration
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0xa14c
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 5.000000 / Clang 15.0.7 Using NuttX compilation options / Defined by the NuttX configuration

Co-Authored-By: Huang Qi <huangqi3@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-03-06 13:23:44 +02:00
Huang Qi
12d31075eb nsh: Fix a buffer overflow in help
Introduced by https://github.com/apache/nuttx-apps/pull/1610,
internal line buffer should have more bytes for tab before newline and '\0'.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-05 11:18:59 +02:00
Huang Qi
509e90aadc termcurses: Disable echo for serial driver
Since termcurse will control whole echo and vt100 command itself.

This fix the dupped character in VI's command mode and some display issue in editor mode, like:
```
~
~
~
~
:qq!!
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-05 14:37:45 +08:00
simbit18
b370f77851 Update batt_main.c 2023-03-04 13:50:22 +08:00
simbit18
d4e85ce384 apps/examples/battery/batt_main.c: Fix mistakes in comments
Fix mistakes in comments
2023-03-04 13:50:22 +08:00
simbit18
13d2cc1d88 apps/examples/battery/Make.defs: Fix mistakes in comments
Fix mistakes in comments
2023-03-04 13:50:22 +08:00
simbit18
e7a86f38d3 apps/examples/battery/Makefile:Fix mistakes in comments
Fix mistakes in comments
2023-03-04 13:50:22 +08:00
Huang Qi
fd8ce46060 system/cle: Don't echo extra '\n'
Before:
```
NuttShell (NSH) NuttX-12.0.0
nsh> free
/* Extra line here */
                   total       used       free    largest  nused  nfree
        Umem:   33154512      33584   33120928   33120928     96      1
```

After:
```
NuttShell (NSH) NuttX-12.0.0
nsh> free
                   total       used       free    largest  nused  nfree
        Umem:   33154512      33584   33120928   33120928     96      1
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-04 13:50:08 +08:00
Gustavo Henrique Nihei
fe7b57aa11 wamr: Fix INTERPRETERS_WAMR_LIBC_WASI dependency on PSEUDOFS_SOFTLINKS
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-04 01:47:33 +08:00
Huang Qi
9bb730fb6b nsh: Don't echo password during login
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-04 01:44:40 +08:00
Huang Qi
2e49d78400 nsh/login: FIx error prompt length
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-04 01:44:40 +08:00
simbit18
68fee5effb apps/examples/ina226/Makefile: Fix mistake in comment
fix relative path error
2023-03-04 01:43:30 +08:00
simbit18
4e4ccd6c73 apps/examples/apds9960/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-04 01:43:17 +08:00
simbit18
88b01447b5 apps/examples/lp503x/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-04 01:43:03 +08:00
simbit18
006e33c646 apps/examples/hidkbd/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-04 01:43:03 +08:00
simbit18
2254074f82 apps/examples/can/Makefile: Fix mistakes in comments
Fix mistakes in comments
2023-03-04 01:43:03 +08:00
Huang Qi
f1ba1a40ed nsh: Improve performance of ps by merge nsh_output
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-03 17:41:39 +09:00
Huang Qi
e957e1633c nsh: Improve performance of help by line buffer
This change reduce the usage of `printf`,
which will improve both CPU usage and IO performance.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-03 17:41:39 +09:00
Xiang Xiao
21bc466a2b Remove the tail space char from all files
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-03 00:18:36 +02:00
Karel Kočí
cf9dd1c653 lvgl: silent download and unpack
This introduces changes from NuttX commit
03b164f59ce40a3f5677b0588af2aee8d9697bf6.
2023-03-02 22:24:54 +08:00
raiden00pl
832b160cb1 bluetooth/nimble: update to bc7828341226d860429c63994065f8f1b8b8d7b0
which fix https://github.com/apache/mynewt-nimble/pull/1472
2023-03-02 22:21:37 +08:00
pengyiqiang
ca403ffaf7 lvgl/port: optimize fbdev buffer sync algorithm
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-03-02 13:52:05 +08:00
Huang Qi
8160dd0d56 readline: Don't echo input except VT100 command
Let's echo character by serial driver,
this will imporve the experience of telnetd,
which will display input command and newline twice.
And also enhance the compatiblity with some third party
linux readline based application (like WAMR repl).

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-02 13:46:18 +08:00
yinshengkai
4f04151f17 exampels/note: modify SCHED_NOTE_XXX -> sched_note_xxx
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-02 11:20:40 +08:00
SPRESENSE
b58ecee1c9 apps/examples/udp: Fix warnings by -Wformat
Fix warnings where address of IPv4 is displayed.
2023-03-02 11:20:06 +08:00
yinshengkai
fa589ae622 nsh: fix nsh startup failure
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-01 21:26:01 +08:00
zhangyuan21
5e4c4d7393 netutils/dhcpd: fixed simusb build issue
define dhcpd_arpupdate when CONFIG_NETUTILS_DHCPD_IGNOREBROADCAST undef

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-03-01 21:25:31 +08:00
Michal Lenc
99b99c8c5e pwm: update channel range with support of 0 and -1
PWM drivers support channel numbers 0 (skip the channel) and -1 (skip this
channel and all following channels). This commit enables usage of this
numbers in PWM example application.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-02-27 22:33:56 +08:00
Takeyoshi Kikuchi
c785e32183 add "hello_nim" example application written by Nim.
Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2023-02-27 10:15:33 +01:00
raiden00pl
a594bbda7c logging/nxscope: add a mention of available client tools for NxScope 2023-02-27 16:04:46 +08:00
Xiang Xiao
a4f7129984 Fix nsh_builtin.c:91:22: error: 'SA_NOCLDWAIT' undeclared
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-26 19:02:28 +02:00
Xiang Xiao
359f66ad37 nshlib: Remove the remaining CONFIG_FILE_STREAM dependence
continue the change from https://github.com/apache/nuttx-apps/pull/1559

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-24 17:38:19 +08:00
Xiang Xiao
80feb2432d nshlib: Shouldn't set TIOCSCTTY with STDOUT_FILENO directly
to handle the shell redirection correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-24 17:38:19 +08:00
xinbingnan
9246502aca drivertest/drivertest_uart: uart driver testcase
VELAPLATFO-4612

There are three test.

1. Write a long default string into the serial port.
2. Read the default string given by the last test from the serial port.
3. Manually execute the `test_content_ gen.py` script and write the text into the serial device to test the burst capability or run this script and specify device path to automatically test.

Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2023-02-24 17:13:06 +08:00
Xiang Xiao
df2db2e410 interpreters/bas: Fix the nxstyle warning
except "Mixed case identifier found"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-24 08:36:58 +02:00
Lucas Saavedra Vaz
c94b091bd3 benchmarks/coremark: Fix recompilation bug 2023-02-24 14:06:10 +08:00
chao.an
ba030e5843 wireless/wapi: correct check of return value
VELAPLATFO-2999

----------------------
 * Name: ioctl
...
 * Returned Value:
 *   >=0 on success (positive non-zero values are cmd-specific)
 *   -1 on failure with errno set properly:

Signed-off-by: chao.an <anchao@xiaomi.com>
2023-02-23 12:56:11 -03:00
yinshengkai
19ba886ec2 trace: remove SCHED_INSTRUMENTATION_HIRES
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-02-23 22:33:14 +08:00
chao an
7cc325ae83 crypto/mbedtls: disable optimize on sim platform
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-23 18:05:26 +08:00
Huang Qi
7f67ee8c88 bas_fs.c: Fix nxstyle: Multiple data definitions
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-23 17:21:19 +08:00
Huang Qi
db22e07d07 stdio: Remove CONFIG_EOL_IS_XXX
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-23 17:21:19 +08:00
Xiang Xiao
69cad3c287 build: Remove the annoy warning from distclean
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-22 23:15:02 +08:00
lilei19
41f60bd669 change strcpy to strlcpy
Change-Id: I8b9429a3c225a82842fce136bdb14b8b135066d3
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-02-22 23:09:55 +08:00
pengyiqiang
e86745b9a2 lvgldemo: use nitems instead of sizeof
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-02-22 23:09:42 +08:00
Karel Kočí
6b44c59bee graphics/lvgl: fix build due to no-format-security
Without this change the build produces error:
  error: ‘-Wformat-security’ ignored without ‘-Wformat’
2023-02-22 23:07:20 +08:00
pengyiqiang
6f192bd1e0 lvgl/port: add libuv porting
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-02-22 15:33:53 +02:00
crafcat7
b8533e0f70 drivertest/gpio:Add FAR to the pointer 2023-02-22 16:17:04 +08:00
crafcat7
fd0ac1b8fb drivertest/block:Add FAR to the pointer 2023-02-22 16:16:51 +08:00
Huang Qi
95f32fd018 nsh: Decouple with CONFIG_FILE_STREAM
Replace all fwrite/fread/fgets/... to write/read/...

Before:
```
       text    data     bss     dec     hex filename
 109827     601    6608  117036   1c92c nuttx/nuttx
```
    After:
```
       text    data     bss     dec     hex filename
108053     601    6608  115262   1c23e nuttx/nuttx
```
    After with CONFIG_FILE_STREAM disabled:
```
       text    data     bss     dec     hex filename
 105667     601    6608  112876   1b8ec nuttx/nuttx
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-22 13:47:41 +08:00
Xiang Xiao
6a686ba93d bluetooth/nimble: Update to 17a8e61fdec48d579df3bc5af59a9cff5edee674
which contain the fix:
https://github.com/apache/mynewt-nimble/pull/1462
https://github.com/apache/mynewt-nimble/pull/1459
https://github.com/apache/mynewt-nimble/pull/1457
https://github.com/apache/mynewt-nimble/pull/1161

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-21 23:39:51 +02:00
xinbingnan
5a8e089c66 drivertest/drivertest_i2c_spi.c: add testcase for i2c and spi
The BMI160 6-axis acceleration sensor is used as the peripheral of the I2C test. The main purpose of the test is to open the peripheral and read the data of the sensor. If it is read successfully, the test is successful.

Add compiled constraints to make it work only when the bmi160 driver is turned on.

Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2023-02-22 02:46:36 +08:00
chao an
8ac809e680 system/libuv: check GCC version before set special flags
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-21 13:57:43 +08:00
chao an
f0ddb92be0 libuv: disable warning message of dangling-pointer
| In file included from libuv/src/uv-common.h:42,
|                  from libuv/src/uv-common.c:23:
| libuv/src/uv-common.c: In function 'uv_walk':
| libuv/src/queue.h:68:19: warning: storing the address of local variable 'queue' in '((void * (**)[2])MEM[(void *[2] * *)loop_13(D) + 8B])[1]' [-Wdangling-pointer=]
|    68 |     QUEUE_PREV(q) = (n);                                                      \
|       |                   ^
| libuv/src/queue.h:78:7: note: in expansion of macro 'QUEUE_SPLIT'
|    78 |       QUEUE_SPLIT(h, q, n);                                                   \
|       |       ^~~~~~~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-20 19:25:58 +08:00
chao an
cf4db3f62d drivers/note: fix build break by note rename change
Regression by:

| commit 4e6041a46c (HEAD, origin/master, origin/HEAD)
| Author: Xiang Xiao <xiaoxiang@xiaomi.com>
| Date:   Tue Feb 14 01:17:13 2023 +0800
|
|     system: Change DRIVER_NOTExxx to DRIVERS_NOTExxx
|
|     follow the kernel side change: https://github.com/apache/nuttx/pull/8531
|
|     Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-20 16:13:54 +08:00
Xiang Xiao
4e6041a46c system: Change DRIVER_NOTExxx to DRIVERS_NOTExxx
follow the kernel side change: https://github.com/apache/nuttx/pull/8531

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-20 14:30:57 +08:00
Oreh
f63a3cac0e Add NSH lomtd command (creates MTD loop device) 2023-02-19 19:55:52 +08:00
pengyiqiang
8bee2e2fe0 lvgl/port/lv_port_touchpad: add cursor display
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-02-19 10:53:42 +08:00
Junbo Zheng
78b7318a04 fsutils/passwd: fix warning: leak of ‘iobuffer’ [CWE-401] [-Wanalyzer-malloc-leak]
In function ‘passwd_find’:
passwd_find.c:82:14: warning: leak of ‘iobuffer’ [CWE-401] [-Wanalyzer-malloc-leak]
   82 |       return -errcode;
      |              ^~~~~~~~
  ‘passwd_find’: events 1-5
    |
    |   65 |   iobuffer = (FAR char *)malloc(CONFIG_FSUTILS_PASSWD_IOBUFFER_SIZE);
    |      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |      |                          |
    |      |                          (1) allocated here
    |   66 |   if (iobuffer == NULL)
    |      |      ~
    |      |      |
    |      |      (2) assuming ‘iobuffer’ is non-NULL
    |      |      (3) following ‘false’ branch (when ‘iobuffer’ is non-NULL)...
    |......
    |   73 |   stream = fopen(CONFIG_FSUTILS_PASSWD_PATH, "r");
    |      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |      |            |
    |      |            (4) ...to here
    |   74 |   if (stream == NULL)
    |      |      ~
    |      |      |
    |      |      (5) following ‘true’ branch (when ‘stream’ is NULL)...
    |
  ‘passwd_find’: event 6
    |
    |   80 |       int errcode = errno;
    |      |                     ^~~~~
    |      |                     |
    |      |                     (6) ...to here
    |
  ‘passwd_find’: event 7
    |
    |   82 |       return -errcode;
    |      |              ^~~~~~~~
    |      |              |
    |      |              (7) ‘iobuffer’ leaks here; was allocated at (1)
    |

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2023-02-18 17:24:54 +08:00
yintao
49f88d50b2 testing/cmocka: update cmocka version and add patch
Specify cmocka as the latest version 1.15
add patch to enable cmocka to output with syslog

Signed-off-by: yintao <yintao@xiaomi.com>
2023-02-17 23:44:30 +08:00
wangbowen6
f3d06972dc drivertest_relay: add relay test case
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-02-17 23:43:11 +08:00
Alan Carvalho de Assis
38eec3f0f0 netinit: Improve WiFi configuration
The current WiFi configuration expects user to look at symbols in
the wireless headers to configure it. This patch will improve it.
Notice that even those symbols that are bitfields are not allowed
to have more than 1 bit set at time.
2023-02-17 16:21:49 +08:00
Peter Bee
ce84d5d7cd system/nxcamera: fix sscanf overflow
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2023-02-16 19:00:29 +08:00
Huang Qi
1207977447 readline: Check the fd before echo
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-16 15:47:26 +08:00
Ville Juven
a38c23f557 system/cle.c: Fix configuration for CONFIG_EOL_IS_EITHER_CRLF=y
The old flagging was insufficient, only '\r' was accepted as a line terminator
if CONFIG_EOL_IS_EITHER_CRLF was set.

I noticed this regression after:
https://github.com/apache/nuttx/pull/8454
2023-02-14 00:19:24 +08:00
crafcat7
1789e685a2 testing/drivertest: add gpio driver test 2023-02-12 21:48:24 +08:00
Xiang Xiao
df55bf5cea system/adb: Update to 305007e0e574e7cc2b8d706b0f5d8cc76675fc51
which contain the fix: https://github.com/spiriou/microADB/pull/34

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-11 22:00:05 +02:00
zhanghongyu
96956ba83c dhcpc: under STATE_HAVE_OFFER, dont send DECLINE when offer from same server
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-02-11 14:37:19 +08:00
chao an
1927f8060c build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
First decoupling changes related to CMAKE

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-10 16:30:43 +08:00
Nathan Hartman
8e77b79f78 Kconfig: Make indent consistent with TABS 2023-02-10 14:11:48 +08:00
crafcat7
9ee3640b62 testing/drivertest: add block driver test 2023-02-09 19:52:52 +08:00
chao an
42d34fcef3 build/Kconfig: fix warnings detected by kconfiglib
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 19:45:36 +08:00
cuiziwei
9db9ef37b4 testing/drivertest:add watchdog test case.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-02-09 03:06:22 +08:00
cuiziwei
7394b4584d testing/drivertest: add pwm driver test
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-02-08 21:13:27 +08:00
raiden00pl
220a5a2ce6 nxscope: use the entire reserved channel length when sending strings
The previous version makes stream data parser too complicated and susceptible to errors.
2023-02-08 10:29:28 +08:00
raiden00pl
ee1e84a261 examples/nxscope: add a new option to wake up the samples thread with timer.
Now we can add samples with at a higher frequency than with usleep().
2023-02-08 02:54:56 +08:00
raiden00pl
1dd7d3dec3 examples/timer_gpio: fix compilation 2023-02-08 00:36:20 +08:00
chao an
8ad4ae5508 net: fix compiler warning
sixlowpan_assocresp.c: In function ‘sixlowpan_assoc_resp’:
sixlowpan_assocresp.c:48:3: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
   48 |   strncpy(arg.ifr_name, ifname, IFNAMSIZ);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-08 00:35:39 +08:00
yinshengkai
f102f6f405 trace: add trace header when dumping
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-02-08 00:35:17 +08:00
yinshengkai
ecadbbb43c trace: expand NOTE_DUMP_STRING
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-02-08 00:34:59 +08:00
raiden00pl
bcd721b627 examples/nxscope: add support for CDCACM dev 2023-02-08 00:34:33 +08:00
raiden00pl
3fd4ea8587 nxscope/nxscope_iser.c: wait for device if CONFIG_SERIAL_REMOVALBE=y 2023-02-08 00:34:33 +08:00
Lee Lup Yuen
c57e7a7b81 examples/lvglterm: Add LVGL Terminal for NSH
This PR adds an LVGL App that executes NSH Commands (entered with a Touchscreen Keyboard) and renders the NSH Output. The app follows the same design as the `lvgldemo` app and is explained here: ["NuttX RTOS for PinePhone: LVGL Terminal for NSH Shell"](https://lupyuen.github.io/articles/terminal)

`examples/README.md`: Added doc for `lvglterm` app

`examples/lvglterm/lvglterm.c`: LVGL Terminal App

`examples/lvglterm/Makefile`, `Make.defs`: Makefile for LVGL Terminal

`examples/lvglterm/Kconfig`: Added menuconfig option for "Application Configuration > Examples > LVGL Terminal"
2023-02-07 20:53:24 +08:00
raiden00pl
705b87e7a2 logging/nxscope/nxscope_chan.c: fix printf warnings 2023-02-07 20:50:12 +08:00
Xiang Xiao
0f9642d403 graphics/ft80x: Fix error: implicit declaration of function 'getpid
report here: https://github.com/apache/nuttx/actions/runs/4100097451/jobs/7070641033

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-07 12:15:35 +02:00
cuiziwei
8a131cb7e7 testing/drivertest: add timer driver test
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-02-07 00:54:03 +08:00
cuiziwei
efa6e60b45 testing/drivertest:add rtc test case.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-02-06 03:54:02 +08:00
Xiang Xiao
d9eedb052e tesint/irtest: Include unistd.h to get close prototype
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-05 20:41:37 +02:00
Xiang Xiao
a29d9ea9da fsutils/examples: Include unistd.h explicitly
to get the prototypes or macros are defined in it

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-05 08:46:59 +02:00
Xiang Xiao
28d71b79a2 Fix sensortest.c:168:40: error: format specifies type 'unsigned long' but the argument has type 'uint32_t' (aka 'unsigned int') [-Werror,-Wformat]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-02 18:46:14 -03:00
Xiang Xiao
fea1b197d4 testing/sensortest: Fix the typo for ecg sensor
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-02 14:51:38 -03:00
liucheng5
bf140bcaae fix: sensor: support ECG event lead info
Lead info is added into sensor_ecg event struct. Uorb and sensortest shall be modified.

Signed-off-by: liucheng5 <liucheng5@xiaomi.com>
2023-02-02 22:49:22 +08:00
jinxudong
57af6174f0 fix: sensor: update hall data type
update hall data type to int32_t

Signed-off-by: jinxudong <jinxudong@xiaomi.com>
2023-02-02 22:49:22 +08:00
yintao
c375f3e6fc testing/drivertest: modify the test source code name
Signed-off-by: yintao <yintao@xiaomi.com>
2023-02-02 22:14:27 +08:00
yintao
0a9b58ff88 testing/drivertest: add drivertest for cmocka driver testcases
Signed-off-by: yintao <yintao@xiaomi.com>
2023-02-02 22:14:27 +08:00
chao an
9ccff7b349 apps/Application.mk: silent all compile output
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 22:12:49 +08:00
qiaohaijiao1
61c4050d31 nxrecorder: add support to record media file.
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2023-02-02 22:12:00 +08:00
Xiang Xiao
8cfcd274b2 testint/irtest: Remove ERROR macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-02 13:58:24 +01:00
qiaohaijiao1
3648ddce0f nxlooper: add loopback of compressed audio data.
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2023-02-02 14:36:08 +08:00
Gustavo Henrique Nihei
b0da60e498 apps: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-02 00:35:14 +02:00
qiaohaijiao1
e949e207e0 nxplayer: add support which mp3 file which has no ID3 header
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2023-02-01 21:46:21 +08:00
Zhe Weng
93b4dc2692 ifconfig: Support ifconfig interface and update arg limit
From comment in cmd_ifconfig, it seems that we support `ifconfig [interface]`, but actually not considering the interface param now. After this commit, we only print the information of interface specified in param, just like linux.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-02-01 11:12:24 +08:00
Huang Qi
a275567ad0 Application.mk: Provide a default ZIGELFFLAGS if not defined
Avoid add ZIGELFFLAGS to each board level Make.defs by default value.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-01 11:12:15 +08:00
haopengxiang
f4e29f376d netutils/cjson: fix unpackage error when local gerrit does not exist
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2023-01-31 22:21:41 +02:00
qiaohaijiao1
20fb7e1898 nxplayer: enqueue streaming data to audio driver.
audio offload playback, change data form to streaming.

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2023-01-31 22:26:39 +08:00
Masayuki Ishikawa
bb8b5493e0 testing: ostest: Show errno in message queue test
Summary:
- This commit shows errno in message queue test

Impact:
- None

Testing:
- Tested with esp32-devkitc:smp on QEMU-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-01-31 22:10:59 +08:00
yinshengkai
0e823eadca Makefile: adjust compilation flags order
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-31 16:36:10 +08:00
Fotis Panagiotopoulos
464607dc90 Fixed compiler warnings in dd. 2023-01-30 10:59:07 +08:00
wangbowen6
0eb778d849 crypto/tinycrypt: sync .gitignore with mbedtls/.gitignore
avoid git untracked
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        crypto/tinycrypt/tinycrypt/

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-01-30 00:06:24 +08:00
haopengxiang
fc7a957554 graphics/libyuv: fix with using git repo check
There is no subfolder called "libyuv" in libyuv's folder, check
libyuv/libyuv may trigger download libyuv in everytime, hence fixed by
check libyuv repo.

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2023-01-29 20:42:26 +08:00
haopengxiang
5a9529185f netutils/cjson: change cjson unpackname to cJSON
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2023-01-29 20:42:26 +08:00
Xiang Xiao
b94c26fefc build: Generate a staging folder like kernel side
so the user could generate the separate library through BIN.
Here is the similar code snippet copied from nuttx/tools/Unix.mk:
context: include/nuttx/config.h include/nuttx/version.h .dirlinks $(CONTEXTDIRS_DEPS) | staging

staging:
	$(Q) mkdir -p $@

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-27 01:08:11 +02:00
haopengxiang
1f4292c250 testing/cmocka: forwarding cmocka log message to syslog channel
and ignore cmocka files in apps

Signed-off-by: chao an <anchao@xiaomi.com>
2023-01-26 08:13:00 +02:00
caofuqi1
248a9f772b netutils/cjson: Enable cjson test 2023-01-26 08:12:19 +02:00
ligd
e9c6fa0497 cpuload: add cpulad test case
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-26 08:11:04 +02:00
panran
53491d4f0c [system/argtable3] Add test suite for argtable3 2023-01-25 23:45:29 +02:00
liubojun1
928fb2be6d apps/system/nxplayer&nxlooper: fix codechecker warning
nxplayer_main.c:
code checker warning:
level_percent = (uint8_t) atoi(parg);
     'atoi' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtol' instead.
nxlooper_main.c:
code checker warning:
percent = (uint16_t)(atof(parg) * 10.0);
     'atof' used to convert a string to a floating-point value, but function will not report conversion errors; consider using 'strtod' instead

Signed-off-by: liubojun1 <liubojun1@xiaomi.com>
2023-01-25 23:44:07 +02:00
panran
1bd7554f5c math/libtommath: Add mtest test suite
Signed-off-by: panran <panran@xiaomi.com>
2023-01-25 23:41:30 +02:00
ligd
8994bab34c adb: add depends on LIBUV
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-25 23:20:28 +02:00
Xiang Xiao
cfed5f08fd Minor typo fix
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-25 23:20:07 +02:00
Alan Carvalho de Assis
4ed5bec472 Enable TMPFS and NSH_QUOTE to get CONFIG_NSH_CMDPARMS working 2023-01-24 13:24:23 +01:00
Lucas Saavedra Vaz
e769d53471 benchmarks: Add EEMBC's CoreMark 2023-01-23 13:15:56 -03:00
Lucas Saavedra Vaz
4563668e5b apps: Add benchmark applications 2023-01-23 13:15:56 -03:00
ligd
0bf87e7893 system/media: fix race condion on pthread id
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-20 22:47:26 +08:00
ligd
0e06cfeaec system/media: replace sem lock with pthread_mutex
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-20 22:47:26 +08:00
Xiang Xiao
44d0642334 Add *.su to .gitignore
*.su is generated by gcc/clang when we pass -fstack-usage to them

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-19 08:19:34 +01:00
pengyiqiang
360f7b748a system/ramspeed: skip cases where time too short
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-01-18 09:02:10 +01:00
anjiahao
731e7470b2 crypto:add aescbc testcase to testing
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-17 01:57:39 +08:00
anjiahao
b366a31644 crypto:add getfd for crypto testcase
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-17 01:57:39 +08:00
Lee Lup Yuen
757fc307c3 examples/lvgldemo: Select default demo
The LVGL Example App `lvgldemo` currently requires 1 argument: the name of the demo to show.

```bash
lvgldemo widgets
```

In this PR, we propose to make the argument optional if there is only one demo configured. This will enable PINE64 PinePhone to boot straight into `lvgldemo` and auto-start the LVGL App, without entering any `nsh` commands.

### Modified Files

`examples/lvgldemo/lvgldemo.c`: If no arguments are specified and only 1 demo exists, select the demo
2023-01-16 19:41:19 +08:00
田昕
b1e6583246 wireless/wapi:rework wapi error print in util.h
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2023-01-14 14:01:28 +08:00
YAMAMOTO Takashi
6aef7fc0a3 interpreter/toywasm: Update toywasm version
Tested on esp32-devkitc.
2023-01-11 17:05:01 +02:00
梁超众
fb638a13cc remove userspace usrsock rpmsg client/server
Signed-off-by: 梁超众 <liangchaozhong@xiaomi.com>
2023-01-11 18:11:02 +08:00
chao an
8b368b7680 examples/netlink_route: fix compiler warning
netlink_route_main.c: In function ‘dump_neighbor’:
netlink_route_main.c:151:26: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘uint8_t *’ {aka ‘unsigned char *’} [-Wformat=]
  151 |               printf("%02x", nb->ne_addr.u.na_addr);
      |                       ~~~^   ~~~~~~~~~~~~~~~~~~~~~
      |                          |                |
      |                          unsigned int     uint8_t * {aka unsigned char *}
      |                       %02hhn
netlink_route_main.c:155:26: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘uint8_t *’ {aka ‘unsigned char *’} [-Wformat=]
  155 |               printf("%02x.", nb->ne_addr.u.na_addr);
      |                       ~~~^    ~~~~~~~~~~~~~~~~~~~~~
      |                          |                 |
      |                          unsigned int      uint8_t * {aka unsigned char *}
      |                       %02hhn

Signed-off-by: chao an <anchao@xiaomi.com>
2023-01-11 15:14:51 +08:00
田昕
2b2c4805a4 netutils/dhcpc:fix dhcp hostname len error in dhcpc_sendmsg
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2023-01-10 21:52:31 +08:00
raiden00pl
efdc1ebf3f move embedlog from system to logging 2023-01-05 21:42:15 +08:00
Xiang Xiao
6e6df7dca8 Remove the unnecessary NULL fields in global instance definition of file_operations
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 09:30:25 +02:00
pengyiqiang
a610b633d2 graphics/lvgl: Upgrade to lvgl v8 version
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-01-01 10:14:55 -03:00
dongjiuzhu1
542558f2c1 nshlib/script: avoid output unnecessary log when missing rc.sysinit file
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-31 00:40:00 +08:00
TimJTi
9d1a70af86 Add example app for LP503x LED driver
Update examples/lp503x/lp503x_main.c

Move struct lp503x_cmd_s to private types section

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Update examples/lp503x/lp503x_main.c

Co-Authored-By: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-12-30 21:19:33 +08:00
Zhe Weng
2ad05e3062 ifconfig: Support prefixlen/CIDR for IPv6
Linux:
ifconfig eth0 [inet6] add 2022::2/96

FreeBSD:
ifconfig eth0 inet6 2022::2/96
ifconfig eth0 inet6 2022::2 prefixlen 96

NuttX newly supported:
ifconfig eth0 inet6 [add] 2022::2/96
ifconfig eth0 inet6 [add] 2022::2 prefixlen 96

Ref:
https://man7.org/linux/man-pages/man8/ifconfig.8.html
https://www.freebsd.org/cgi/man.cgi?ifconfig

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-12-29 17:33:59 +08:00
Zhe Weng
8f10dde6ad ifconfig: Allow hostip on first non-option place after inet/inet6
NuttX previous:

ifconfig eth0 10.0.0.1 [inet]
ifconfig eth0 2022::2 inet6

Try to be compatible with other systems:

Linux:
ifconfig eth0 [inet] 10.0.0.1
ifconfig eth0 [inet6] add 2022::2

FreeBSD:
ifconfig eth0 inet 10.0.0.1
ifconfig eth0 inet6 2022::2

NuttX newly supported:
ifconfig eth0 [inet] 10.0.0.1
ifconfig eth0 inet6 [add] 2022::2

Ref:
https://man7.org/linux/man-pages/man8/ifconfig.8.html
https://www.freebsd.org/cgi/man.cgi?ifconfig

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-12-29 17:33:59 +08:00
Zhe Weng
19958f0428 apps/system: Add iptables command.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-12-29 14:26:41 +08:00
Zhe Weng
64f9dc100c netutils: Add iptables in netlib.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-12-29 14:26:41 +08:00
dongjiuzhu1
2e0c1c1ddb app/fstest: config the number of open file and the maximum size of file
adjust resource using on resource-constrained systems

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-29 13:38:44 +08:00
crafcat7
30efeb7424 system/cachespeed:Optimize output format and processing logic 2022-12-29 03:56:45 +08:00
raiden00pl
eb8ad7af2f add NxScope example 2022-12-28 01:40:24 +08:00
raiden00pl
cd499f9d37 add the NxScope library - a real-time data logging tool 2022-12-28 01:40:24 +08:00
crafcat7
ea7241a1a6 system/ramspeed:Fix the error of CI compilation caused by not initializing irqstate_t flags in some cases 2022-12-28 01:37:44 +08:00
Xiang Xiao
77ac0e4838 system/trace: Check NOTERAM_GETTASKNAME existence directly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-26 11:53:26 +08:00
Xuxingliang
6e67d8ab78 luamodules: fix compile warning in cjson
Signed-off-by: Xuxingliang <xuxingliang@xiaomi.com>
2022-12-22 13:39:35 +08:00
Neo Xu
185ebab90f apps/industry: add scpi parser lib
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2022-12-22 00:59:10 +08:00
yintao
3fbb452b4a cmocka:Add automated testing framework cmocka in testing
Signed-off-by: yintao <yintao@xiaomi.com>
2022-12-22 00:58:51 +08:00
Neo Xu
6725d481b2 interpreters/lua: fix unpack on incremental build
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2022-12-21 17:48:29 +08:00
Xu Xingliang
167672c783 interpreters/lua: support lua module list register
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2022-12-21 17:48:13 +08:00
Neo Xu
311b4210b7 luamodules/cjson: add lua cjson module
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2022-12-21 17:47:14 +08:00
Neo Xu
6d7761f274 luamodules/lsyslog: add lua syslog module
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2022-12-21 17:46:59 +08:00
Neo Xu
7a2774b75a luamodules/lfs: add luafilesystem module
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2022-12-21 17:46:44 +08:00
ligd
7f11c91054 ostest: remove printf & sem_wait in sigaction
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-12-21 13:38:18 +09:00
Xiang Xiao
d1e46c2d3e compiler.h: Add _ between format|printf|syslog|scanf|strftime and like
align with other macro naming style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-21 01:05:12 +02:00
huangjian
19553cb395 nshlib:fix "Long line"
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-20 23:39:36 +08:00
huangjian
78020aec0d nshlib:nsh login include nshlib/nshlib.h
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-20 23:39:36 +08:00
huangjian
9f3e2cd234 nshlib:add platform_skip_login to nshlib.h
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-20 23:39:36 +08:00
ligd
9fcb58fb8a pipe: fix pipe test case failed
pipe shouldn't use /tmp folder, /tmp maybe mounted to tmpfs

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-12-20 23:39:12 +08:00
YAMAMOTO Takashi
867897ad53 interpreters/toywasm/src/toywasm_config.c: add an empty section
I feel this should be fixed in nxstyle.
This is a separate commit to make a revert easier.
2022-12-20 10:45:07 +08:00
YAMAMOTO Takashi
7d6e12917f interpreter/toywasm: Update toywasm version
The situation of toywasm_config.c is similar to toywasm_config.h.
It's cmake-generated in the upstream. The original template is covered
by a different license. I'm the author of the file and hereby re-license
this copy.

Tested on sim/macOS.
2022-12-20 10:45:07 +08:00
Xiang Xiao
cfc005a460 arp: Remove the unnecessary inclusion of nuttx/net/arp
and change the remain inclusion to netinet/arp.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-16 22:11:10 +02:00
Xiang Xiao
9884159346 nshlib: Add login skip, invalid name ignore and password challenge to telnet login
forget in the follow patches:
commit 6aef469c19
Author: huangjian <huangjian@xiaomi.com>
Date:   Fri Nov 4 20:37:04 2022 +0800

    nshlib:judge whether nsh login username is a valid input

    Signed-off-by: huangjian <huangjian@xiaomi.com>

commit 88fff23d34
Author: huangjian <huangjian@xiaomi.com>
Date:   Fri Nov 4 20:39:26 2022 +0800

    nshlib:add platform skip login function

    Signed-off-by: huangjian <huangjian@xiaomi.com>

commit 5a623cc9e3
Author: huangjian <huangjian@xiaomi.com>
Date:   Fri Nov 4 20:35:07 2022 +0800

    nshlib:add platform challenge function for nsh login

    Signed-off-by: huangjian <huangjian@xiaomi.com>

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-16 16:31:05 +02:00
yinshengkai
595adbcca6 drivers/note: rename /dev/note to /dev/note/ram
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-15 12:15:53 +08:00
zhanghongyu
c7e8ade590 arp: change arptable get struct from arp_entry_s to arpreq
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-12-14 21:19:37 +08:00
zhanghongyu
df3121213e cmd_arp: add device input for arp interface
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-12-14 21:19:37 +08:00
Peter Bee
11f0c2af43 system/camera: fix 'is_image' uninitialized
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-14 21:17:22 +08:00
Masayuki Ishikawa
5592e38253 netutils: iperf: Fix the transfer bytes and the bandwidth overflow
Summary:
- I noticed that the iperf shows incorrect transfer bytes
  in each period.
- Also, the bandwidth overflows sometimes.
- This commit fixes these issues.

Impact:
- None

Testing:
- Tested with qemu-armv8a:netnsh_smp on QEMU-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-12-12 21:45:52 +08:00
Xu Xingliang
636a155a21 luamodules/luv: fix comile warning -Werror=int-to-pointer-cast
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2022-12-12 18:06:53 +08:00
Xiang Xiao
e07d8f546a build.yml: Sync with nuttx version
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-12 01:37:50 +02:00
Xu Xingliang
80ed2b96d3 luamodules/luv: add libuv lua binding luv.
Initial work done by Michael Mogenson.

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2022-12-10 19:19:10 +08:00
Xu Xingliang
8175d89cd3 apps: add luamodules
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2022-12-10 19:19:10 +08:00
Peter Bee
38a190156a apps/system: add nxcamera app
Add NxCamera app similar to NxLooper, which can be used to control video
capture device. The basic capture n' display function is complete, while
file output and camera control features are left TODO.

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-10 02:46:31 +08:00
Peter Bee
091ff57126 graphics/libyuv: fix strict-prototype warning
Added a patch file to fix the warning

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-09 15:21:59 +08:00
Xiang Xiao
3e2c8fdb41 examples/camera: Cast the last argument of ioctl to uintptr_t
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-08 12:38:55 +01:00
Xiang Xiao
519c4ccb1b examples/camera: Add FAR for all pointer
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-08 12:38:55 +01:00
Xiang Xiao
02f608b64d examples/camera: Call VIDIOC_S_FMT before VIDIOC_REQBUFS
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-08 12:38:55 +01:00
Xiang Xiao
ca855f3f23 examples/camera: Fix the style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-08 12:38:55 +01:00
zouboan
776136a113 Fix various error in Windows native build 2022-12-08 13:22:13 +08:00
Peter Bee
a8e6a07b0a graphics/libyuv: add libyuv
Library for video format conversions

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-07 00:01:09 +08:00
Xiang Xiao
00dd4affea examples/hidkbd: Reuse lib_meminstream_s and remove hidbkd_instream_s
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 13:55:31 +01:00
Xiang Xiao
2c56945fee libc/stream: Rename (put|get) to (putc|getc)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 13:55:31 +01:00
huangjian
6aef469c19 nshlib:judge whether nsh login username is a valid input
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-04 19:24:57 +08:00
huangjian
88fff23d34 nshlib:add platform skip login function
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-04 19:24:57 +08:00
huangjian
5a623cc9e3 nshlib:add platform challenge function for nsh login
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-04 19:24:57 +08:00
qiaohaijiao1
05eadd1bd6 nxplayer: add mp3 offload playback demo
Mask: Only parse ID3v2 header simple.

Usage:
    nxplayer
    device pcm0p
    play /stream/1.mp3

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2022-12-02 22:51:58 +08:00
YAMAMOTO Takashi
5ae46ab6a7 interpreters/toywasm: update toywasm version 2022-12-01 19:39:22 +08:00
YAMAMOTO Takashi
bd20d45612 toywasm: add .gitignore
Following wasm3 and wamr.
2022-12-01 19:39:02 +08:00
pengyiqiang
8ec53eeb52 testing/monkey: add auto select uinput
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2022-11-29 04:54:20 +08:00
Xiang Xiao
8fff07b435 Remove the unnecessary "return;" at the end of function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 22:36:40 +01:00
Nathan Hartman
e4376a0e60 NuttX graduated the Incubator; update repository links 2022-11-26 11:59:17 -08:00
Robert-Ionut Alexa
e517dfd672 apps/ltr308: add simple application to test ltr308 sensor
Signed-off-by: Robert-Ionut Alexa <robertalexa2000@gmail.com>
2022-11-26 21:16:30 +08:00
mlondono74
fd22b63722 fix issue with reading ipv6 routes. Handle space ahead of first line of route. 2022-11-22 13:20:17 +08:00
Xiang Xiao
92d38a3bb1 Fix Error: nxtext_popup.c:250:20: error: unused function 'nxpu_puts'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-22 11:32:35 +08:00
Brennan Ashton
393df6762e CI: Update worker base OS version 2022-11-22 01:28:48 +08:00
chao an
60dc920701 netutils/iperf: add support of multi-instance
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-21 08:52:25 +01:00
chao an
8edfe88187 system/vi: fix nxstyle warning
system/vi/vi.c:540:57: error: Multiple data definitions
system/vi/vi.c:541:54: error: Multiple data definitions

Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-21 13:15:28 +08:00
Xiang Xiao
37c0cdd1a6 dhcp: Make the option dependence work for usrsock case
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-21 01:02:14 +08:00
chao an
63e3c6c521 netutils: correct iperf thread name
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-20 20:54:58 +08:00
chao an
a3390417f7 netutils/iperf: add more default device name
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-20 19:44:22 +08:00
chao an
c81da4c185 system/ping: remove depends since NETUTILS_PING already contains this check
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-20 19:35:13 +08:00
Xiang Xiao
bce24201c7 Fix ft80x_coprocessor.c:3911:14: error: format specifies type 'unsigned long' but the argument has type 'uint32_t' (aka 'unsigned int')
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-20 19:03:20 +08:00
Xiang Xiao
d706510064 Fix Error: vi.c:888:57: error: format string is not a string literal (potentially insecure)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-20 19:03:20 +08:00
chao an
bb24794fcb system/ping[6]: ping[6] should also be enabled if NET_ICMP[v6]_NO_STACK == y
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-20 16:05:07 +08:00
zhanghongyu
dc90c52413 wapi: fix passphrase can not update if prefix is same
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-11-20 07:45:15 +01:00
Xiang Xiao
0c200b8966 Fix dac_main.c: error: format string is not a string literal (potentially insecure)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-19 18:47:41 +01:00
Xiang Xiao
81de5d4c59 Fix foc_fixed16_thr.c:188:27: error: variable 'time' set but not used
and foc_float_thr.c:189:27: error: variable 'time' set but not used

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-19 18:47:41 +01:00
Junbo Zheng
3a6775c8ac examples/tcp_ipc_server: fix wrong file path typo
The lorawan folder is under the path of examples/tcp_ipc_server, the server_tcp folder is not exist here, fix it.

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-11-18 16:44:04 +08:00
Nathan Hartman
ed5cadb7cb Remove DISCLAIMER. Apache NuttX has graduated the Incubator. 2022-11-18 01:40:33 +08:00
qinwei1
c86509be4c apps: getpid should return process id not thread id
Summary:
   following the change in the nuttx kernel, implement the right semantics:
1. getpid should return the main thread id
2. gettid should return the current thread id

Refer:
 https://github.com/apache/incubator-nuttx/issues/2499
 https://github.com/apache/incubator-nuttx/pull/2518

Nuttx Kernel PR:
 https://github.com/apache/incubator-nuttx/pull/7597

update apps code

Testing PASSED with qemu( 32/64 )

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2022-11-17 17:58:45 +08:00
Huang Qi
0357cb99b2 interpreters/wamr: New option to support spec test
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-11-17 13:28:40 +08:00
Huang Qi
31e7c5ec60 interpreters/wamr: New option to support ref types
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-11-17 13:28:40 +08:00
Xiang Xiao
7b22525f0b boot/mcuboot: Bump up version to 36bac4f6a54a3b76266444d8c6c177b8b0483a05
Fix Error: mcuboot/boot/bootutil/src/bootutil_public.c:159:1: error: unused function 'boot_swap_size_off' [-Werror,-Wunused-function]
boot_swap_size_off(const struct flash_area *fap)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-15 21:06:27 +01:00
zhangyuan21
3dabc24635 ostest: reset g_restartstep when test case restart
The g_restartstep value is not initialized when ostest repeated.
2022-11-16 00:07:38 +08:00
liangchaozhong
4c5406e225 dhcpc:disable broadcast flag in DHCP process
Issue:
DHCP server will send DHCP offer/ack via broadcast packet if broadcast
flag is enabled in DHCP discover/request.
There's no retransmition mechanism for broadcast frame in 802.11 MAC
layer, thus transmit fail rate might be very high. This will increase DHCP fail rate.

Solution:
Disable broadcast flag by default

Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-11-14 19:00:39 +01:00
crafcat7
a799738184 testing/fstest:Remove duplicate macro references in source code 2022-11-14 22:41:53 +08:00
crafcat7
606ebe99d9 testing/fstest:Remove duplicate macro references in source code
There is a macro configuration in the source code, and the macro configuration is also referenced in Kconfig. Delete the macro configuration in the source file, whichever is in Kconfig.
2022-11-14 22:41:53 +08:00
anjiahao
14465b85c4 cmd_dd:support dd can do verify
After writing the file, compare the contents of the two files again

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-11-14 20:40:43 +08:00
anjiahao
c2f07a4d5a dd:simplified cmd_dd code steps
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-11-14 20:40:43 +08:00
Xiang Xiao
da30a87b81 Fix Error: version_main.c:124:42: error: format specifies type 'long' but the argument has type 'uint32_t' (aka 'unsigned int') [-Werror,-Wformat]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-13 14:55:30 +01:00
Xiang Xiao
25f200e9b0 Fix Error: sx127x_demo.c:464:7: error: variable 'fd' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-13 14:55:30 +01:00
Xiang Xiao
bf03439d1b Fix Error: src/wapi.c:1050:14: error: implicit conversion from enumeration type 'enum wapi_mode_e' to different enumeration type 'enum wapi_pta_prio_e' [-Werror,-Wenum-conversion]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-13 14:55:30 +01:00
Xiang Xiao
dd5dbde620 Fix Error: slcan.c:266:60: error: format specifies type 'unsigned long' but the argument has type 'canid_t' (aka 'unsigned int') [-Werror,-Wformat]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-13 14:55:30 +01:00
Xiang Xiao
8094ced139 Fix Error: slcan.c:265:19: error: variable 'reccount' is uninitialized when used here [-Werror,-Wuninitialized]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-13 14:55:30 +01:00
Alan Carvalho de Assis
46fac8c851 Fix CI crash because switch() as missing NMEA sentences 2022-11-13 00:31:02 +01:00
crafcat7
902ae591b1 system/ramspeed:Add automated testing process
In the previous ramspeed test process, it was necessary to keep adding size to achieve speed tests for different sizes of memcpy and memset. After the modification, the results will be automatically looped from 32k to the input size.
2022-11-12 18:57:06 -03:00
Alan Carvalho de Assis
d03b87b1bc gps: Fix GPS example application 2022-11-13 01:45:43 +08:00
Xiang Xiao
89ec8cbf96 Fix Error: slcd_trapezoids.cxx:84:5: error: array designators are a C99 extension [-Werror,-Wc99-designator]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-12 18:29:31 +01:00
Andrés Sánchez Pascual
03909627b9 add symbols in webclient kconfig
Signed-off-by: Andrés Sánchez Pascual <tito97_sp@hotmail.com>
2022-11-12 20:27:53 +08:00
Xiang Xiao
82ee0d1e24 Fix Error: src/cwindow.cxx:97:3: error: array designators are a C99 extension [-Werror,-Wc99-designator]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-11 21:12:22 +01:00
Xiang Xiao
76e6a03d71 fix Error: include/graphics/twm4nx/apps/ccalibration.hxx:149:34: error: private field 'm_stop' is not used [-Werror,-Wunused-private-field]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-11 21:12:22 +01:00
Xiang Xiao
5f4525bf0c Fix Error: include/graphics/twm4nx/cwindow.hxx:145:35: error: private field 'm_eventObj' is not used [-Werror,-Wunused-private-field]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-11 21:12:22 +01:00
ligd
b16eaf9d8e mm: add memory stress test
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-11-11 22:26:59 +08:00
yinshengkai
bd2efd9f51 tools: replace DEFINE to DEFINE_PREFIX
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-11 01:18:32 +08:00
YAMAMOTO Takashi
7903911000 toywasm_config.h: Add a license notice to appease nxstyle
* This file is derived from [1], which is covered by [2].

* I'm the solo author of the file. I hereby re-license this version with
  the license added by this commit.

[1] e43d33016a/lib/toywasm_config.h.in
[2] e43d33016a/LICENSE
2022-11-10 11:19:43 +08:00
YAMAMOTO Takashi
f1e8e933c5 interpreter/toywasm: update toywasm version 2022-11-10 11:19:43 +08:00
yinshengkai
ee4d8b738f Makefile: replace INCDIR to INCDIR_PREFIX
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-10 02:38:58 +08:00
Xiang Xiao
dbc757d79d Fix error: 'CTouchscreen' defined as a class here but previously declared as a struct
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 21:38:21 +01:00
Xiang Xiao
7bc1c17ecd Fix error: private field 'm_stop' is not used
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 21:38:21 +01:00
Xiang Xiao
56da7efc57 Fix error: struct 'CWindow' was previously declared as a class
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 21:38:21 +01:00
Xiang Xiao
a95d34c346 Fix error: 'NXWidgets::CTextBox::insertText' hides overloaded virtual functio
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 21:38:21 +01:00
Xiang Xiao
e1cc1199bb Fix error: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'?
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 21:38:21 +01:00
Xiang Xiao
1f78f8a9c6 Fix Error: src/cscaledbitmap.cxx:456:26: error: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 21:38:21 +01:00
Xiang Xiao
8554db0b5e Fix slcd_trapezoids.cxx:38:5: error: array designators are a C99 extension
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 21:38:21 +01:00
Fotis Panagiotopoulos
f85a6b6fb9 Added poweroff in fs and mm tests. 2022-11-08 02:52:46 +08:00
Xiang Xiao
36a0c924f7 netutils: Support telnetd in the kernel mode
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-07 15:24:08 +09:00
Xiang Xiao
12863fbd52 system/telnet: Fix the style warning
and remove the unused code

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 15:24:08 +09:00
Xiang Xiao
58c3dbac95 Revert "netutils: Make telnetd_daemon() in public"
This reverts commit 000d1455b4.
2022-11-07 15:24:08 +09:00
liangchaozhong
d6070cdfc8 usrsock:aggregrate more data into single recf_from response
recv request can only get maximum 1500 bytes payload in single response in
earlier design, this patch aggregrate more payloads(maximum 16k bytes)
into one response to make sure usrsock’s req/response mechanism is not
bottleneck during usrsock’s throughput test.

Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-11-07 13:33:56 +08:00
chao an
fc12542fd4 netutils/iperf: add newline in printf format
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-07 12:44:58 +08:00
pedrobertoleti
1d9e1deb77 Improve tcp_ipc_server LoraWAN module communication 2022-11-05 12:55:40 +08:00
raiden00pl
8609c92081 industry/foc/fixed16/foc_ident.c: add b16_t overflow protection 2022-11-04 02:08:08 +08:00
raiden00pl
4beb637925 industry/foc/fixed16/foc_ident.c: fix div operation 2022-11-04 02:08:08 +08:00
raiden00pl
9517b46958 industry/foc/fixed16/foc_ident.c: port changes from float32 implementation 2022-11-04 02:08:08 +08:00
raiden00pl
13bfad1053 examples/foc: control motor identification parameters from cmd line 2022-11-04 02:07:15 +08:00
raiden00pl
682cac07d9 examples/foc/Kconfig: update EXAMPLES_FOC_MMODE range 2022-11-04 02:07:15 +08:00
raiden00pl
2bbfb1b396 examples/foc: move validate_args to parseargs file 2022-11-04 02:07:15 +08:00
raiden00pl
2c5dc1e4a2 examples/foc: simplify control thread configuration 2022-11-04 02:07:15 +08:00
raiden00pl
b1f91528ec examples/foc: separate control thread configuration from general args 2022-11-04 02:07:15 +08:00
raiden00pl
c2efa80969 examples/foc: refactor args 2022-11-04 02:07:15 +08:00
dongjiuzhu1
6e3c4aab7d alarm: using timegm instead of mktime beacuse rtc is gmt time
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-11-01 21:58:43 +08:00
wangbowen6
fe28ed0520 mm_main: delete realloc boundary test
It's better to add DEBUGASSERT in mm code to check the unaligned
problem instead add a complex test case.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-11-01 19:18:08 +08:00
Xiang Xiao
678415c6fa Rename task_spawnattr_setstacksize to posix_spawnattr_setstacksize
follow up the kernel side change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 09:51:08 +09:00
Xiang Xiao
192f87b3ea Fix the compiler warning
Error: discover.c:210:13: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'in_addr_t' {aka 'unsigned int'} [-Werror=format=]
  210 |       ninfo("Received discover from %08lx'\n", srcaddr.sin_addr.s_addr);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                |
      |                                                                in_addr_t {aka unsigned int}
discover.c:210:41: note: format string is defined here
  210 |       ninfo("Received discover from %08lx'\n", srcaddr.sin_addr.s_addr);
      |                                     ~~~~^
      |                                         |
      |                                         long unsigned int
      |                                     %08x
In file included from discover.c:25:
discover.c: In function 'discover_openlistener':
Error: discover.c:359:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'uint32_t' {aka 'unsigned int'} [-Werror=format=]
  359 |   ninfo("serverip: %08lx\n", ntohl(g_state.serverip));
      |         ^~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~
      |                              |
      |                              uint32_t {aka unsigned int}
discover.c:359:24: note: format string is defined here
  359 |   ninfo("serverip: %08lx\n", ntohl(g_state.serverip));
      |                    ~~~~^
      |                        |
      |                        long unsigned int
      |                    %08x

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 06:30:03 +01:00
Xiang Xiao
165f30d3ac Fix Error: ascii/mbascii.c:118:25: error: unused variable 'ucLRC' [-Werror,-Wunused-variable]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 06:28:17 +01:00
Xiang Xiao
76fece26a2 Fix Error: shift_main.c:763:7: error: variable 'score' set but not used [-Werror,-Wunused-but-set-variable]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 06:28:17 +01:00
Xiang Xiao
757552e759 Fix nsh_fscmds.c:92:19: error: unused function 'ls_specialdir' [-Werror,-Wunused-function]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 06:28:17 +01:00
Xiang Xiao
1c23a095ea Fix Error: keyboard_main.c:420:15: error: result of comparison of constant -1 with expression of type 'char' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
if (key != EOF)
          ~~~ ^  ~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 06:28:17 +01:00
Xiang Xiao
d52a8298ce Fix Error: ftpd.c:1773:9: error: variable 'pos' set but not used [-Werror,-Wunused-but-set-variable]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-27 22:41:58 +02:00
Fotis Panagiotopoulos
390f1e2c60 Fixed compiler warning in webclient. 2022-10-27 21:20:01 +08:00
Junbo Zheng
9f8f70e32a README.md: Update NuttX Porting Guide Online links
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-10-26 21:57:30 +08:00
SPRESENSE
c3f91b3a0a examples/camera: Dynamically get the connected device
This example can support for both ISX012 and ISX019 image sensors.
2022-10-25 22:46:45 +08:00
yinshengkai
2c3c2edcb7 Makefile: Remove INCDIROPT
This option, which resolves to -w when CONFIG_CYGWIN_WINTOOL is
configured, is now appended to INCDIR in tools/Config.mk.

See git commit # 5eae32577e5d5226e5d3027c169eeb369f83f77d in the main
2022-10-25 13:48:16 +08:00
liangchaozhong
ffab06c6c5 usrsock:fix stack-buffer-overflow issue when running basic_send test case
The following error was reported when runing usrsocktest with KASAN check enabled.
    ==1348590==ERROR: AddressSanitizer: stack-buffer-overflow on address 0xf20ec610 at pc 0x56ac61ba bp 0xf20ec278 sp 0xf20ec268

rootcause:
hdrbuf's size is not large enough to store the data in usrsock's request.

solution:
double herbuf's size to make sure the space, used to store usrsock's request, is enough.

Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-10-24 17:02:15 +08:00
SPRESENSE
2717ba4f88 wireless: gs2200m: Change usrsock xid from uint64_t to uint32_t
Fix the type to match usrsock.h has been changed.
2022-10-24 09:04:31 +02:00
Fotis Panagiotopoulos
d251d12f6f Fixed compiler warnings. 2022-10-24 12:03:44 +08:00
raiden00pl
8d61a10a74 industry/foc/foc_ident: make the Ki resistance measurement parameter configurable
The hardcoded parameter may not be suitable for various types of motors
2022-10-24 01:14:52 +08:00
Petro Karashchenko
5862b9d15c netutils/thttpd: remove MIN and MAX definitions from libhttpd.c
This reverts commit e12d48f0d2.
2022-10-24 01:13:27 +08:00
Petro Karashchenko
0fe45a4c73 Revert "Revert "examples/foc: fix description in Kconfig""
This reverts commit 1a18703a42.
2022-10-24 01:13:27 +08:00
Petro Karashchenko
9368b659a7 Revert "Revert "examples/timer_gpio: fix initialization of timer notification""
This reverts commit 539b7363d0.
2022-10-24 01:13:27 +08:00
Petro Karashchenko
ec1c5f9273 Revert "Revert "nshlib: fix possible out of bounds array access""
This reverts commit fe4b44e3ff.
2022-10-24 01:13:27 +08:00
Petro Karashchenko
7bf9025f28 Revert "Revert "system/spi: improve alignment in array initialization""
This reverts commit a7567ce7b6.
2022-10-24 01:13:27 +08:00
Petro Karashchenko
513662732d Revert "Revert "system/libuv: minor style fixes in Makefile""
This reverts commit f613d05496.
2022-10-24 01:13:27 +08:00
Petro Karashchenko
7c8f0e41fc Revert "Revert "include/canutils/lely: fix file path in comment header""
This reverts commit 8e1ee24f9e.
2022-10-24 01:13:27 +08:00
Junbo Zheng
9ba5c86bcd README.md: remove inaccessible links
When try to access nuttx/Documentation/NuttXPortingGuide.html online,
it will prompt that the repository has been deleted, and the prompt
information is as follows:
This repository has been deleted
Our apologies, but the repository "nuttx/nuttx" has been deleted.
It now lives at https://bitbucket.org/patacongo/nuttx.

Also the file nuttx/Documentation/NuttXPortingGuide.html has been
removed under nuttx/Documentation, so this link is not needed here.

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-10-23 19:52:40 +08:00
Xiang Xiao
2962af6fe6 Fix fatal error: array: No such file or directory
enable test_stl2 only when CONFIG_LIBCXX is enabled
since uClibc++/minic++ doesn't have array header file

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-23 16:51:25 +08:00
Petro Karashchenko
e12d48f0d2 Revert "netutils/thttpd: remove MIN and MAX definitions from libhttpd.h"
This reverts commit c52f40770e.
2022-10-23 08:29:01 +02:00
Petro Karashchenko
1a18703a42 Revert "examples/foc: fix description in Kconfig"
This reverts commit eca51e267f.
2022-10-23 08:29:01 +02:00
Petro Karashchenko
539b7363d0 Revert "examples/timer_gpio: fix initialization of timer notification"
This reverts commit e431abe2ed.
2022-10-23 08:29:01 +02:00
Petro Karashchenko
fe4b44e3ff Revert "nshlib: fix possible out of bounds array access"
This reverts commit f6a86a578d.
2022-10-23 08:29:01 +02:00
Petro Karashchenko
a7567ce7b6 Revert "system/spi: improve alignment in array initialization"
This reverts commit ef952aac96.
2022-10-23 08:29:01 +02:00
Petro Karashchenko
f613d05496 Revert "system/libuv: minor style fixes in Makefile"
This reverts commit d7ce4226ef.
2022-10-23 08:29:01 +02:00
Petro Karashchenko
8e1ee24f9e Revert "include/canutils/lely: fix file path in comment header"
This reverts commit bc84e5eb3c.
2022-10-23 08:29:01 +02:00
Xiang Xiao
ad48457183 Fix nxstyle wanring as much as we can
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-23 11:47:20 +08:00
Xiang Xiao
041cec1af8 Fix thttpd_alloc.h:64:32: error: 'free' called on pointer 'hc' with nonzero offset 286 [-Werror=free-nonheap-object]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-23 11:47:20 +08:00
Petro Karashchenko
bc84e5eb3c include/canutils/lely: fix file path in comment header
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-23 11:45:52 +08:00
Petro Karashchenko
d7ce4226ef system/libuv: minor style fixes in Makefile
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-23 11:45:52 +08:00
Petro Karashchenko
ef952aac96 system/spi: improve alignment in array initialization
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-23 11:45:52 +08:00
Petro Karashchenko
f6a86a578d nshlib: fix possible out of bounds array access
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-23 11:45:52 +08:00
Petro Karashchenko
e431abe2ed examples/timer_gpio: fix initialization of timer notification
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-23 11:45:52 +08:00
Petro Karashchenko
eca51e267f examples/foc: fix description in Kconfig
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-23 11:45:52 +08:00
Petro Karashchenko
c52f40770e netutils/thttpd: remove MIN and MAX definitions from libhttpd.h
add newlines between MIN and MAX definitions for style consistency

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-23 11:45:52 +08:00
raiden00pl
003dbe1837 Lely CANopen port 2022-10-22 23:31:26 +08:00
nietingting
0a6539bfc5 ltp: fix build fail with "argument too long" issue on 20.04
Signed-off-by: nietingting <nietingting@xiaomi.com>
2022-10-22 22:14:44 +08:00
anjiahao
65668b33d9 ostest:add sem protocl to priority inheritance
ostest testcase use sem as lock
need set protocl
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-22 16:23:42 +09:00
zhanghongyu
f6ab04addb dhcpc: codechecker issuse fix
presult->serverid.s_addr maybe is garbage or undefined

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-10-21 16:31:13 +08:00
zhanghongyu
cfb64cffb1 netlib_getarptab: fix codechecker high level issue
197:  paysize = RTA_PAYLOAD(&resp->attr);
198:  if (paysize > maxsize)
199:    {
200:      paysize = maxsize;
201:    }
202:
203:  memcpy(arptab, resp->data, paysize);

Memory copy function accesses out-of-bound array element

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-10-21 16:31:13 +08:00
Masayuki Ishikawa
6fb173e3d5 netutils: webserver: Fix directory handling
Summary:
- I noticed that the webserver can not handle a directory.
- This commit fixes this issue.

Impact:
- None

Testing:
- Tested with spresense:wifi_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-10-21 16:29:37 +08:00
LiShuzhen
4eda9bda8f netutils/mqttc: Add mbedtls configs.
MIIO-62724

Signed-off-by: LiShuzhen <lishuzhen@xiaomi.com>
2022-10-21 09:31:09 +02:00
Xiang Xiao
6f01a3b3d4 testing/ostest: Remove the code which reference CONFIG_SEM_NNESTPRIO
since CONFIG_SEM_NNESTPRIO is removed by:
https://github.com/apache/incubator-nuttx/pull/6318

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-21 09:18:26 +02:00
zhanghongyu
31ad585611 gs2200m: fix usrsock_bind error in gs2200m module
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-10-21 08:33:50 +09:00
Masayuki Ishikawa
ee7b47ba4e testing: ostest: Fix task_restart test
Summary:
- This commit fixes the task_restart test for the 2nd time execution

Impact:
- None

Testing:
- sim:ostest

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-10-21 01:34:15 +08:00
田昕
e69a032f20 dhcpc:fix xid error clear bug.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-10-20 22:12:33 +08:00
anjiahao
fa6aeb3e12 mcuboot:move tinycrypt headfile path from make.defs to Makefile
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-20 14:53:38 +08:00
anjiahao
263f4ab8b9 crypto:add tinycrypt to apps/crypto
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-20 14:53:38 +08:00
YAMAMOTO Takashi
195ffe71e4 Add interpreters/toywasm 2022-10-20 01:06:00 +08:00
Alin Jerpelea
0b55209aff system: add cwebsocket support
High performance websocket client/server
The goal of cwebsocket is to provide a portable,
high performance websocket client/server,
especially on low power embedded systems.
cwebsocket is currently in a development state. You may encounter bugs.
Report them for a timely fix.

Successful tests have been conducted on the following architectures:
    x86
    x86_64
    ARM

cwebsocket is compliant with the following standards:
    ANSI C
    POSIX
    RFC 6455

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-10-19 19:45:25 +08:00
pedrobertoleti
00bd5a2edf Fixed unused variable and improved Kconfig for TCP IPC Client & Server 2022-10-19 15:51:04 +08:00
Xiang Xiao
0d2ef47192 nshlib: Rename CONFIG_SYSTEM_NSH_SYMTAB to CONFIG_NSH_SYMTAB
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 22:18:38 +02:00
Xiang Xiao
b659f0fbdf Remove the unnecessary cast for main_t, NULL and argv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 18:40:23 +02:00
Alin Jerpelea
d6f787afca apps: system: add libjpeg
This package contains C software to implement JPEG image encoding, decoding,
and transcoding.  JPEG is a standardized compression method for full-color
and grayscale images.

The distributed programs provide conversion between JPEG JFIF format and
image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.  The
core compression and decompression library can easily be reused in other
programs, such as image viewers.  The package is highly portable C code;
we have tested it on many machines ranging from PCs to Crays.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-10-18 23:58:40 +08:00
Ville Juven
f844db5194 libapps.a: Add the static application library always to the target libraries
This error was made by me a long time ago, not understanding how the kernel
mode build is expected to work. So partially revert PR#946.
2022-10-18 22:58:13 +08:00
Ville Juven
bca94fce5a CONFIG_BUILD_KERNEL/libapps.a: Allow creation of libapps.a separately
Add rule to create libapps.a for CONFIG_BUILD_KERNEL=y, there is no
reason to disallow this.

The behavior of make import remains the same, so no regression is expected.
2022-10-18 22:58:13 +08:00
Pedro Bertoleti
c908661414 Client & Server examples to use TCP/IP socket as an IPC Channel for LoRaWAN 2022-10-17 18:54:55 -03:00
Xiang Xiao
6944c5a0a1 nshlib: Fix warning reported by clang
nsh_telnetlogin.c:62:15: error: implicit conversion from 'int' to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion]

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:14:20 +02:00
Xiang Xiao
75455d3788 nshlib: Reuse nsh_session logic in nsh_telnetmain
to avoid the code duplication

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 09:41:43 -03:00
Xiang Xiao
8e460e7e19 nshlib: Move symbol table initialization from nsh_main to nsh_initialize
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 15:39:10 -04:00
Xiang Xiao
0d210c3227 nshlib: Move commoin initialization from console_main to nsh_initialize
to avoid the code duplication

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 15:39:10 -04:00
Xiang Xiao
964747dd36 nshlib: Call nsh_telnetstart in nsh_initialize to avoid the dupliation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 15:39:10 -04:00
Xiang Xiao
cf70d8f95b nshlib: Call nsh_sysinitscript in usb or alt console like normal one
forget in the pull request:
https://github.com/apache/incubator-nuttx-apps/pull/1142

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 15:39:10 -04:00
Xiang Xiao
893387b2c5 Fix the minor style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:07:16 +02:00
Xiang Xiao
4941182cc6 Make.defs: Change "ifeq ($(XXX),y)" to "ifneq ($(XXX),)
to support the tristate option correctly and unify the usage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 14:59:08 +02:00
Masayuki Ishikawa
97440889ac testing: ostest: Add ASSERT in case of errors
Summary:
- This commit adds ASSERT in case of errors to stop the
  execution of ostest
- Also, add some 'ERROR' messages

Impact:
- None

Testing:
- Run ostest with several configs

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-10-16 13:24:50 +08:00
crafcat7
2ad6dc37d8 system/cachespeed:Average time to add 2022-10-15 03:15:30 +08:00
zhanghongyu
78541e9876 usrsocktest: Fix default config mismatch in recv_block & no_block_connect
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-10-14 11:39:41 +09:00
zhanghongyu
6e8ea78d70 usrsock_server: combine response and events when socket setup case
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-10-14 11:39:41 +09:00
zhanghongyu
8a2f29c9b5 usrsock_server: fix unblock socket connect error
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-10-14 11:39:41 +09:00
Fotis Panagiotopoulos
bcbf3ae89d Fixes in DHCPc. 2022-10-13 22:59:54 +02:00
nietingting
6e3b402cf4 examples: clean warning of pipe
transfer_test.c:66:12: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
   int fd = (int)pvarg;
            ^
transfer_test.c: In function 'transfer_writer':
transfer_test.c:122:12: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
   int fd = (int)pvarg;
            ^
transfer_test.c: In function 'transfer_test':
transfer_test.c:169:58: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   ret = pthread_create(&readerid, NULL, transfer_reader, (pthread_addr_t)fdin);
                                                          ^
transfer_test.c:179:58: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   ret = pthread_create(&writerid, NULL, transfer_writer, (pthread_addr_t)fdout);
                                                          ^
transfer_test.c:202:13: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
       ret = (int)value;
             ^
transfer_test.c:216:13: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
       tmp = (int)value;
             ^

Signed-off-by: nietingting <nietingting@xiaomi.com>
2022-10-11 19:49:45 +08:00
zhangyuan21
7fcba8a119 ostest: add semaphore wait case for task restart 2022-10-11 15:29:45 +08:00
Alan Carvalho de Assis
abbe022894 wapi: Verify if password size if valid 2022-10-11 14:35:43 +08:00
Fotis Panagiotopoulos
ab7cb90f88 ftpd: Fixed compiler warnings. 2022-10-06 23:54:31 +08:00
Xiang Xiao
9291d07a87 Fix the coding style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-06 12:20:32 +02:00
Xiang Xiao
a86790c367 poll: Don't need monitor POLLERR or POLLHUP explicitly
since spec require the implementation always report POLLERR/POLLHUP:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-05 05:58:02 +02:00
Ville Juven
8c1c0efabc make export: Fix make export for CONFIG_BUILD_KERNEL=y
The condition:
[ -f "$${f}" ] && cp -f "$${f}" "${EXPORTDIR}"$(DELIM)registry ;

Fails if the first part of the condition returns empty / false, stopping
make for no reason due to the error.
2022-10-05 03:13:39 +08:00
Alan Carvalho de Assis
ed78d25934 webserver: Help users to easily identify missing configurations
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-04 20:22:33 +02:00
crafcat
98a9d2c749 system/ramspeed: Add system interrupt switch.
system/ramspeed: Add system interrupt switch.
2022-10-03 21:07:17 +02:00
crafcat
744ecf2b01 system/ramspeed: Add system interrupt switch. 2022-10-03 21:07:17 +02:00
crafcat
0e0ac0656b system/cachespeed:Tools for testing cache-related speed.
Signed-off-by: crafcat <110923103+crafcat7@users.noreply.github.com>
2022-10-01 11:41:40 +08:00
Petro Karashchenko
8e8d461590 ostest/prioinherit: fix priority inheritance test when compiled without optimisation
When application is compiled without optimisation the stack usage
is higher. 1K stack of adversary task is getting overflowed and that
leads to crash. Set stack size to CONFIG_DEFAULT_TASK_STACKSIZE for
adversary task

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-01 11:41:26 +08:00
Fotis Panagiotopoulos
1975f7c485 nxstyle fixes. 2022-09-30 14:23:04 +08:00
Fotis Panagiotopoulos
2c0c02fe78 Fixed non-UTF8 characters. 2022-09-30 14:23:04 +08:00
Tiago Medicci Serrano
66f957792f examples/i2schar: Fix compile error and warning
Fix compile error due to unnecessary endif.
Fix warning of long line.
2022-09-30 10:24:17 +08:00
yinshengkai
1b99543e8d system/gcov: add show usage
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-09-27 19:39:31 +08:00
yinshengkai
d9ec9ca868 system/trace: expand dump string
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-09-27 19:39:22 +08:00
SunJ
162dc0996c netutils/dhcpc: Add dhcp client id option
Signed-off-by: SunJ <jsun@bouffalolab.com>
2022-09-27 12:20:34 +08:00
chao an
09dfbdf4c7 netutls/dhcpc: treat EINTR as normal errno
A return code of EINTR is perfectly normal, and isn't an error as such.
It's an indication that your program may need to do something because
a signal occurred, but if not, should re-call recv().

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-27 12:20:25 +08:00
chao an
a1ea7f9df7 netinit: associate wlan if DRIVERS_IEEE80211 enabled
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-27 12:20:25 +08:00
chao an
cbcfe6be28 netutils/dhcpc: Set close-on-exec by default to avoid udp_conn leak
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-27 12:20:25 +08:00
Xiang Xiao
0dc5e9f469 Replace #include <queue.h> with #include <nuttx/queue.h>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-26 08:04:51 +02:00
Junbo Zheng
79e770b0c6 apps/nshlib: add the missing FAR macro for all source files
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-09-22 14:22:13 +08:00
Junbo Zheng
45ef7f948f apps/nshlib: fix CI error
Error: /home/runner/work/incubator-nuttx-apps/incubator-nuttx-apps/apps/nshlib/nsh_proccmds.c:574:40: error: Operator/assignment must be preceded with whitespace
Error: Process completed with exit code 1.

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-09-21 16:37:34 +02:00
Junbo Zheng
06f39d10f1 apps/nshlib: add uptime command support
run uptime command on sim:
nsh>
nsh>
nsh> uptime
19:35:01 up  1:40, load average: 0.00, 0.00, 0.00
nsh>
nsh>
nsh> uptime -s
2022-09-16 17:54:26
nsh>
nsh>
nsh> uptime -p
up 1 hour, 40 minutes
nsh>
nsh>
nsh> uptime -h
Usage:
uptime [options]
Options:
-p, show uptime in pretty format
-h, display this help and exit
-s, system up since
nsh>
nsh>
nsh> uptime -abc
uptime: invalid option -- -abc
Usage:
uptime [options]
Options:
-p, show uptime in pretty format
-h, display this help and exit
-s, system up since
nsh>
nsh>
nsh> date
Fri, Sep 16 19:35:18 2022
nsh>
nsh>

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-09-21 16:37:34 +02:00
anjiahao
ac4b42fee7 testing:support openbsd crypto test for nuttx
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-09-16 23:20:58 +08:00
anjiahao
ccd7d12bcb testing:crypto testing form openbsd
aesctr.c:
49a6e16f2c2c8e509184b1f777366d1a6f337e1c
aes_xts.c:
49a6e16f2c2c8e509184b1f777366d1a6f337e1c
des3.c:
49a6e16f2c2c8e509184b1f777366d1a6f337e1c
hmac.c
f51db96baec97348726b28106516038de1518dc5
https://github.com/openbsd/src
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-09-16 23:20:58 +08:00
田昕
799fe4e684 testing/mtd_config_fs:more test cases for garbage collection.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-09-16 18:03:11 +08:00
Junbo Zheng
732450d42a apps/nshlib: correct commands with alphabet order in kconfig
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-09-16 15:59:30 +08:00
田昕
3d53b7e0e0 testing/nvconfig:fix compiling err after removing MTD_CONFIG_ERASEDVALUE
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-09-14 20:16:17 +08:00
Huang Qi
5d972ba6d5 Application.mk: Fix Zig build break
Correct wrong make variable name for Zig main source,
and update compile command for latest compiler.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-09-10 11:09:22 +08:00
Huang Qi
0d5804c527 examples/hello_zig: Fix unused return value
Zig don't allow unused return value, so let's discard it explicitly.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-09-10 11:09:22 +08:00
yinshengkai
75673fed70 quickjs: add qjs tool configuration item
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-09-09 17:25:12 +02:00
Nathan Hartman
c2fdd8e99d tools/README.md: Fix typo and reflow paragraph 2022-09-09 01:08:33 +08:00
田昕
21e1ef11da netutils/dhcpc:receiving unexpected packet not leading to dhcp retry.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-09-08 14:48:56 +08:00
Masayuki Ishikawa
3837091582 wireless: gs2200m: Add SIOCGIFFLAGS support to gs2200m_main.c
Summary:
- I noticed that the latest ifconfig command shows nothing
- Finally, I found that gs2200m_main.c needs to handle SIOCGIFFLAGS
- This commit fixes this issue

Impact:
- gs2200m only

Testing:
- Tested with spresense:wifi
- NOTE: gs2200m driver needs to be updated as well

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-09-07 11:21:29 +08:00
ligd
048b79955e ostest: fix sighand_test report error
sighand_test: ERROR waiter task did not exit

reason:
sleep will be interrupt by signal

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-07 01:18:15 +08:00
chao an
e6e4661131 nshlib/netcmd: add sanity check for netdev
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-06 23:01:18 +08:00
田昕
37b77a78fa netutils/dhcpc:Make DHCP xid random
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-09-06 19:33:38 +08:00
chao an
e031a82882 netutils/dhcp: fix build warning/break of dhcp6c
dhcp6c.c:222:3: error: unknown type name ‘pthread_t’
  222 |   pthread_t thread;
      |   ^~~~~~~~~
dhcp6c.c: In function ‘dhcp6c_get_result’:
dhcp6c.c:415:7: warning: implicit declaration of function ‘netlib_prefix2ipv6netmask’ [-Wimplicit-function-declaration]
  415 |       netlib_prefix2ipv6netmask(presult->pl, &presult->netmask);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~
dhcp6c.c: In function ‘dhcp6c_parse_ia’:
dhcp6c.c:1046:30: warning: unused variable ‘pdhcp6c’ [-Wunused-variable]
 1046 |   FAR struct dhcp6c_state_s *pdhcp6c = (FAR struct dhcp6c_state_s *)handle;
      |                              ^~~~~~~
dhcp6c.c: In function ‘dhcp6c_precise_open’:
dhcp6c.c:1702:3: warning: missing braces around initializer [-Wmissing-braces]
 1702 |   {
      |   ^
......
 1706 |     {0},
      |      -
      |      {{0}}
dhcp6c.c:1796:43: error: ‘UDP_BINDTODEVICE’ undeclared (first use in this function); did you mean ‘SO_BINDTODEVICE’?
 1796 |   setsockopt(pdhcp6c->sockfd, SOL_SOCKET, UDP_BINDTODEVICE, ifname,
      |                                           ^~~~~~~~~~~~~~~~
      |                                           SO_BINDTODEVICE
dhcp6c.c:1796:43: note: each undeclared identifier is reported only once for each function it appears in
dhcp6c.c: In function ‘dhcp6c_request_async’:
dhcp6c.c:1886:9: warning: implicit declaration of function ‘pthread_create’; did you mean ‘timer_create’? [-Wimplicit-function-declaration]
 1886 |   ret = pthread_create(&pdhcp6c->thread, NULL, dhcp6c_run, pdhcp6c);
      |         ^~~~~~~~~~~~~~
      |         timer_create

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-06 19:31:16 +08:00
Fotis Panagiotopoulos
387eba2efd ftpd: server port made configurable. 2022-09-04 11:03:28 -04:00
Fotis Panagiotopoulos
e3a9be0d05 Minor changes in ftpd. 2022-09-03 21:49:15 +08:00
chao an
3d0a49f33e examples/usrsocktest: read from the closed remote should return EOF
fix usrsock remote_disconnect fail:

nsh> usrsocktest
...
Testing group "remote_disconnect" =>
        [TEST ASSERT FAILED!]
                In function "receive":
                line 497: Assertion `(ssize_t)((ret)) == (ssize_t)((0))' failed.
                        got value: -1
                        should be: 0
        Group "remote_disconnect": [FAILED]
...

Reference:

RECV(2)

NAME
       recv, recvfrom, recvmsg - receive a message from a socket
...
RETURN VALUE
...
       When a stream socket peer has performed an orderly shutdown,
       the return value will be 0 (the traditional "end-of-file" return).

       Datagram sockets in various domains (e.g., the UNIX and Internet domains)
       permit zero-length datagrams.  When such a datagram is received, the return value is 0.

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-01 14:58:09 +08:00
chao an
6bc5196ff0 examples/usrsocktest: add some delay to wait the daemon task ready
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-01 14:58:09 +08:00
chao an
45a21aea8e examples/usrsocktest: add USRSOCK_REQUEST_IOCTL support
The test model of usrsock ioctl() has changed after file socket layer implemented from vfs,
usrsock must implement the ioctl() hook to pass this test

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-01 14:58:09 +08:00
chao an
046e83bec9 examples/usrsocktest: fix build break
usrsocktest_wake_with_signal.c: In function ‘do_wake_test’:
usrsocktest_wake_with_signal.c:553:16: error: ‘USEC_PER_MSEC’ undeclared (first use in this function)
  553 |   usleep(100 * USEC_PER_MSEC); /* Let worker thread proceed to blocking
      |                ^~~~~~~~~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-01 14:58:09 +08:00
chao an
5b47bc24ae examples/usrsocktest: correct the check region of remote address
let us skip the sin_zero

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-01 14:58:09 +08:00
chao an
a8d2924c55 examples/usrsocktest: correct return value check of dup2()
DUP(2) Linux Programmer's Manual

NAME
       dup, dup2, dup3 - duplicate a file descriptor
...
RETURN VALUE
       On success, these system calls return the new file descriptor.
       On error, -1 is returned, and errno is set appropriately.

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-01 14:58:09 +08:00
田昕
c427f408cb testing:add MTD Fail-safe config-data tests
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-08-31 20:33:20 +08:00
Fotis Panagiotopoulos
1c7839c28c Fixed compiler warnings. 2022-08-30 12:10:49 +08:00
Alex
daf9e80936 Update build.yml
Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
2022-08-29 21:36:17 +08:00
Xiang Xiao
0d85084741 wireless/gs2200m: Rename usrsock_request to usrsock_handle_request
fix the conflict after usrsock reconstruct:
https://github.com/apache/incubator-nuttx/pull/6949

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-29 22:17:29 +09:00
Huang Qi
1e4165220e gpusutils/minmea: Fix build break by wrong unpack path
minmea is not cover by CI and in current implementations,
the source files from downloaded tarball were put into root path in gpsutils/minmea instead of in $(MINMEA_DIR)/$(MINMEA_UNPACKNAME),
and then:
```
mv: cannot stat 'minmea-db46128e73cee26d6a6eb0482dcba544ee1ea9f5': No such file or directory
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-29 14:26:18 +08:00
YAMAMOTO Takashi
65b58724ca interpreters/wamr/Kconfig: Add INTERPRETERS_WAMR_DEBUG_INTERP option
Tested with sim/Linux/amd64 and esp32 devkit-c.
2022-08-29 14:20:19 +08:00
Huang Qi
2e2630e838 Don't download tarballs if a local git repo found
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-28 17:20:47 +08:00
raiden00pl
35c31e35c1 examples/foc: add options to run only the sensor alignment routine or the motor identification routine 2022-08-28 13:24:51 +08:00
raiden00pl
7dbd02947e examples/foc: support for motor identification 2022-08-28 01:20:53 +08:00
raiden00pl
f987c6c02e examples/foc: make sure that the queue is empty before start the control thread 2022-08-27 23:50:58 +08:00
raiden00pl
429f5a166f examples/foc: terminate the control thread if no work to do 2022-08-27 23:50:58 +08:00
raiden00pl
420da4589e examples/foc: print default values in the help message 2022-08-27 23:50:58 +08:00
liyi
7035546422 fix use of addroute/delroute
Signed-off-by: liyi <liyi25@xiaomi.com>
2022-08-27 23:50:46 +08:00
Masayuki Ishikawa
1bf462e1c1 testing: getprime: Fix the thread number info
Summary:
- I noticed that getprime sometimes shows a wrong thread number
- This commit fixes this issue

Impact:
- None

Testing:
- Tested with sabre-6quad:netnsh

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-25 19:42:25 +08:00
Takayoshi Koizumi
4d86c69a22 examples/fmsynth: Add examples for FM synthesizer lib
Add examples to show how to use fmsynth library.

There are 2 samples.
One is a music keyboard, and the other is music player decording MML.
2022-08-25 20:29:55 +09:00
Takayoshi Koizumi
80eb94da8a audioutils/nxaudio: Add audio utility library for nuttx audio
Add an utility  library for easier use of NuttX's Audio driver.
2022-08-25 20:29:55 +09:00
Takayoshi Koizumi
40c506f3a0 audioutils/fmsynth: Add FM synthesizer library
Add simple FM synthesizer library in audioutils.
2022-08-25 20:29:55 +09:00
chao.an
995aef9d99 net/sockopt: move BINDTODEVICE to socket level
rename the UDP_BINDTODEVICE to SO_BINDTODEVICE to follow the linux
style to be compatible with non-UDP protocol binding requirements

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-25 00:11:23 +08:00
Fotis Panagiotopoulos
0cdb2cfa48 Fixed compiler warnings. 2022-08-23 01:39:59 +08:00
zouboan
d1cbbcdb41 reset state machine to support identification once more without restart app 2022-08-22 13:57:12 +08:00
zouboan
bd82e8d39f improve flux linkage identification method
improve flux linkage identification method
2022-08-22 13:57:12 +08:00
Huang Qi
511d9d59de nshlib: Disable dmesg if RAMLOG_SYSLOG disabled
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-22 13:56:54 +08:00
weizihan
c4972d4721 apps: Fix bug by calling getrandom
Signed-off-by: weizihan <weizihan@xiaomi.com>
2022-08-18 18:02:01 +08:00
zhanghongyu
8fe295de32 wireless: Add ioctl cmd to setting PTA prio
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-18 11:48:23 +08:00
weizihan
9dd3055014 apps: Fix the bug that setsockopt didn't check return value
Signed-off-by: weizihan <weizihan@xiaomi.com>
2022-08-17 22:50:56 +08:00
pengyiqiang
a9f6d66888 add fds initialization and buttonset comparison 2022-08-17 11:41:13 +08:00
pengyiqiang
d3232585b0 fixed non-standard naming and usage 2022-08-17 11:41:13 +08:00
pengyiqiang
2af0fb3815 fix warning 2022-08-17 11:41:13 +08:00
pengyiqiang
2ed3a91426 testing: add monkey test 2022-08-17 11:41:13 +08:00
liuhaitao
e1a382d62a testing/uclibcxx_test: Define TESTDIR correctly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-16 19:00:01 +03:00
baggio63446333
0d3a2bbae8 nshlib: Change ELF priority and stack size based on builtin list
When an application is used as a loadable ELF module, the priority and
stack size of the application task is always fixed at the default values.

This commit changes to get the priority and stack size of the application
from the bulitin list. If it is not on the list, it still works as before.
2022-08-16 23:19:00 +08:00
weizihan
e1ed558543 apps: Fix the bug that didn't initialize structure
Signed-off-by: weizihan <weizihan@xiaomi.com>
2022-08-16 23:18:18 +08:00
liuhaitao
14030f6ba4 Add minmea and cmsis .gitignore files
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2022-08-16 12:50:26 +03:00
yinshengkai
1e66c39066 system/input: update input device name
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-08-16 14:59:34 +08:00
jihandong
6afc226350 nxlooper nxplayer nxrecorder: fix coverity bug
readline might return EOF.

Signed-off-by: jihandong <jihandong@xiaomi.com>
2022-08-16 14:59:19 +08:00
Xiang Xiao
de26582775 system/uorb: Pass NULL to task_create directly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-16 09:47:17 +03:00
yintao
8e9462985a examples/rpmsgsocket: fix wrong typo
Signed-off-by: yintao <yintao@xiaomi.com>
2022-08-16 01:04:10 +08:00
zhanghongyu
a25f640e54 wapi: Make the initial scan buffer configurable through Kconfig
The default value is 4KB which is same as IW_SCAN_MAX_DATA

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-15 22:27:59 +08:00
zhanghongyu
a755cb72da wapi: correct scan return value
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-15 22:27:59 +08:00
zhanghongyu
8c8ebf4503 wapi: fix coverity warning
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-15 22:27:59 +08:00
raiden00pl
13a0d539fe examples/foc/Kconfig: EXAMPLES_FOC_SETPOINT_ADC depends on ADC 2022-08-15 16:42:56 +03:00
raiden00pl
1f4f338772 examples/foc/foc_motor_b16.c: fix open loop Q current 2022-08-15 16:42:00 +03:00
zhanghongyu
26892be894 usrsock: fix usrsock close hang when net not ready
reason: ept NULL when close request and poll event occur simultaneously

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-15 16:41:17 +03:00
zhanghongyu
451243accb usrsock_server: Reduce unnecessary poll prepare
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-15 16:41:17 +03:00
zhanghongyu
707b7be4da usrsock: ioctl Remove bad copy operations
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-08-15 16:41:17 +03:00
Peter Bee
a3ccf59204 quickjs/Makefile: pass jobserver status to submake
N/A

Use +make or $(MAKE) instead of make -C

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-08-15 11:12:33 +03:00
yinshengkai
6895da98e3 system/input: add input tools keyboard support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-08-15 11:12:21 +03:00
chao.an
451f528bbb wireless/wapi: correct check of return value
1. correct check of return value
----------------------
 * Name: ioctl
...
 * Returned Value:
 *   >=0 on success (positive non-zero values are cmd-specific)
 *   -1 on failure with errno set properly:

2. country code length should contain LF

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-15 10:51:55 +03:00
zhouliang3
ec4f97623a libuv/tests: Fix libuv extension tests compilation error
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2022-08-15 10:51:10 +03:00
Xiang Xiao
79e4c66764 testing/sensortest: Keep g_sensor_info in order
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-15 10:49:34 +03:00
Xiang Xiao
3021b8d11e testing/sensortest: Add FAR for pointer type
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-15 10:49:34 +03:00
xiatian6
491f549d1c fix: sensor: add sensor type of cap
Increase the type of cap sensor, including
raw data and detection status.

Signed-off-by: xiatian6 <xiatian6@xiaomi.com>
2022-08-15 10:49:34 +03:00
liuhaitao
06754940c5 dhcpd: fix build warning
CC:  dhcpd.c
In function 'dhcpd_openlistener',
    inlined from 'dhcpd_run.part.0' at dhcpd.c:1513:20:
dhcpd.c:1425:3: error: 'strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation]
 1425 |   strncpy(req.ifr_name, interface, IFNAMSIZ);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2022-08-14 14:08:52 +03:00
liuhaitao
dbb19c9e5a tools: add git pre-commit hook for apps
VELAPLATFO-1028

tools/pre-commit should be copied to .git/hooks/pre-commit to take
effect.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2022-08-14 14:06:10 +03:00
Xiang Xiao
b515a00fea zmodem: Move crc16.h and crc32.h from host to host/nuttx
to avoid the conflict with the 3rd party library

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-13 13:28:30 +03:00
Huang Qi
29a49f366e wamr: Add a new option to custom stack guard size
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-10 15:21:26 +08:00
Masayuki Ishikawa
41fe4f177a system:nsh : Apply CONFIG_NSH_DISABLE_TELNETSTART to nsh_main.c
Summary:
- This commit applies CONFIG_NSH_DISABLE_TELNETSTART to nsh_main.c

Impact:
- None

Testing:
- Tested with sabre-6quad:netknsh (will be updated later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-09 23:17:25 +08:00
Masayuki Ishikawa
a86315050d system: telnetd: Add telnetd app
Summary:
- This commit adds telnetd app

Impact:
- None

Testing:
- Tested with sabre-6quad:netknsh (will be updated later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-09 23:17:25 +08:00
Masayuki Ishikawa
3f70a78dd3 nshlib: Make nsh_telnetmain() in public
Summary:
- This commit makes nsh_telnetmain() in public so that we can
  call it from applications.
- Also, CONFIG_NSH_DISABLE_TELNETSTART is introduced so that
  we can disable nsh_telnetstart()

Impact:
- nsh with telnet daemon

Testing:
- Tested with sabre-6quad:netknsh (will be updated later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-09 23:17:25 +08:00
Masayuki Ishikawa
000d1455b4 netutils: Make telnetd_daemon() in public
Summary:
- This commit makes telnetd_daemon() in public so that we
  can call it from applications.
- Also, adds new configs to support posix_spawnp()

Impact:
- telnetd only

Testing:
- Tested with sabre-6quad:netknsh (will be updated later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-09 23:17:25 +08:00
Huang Qi
167c551e82 wamr: Add a new option to enable semaphore support
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-09 23:17:00 +08:00
Jiuzhu Dong
e04333c986 driver/sensor: rename /dev/sensor -> /dev/uorb
because this directory contains all topics by uorb using, not just sensors.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-08 23:11:37 +08:00
Lee Lup Yuen
8b43f9f9ca testing/sensortest: Update device path
Device paths are now named `/dev/sensor/sensor_...`: 3fdd036ba6/drivers/sensors/sensor.c (L49)
2022-08-08 13:31:18 +08:00
Jiuzhu Dong
c0cafab1a7 fsutils/mkfatfs: remove invalid header file
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-08 00:55:49 +08:00
Petro Karashchenko
672b5ffbc1 netutils/iperf: fix string for iperf test interface option
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-08-05 13:57:28 +08:00
Petro Karashchenko
6d730e3c25 system/cfgdata: add "format" command to description
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-08-05 13:57:21 +08:00
Peter van der Perk
9179783906 Embedded Template Library (ETL) Example application 2022-08-05 13:56:36 +08:00
Nathan Hartman
30805a7001 Remove executable permission from source file. 2022-08-04 23:19:39 +08:00
Peter van der Perk
dcd60a2abe Use thread-safe ntoa functions
NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

API fixes and NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Use thread-safe ntoa functions

NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

API fixes and NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-08-04 23:18:06 +08:00
liyi
c5102fe504 ifconfig support set IPv6 DNS server
Signed-off-by: liyi <liyi25@xiaomi.com>
2022-08-04 19:47:15 +08:00
Peter van der Perk
a0d0f5eb25 mkfats make g_bootcodeblob const to save on static ram usage 2022-08-02 21:05:05 +08:00
Peter van der Perk
c026bd824a canardv0 nxstyle fix 2022-08-02 17:01:28 +08:00
Peter van der Perk
819c34e975 Add libcanardv1 for Cyphal, rename libcanard to libcanardv0 2022-08-02 17:01:28 +08:00
Takayoshi Koizumi
cfa5af51cd wireless/gs2200m: Release all blocking socket
When dis-associtaion happens, the socket is destroyed. And all blocking
sockets are released for that error handling can be performed.
2022-08-02 16:54:35 +09:00
Alan Carvalho de Assis
8a177cd797 apps/games: Add shift game 2022-07-31 13:41:43 +03:00
ligd
75155532b6 pmconfig: update pmconfig dump
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-30 03:15:01 +08:00
ligd
a109a6e58b rptun_ping: add sleep param to rptun_ping
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-30 03:15:01 +08:00
ligd
79a137495a cu: fix cu hang when meet ctrl + C
We can't do sem_wait in sigaction

hang backtrace:
[<0x2c5a6958>] arm_switchcontext+0xc/0x10
[<0x2c579eba>] nxsem_wait+0x6e/0xa8
[<0x3c9a8cb5>] pb_field_iter_find+0xffde8cb/0xd3635c15
[<0x2c58d164>] uart_tcdrain.constprop.0+0x10/0xf8
[<0x2c58d5c6>] uart_close+0x10e/0x180
[<0x2c579f38>] nxsem_wait_uninterruptible+0x44/0xb8
[<0x2c95f87a>] file_close+0x12/0x44
[<0x2c95e5a8>] close+0x80/0xb4
[<0x2c5c6396>] sigint+0x1a/0x28
[<0x2c57b1b0>] nxsig_deliver+0x54/0xb8
[<0x2c5a549a>] arm_sigdeliver+0x1a/0x44
[<0x2c579eb6>] nxsem_wait+0x6a/0xa8
[<0x2c579eb6>] nxsem_wait+0x6a/0xa8
[<0x2c579eb6>] nxsem_wait+0x6a/0xa8
[<0x2c58aa1a>] pm_lock+0x1a/0x28
[<0x2c58a656>] pm_stay+0xa/0x60
[<0x2c58bb14>] rptun_notify+0x4c/0x58
[<0x2c97b8fc>] virtqueue_kick+0x54/0x7c
[<0x2c97ac82>] rpmsg_virtio_send_offchannel_nocopy+0x9a/0xcc
[<0x2c58df7c>] uart_rpmsg_dmasend+0x8c/0xe0
[<0x2c5771be>] leave_critical_section+0x2e/0x54
[<0x2c58d124>] uart_write+0x11c/0x14c
[<0x2c9620c6>] write+0x32/0x50
[<0x2c5c665e>] cu_main+0x2ba/0x484
[<0x2c5957be>] nxtask_startup+0x12/0x24
[<0x2c57b9d2>] nxtask_start+0x46/0x60

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-29 19:21:52 +03:00
ligd
8081711e22 nxlooper: nxlooper should wait call buffer returned before close
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-29 19:18:34 +03:00
Jiuzhu Dong
eef03ad0a1 testing/sensortest: fix cmd argument mismatch(follow new sensor driver)
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-29 16:26:40 +03:00
Masayuki Ishikawa
147a796a7a system: popen: Fix to build with CONFIG_BUILD_KERNEL=y
Summary:
- This commit fixes to build with CONFIG_BUILD_KERNEL=y

Impact:
- None

Testing:
- Tested with sabre-6quad:knsh (not merged yet)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-07-29 10:20:19 +08:00
ligd
1345fa13b1 usrsock: adjust rptun API
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-27 20:36:59 +08:00
Jiuzhu Dong
ab43c625d1 nshlib/ps: update config MM_BACKTRACE to int type
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-27 02:43:28 +08:00
haopengxiang
6b635d575a gps/minmea: replace minmea file with github repo
apply kosma/minmea origin github repo in gpsutils

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2022-07-26 19:29:12 +08:00
Jiuzhu Dong
45f2c2a26d testing/sensortest: fix compile break
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 12:38:34 +08:00
Jiuzhu Dong
a06fa5ac27 testing/sensor_test: update sensortest according to enhance sensor driver
1.update prefix of sensor event structure to sensor_xxx.
2.remove activate cmd because of open will auto activate sensor.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:39 +08:00
Xiang Xiao
a549ea3888 Fix find: '/github/workspace/sources/nuttx/libs/libxx/uClibc++/tests': No such file or directory
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-25 10:47:21 +02:00
Jiuzhu Dong
45615a8d9d nshlib/dmesg: update config about enable dmesg
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 08:27:48 +02:00
jihandong
74af9a8065 app/system/uorb: fix error, memset() wrong size.
Signed-off-by: jihandong <jihandong@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
131e4dc69d system/uorb: simply orb_check by SNIOC_UPDATED
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
jihandong
3f865c4f9e uorb/listener: ignore first get_state failed.
Signed-off-by: jihandong <jihandong@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
jihandong
2b8bfc5be7 app/system/uorb: modify unit test to support data persist
Signed-off-by: jihandong <jihandong@xiaomi.com>
2022-07-23 16:57:58 -03:00
jihandong
874ed7654d app/system/uorb: fix listener run_once not work.
And remove dead code.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
f02c5a5d7e system/uorb: support new api
orb_advertise_multi_queue_persist

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
ligd
37f1e453b1 uorb: use another writing method to avoid compiler bug
int func(int b)
{
    int a;

    while (1) {
        ...;

        if (b != 0)
            a = 1000 / b;

        ...;
    }
}

if b == 0, then system crash in Xtensa arch, clang compiler

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
8558e63772 uorb_listener: support set batch latency
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
3a8f4b53fc apps/uorb: fix compile break
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
jihandong
384c05beb2 app/system/uorb: alloc on heap instead of stack.
Signed-off-by: jihandong <jihandong@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
e97b1a79d6 uorb_listener: support subscribe physical sensor before node register
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
5bb4e14aad system/uorb: always let orb_advertise, orb_advertise_queue for instance 0
1.orb_advertise, orb_advertise_queue for instance 0
2.orb_advertise_multi, orb_advertise__multi_queue for specified instance
3.If orb_advertise_multi_queue with instance is NULL, auto increase
instance from existing base.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
53ee04ba3c uorb/listener: add new api: orb_open and orb_close
don't using subscriber to get state to avoid rpmsg access

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
d44dd1c426 uorb_unit_test: optimize stack used
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
6fceb913a2 system/uorb: optimize stack used
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
jihandong
9f6d322186 system/uorb: listener, has 'top' command.
Listener can scan device under ORB_SENSOR_PATH, subscribe them and
cotinue printing messages by call their cb.

'-T' can Continuously print updating objects, '-l' means only
print once.

Signed-off-by: jihandong <jihandong@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
4ec3f70f1d apps/system/uorb: support orb_get_meta by name string
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
Jiuzhu Dong
46c98420b7 system/uorb: add builtin sensor topics
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
jihandong
d8d1e1e761 apps/system/uorb: c unit testcases
testcases:
1. test_single(): single instance, advertise then subscribe.
2. test_multi_inst10(): 10 instance, each 1 subscriber.
3. test_multi(): 2 instances, 2 advertisers, 2 subscribers.
4. test_multi_reversed(): same as test_multi(), but subsribe before
		          advertise.
5. test_unadvertise(): unadvertise upper 4 advertisers.
6. test_multi2(): same as tset_multi(). but multi-thread.
7, test_queue():  topic queue_size = 16.

Signed-off-by: jihandong <jihandong@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 16:57:58 -03:00
jihandong
3528b5515f apps/system/uorb: c interfaces.
refer to: https://docs.px4.io/v1.12/en/middleware/uorb.html

- orb_open: do real work for advertise() and subscribe(), if thre is
            no user, register topic first, then save meta in driver;
            only first user can successfully set buffer number.
- orb_exists: check topic state, if topic only has subscribers,
	      return "not exists".

Signed-off-by: jihandong <jihandong@xiaomi.com>
2022-07-23 16:57:58 -03:00
anjiahao
beb9188cee nshlib:support nsh can redirect
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-07-22 13:52:34 +08:00
Fotis Panagiotopoulos
2d2e36c5e9 Fixed heap information output in nsh ps command. 2022-07-22 00:03:41 +08:00
Fotis Panagiotopoulos
d7ec4e51b5 nsh: Fixed typos in comments. 2022-07-22 00:03:22 +08:00
anjiahao
dbfe5fb573 cmd_reset_cause:remove ouput space.
can use ouput string set a env to argv
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-07-21 21:13:11 +08:00
anjiahao
29be9e3d1b apps:fix reset cuase wraming
nsh_syscmds.c:352:40: error: passing argument 2 of 'boardctl' makes integer from pointer without a cast [-Werror=int-conversion]
352 |   ret = boardctl(BOARDIOC_RESET_CAUSE, &cause);
    |                                        ^~~~~~
    |                                        |
    |                                        struct boardioc_reset_cause_s *
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-07-21 19:41:05 +08:00
Xiang Xiao
af2741317a examples/noteprintf: Change CONFIG_LIBC_LONG_LONG to CONFIG_HAVE_LONG_LONG
follow the kernel side change:
https://github.com/apache/incubator-nuttx/pull/6613

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-20 22:22:49 +03:00
Denis Tolstov
5ae2e1034b nshlib/netcmds: Decouple nslookup from netdb_dnsclient
Allow disabling nslookup even when not using dnsclient.
2022-07-20 15:54:52 +08:00
Fotis Panagiotopoulos
c4c3ffff90 ostest: Fixed prints in setenv test. 2022-07-20 11:57:01 +08:00
Xiang Xiao
c252ec1481 Add printflike to all printf like functions
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-18 14:09:10 +03:00
Norman Rasmussen
5c84c47cad system/hostname: Add an option to read the hostname from a file 2022-07-18 12:29:51 +08:00
pengyiqiang
71ea8b052d nshlib/nsh_ddcmd: calculate time difference with microsecond precision
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2022-07-17 14:06:40 +08:00
YAMAMOTO Takashi
83505e217b dhcpc: Rename timeout Kconfig
NETUTILS_DHCPC_RECV_TIMEOUT -> NETUTILS_DHCPC_RECV_TIMEOUT_MS

Recently its unit has been changed from second to millisecond. [1]
Using the same Kconfig name for a different meaning is a pitfall
for an upgrade. I was using 3ms timeout because of this.

This commit renames it so that at least the default value
is used for a careless user like me.

[1]
```
commit 8fd4b6105b
Author: zrrong <zrrong@bouffalolab.com>
Date:   Fri May 27 11:35:23 2022 +0800

    netutils/dhcpc: Change the timeout unit to milliseconds
```
2022-07-07 21:42:58 +08:00
curuvar
ca4ef69661 Added simple ws2812 example 2022-07-04 10:50:48 +08:00
Satoshi Togawa
943df4cb60 pppd: Fix PAP Request packet. 2022-06-30 22:27:07 +08:00
zouboan
e7961a696e examples: add pwm input capture example
Co-authored-by: Alan Carvalho de Assis <alan.carvalho@espressif.com>
2022-06-28 23:52:21 +08:00
qinwei1
db9ea40798 .github/workflows: Add nuttx/source to the safe directory, covering apps
Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2022-06-24 23:47:49 -07:00
Xiang Xiao
99d905369e .github/workflows: Add nuttx/source to the safe directory
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-24 23:47:49 -07:00
chao.an
61250d5516 wireless/wapi: add get country code support
Country command with no args to get the ccode:

Get country code:
cp> wapi country wlan0
CN

Set country code:
cp> wapi country wlan0 JP

Get country code:
cp> wapi country wlan0
JP

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-23 23:40:20 +08:00
dependabot[bot]
23f35ea1b3 build(deps): bump actions/upload-artifact from 1 to 3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 01:12:21 +08:00
dependabot[bot]
85962aab14 build(deps): bump actions/cache from 2 to 3
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 01:12:12 +08:00
dependabot[bot]
452d5352d5 build(deps): bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 23:23:30 +08:00
dependabot[bot]
a4c96f5dbc build(deps): bump actions/download-artifact from 1 to 3
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 1 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 23:23:22 +08:00
naveen
2f173e9f48 chore: Included githubactions in the dependabot config
This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.

Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot

GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot

https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-06-21 16:43:58 +03:00
naveen
83ea328ef5 chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-06-21 16:43:58 +03:00
Christian Clauss
72cb2c237b Lint Python code with flake8 and isort 2022-06-21 16:43:58 +03:00
Brennan Ashton
72ead93dee ci: lint only changed files 2022-06-21 16:43:58 +03:00
Brennan Ashton
5787c26159 Add black linter for python 2022-06-21 16:43:58 +03:00
YAMAMOTO Takashi
fe109998c9 webclient_get_tunnel: A comment about how to dispose the returned "conn" 2022-06-20 13:56:53 +08:00
YAMAMOTO Takashi
d435858c53 webclient: Export a few ops on webclient_conn_s
* Make webclient_conn_s self-contained so that it can be
  used without webclient_context.

* Add missing FAR.
2022-06-20 13:56:53 +08:00
YAMAMOTO Takashi
fca5b186b1 webclient: Make webclient_get_tunnel returns void
As it does never fail.
2022-06-20 13:56:53 +08:00
YAMAMOTO Takashi
5cfc5cd4f2 webclient.h: Update the state diagram after the tunnelling stuff 2022-06-20 13:56:53 +08:00
YAMAMOTO Takashi
2be66e83a4 webclient_conn_s: Add a missing FAR 2022-06-20 13:56:53 +08:00
chao.an
92c001bbc0 wapi/utils: add SIOCGIWSENS into string name list
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-17 16:44:01 +08:00
YAMAMOTO Takashi
eece4a5ca0 webclient_abort: Fix a resource leak for the tunneling case 2022-06-17 08:35:59 +03:00
chao.an
be516e4c5e wireless/wapi: authentication parameters should update before key set
set authentication parameters before key set on command mode

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-17 08:34:51 +03:00
Xiang Xiao
7ce7eff9a9 Remove the non standard c++ header file inclusion
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-15 22:23:25 +03:00
YAMAMOTO Takashi
159ca00752 webclient: Allow users to specify extra headers for proxy
My primary motivation at this point is to use it for basic proxy auth.
(specify "Proxy-Authorization" header)
But there can be other use cases for proxy-specific extra headers.

If/when we want to support other non-trivial auth methods, probably
a callback-based mechanism will be necessary. But at this point,
this serves my purpose well.
2022-06-15 20:40:53 +08:00
chenwen@espressif.com
068905d07b testing/irtest: Fix issue of failure to open multiple IR devices
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2022-06-14 14:56:18 +02:00
Norman Rasmussen
ce7c9ae65b wireless/wapi: fix wapi wpa_wconfig_s sta_mode data type error 2022-06-13 21:01:13 +08:00
Adam Kaliszan
835f43524b serialblaster bugfix 2022-06-13 15:47:44 +08:00
Nimish Telang
1f0ba0db6e Update examples/elf/tests/helloxx/Makefile
Check for the right config variable

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-06-11 17:04:20 +08:00
Nimish Telang
550cb3a1ea Address #190
Should guard against these being included if exception support isn't there
2022-06-11 17:04:20 +08:00
Alin Jerpelea
f55523038d rename DISCLAIMER-WIP
Before graduation We can only remove the WIP from the DISCLAIMER.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-06-08 20:19:53 +08:00
Xiang Xiao
a12707177b Remove "| O_BINARY" or " |= O_BINARY" since O_BINARY is 0 now
follow nuttx kernel side change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-07 20:22:38 +03:00
YAMAMOTO Takashi
610b04fa97 webclient: Clear WGET_FLAG_GOT_CONTENT_LENGTH for each request
Otherwise, a stale value might be used after a redirection.
2022-06-07 15:09:11 +03:00
YAMAMOTO Takashi
065a130bc8 webclient: Be a bit strict on Location header
* Record Location header explicitly

* Bail out / warn on unexpected cases
2022-06-07 15:09:11 +03:00
YAMAMOTO Takashi
0c4c811434 webcilent: Fix a buffer overrun on a malformed status line 2022-06-07 15:09:11 +03:00
YAMAMOTO Takashi
f7b3eb5b44 netlib_parseurl: Make the buffer size assumption explicit 2022-06-07 15:09:11 +03:00
YAMAMOTO Takashi
a7de8dffe7 netlib_parseurl.c: Add a comment 2022-06-07 15:09:11 +03:00
Alin Jerpelea
a5506b379c Revert "remove DISCLAIMER-WIP"
This reverts commit 4a2aa6d8cf.
2022-06-07 09:38:31 +02:00
Xiang Xiao
dd7e98129a system/libuv: Fix the undefined reference to `uv__strscpy'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-03 20:25:52 +03:00
Xiang Xiao
f5c094aef1 system/libuv: Skip compile strscpy.c when CONFIG_LIBUV_UTILS_TEST enable
since test/test-strscpy.c will include it in this case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-03 20:25:52 +03:00
anjiahao
99629e9b5f fstest:support fstest can run many times
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-06-04 01:14:37 +08:00
YAMAMOTO Takashi
5e3a3dae10 webclient.h: Avoid relying on indirect inclusion
Include stdint.h for uint16_t explicitly.

This was necessary when I was trying to build this natively
on Ubuntu.  It seems some other headers happen to pull
the uint16_t definition by luck on NuttX and macOS.
2022-06-03 17:28:05 +03:00
YAMAMOTO Takashi
a563014646 webclient: make webclient_get_tunnel assert http_status 2022-06-03 16:33:09 +08:00
YAMAMOTO Takashi
a696c8945e webclient: Don't forget to check http status before webclient_get_tunnel 2022-06-03 16:33:09 +08:00
YAMAMOTO Takashi
3f4e723ff7 webclient: dispose the response body by default
Instead of a NULL dereference.

This fixes a crash on CONNECT failure when trying to proxy https.
2022-06-03 16:33:09 +08:00
YAMAMOTO Takashi
dbee240869 webclient.c: Fix the placement of "Public Function" banner 2022-06-03 16:33:09 +08:00
YAMAMOTO Takashi
c116f8b673 webclient: Add https proxy (https over http) support
Use a separate webclient_context for tunnel establishment.

I chose this way (instead of having tunnelling steps in
the state machine of a single webclient_context) because
I want to allow tunnelling of non-HTTP protocols sooner or later.
2022-06-02 12:45:41 +08:00
YAMAMOTO Takashi
a95dd30f0e webclient: Add tunneling support
Add a primitive API for tunnel establishment.
(WEBCLIENT_FLAG_TUNNEL and webclient_get_tunnel)

I plan to use this to implement https proxy support.
That is, the primary user will be webclient itself.
2022-06-02 12:45:41 +08:00
Xiang Xiao
8d1484b562 system/libuv: Include nuttx/tls.h to call task local storage api
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-01 22:50:54 +03:00
YAMAMOTO Takashi
e5c07b9a62 interpreters/wamr: Remove WAMR_VERSION_STUB and always use actual tags
This allows to use a commit sha1 for CONFIG_INTERPRETERS_WAMR_VERSION.

Note: the existing configs with specific wamr version
need to be updated.

Tested with:
CONFIG_INTERPRETERS_WAMR_VERSION=main
CONFIG_INTERPRETERS_WAMR_VERSION=WAMR-04-15-2021
CONFIG_INTERPRETERS_WAMR_VERSION=3168ba8dcf20d9d8539d75c637420f5fd8682335
2022-06-02 00:35:08 +08:00
YAMAMOTO Takashi
a46b144ab1 webclient: Remove an extra slash for proxy 2022-06-01 22:42:12 +08:00
zouboan
30dbdf71ff industry/foc foc_ident: adding flux linkage identification 2022-06-01 01:06:26 +08:00
zouboan
5ae5ab7f44 industry/foc foc_ident: improving the measuring of resistance 2022-06-01 01:06:26 +08:00
Alin Jerpelea
b065d72194 mlearning: add Darknet (Open Source Neural Networks in C)
Darknet is an open source neural network framework written
in C and CUDA. It is fast, easy to install, and supports
CPU and GPU computation.

You Only Look Once (YOLO) is a state-of-the-art,
real-time object detection system

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-05-31 23:33:29 +08:00
zrrong
8fd4b6105b netutils/dhcpc: Change the timeout unit to milliseconds 2022-05-31 11:01:19 +03:00
Adam Kaliszan
e08fdca129 Fixed bug in drawing rectangle using 1 bit palette 2022-05-31 08:01:12 +03:00
Xiang Xiao
26367a66db testing/ostest: Replace up_tls_info with tls_get_info
follow the kernel side change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-30 15:14:29 +03:00
Ville Juven
871c59dc31 nxwm: Fix warning about on_exit() dependency 2022-05-25 21:52:22 +08:00
YAMAMOTO Takashi
ba08c77000 interpreters/wamr/Kconfig: enable text heap when necessary 2022-05-25 15:25:05 +08:00
YAMAMOTO Takashi
f7b0ad4b74 webclient: Require a port in proxy string 2022-05-24 22:42:54 +08:00
YAMAMOTO Takashi
4798f01449 webclient: Implement proxy
Only the very basic case (http over http) for now.
2022-05-24 22:42:54 +08:00
YAMAMOTO Takashi
41aee40a2c webclient: Add proxy setting in webclient_context 2022-05-24 22:42:54 +08:00
YAMAMOTO Takashi
4f4f4da526 webclient: Separate wget_target_s from wget_s
I plan to use the former for proxy settings.
2022-05-24 22:42:54 +08:00
YAMAMOTO Takashi
562db060b7 interpreters/wamr/Kconfig: Mention limitations about wasi 2022-05-24 22:38:36 +08:00
YAMAMOTO Takashi
90e164b708 interpreters/wamr/Kconfig: Add an option to enable wasi libc 2022-05-24 22:38:36 +08:00
Xiang Xiao
1d216fde99 import/Make.defs: Add -noincstd++
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-22 18:12:27 +03:00
Xiang Xiao
dcd481360f examples/README.md: Remove -nostartfiles and -nodefaultlibs
follow nuttx change:
commit b30e0a26efae828b3505059ffaa3a75df74236c0
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Sun May 15 12:32:04 2022 +0800

    Move "-nostartfiles -nodefaultlibs" from Make.defs to Toolchian.defs

    and replace "-nostartfiles -nodefaultlibs" with "-nostdlib"

    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-22 18:12:27 +03:00
zhuyanlin
23584669c5 pmconfig: add last state and modify current state to next state
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-05-22 22:00:11 +08:00
David Sidrane
3821121a2e ostest:priority_inheritance Added priority restoration test 2022-05-21 18:27:55 +03:00
YAMAMOTO Takashi
137b924b93 interpreters/wamr/Kconfig: Add INTERPRETERS_WAMR_PERF_PROFILING 2022-05-20 21:53:34 +08:00
Xiang Xiao
02da51ddf5 examples/nrf24l01: Replace the hardcode value with enum const
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-15 16:19:46 +03:00
Huang Qi
24c16780e2 libuv: Don't add idna.c to CSRCS if test enabled
test-idna.c will include idna.c and then cause multiple definition.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-05-13 08:23:23 +03:00
YAMAMOTO Takashi
59fc69c453 examples/thttpd: -fno-builtin for a file generated by mksymtab.sh 2022-05-12 23:12:39 +08:00
YAMAMOTO Takashi
4b383b397d examples/sotest: -fno-builtin for a file generated by mksymtab.sh 2022-05-12 23:12:39 +08:00
YAMAMOTO Takashi
dc9103a72d examples/nxflat: -fno-builtin for a file generated by mksymtab.sh 2022-05-12 23:12:39 +08:00
YAMAMOTO Takashi
b7f57a1952 examples/posix_spawn: -fno-builtin for a file generated by mksymtab.sh 2022-05-12 23:12:39 +08:00
YAMAMOTO Takashi
8e6081abe0 examples/module: -fno-builtin for a file generated by mksymtab.sh 2022-05-12 23:12:39 +08:00
YAMAMOTO Takashi
adf7ceedf4 examples/elf: -fno-builtin for a file generated by mksymtab.sh 2022-05-12 23:12:39 +08:00
YAMAMOTO Takashi
6a25898568 Revert "tools/mksymtab.sh: Disable the mismatch warning of builtin declaration"
This reverts commit a6773a8412.

Unnecessary after "Use -fno-builtin for SYMTABOBJ"
2022-05-12 23:12:39 +08:00
YAMAMOTO Takashi
5ee2e6348f Use -fno-builtin for SYMTABOBJ
The code generated by tools/mksymtab.sh uses
```
extern void *var;
```
for ~everything.

After the recent removal of -fno-builtin, [1]
it ends up with warnings:
* -Wbuiltin-requires-header for clang
* -Wbuiltin-declaration-mismatch for gcc

It also generates errors like the following for clang:
```
symtab_apps.c:125:14: error: redefinition of 'strdup' as different kind of symbol
extern void *strdup;
```
I couldn't find a way to disable it.
(it's err_redefinition_different_kind in clang source)

This commit works it around by restoring -fno-builtin
when building SYMTABOBJ.

[1] https://github.com/apache/incubator-nuttx/pull/5476
2022-05-12 23:12:39 +08:00
chao.an
725fe76b91 trace: format the usage output
before:
Usage: trace <subcommand>...
Subcommand:
  start [-c][<duration>]          : Start task tracing
  stop                            : Stop task tracing
  dump [-a][-c][<filename>]           : Output the trace result
 [-a] <Android SysTrace>
  mode [{+|-}{o|w|s|a|i|d}...]        : Set task trace options
  switch [+|-] : Configure switch trace filter
  syscall [{+|-}<syscallname>...] : Configure syscall trace filter
  irq [{+|-}<irqnum>...]          : Configure IRQ trace filter
  print [+|-] : Configure dump tnsh>

after:
Usage: trace <subcommand>...
Subcommand:
 start   [-c][<duration>]            : Start task tracing
 stop                                : Stop task tracing
 cmd     [-c] <command> [<args>...]  : Get the trace while running <command>
 dump    [-a][-c][<filename>]        : Output the trace result
                                       [-a] <Android SysTrace>
 mode    [{+|-}{o|w|s|a|i|d}...]     : Set task trace options
 switch  [+|-]                       : Configure switch trace filter
 syscall [{+|-}<syscallname>...]     : Configure syscall trace filter
 irq     [{+|-}<irqnum>...]          : Configure IRQ trace filter
 print   [+|-]                       : Configure dump trace filter

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-05-12 14:55:34 +08:00
chao.an
089c05cbd8 system/trace: correct arg index if command is alreay set
An error occurs when the same command is executed twice

$ trace switch +
$ trace switch +
Usage: trace <subcommand>...
Subcommand:
  start [-c][<duration>]          : Start task tracing
  stop                            : Stop task tracing
  dump [-a][-c][<filename>]           : Output the trace result
 [-a] <Android SysTrace>
  mode [{+|-}{o|w|s|a|i|d}...]        : Set task trace options
  switch [+|-] : Configure switch trace filter
  syscall [{+|-}<syscallname>...] : Configure syscall trace filter
  irq [{+|-}<irqnum>...]          : Configure IRQ trace filter
  print [+|-] : Configure dump tnsh>

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-05-12 14:55:34 +08:00
chao.an
8ce86fe572 system/sched_note: fix build break
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-05-12 14:55:34 +08:00
Takayoshi Koizumi
5040719911 audioutils/mml_parser: Add mml_parser library
Add Music Macro Language parser library in audioutils.
audioutils is also created for several audio utilities
not only mml_parser.
2022-05-07 13:56:53 +08:00
Jiuzhu Dong
1444e0dc76 apps/nshlib: fix unreachable code about i++
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-05-07 08:36:42 +03:00
Jiuzhu Dong
1f093da6a4 Revert "apps/nshlib: fix unreachable code about i++"
This reverts commit 467de8ca83.
2022-05-07 08:36:42 +03:00
Jiuzhu Dong
b3a5b56ff3 apps/nshlib: fix warning by tool converity report
uninit_use_in_call addr before call netlib_set_ipv4addr at line 780

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-05-07 10:30:47 +08:00
Jiuzhu Dong
234e297cd9 apps/nshlib: fix warning by tools converity report
uninit_use_in_call inaddr.sin_zero before call
netlib_set_arpmapping

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-05-07 10:30:47 +08:00
Jiuzhu Dong
467de8ca83 apps/nshlib: fix unreachable code about i++
Report by the tool coverity

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-05-07 10:30:47 +08:00
Xiang Xiao
385603666b system: Add gcov command
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-04 18:08:07 +03:00
Xiang Xiao
0e9946956a .gitignore: Ignore gcov files(*.gcno and *.gcda)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-03 16:11:28 +03:00
Ville Juven
e2f0ae3816 import/Make.defs: Fix C++ library linkage with CONFIG_BUILD_KERNEL
Encapsulate link libraries with start/end group
2022-04-29 12:09:15 +03:00
zhuyanlin
a5a4c561fb pmconfig: add mulit domain support
pmconfig [domain]
pmconfig relax/stay state [domain]

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-04-28 00:36:36 +08:00
zhouliang3
426cc840d8 apps/ping: fix ping statistics error problem
nsh> ping 192.168.31.162
PING 192.168.31.162 56 bytes of data
56 bytes from 192.168.31.162: icmp_seq=0 time=8 ms
56 bytes from 192.168.31.162: icmp_seq=1 time=27 ms
56 bytes from 192.168.31.162: icmp_seq=2 time=17 ms
56 bytes from 192.168.31.162: icmp_seq=3 time=14 ms
56 bytes from 192.168.31.162: icmp_seq=4 time=16 ms
56 bytes from 192.168.31.162: icmp_seq=5 time=14 ms
56 bytes from 192.168.31.162: icmp_seq=6 time=8 ms
56 bytes from 192.168.31.162: icmp_seq=7 time=87 ms
WARNING: Received after timeout
56 bytes from 192.168.31.162: icmp_seq=8 time=1003 ms
56 bytes from 192.168.31.162: icmp_seq=8 time=6 ms
56 bytes from 192.168.31.162: icmp_seq=9 time=5 ms
10 packets transmitted, 11 received, 4294967287% packet loss, time 10011 ms

Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2022-04-25 22:12:42 +08:00
Petro Karashchenko
7eda43768a interpreters/ficl: add double include guard to nuttx.h
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-24 09:48:56 +08:00
Abdelatif Guettouche
473611d51d system/ping: Guard against division by zero when calculating the RTT.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-04-23 20:17:45 +03:00
Xiang Xiao
1acca2946e Update the call site of exec to accommodate the environment variables
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-22 10:40:38 +03:00
Alin Jerpelea
d60fb1168d nxstyle fixes
fixes for nxstyle errors reported by CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
73887c15e0 LICENSE: add license for chat
document the license in the LICENSE file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
fa5fb8fc4b LICENSE: add license for wapi
document the license in the LICENSE file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
d5560b97ad LICENSE: add license for gpsutils
document the license in the LICENSE file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
8c09bddeb8 LICENSE: add license for netutils
document the license in the LICENSE file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
1d1b25724e LICENSE: add license for zmodem
document the license in the LICENSE file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
0baea75f5c LICENSE: add license for ubloxmodem
document the license in the LICENSE file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
f3330cbca4 LICENSE: add license for telnet
document the license in the LICENSE file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
f0f08b5ee9 LICENSE: add license for tee
document the license in the LICENSE file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
b99070589a graphics: nxglyphs: Add Apache License
The initial contribution was missing a license.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
54ce2e0ab9 nshlib: Add Apache License
The initial contribution was missing a license.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
7c46bbc34d include: netutils: pppd.h: update license to Apache
Brennan Ashton has signed the ICLA. As a result we can migrate the
license to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
e07ac9bc96 platform: dummy: Add Apache License
The initial contribution was missing a license.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
26e4e29c95 interpreters: ficl: Add Apache License
The initial contribution was missing a license.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Petro Karashchenko
84e0e50995 make: update makefiles for mcuboot and libtomcrypt
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-21 21:11:58 +08:00
Ville Juven
0957a740cb nshlib/nsh_fileapps.c: Pass global environ instead of NULL for posix_spawnp
Now that the environ pointer is a list of pointers-to-string, it can be
passed to the standard posix_spawn function as-is.
2022-04-21 20:58:05 +08:00
Jiuzhu Dong
9f79bf183a nsh/script: support rc.sysinit script
Follow: http://glennastory.net/boot/sysinit.html

This is first script that init runs is rc.sysinit. This
script does serval initialization tasks about basic service.

The boot sequence currently provided to the board level is:
board_earlyinitialize->
    board_lateinitialize(Peripherals driver, core driver, ...)->
	run rcS script(mount fs, run service) ->
	    board_appinitialize->

After this patch:
The boot sequence currently provided to the board level is:
board_earlyinitialize->
    board_lateinitialize(core driver,...)->
	run rc.sysinit script(mount fs, run core service) ->
	    board_appinitialize(Peripherals driver)->
		run rcS script(run other service)->

So, Peripheral drivers can do more with the file system and
core services.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-21 12:54:24 +03:00
Huang Qi
768a21b587 system/i2c: Fix fd leak in i2ccmd_reset
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-04-19 14:53:51 +03:00
Huang Qi
c7413ee859 system/critmon: Fix dead code
Remove branch since errcount could never bigger than 100.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-04-19 18:21:00 +08:00
chao.an
e4dcdcd158 testing/ostest: remove CONFIG_TESTING_OSTEST_FPUSIZE
fptest should not need to care about the size of FPU

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-19 02:48:24 +08:00
Xiang Xiao
3760ab5fc8 Remove the unneeded void cast
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-17 23:31:35 +03:00
zhanghongyu
b80ef1df87 usrsock: Don't clear recv and send available flag
Don't clear available flag if the response indicate there is more data

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-04-16 14:07:48 +08:00
chao.an
ab5e7496d5 Makefile/Application: correct COMPILER_RT_LIB PATH
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-16 00:33:00 +08:00
songlinzhang
460f631fa3 netutils/usrsock_rpmsg: broadcast the client DNS server to server
Signed-off-by: songlinzhang <songlinzhang@xiaomi.com>
2022-04-15 16:05:38 +08:00
Masayuki Ishikawa
7663f993f7 wireless: gs2200m: Fix recvfrom_request() in gs2200m_main.c
Summary:
- I noticed that wget causes ASSERT in gs2200m_main.c recently.
- Finally, I found that it sends a wrong ack message in
  recvfrom_request() when the socket is closed passively
- This commit fixes this issue.

Impact:
- gs2200m only

Testing:
- Tested with spresense:wifi_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-04-15 10:36:52 +03:00
chao.an
b8b9d45706 netutils/ping: skip the id check
https://joekuan.wordpress.com/2017/05/30/behaviour-of-identifier-field-in-icmp-ping-as-udp-between-linux-and-osx/
https://lwn.net/Articles/443051/

https: //github.com/apache/incubator-nuttx-apps/blob/master/netutils/ping/icmp_ping.c#L298

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-14 23:23:07 +03:00
zrrong
d17c9509f6 wireless/wapi: fix wapi wpa_wconfig_s alg data type error
Signed-off-by: zrrong <zrrong@bouffalolab.com>
2022-04-14 18:24:33 +03:00
田昕
cc7653b8c7 fix resetcause nsh command print
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-04-14 16:43:45 +03:00
zhanghongyu
a6c986d516 rpmsg_usrsock: Support the wireless ioctl which contain pointer 2/2
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-04-14 02:47:53 +08:00
zhanghongyu
3a42d849f5 Revert "rpmsg: pointer of netdev ioctl support cross-core memory access"
This reverts commit bd539651cdf1e5067dc5d21349ef835e98e262eb.

Reason for revert: Change the implementation method

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-04-14 02:47:53 +08:00
YAMAMOTO Takashi
c7fcffd09a nshlib/nsh_fscmds.c: Make losetup command take optional sector size 2022-04-11 22:19:19 +08:00
SPRESENSE
f2e7faa478 examples/scd41: Add new example for scd41 CO2 sensor
Add new example for scd41 CO2 sensor application.
2022-04-11 20:54:48 +08:00
okayserh
c8bc287a29 According to the help text, the balance command without value
should display the current balance value. This patch adjusts
the code accordingly.
2022-04-11 11:07:49 +08:00
Xiang Xiao
2f74de6f02 .github/workflows/check.yml: Enable Change-ID check explicitly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-09 22:08:27 +02:00
chao.an
8c1a4994cc system/note: correct unflatten format
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-08 01:38:13 +08:00
chao.an
25d7dfe990 fs/epoll: fix compile break about change type of pollevent_t
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-07 16:23:47 +08:00
Jiuzhu Dong
2f2e4680d0 fs/epoll: fix compile break about change type of pollevent_t
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-07 12:13:22 +08:00
Jiuzhu Dong
63f28099e3 nsh/timedatectl: add timedatectl to get/set TZ
follow https://man7.org/linux/man-pages/man1/timedatectl.1.html

nsh> timedatectl
      TimeZone: CST, 28800
    Local time: Sat, Apr 02 05:59:43 2022 CST
Universal time: Fri, Apr 01 21:59:43 2022 GMT
      RTC time: Sun, Apr 01 21:59:42 2022

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-07 02:52:11 +08:00
Jiuzhu Dong
5b0b44f24e iozone: support on nuttx
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-07 02:51:49 +08:00
YAMAMOTO Takashi
fe5b68142e testing/mm: Test more patterns for memalign 2022-04-07 02:51:39 +08:00
YAMAMOTO Takashi
f9a24e3c0a testing/mm: check alignment in do_memaligns 2022-04-07 02:51:39 +08:00
YAMAMOTO Takashi
cc5f73019e testing/mm: Update after the recent changes in nuttx
The following commit changed the typo of SIZEOF_MM_ALLOCNODE
from int to size_t.
```
commit 39eaeefb78f36724adbdc47400d6f60372b68344
Author: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Date:   Thu Jan 27 12:17:20 2022 +0800

    mm/mm_heap: remove the unnecessary check for memory node size

    Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>

```
2022-04-07 02:51:39 +08:00
Xiang Xiao
0c7adf4567 usrsock/rpmsg: Change the dependence from OPENAMP to RPTUN
since all rpmsg driver need the extension api exposed by rptun driver

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-05 10:05:47 +03:00
Petro Karashchenko
319203d5d8 apps: unify FAR attribute usage across apps
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-05 00:55:22 +08:00
Petro Karashchenko
aaa950faee netutils/ftpd: Do not terminate connection if CWD fails
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-04 17:32:51 +08:00
chao.an
124c1328a6 sched/note: add support of trace section mark
The implementation of this feature is based on android systrace:

https://source.android.com/devices/tech/debug/ftrace

Application developers are more concerned about the performance of
the specified application section,
added two APIs to implement performance measurement:

void sched_note_begin(FAR const char *str);
void sched_note_end(FAR const char *str);
or
SCHED_NOTE_BEGIN();  /* defined to sched_note_begin(__FUNCTION__) */
SCHED_NOTE_END();    /* defined to sched_note_end(__FUNCTION__) */

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
chao.an
f4a41c6ed4 system/trace: fix the irq print compatibility with systrace
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
chao.an
023971d46c system/trace: add switch priority print to align with ftrace
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
chao.an
2fd38eb57b system/trace: force flush the output stream
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
chao.an
7612d2aea8 system/trace: correct preamble header pid
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
chao.an
90484a33e9 sched/trace: correct the note print format
note print should with Instruction pointer.

e.g:

        trace_printk("hello NuttX");

trace dump:

        hello-6  [000] .... 23080.367994: 0xc044a005: hello NuttX

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
chao.an
0dc716d426 sched/note: unify the data format
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-03 18:04:28 +08:00
zhanghongyu
16c1fec99d usrsock: Move event field to usrsock_message_common_s
Zero the events field for all response message

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-04-03 11:39:19 +09:00
wangbowen6
c7b7162d5f testing/mm: add memory boundary realloc test.
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-04-02 18:11:58 +08:00
Petro Karashchenko
214dbe51b4 open() options: pass file options 0 if only ioctl is used
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-01 12:22:07 -03:00
ligd
470174260c rptun: update rptun cmd usage
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:36:51 +08:00
ligd
f5d2c64556 rptun: add rptun ping support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:36:51 +08:00
ligd
622784be89 rptun cmd: add broadcast rptun cmd
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:36:51 +08:00
ligd
e0e5652de4 rptun: add rptun dump support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:36:51 +08:00
ligd
d5aae96523 apps: add rptun reset /dev/rptun/xx cmd
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:36:51 +08:00
ligd
c57677c3ce apps: add rptun /dev/rptun/xx panic cmd
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:36:51 +08:00
Jiuzhu Dong
de61706552 nsh/memdump: support dynamic turn on/off backtrace in heap
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-01 13:31:28 +08:00
田昕
cbc9163266 apps/nsh:add resetcause command
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-03-31 12:09:24 +03:00
qiaohaijiao1
442d52e878 system/nxlooper: fix warning
nxlooper.c:615:7: warning: 'playbufs' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2022-03-31 16:59:16 +08:00
qiaohaijiao1
68fa377c5e system/nxplayer: fix warning
nxplayer.c:400:57: warning: array subscript 4 is above array bounds of 'uint8_t[4]' {aka 'unsigned char[4]'} [-Warray-bounds]
nxplayer.c:400:57: warning: array subscript 5 is above array bounds of 'uint8_t[4]' {aka 'unsigned char[4]'} [-Warray-bounds]
nxplayer.c:400:57: warning: array subscript 6 is above array bounds of 'uint8_t[4]' {aka 'unsigned char[4]'} [-Warray-bounds]
nxplayer.c:400:57: warning: array subscript 7 is above array bounds of 'uint8_t[4]' {aka 'unsigned char[4]'} [-Warray-bounds]

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2022-03-31 16:59:16 +08:00
ligd
9730eaad9e nsh: sh_main also support isctty = true
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-30 22:47:37 +03:00
wangbowen6
963c1f31db testing/mm: repair the memory leak question when realloc failed.
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-03-31 03:16:24 +08:00
Alin Jerpelea
19acc783c4 remove DISCLAIMER-WIP
Most licenses have been converted to Apache and the non Apache
licenses have been documented.
We can assume that now it should be the time to remove DISCLAIMER-WIP

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-03-30 16:09:51 +08:00
ligd
427798f7ee nxlooper: support different period size of player & recorder
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-30 02:46:07 +08:00
ligd
d6a187efed nshlib: merge nsh_getdirpath() to nsh_fsutils.c
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-30 02:36:13 +08:00
Huang Qi
ec15dc0344 system/libuv: Support specify stack size for worker thread
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-03-29 18:09:10 +03:00
yinshengkai
cd1bc19bf9 quickjs: fix compile warning
optind is a global variable in getopt.h (a macro defined in stdlib.h in nuttx).
Here it is used as a variable, not a variable of getopt
2022-03-29 22:47:11 +08:00
ligd
e0da9d1409 rexec: correct af type from int to sa_family_t
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-29 17:10:32 +08:00
Gustavo Henrique Nihei
c29deef4e5 testing: Extend cxxtest with some C++17 features
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-03-29 10:03:10 +08:00
Petro Karashchenko
41dd5f15bd system/cfgdata: add missing include file
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-28 17:19:00 -03:00
Petro Karashchenko
c1dfaf42ff netutils/ftpd: add option to login to FTPD using FSUTILS_PASSWD
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-28 23:30:45 +08:00
zhuyanlin
e3df21cd4c trace: fix pointer cross the border
Fix pointer cross the border

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-03-28 22:17:59 +08:00
Petro Karashchenko
d868387148 fsutils/passwd: fix out of bounds array access during password encryption
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-28 22:11:01 +08:00
Peter Bee
2831af6395 apps/mlearning: tweak lib makefile
only one .c needed for each function group
add -flax-vector-conversions to avoid build error on gcc && M55

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-03-28 16:08:58 +08:00
Peter Bee
96efff32fe apps/mlearning: tweak lib makefile
only one .c needed for each function group
add -flax-vector-conversions to avoid build error on gcc && M55

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-03-28 16:08:58 +08:00
SunJ
f8811eab38 examples/watchdog: Fix watchdog command parameter error 2022-03-28 13:42:49 +08:00
Jiuzhu Dong
5fab48a2fe testing/scanftest: fix nxstyle
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-03-28 00:25:56 +08:00
Jiuzhu Dong
494b47c692 fix compile warning
scanftest_main.c:1121:34: warning: ‘%s’ directive writing up to 2 bytes into a region of size between 1 and 80 [-Wformat-overflow=]
canftest_main.c: In function 'scanftest_main':
scanftest_main.c:1399:42: warning: format '%n' expects argument of type 'int *', but argument 3 has type 'unsigned int' [-Wformat=]
 1399 |               printf("Test #%u assigned %nou instead of %lli.\n",
      |                                         ~^
      |                                          |
      |                                          int *
      |                                         %d
 1400 |                      t + 1, nou, type_data[t].value.u);
      |                             ~~~
      |                             |
      |                             unsigned int

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-03-28 00:25:56 +08:00
Jiuzhu Dong
dede3698ae rexecd: fix compile warning
rexecd.c:196:9: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-03-28 00:25:56 +08:00
Gustavo Henrique Nihei
732df52aef testing: Fix cxxtest application for "no-rtti" builds
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-03-26 06:31:51 +02:00
Petro Karashchenko
cfadf7b9dc fsutils/passwd: fix compilation
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-25 11:07:10 +02:00
Michael Mogenson
4043522daf interpreters: lua: replace awk command with shell script 2022-03-24 00:18:28 +08:00
Xiang Xiao
d364d7a810 system: Fix nx[looper|player|recorder] warning
nxlooper.c:879:7: warning: 'strncpy' specified bound 96 equals destination size [-Wstringop-truncation]
  879 |       strncpy(plooper->recorddev, pdevice, sizeof(plooper->playdev));
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nxlooper.c:875:7: warning: 'strncpy' specified bound 96 equals destination size [-Wstringop-truncation]
  875 |       strncpy(plooper->playdev, pdevice, sizeof(plooper->playdev));
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nxlooper.c: In function 'nxlooper_loopraw':
nxlooper.c:165:52: warning: '%s' directive output may be truncated writing up to 96 bytes into a region of size 53 [-Wformat-truncation=]
  165 |           snprintf(path, sizeof(path), "/dev/audio/%s", pdevice->d_name);
      |                                                    ^~
nxlooper.c:165:11: note: 'snprintf' output between 12 and 108 bytes into a destination of size 64
  165 |           snprintf(path, sizeof(path), "/dev/audio/%s", pdevice->d_name);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nxplayer.c: In function 'nxplayer_playinternal':
nxplayer.c:359:53: warning: '%s' directive output may be truncated writing up to 96 bytes into a region of size 53 [-Wformat-truncation=]
  359 |           snprintf(path,  sizeof(path), "/dev/audio/%s", pdevice->d_name);
      |                                                     ^~
nxplayer.c:359:11: note: 'snprintf' output between 12 and 108 bytes into a destination of size 64
  359 |           snprintf(path,  sizeof(path), "/dev/audio/%s", pdevice->d_name);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nxrecorder.c: In function 'nxrecorder_setdevice':
nxrecorder.c:695:3: warning: 'strncpy' specified bound 96 equals destination size [-Wstringop-truncation]
  695 |   strncpy(precorder->device, pdevice, sizeof(precorder->device));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nxplayer.c: In function 'nxplayer_setdevice':
nxplayer.c:1686:3: warning: 'strncpy' specified bound 96 equals destination size [-Wstringop-truncation]
 1686 |   strncpy(pplayer->prefdevice, pdevice, sizeof(pplayer->prefdevice));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC:  nxrecorder_main.c
nxplayer.c: In function 'nxplayer_setmediadir':
nxplayer.c:2090:3: warning: 'strncpy' specified bound 96 equals destination size [-Wstringop-truncation]
 2090 |   strncpy(pplayer->mediadir, mediadir, sizeof(pplayer->mediadir));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-23 11:05:18 +02:00
Xiang Xiao
2fc7c67031 wireless/wapi: Fix warning: 'strncpy' specified bound 16 equals destination size
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-22 08:35:58 +02:00
Petro Karashchenko
c88dd4bbaf system/cfgdata: implement "format" option
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-22 10:30:50 +08:00
Michael Mogenson
f1a74533f2 examples: add Lua module example 2022-03-21 13:49:42 +08:00
Michael Mogenson
87df63d367 interpreters: add Lua support 2022-03-21 13:49:42 +08:00
Xiang Xiao
282e44e3e0 system/ping: Don't include nuttx/lib/math.h
since the mdev is calculated through function provided by fixedmath.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-19 22:24:04 +02:00
songlinzhang
f85388578c Add dhcp6c module
Signed-off-by: songlinzhang <songlinzhang@xiaomi.com>
2022-03-19 23:25:50 +08:00
Gerson Fernando Budke
afefa1c308 boot/mcuboot: Move MCUboot samples to examples dir
The current examples belongs to 'examples/mcuboot' directory. This
moves related example code and Kconfig entries to their respective
project inside examples/mcuboot directory. It cleans all Kconfig
entries at 'boot/mcuboot', including Kconfig, Makefile and
README.md files.

This not perform any code modification.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-03-19 16:09:44 +02:00
Gerson Fernando Budke
36cb168077 boot/mcuboot: Prepare to move MCUboot samples to examples dir
This adjusts code and Kconfig variables as preparation to move MCUboot
examples to examples/mcuboot folder.

This changes perfor below sed operations:

's/MCUBOOT_UPDATE_AGENT_EXAMPLE/EXAMPLES_MCUBOOT_UPDATE_AGENT/g'
's/MCUBOOT_SLOT_CONFIRM_EXAMPLE/EXAMPLES_MCUBOOT_SLOT_CONFIRM/g'

It replaces 'apps/boot/mcuboot' prefix by 'apps/examples/mcuboot' and
adjust it with respective application name on below source files:

boot/mcuboot/mcuboot_agent_main.c
boot/mcuboot/mcuboot_confirm_main.c

This commit does not other changes in the code.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-03-19 16:09:44 +02:00
Petro Karashchenko
29cc338dac system/cfgdata: fix compilation when MTD_CONFIG_NAMED is enabled
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-19 17:36:29 +08:00
Petro Karashchenko
2d8798d260 graphics/nxwidgets/UnitTests: correct configuration option name in README.md
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-19 17:35:48 +08:00
xuewenliang
c69ec94d13 Modifying the ping command
1、Round trip times in the ping command range from millisecond to subtle
2、Add statistics on RTT related min/avg/Max/mdev in ping program
3、The ping command supports ctrl+c interruption operations

Signed-off-by: xuewenliang <xuewenliang@xiaomi.com>
2022-03-18 09:54:01 +08:00
Matheus C. França
2796187bdf Update Application.mk 2022-03-16 19:59:08 +02:00
Petro Karashchenko
566be8c7b1 definitions: unify MAX and MIN macro definitions
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-16 23:20:17 +08:00
Petro Karashchenko
b207387d48 examples/timer: fix timer notification asignment
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-16 23:19:41 +08:00
anjiahao
7d10751037 nshlib/nsh_fscmds:use strchr instead of strstr
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-03-16 20:05:51 +08:00
anjiahao
eabba4ca20 cmd_mkdir:support mkdir opthon -p
use "mkdir -p /test/test" to ceate a dir

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-03-16 13:53:45 +08:00
Matheus Catarino França
cdb04f6172 Zig hello-example
rename example - fix

confusion-rename fixed

zigflags added

rm zigflag single-threaded

zig rules added
2022-03-16 12:18:01 +08:00
fanzhuyun
2dde296d4f testing/fstest: add cleanup to fatutf8
Signed-off-by: fanzhuyun <fanzhuyun@xiaomi.com>
2022-03-15 18:38:52 +08:00
zhanghongyu
e0e41c5d7f feature: wapi add encode parse when scan
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-03-15 18:01:04 +08:00
zhanghongyu
5e22b6f564 fix: iperf can not exit when stop
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-03-15 18:01:04 +08:00
zhanghongyu
f1d5d6e671 fix: ap socket can not accept twice
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-03-15 18:01:04 +08:00
zhanghongyu
6c2a487f85 feature: pointer of netdev ioctl support cross-core access via clean dcache
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-03-15 18:01:04 +08:00
5414 changed files with 482772 additions and 42274 deletions

View file

@ -1,10 +1,9 @@
# Reference: https://github.com/apache/infrastructure-asfyaml.
github:
description: "Apache NuttX Apps is a collection of tools, shells, network utilities, libraries, interpreters and can be used with the NuttX RTOS"
homepage: https://nuttx.apache.org/
features:
# Enable issues management
issues: true
# Enable project for project management boards
projects: true
labels:
- nuttx
@ -14,9 +13,22 @@ github:
- mcu
- microcontroller
enabled_merge_buttons:
# disable squash button:
squash: false
# disable merge button:
merge: false
# enable rebase button:
rebase: true
squash: false
merge: false
rebase: true
protected_branches:
master:
required_status_checks:
strict: false
# Contexts cause hanging CI etc disable for now.
# contexts:
# - Check
# - Lint
# - Build
required_pull_request_reviews:
dismiss_stale_reviews: true
require_last_push_approval: true
required_approving_review_count: 2
required_linear_history: true
required_signatures: false
required_conversation_resolution: true

16
.codespell-ignore-lines Normal file
View file

@ -0,0 +1,16 @@
mynewt-nimble/nimble/host/services/ans/src/ble_svc_ans.c
mynewt-nimble/nimble/host/services/ans/include
#include "services/ans/ble_svc_ans.h"
#include "crypto/controlse/ccertificate.hxx"
* notifications for the ANS Unread Alert Status characteristic
object = new Controlse::CCertificate(
Controlse::CCertificate cert(se, settings->key_id);
auto certificate = Controlse::CCertificate(
* |---------- [-rw-r--r-- 15] afile.txt
g_afile.name = "afile.txt";
"*.deh", "*.hhe", "*.seh", NULL);
MUSIC("introa"), MUSIC("runnin"), MUSIC("stalks"), MUSIC("countd"),
MUSIC("betwee"), MUSIC("doom"), MUSIC("the_da"), MUSIC("shawn"),
MUSIC("messag"), MUSIC("count2"), MUSIC("ddtbl3"), MUSIC("ampie"),
MUSIC("tense"), MUSIC("shawn3"), MUSIC("openin"), MUSIC("evil"),
/* ANS service */

16
.codespellrc Normal file
View file

@ -0,0 +1,16 @@
[codespell]
# Add complete lines to be ignored to this file.
# Example for ignoring all current occurrences of (verifiably correct) word usage:
# grep -hirw "emac" | sort | uniq >>.codespell-ignore-lines
exclude-file = .codespell-ignore-lines
# Ignore complete files (e.g. legal text or other immutable material).
skip =
LICENSE,
examples/webpanel/content/www/xterm.min.js,
**/games/NXDoom/src/doom/d_englsh.h,
**/games/NXDoom/src/doom/d_french.h
# Ignore words list (FTP protocol commands and technical terms)
ignore-words-list = ALLO, ARCHTYPE, parm, shiftIn

View file

@ -0,0 +1,166 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Bug report
description: Report a bug to improve NuttX stability
title: "[BUG] <title>"
labels: [👀 needs triage, "Type: Bug"]
body:
- type: markdown
attributes:
value: |
Hello NuttX Community member! Please keep things tidy by putting your post in the proper place:
Reporting a bug: use this form.
Asking a question or getting help: use the [General Help](https://github.com/apache/nuttx-apps/issues/new?assignees=&labels=Community%3A+Question&projects=&template=003_help.yml&title=%5BHELP%5D+%3Ctitle%3E) form or [Mailing list](https://nuttx.apache.org/community/).
Requesting a new feature: use the [Feature request](https://github.com/apache/nuttx-apps/issues/new?assignees=&labels=Type%3A+Enhancement&projects=&template=002_feature_request.yml&title=%5BFEATURE%5D+%3Ctitle%3E) form.
- type: textarea
attributes:
label: "Description / Steps to reproduce the issue"
description: "A clear and concise description of what the bug is, and why you consider it to be a bug, and steps for how to reproduce it"
placeholder: |
A description with steps to reproduce the issue.
May include logs, images, or videos.
1. Step 1
2. Step 2
validations:
required: true
- type: markdown
attributes:
value: |
### Environment
Please specify your environment.
- type: dropdown
id: os
attributes:
label: On which OS does this issue occur?
multiple: true
options:
- "[OS: BSD]"
- "[OS: Linux]"
- "[OS: Mac]"
- "[OS: Windows]"
- "[OS: Other]"
validations:
required: true
- type: input
id: os_version
attributes:
label: What is the version of your OS?
description: Please fill out the distro or OS version from the previous dropdown
placeholder: "MacOS 14, Ubuntu 23.10, Windows 10/MSYS_NT-10.0-19045, ecc"
validations:
required: true
- type: input
attributes:
label: NuttX Version
placeholder: "e.g., master, 12.5.1, ecc"
validations:
required: true
- type: dropdown
id: architecture
attributes:
label: Issue Architecture
description: What architecture(s) are you seeing the problem on?
multiple: true
options:
- "[Arch: all]"
- "[Arch: arm]"
- "[Arch: arm64]"
- "[Arch: avr]"
- "[Arch: ceva]"
- "[Arch: hc]"
- "[Arch: mips]"
- "[Arch: misoc]"
- "[Arch: openrisc]"
- "[Arch: renesas]"
- "[Arch: risc-v]"
- "[Arch: simulator]"
- "[Arch: sparc]"
- "[Arch: tricore]"
- "[Arch: x86]"
- "[Arch: x86_64]"
- "[Arch: xtensa]"
- "[Arch: z16]"
- "[Arch: z80]"
validations:
required: true
- type: dropdown
id: area
attributes:
label: Issue Area
description: What area(s) are you seeing the problem on?
multiple: true
options:
- "[Area: Audio]"
- "[Area: Benchmarks]"
- "[Area: Boot]"
- "[Area: CAN]"
- "[Area: Binfmt]"
- "[Area: Crypto]"
- "[Area: Database]"
- "[Area: Examples]"
- "[Area: File System]"
- "[Area: Games]"
- "[Area: Graphics]"
- "[Area: Industry]"
- "[Area: Inertial]"
- "[Area: Interpreters]"
- "[Area: Logging]"
- "[Area: LTE]"
- "[Area: Math]"
- "[Area: Mlearing]"
- "[Area: Modbus]"
- "[Area: Networking]"
- "[Area: NSH]"
- "[Area: SDR]"
- "[Area: System]"
- "[Area: Testing]"
- "[Area: Video]"
- "[Area: Wireless]"
- "[Area: Build System]"
- "[Area: Tools]"
- "[Area: Other]"
- "[Area: Posix]"
validations:
required: true
- type: textarea
attributes:
label: "Host information"
description: "What is the output of `make host_info` command while your buggy configuration selected and if possible device connected to your system?"
validations:
required: false
- type: markdown
attributes:
value: |
### Before You Submit
Please verify that you've followed these steps:
- Confirm the problem is reproducible on [**master**](https://github.com/apache/nuttx-apps) or [**latest stable**](https://nuttx.apache.org/download) release.
- Run `make distclean` when encountering build issues.
- Search [existing issues](https://github.com/apache/nuttx-apps/issues) (including [closed](https://github.com/apache/nuttx-apps/issues?q=is%3Aissue+is%3Aclosed))
- Read the [FAQ](https://nuttx.apache.org/docs/latest/faq/index.html).
- type: checkboxes
attributes:
label: "Verification"
options:
- label: "I have verified before submitting the report."
required: true

View file

@ -0,0 +1,62 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Feature request
description: Request an enhancement for NuttX
title: "[FEATURE] <title>"
labels: ["Type: Enhancement"]
body:
- type: markdown
attributes:
value: |
Hello NuttX Community member! Please keep things tidy by putting your post in the proper place:
Requesting a new feature: use this form.
Asking a question or getting help: use the [General Help](https://github.com/apache/nuttx-apps/issues/new?assignees=&labels=Community%3A+Question&projects=&template=003_help.yml&title=%5BHELP%5D+%3Ctitle%3E) form or [Mailing list](https://nuttx.apache.org/community/).
Reporting a bug: use the [Bug report](https://github.com/apache/nuttx-apps/issues/new?assignees=&labels=%F0%9F%91%80+needs+triage%2CType%3A+Bug&projects=&template=001_bug_report.yml&title=%5BBUG%5D+%3Ctitle%3E) form.
- type: textarea
id: question-description
attributes:
label: Is your feature request related to a problem? Please describe.
description: Please provide a clear and concise description of what the problem is. Add relevant issue link.
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
description: Please provide a clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
description: Please provide a clear and concise description of any alternative solutions or features you've considered.
- type: markdown
attributes:
value: |
### Before You Submit
Please verify that you've followed these steps:
- Search [existing feature requests](https://github.com/apache/nuttx-apps/issues) (including [closed](https://github.com/apache/nuttx-apps/issues?q=is%3Aissue+is%3Aclosed))
- type: checkboxes
attributes:
label: "Verification"
options:
- label: "I have verified before submitting the report."
required: true

54
.github/ISSUE_TEMPLATE/003_help.yml vendored Normal file
View file

@ -0,0 +1,54 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: General Help
description: Get general support regarding NuttX
title: "[HELP] <title>"
labels: ["Community: Question"]
body:
- type: markdown
attributes:
value: |
Hello NuttX Community member! Please keep things tidy by putting your post in the proper place:
Asking a question or getting help: use this form or [Mailing list](https://nuttx.apache.org/community/).
Reporting a bug: use the [Bug report](https://github.com/apache/nuttx-apps/issues/new?assignees=&labels=%F0%9F%91%80+needs+triage%2CType%3A+Bug&projects=&template=001_bug_report.yml&title=%5BBUG%5D+%3Ctitle%3E) form.
Requesting a new feature: use the [Feature request](https://github.com/apache/nuttx-apps/issues/new?assignees=&labels=Type%3A+Enhancement&projects=&template=002_feature_request.yml&title=%5BFEATURE%5D+%3Ctitle%3E) form
- type: markdown
attributes:
value: |
### Whether you're a beginner or an experienced developer, NuttX Help is here to assist you with all your NuttX questions and concerns.
- type: textarea
id: question-description
attributes:
label: Description
description: Explain the background or context of your question. This helps others understand your problem or inquiry better.
validations:
required: true
- type: markdown
attributes:
value: |
### Before You Submit
Please verify that you've followed these steps:
- I have searched [NuttX Documentation](https://nuttx.apache.org/docs/latest/) and didn't find an answer to my question.
- Search [existing issues](https://github.com/apache/nuttx-apps/issues) (including [closed](https://github.com/apache/nuttx-apps/issues?q=is%3Aissue+is%3Aclosed))
- type: checkboxes
attributes:
label: "Verification"
options:
- label: "I have verified before submitting the report."
required: true

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View file

@ -0,0 +1 @@
blank_issues_enabled: false

View file

@ -1,6 +1,21 @@
*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
## Summary
*Update this section with information on why change is necessary,
what it exactly does and how, if new feature shows up, provide
references (dependencies, similar problems and solutions), etc.*
## Impact
*Update this section, where applicable, on how change affects users,
build process, hardware, documentation, security, compatibility, etc.*
## Testing
*Update this section with details on how did you verify the change,
what Host was used for build (OS, CPU, compiler, ..), what Target was
used for verification (arch, board:config, ..), etc. Providing build
and runtime logs from before and after change is highly appreciated.*

21
.github/SECURITY.md vendored Normal file
View file

@ -0,0 +1,21 @@
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| 11.0.x | :heavy_check_mark: |
| 10.3.x | :heavy_check_mark: |
| 10.2.x | :heavy_check_mark: |
| 10.1.x | :heavy_check_mark: |
| 10.0.x | :heavy_check_mark: |
| 9.1.x | :heavy_check_mark: |
| < 9.1 | :x: |
## Reporting a Vulnerability
If you think you have found a possible vulnerability please reach out to the _private_ project mailing list
private@nuttx.apache.org or the Apache Security list security@apache.org.
Please **DO NOT** create a GitHub issue or email the project dev list as they are public.
This project follows the Apache Vulnerability Handling Policy documented [here](https://www.apache.org/security/committers.html#vulnerability-handling).

6
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

171
.github/labeler.yml vendored Normal file
View file

@ -0,0 +1,171 @@
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Note: NuttX PR Labeler only supports a subset of the
# `actions/labeler` syntax: `changed-files` and
# `any-glob-to-any-file`. See .github/workflows/labeler.yml
# add arch labels
"Area: Audio":
- changed-files:
- any-glob-to-any-file: 'audioutils/**'
- any-glob-to-any-file: 'include/audioutils/**'
"Area: Benchmarks":
- changed-files:
- any-glob-to-any-file: 'benchmarks/**'
- any-glob-to-any-file: 'include/benchmarks/**'
"Area: Boot":
- changed-files:
- any-glob-to-any-file: 'boot/**'
- any-glob-to-any-file: 'include/boot/**'
"Area: CAN":
- changed-files:
- any-glob-to-any-file: 'canutils/**'
- any-glob-to-any-file: 'include/canutils/**'
"Area: Binfmt":
- changed-files:
- any-glob-to-any-file: 'builtin/**'
- any-glob-to-any-file: 'include/builtin/**'
"Area: Crypto":
- changed-files:
- any-glob-to-any-file: 'crypto/**'
- any-glob-to-any-file: 'include/crypto/**'
"Area: Database":
- changed-files:
- any-glob-to-any-file: 'database/**'
- any-glob-to-any-file: 'include/database/**'
"Area: Examples":
- changed-files:
- any-glob-to-any-file: 'examples/**'
"Area: File System":
- changed-files:
- any-glob-to-any-file: 'fsutils/**'
- any-glob-to-any-file: 'include/fsutils/**'
"Area: Games":
- changed-files:
- any-glob-to-any-file: 'games/**'
- any-glob-to-any-file: 'include/games/**'
"Area: Graphics":
- changed-files:
- any-glob-to-any-file: 'graphics/**'
- any-glob-to-any-file: 'include/graphics/**'
"Area: Industry":
- changed-files:
- any-glob-to-any-file: 'industry/**'
- any-glob-to-any-file: 'include/industry/**'
"Area: Inertial":
- changed-files:
- any-glob-to-any-file: 'inertial/**'
- any-glob-to-any-file: 'include/inertial/**'
"Area: Interpreters":
- changed-files:
- any-glob-to-any-file: 'interpreters/**'
- any-glob-to-any-file: 'include/interpreters/**'
"Area: Logging":
- changed-files:
- any-glob-to-any-file: 'logging/**'
- any-glob-to-any-file: 'include/logging/**'
"Area: LTE":
- changed-files:
- any-glob-to-any-file: 'lte/**'
- any-glob-to-any-file: 'include/lte/**'
"Area: Math":
- changed-files:
- any-glob-to-any-file: 'math/**'
- any-glob-to-any-file: 'include/math/**'
"Area: Mlearning":
- changed-files:
- any-glob-to-any-file: 'mlearning/**'
- any-glob-to-any-file: 'include/mlearning/**'
"Area: Modbus":
- changed-files:
- any-glob-to-any-file: 'modbus/**'
- any-glob-to-any-file: 'include/modbus/**'
"Area: Networking":
- changed-files:
- any-glob-to-any-file: 'netutils/**'
- any-glob-to-any-file: 'include/netuitls/**'
"Area: NSH":
- changed-files:
- any-glob-to-any-file: 'nshlib/**'
- any-glob-to-any-file: 'include/nshlib/**'
"Area: SDR":
- changed-files:
- any-glob-to-any-file: 'sdr/**'
- any-glob-to-any-file: 'include/sdr/**'
"Area: System":
- changed-files:
- any-glob-to-any-file: 'system/**'
- any-glob-to-any-file: 'include/system/**'
"Area: Testing":
- changed-files:
- any-glob-to-any-file: 'testing/**'
- any-glob-to-any-file: 'include/testing/**'
"Area: Video":
- changed-files:
- any-glob-to-any-file: 'videotuils/**'
- any-glob-to-any-file: 'include/videotuils/**'
"Area: Wireless":
- changed-files:
- any-glob-to-any-file: 'wireless/**'
- any-glob-to-any-file: 'include/wireless/**'
"Area: Build system":
- changed-files:
- any-glob-to-any-file: 'Makefile'
- any-glob-to-any-file: 'Make.defs'
- any-glob-to-any-file: '*.mk'
- any-glob-to-any-file: 'CMakeLists.txt'
- any-glob-to-any-file: 'cmake/**'
- any-glob-to-any-file: 'import/**'
- any-glob-to-any-file: 'staging/**'
"Area: Tools":
- changed-files:
- any-glob-to-any-file: 'tools/**'
"Area: CI":
- changed-files:
- any-glob-to-any-file: '.github/**'

10
.github/linters/setup.cfg vendored Normal file
View file

@ -0,0 +1,10 @@
[flake8]
ignore = W503,W605,E203,E704
max-complexity = 27
max-line-length = 125
multi_line_output=3
show-source = True
statistics = True
[isort]
profile = black

260
.github/workflows/arch.yml vendored Normal file
View file

@ -0,0 +1,260 @@
# Identify the Arch for the PR and select the applicable builds
name: Arch
on:
workflow_call:
inputs:
os:
description: "Operating System hosting the build: Linux, macOS or msys2"
required: true
type: string
boards:
description: "List of All Builds: [arm-01, risc-v-01, xtensa-01, ...]"
required: true
type: string
outputs:
skip_all_builds:
description: "Set to 1 if all builds should be skipped"
value: ${{ jobs.Select-Builds.outputs.skip_all_builds }}
selected_builds:
description: "Selected Builds for the PR: [arm-01, risc-v-01, xtensa-01, ...]"
value: ${{ jobs.Select-Builds.outputs.selected_builds }}
jobs:
Select-Builds:
runs-on: ubuntu-latest
outputs:
skip_all_builds: ${{ steps.select-builds.outputs.skip_all_builds }}
selected_builds: ${{ steps.select-builds.outputs.selected_builds }}
steps:
# Get the Arch for the PR: arm, arm64, risc-v, xtensa, ...
- name: Get arch
id: get-arch
run: |
# If PR is Not Created or Modified: Build all targets
pr=${{github.event.pull_request.number}}
if [[ "$pr" == "" ]]; then
echo "Not a Created or Modified PR, will build all targets"
exit
fi
# Ignore the Label "Area: Documentation", because it won't affect the Build Targets
query='.labels | map(select(.name != "Area: Documentation")) | '
select_name='.[].name'
select_length='length'
# Get the Labels for the PR: "Arch: risc-v \n Board: risc-v \n Size: XS"
# If GitHub CLI Fails: Build all targets
labels=$(gh pr view $pr --repo $GITHUB_REPOSITORY --json labels --jq "$query$select_name" || echo "")
numlabels=$(gh pr view $pr --repo $GITHUB_REPOSITORY --json labels --jq "$query$select_length" || echo "")
echo "labels=$labels"
echo "numlabels=$numlabels" | tee -a $GITHUB_OUTPUT
# Identify the Size, Arch and Board Labels
if [[ "$labels" == *"Size: "* ]]; then
echo 'labels_contain_size=1' | tee -a $GITHUB_OUTPUT
fi
if [[ "$labels" == *"Arch: "* ]]; then
echo 'labels_contain_arch=1' | tee -a $GITHUB_OUTPUT
fi
if [[ "$labels" == *"Board: "* ]]; then
echo 'labels_contain_board=1' | tee -a $GITHUB_OUTPUT
fi
# Get the Arch Label
if [[ "$labels" == *"Arch: arm64"* ]]; then
echo 'arch_contains_arm64=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Arch: arm"* ]]; then
echo 'arch_contains_arm=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Arch: risc-v"* ]]; then
echo 'arch_contains_riscv=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Arch: simulator"* ]]; then
echo 'arch_contains_sim=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Arch: x86_64"* ]]; then
echo 'arch_contains_x86_64=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Arch: x86"* ]]; then
echo 'arch_contains_x86=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Arch: xtensa"* ]]; then
echo 'arch_contains_xtensa=1' | tee -a $GITHUB_OUTPUT
fi
# Get the Board Label
if [[ "$labels" == *"Board: arm64"* ]]; then
echo 'board_contains_arm64=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Board: arm"* ]]; then
echo 'board_contains_arm=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Board: risc-v"* ]]; then
echo 'board_contains_riscv=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Board: simulator"* ]]; then
echo 'board_contains_sim=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Board: x86_64"* ]]; then
echo 'board_contains_x86_64=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Board: x86"* ]]; then
echo 'board_contains_x86=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Board: xtensa"* ]]; then
echo 'board_contains_xtensa=1' | tee -a $GITHUB_OUTPUT
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Select the Builds for the PR: arm-01, risc-v-01, xtensa-01, ...
- name: Select builds
id: select-builds
run: |
# Skip all macOS Builds
if [[ "${{ inputs.os }}" == "macOS" ]]; then
echo "Skipping all macOS Builds"
echo "skip_all_builds=1" | tee -a $GITHUB_OUTPUT
exit
fi
# Fetch the outputs from the previous step
numlabels=${{ steps.get-arch.outputs.numlabels }}
labels_contain_size=${{ steps.get-arch.outputs.labels_contain_size }}
labels_contain_arch=${{ steps.get-arch.outputs.labels_contain_arch }}
labels_contain_board=${{ steps.get-arch.outputs.labels_contain_board }}
arch_contains_arm=${{ steps.get-arch.outputs.arch_contains_arm }}
arch_contains_arm64=${{ steps.get-arch.outputs.arch_contains_arm64 }}
arch_contains_riscv=${{ steps.get-arch.outputs.arch_contains_riscv }}
arch_contains_sim=${{ steps.get-arch.outputs.arch_contains_sim }}
arch_contains_x86=${{ steps.get-arch.outputs.arch_contains_x86 }}
arch_contains_x86_64=${{ steps.get-arch.outputs.arch_contains_x86_64 }}
arch_contains_xtensa=${{ steps.get-arch.outputs.arch_contains_xtensa }}
board_contains_arm=${{ steps.get-arch.outputs.board_contains_arm }}
board_contains_arm64=${{ steps.get-arch.outputs.board_contains_arm64 }}
board_contains_riscv=${{ steps.get-arch.outputs.board_contains_riscv }}
board_contains_sim=${{ steps.get-arch.outputs.board_contains_sim }}
board_contains_x86=${{ steps.get-arch.outputs.board_contains_x86 }}
board_contains_x86_64=${{ steps.get-arch.outputs.board_contains_x86_64 }}
board_contains_xtensa=${{ steps.get-arch.outputs.board_contains_xtensa }}
# inputs.boards is a JSON Array: ["arm-01", "risc-v-01", "xtensa-01", ...]
# We compact and remove the newlines
boards=$( echo '${{ inputs.boards }}' | jq --compact-output ".")
numboards=$( echo "$boards" | jq "length" )
# We consider only Simple PRs with:
# Arch + Size Labels Only
# Board + Size Labels Only
# Arch + Board + Size Labels Only
if [[ "$labels_contain_size" != "1" ]]; then
echo "Size Label Missing, will build all targets"
quit=1
elif [[ "$numlabels" == "2" && "$labels_contain_arch" == "1" ]]; then
echo "Arch + Size Labels Only"
elif [[ "$numlabels" == "2" && "$labels_contain_board" == "1" ]]; then
echo "Board + Size Labels Only"
elif [[ "$numlabels" == "3" && "$labels_contain_arch" == "1" && "$labels_contain_board" == "1" ]]; then
# Arch and Board must be the same
if [[
"$arch_contains_arm" != "$board_contains_arm" ||
"$arch_contains_arm64" != "$board_contains_arm64" ||
"$arch_contains_riscv" != "$board_contains_riscv" ||
"$arch_contains_sim" != "$board_contains_sim" ||
"$arch_contains_x86" != "$board_contains_x86" ||
"$arch_contains_x86_64" != "$board_contains_x86_64" ||
"$arch_contains_xtensa" != "$board_contains_xtensa"
]]; then
echo "Arch and Board are not the same, will build all targets"
quit=1
else
echo "Arch + Board + Size Labels Only"
fi
else
echo "Not a Simple PR, will build all targets"
quit=1
fi
# If Not a Simple PR: Build all targets
if [[ "$quit" == "1" ]]; then
# If PR was Created or Modified: Include all boards
pr=${{github.event.pull_request.number}}
if [[ "$pr" != "" ]]; then
echo "Include all boards"
boards=$(
echo '${{ inputs.boards }}' |
jq --compact-output \
'.'
)
fi
echo "selected_builds=$boards" | tee -a $GITHUB_OUTPUT
exit
fi
# For every board
for (( i=0; i<numboards; i++ ))
do
# Fetch the board
board=$( echo "$boards" | jq ".[$i]" )
skip_build=0
# For "Arch / Board: arm": Build arm-01, arm-02, ...
if [[ "$arch_contains_arm" == "1" || "$board_contains_arm" == "1" ]]; then
if [[ "$board" != *"arm-"* ]]; then
skip_build=1
fi
# For "Arch / Board: arm64": Build arm64-01
elif [[ "$arch_contains_arm64" == "1" || "$board_contains_arm64" == "1" ]]; then
if [[ "$board" != *"arm64-"* ]]; then
skip_build=1
fi
# For "Arch / Board: risc-v": Build risc-v-01, risc-v-02, ...
elif [[ "$arch_contains_riscv" == "1" || "$board_contains_riscv" == "1" ]]; then
if [[ "$board" != *"risc-v-"* ]]; then
skip_build=1
fi
# For "Arch / Board: simulator": Build sim-01, sim-02
elif [[ "$arch_contains_sim" == "1" || "$board_contains_sim" == "1" ]]; then
if [[ "$board" != *"sim-"* ]]; then
skip_build=1
fi
# For "Arch / Board: x86": Build other
elif [[ "$arch_contains_x86" == "1" || "$board_contains_x86" == "1" ]]; then
if [[ "$board" != *"other"* ]]; then
skip_build=1
fi
# For "Arch / Board: x86_64": Build x86_64-01
elif [[ "$arch_contains_x86_64" == "1" || "$board_contains_x86_64" == "1" ]]; then
if [[ "$board" != *"x86_64-"* ]]; then
skip_build=1
fi
# For "Arch / Board: xtensa": Build xtensa-01, xtensa-02, xtensa-03
elif [[ "$arch_contains_xtensa" == "1" || "$board_contains_xtensa" == "1" ]]; then
if [[ "$board" != *"xtensa-"* ]]; then
skip_build=1
fi
# For Other Arch: Allow the build
else
echo Build by default: $board
fi
# Add the board to the selected builds
if [[ "$skip_build" == "0" ]]; then
echo Add $board to selected_builds
if [[ "$selected_builds" == "" ]]; then
selected_builds=$board
else
selected_builds=$selected_builds,$board
fi
fi
done
# Return the selected builds as JSON Array
# If Selected Builds is empty: Skip all builds
echo "selected_builds=[$selected_builds]" | tee -a $GITHUB_OUTPUT
if [[ "$selected_builds" == "" ]]; then
echo "skip_all_builds=1" | tee -a $GITHUB_OUTPUT
fi

View file

@ -16,15 +16,19 @@ on:
pull_request:
push:
branches:
- master
- 'releases/*'
tags:
permissions:
contents: read
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# Fetch the source from nuttx and nuttx-apps repos
Fetch-Source:
runs-on: ubuntu-latest
steps:
@ -59,13 +63,13 @@ jobs:
# Determine the repo and leave that unset to use the normal checkout behavior
# of using the merge commit instead of HEAD
case $GITHUB_REPOSITORY in
"apache/incubator-nuttx")
"apache/nuttx")
# OS
echo "Triggered by change in OS"
APPS_REF=$REF_NAME
;;
"apache/incubator-nuttx-apps" )
"apache/nuttx-apps" )
# APPS
OS_REF=$REF_NAME
echo "Triggered by change in APPS"
@ -77,13 +81,13 @@ jobs:
esac
fi
echo ::set-output name=os_ref::$OS_REF
echo ::set-output name=apps_ref::$APPS_REF
echo "os_ref=$OS_REF" >> $GITHUB_OUTPUT
echo "apps_ref=$APPS_REF" >> $GITHUB_OUTPUT
- name: Checkout nuttx repo
uses: actions/checkout@v2
uses: actions/checkout@v7
with:
repository: apache/incubator-nuttx
repository: apache/nuttx
ref: ${{ steps.gittargets.outputs.os_ref }}
path: sources/nuttx
fetch-depth: 1
@ -91,105 +95,390 @@ jobs:
run: git -C sources/nuttx fetch --tags
- name: Checkout apps repo
uses: actions/checkout@v2
uses: actions/checkout@v7
with:
repository: apache/incubator-nuttx-apps
repository: apache/nuttx-apps
ref: ${{ steps.gittargets.outputs.apps_ref }}
path: sources/apps
fetch-depth: 1
- name: Tar sources
run: tar zcf sources.tar.gz sources
- name: Archive Source Bundle
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v7.0.1
with:
name: source-bundle
path: sources.tar.gz
Linux:
# Select the Linux Builds based on PR Arch Label
Linux-Arch:
uses: apache/nuttx-apps/.github/workflows/arch.yml@master
needs: Fetch-Source
with:
os: Linux
boards: |
[
"arm-01", "risc-v-01", "sim-01", "xtensa-01", "arm64-01", "x86_64-01", "other",
"arm-02", "risc-v-02", "sim-02", "xtensa-02",
"arm-03", "risc-v-03", "sim-03", "xtensa-03",
"arm-04", "risc-v-04",
"arm-05", "risc-v-05",
"arm-06", "risc-v-06",
"arm-07", "arm-08", "arm-09", "arm-10", "arm-11", "arm-12", "arm-13", "arm-14"
]
# Run the selected Linux Builds
Linux:
needs: Linux-Arch
if: ${{ needs.Linux-Arch.outputs.skip_all_builds != '1' }}
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
# Documented sim/login CI test credential (not a production secret).
# Used when CONFIG_BOARD_ETC_ROMFS_PASSWD_ENABLE=y and defconfig omits
# the password. See nuttx tools/update_romfs_password.sh.
NUTTX_ROMFS_PASSWD_PASSWORD: NuttXSimLogin1!
strategy:
max-parallel: 12
matrix:
boards: [arm-01, arm-02, arm-03, arm-04, arm-05, arm-06, arm-07, arm-08, arm-09, arm-10, arm-11, arm-12, arm-13, other, risc-v, sim-01, sim-02, xtensa]
boards: ${{ fromJSON(needs.Linux-Arch.outputs.selected_builds) }}
steps:
- name: Show Disk Space
run: df -h
- name: Free Disk Space (Ubuntu)
run: |
sudo rm -rf /usr/local/lib/android
- name: After CLEAN-UP Disk Space
run: df -h
- name: Download Source Artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v8
with:
name: source-bundle
path: .
- name: Extract sources
run: tar zxf sources.tar.gz
- name: Docker Login
uses: azure/docker-login@v1
uses: docker/login-action@abd2ef45e78c5afb21d64d4ca52ee8550d9572c7 # v4.5.1
with:
login-server: ghcr.io
username: ${GITHUB_ACTOR}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Pull
run: docker pull ghcr.io/apache/incubator-nuttx/apache-nuttx-ci-linux
run: docker pull ghcr.io/apache/nuttx/apache-nuttx-ci-linux
- name: Export NuttX Repo SHA
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
- name: Run builds
uses: ./sources/nuttx/.github/actions/ci-container
env:
BLOBDIR: /tools/blobs
NUTTX_ROMFS_PASSWD_PASSWORD: NuttXSimLogin1!
with:
run: |
export NUTTX_ROMFS_PASSWD_PASSWORD=NuttXSimLogin1!
export ARTIFACTDIR=`pwd`/buildartifacts
for i in 1 2 3; do
python -m pip install \
--default-timeout=100 \
--retries 10 \
ntfc==0.0.1 && break
echo "Retry $i failed..."
sleep 5
done
mkdir /github/workspace/nuttx-ntfc
mkdir /github/workspace/nuttx-ntfc/external
cd /github/workspace/nuttx-ntfc
# get NTFC test cases
cd external
for i in 1 2 3 4 5; do
git clone -b release-0.0.1 https://github.com/apache/nuttx-ntfc-testing && break
if [ "$i" -eq 5 ]; then
echo "Failed to clone nuttx-ntfc-testing after $i attempts"
exit 1
fi
delay=$((i * 10))
echo "Clone attempt $i failed; retrying in ${delay}s..."
rm -rf nuttx-ntfc-testing
sleep "$delay"
done
mv nuttx-ntfc-testing nuttx-testing
export NTFCDIR=/github/workspace/nuttx-ntfc
echo "::add-matcher::sources/nuttx/.github/gcc.json"
git config --global --add safe.directory /github/workspace/sources/nuttx
git config --global --add safe.directory /github/workspace/sources/apps
cd /github/workspace/sources/nuttx/tools/ci
if [ "X${{matrix.boards}}" = "Xcodechecker" ]; then
./cibuild.sh -c -A -N -R --codechecker testlist/${{matrix.boards}}.dat
else
( sleep 7200 ; echo Killing pytest after timeout... ; pkill -f pytest )&
./cibuild.sh -c -A -N -R -S testlist/${{matrix.boards}}.dat
fi
- name: Post-build Disk Space
if: always()
run: df -h
- uses: actions/upload-artifact@v7.0.1
if: ${{ always() }}
with:
name: linux-${{matrix.boards}}-builds
path: buildartifacts/
continue-on-error: true
# Test the out-of-tree build
OOT-Build:
needs: Linux
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
steps:
- name: Download Source Artifact
uses: actions/download-artifact@v8
with:
name: source-bundle
path: .
- name: Extract sources
run: tar zxf sources.tar.gz
- name: Docker Login
uses: docker/login-action@abd2ef45e78c5afb21d64d4ca52ee8550d9572c7 # v4.5.1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Export NuttX Repo SHA
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
- name: Run Out-of-Tree Build Test
uses: ./sources/nuttx/.github/actions/ci-container
env:
BLOBDIR: /tools/blobs
with:
run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json"
export CCACHE_DIR=`pwd`/ccache
mkdir $CCACHE_DIR
export ARTIFACTDIR=`pwd`/buildartifacts
cd sources/nuttx/tools/ci
./cibuild.sh -A -c testlist/${{matrix.boards}}.dat
ccache -s
- uses: actions/upload-artifact@v2
git config --global --add safe.directory /github/workspace/sources/nuttx
git config --global --add safe.directory /github/workspace/sources/apps
cd sources/nuttx
./tools/ci/cibuild-oot.sh
- uses: actions/upload-artifact@v7.0.1
if: ${{ always() }}
with:
name: linux-builds
path: buildartifacts/
name: oot-build-artifacts
path: sources/apps/testing/cxx-oot-build
continue-on-error: true
macOS:
runs-on: macos-10.15
# Select the macOS Builds based on PR Arch Label
macOS-Arch:
uses: apache/nuttx-apps/.github/workflows/arch.yml@master
needs: Fetch-Source
with:
os: macOS
boards: |
["macos", "sim-01", "sim-02", "sim-03"]
# Run the selected macOS Builds
macOS:
permissions:
contents: none
runs-on: macos-15-intel
needs: macOS-Arch
if: ${{ needs.macOS-Arch.outputs.skip_all_builds != '1' }}
env:
NUTTX_ROMFS_PASSWD_PASSWORD: NuttXSimLogin1!
strategy:
max-parallel: 2
matrix:
boards: [macos, sim-01, sim-02]
boards: ${{ fromJSON(needs.macOS-Arch.outputs.selected_builds) }}
steps:
- name: Download Source Artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v8
with:
name: source-bundle
path: .
- name: Extract sources
run: tar zxf sources.tar.gz
- name: Restore Tools Cache
id: cache-tools
uses: actions/cache@v2
uses: actions/cache@v6
env:
cache-name: ${{ runner.os }}-cache-tools
with:
path: prebuilt
key: ${{ runner.os }}-tools-${{ hashFiles('./sources/nuttx/tools/ci/cibuild.sh') }}
path: ./sources/tools
key: ${{ runner.os }}-tools-${{ hashFiles('./sources/nuttx/tools/ci/platforms/darwin.sh') }}
- name: Export NuttX Repo SHA
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
# Released version of Cython has issues with Python 11. Set runner to use Python 3.10
# https://github.com/cython/cython/issues/4500
- uses: actions/setup-python@v7
with:
python-version: '3.10'
- name: Run Builds
run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json"
export CCACHE_DIR=`pwd`/ccache
mkdir $CCACHE_DIR
export NUTTX_ROMFS_PASSWD_PASSWORD=NuttXSimLogin1!
export ARTIFACTDIR=`pwd`/buildartifacts
cd sources/nuttx/tools/ci
./cibuild.sh -i -A -c testlist/${{matrix.boards}}.dat
ccache -s
- uses: actions/upload-artifact@v2
./cibuild.sh -i -c -A -R testlist/${{matrix.boards}}.dat
- uses: actions/upload-artifact@v7.0.1
with:
name: macos-builds
name: macos-${{matrix.boards}}-builds
path: buildartifacts/
continue-on-error: true
# Select the msys2 Builds based on PR Arch Label
msys2-Arch:
uses: apache/nuttx-apps/.github/workflows/arch.yml@master
needs: Fetch-Source
with:
os: msys2
boards: |
["msys2"]
# Run the selected msys2 Builds
msys2:
needs: msys2-Arch
if: ${{ needs.msys2-Arch.outputs.skip_all_builds != '1' }}
runs-on: windows-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
boards: ${{ fromJSON(needs.msys2-Arch.outputs.selected_builds) }}
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v7
- uses: msys2/setup-msys2@v2
with:
msystem: MSYS
update: false
cache: false
install: >-
base-devel
gcc
gperf
automake
autoconf
git
python3
ncurses-devel
unzip
zip
tio
zlib-devel
cmake
ninja
python-pip
vim
genromfs
- name: pip3 install
run: |
python3 -m venv --system-site-packages /usr/local
pip3 install --root-user-action=ignore --no-cache-dir pyelftools cxxfilt kconfiglib
- run: git config --global core.autocrlf false
- name: Download Source Artifact
uses: actions/download-artifact@v8
with:
name: source-bundle
path: .
- name: Extract sources
run: tar zxf sources.tar.gz
- name: Export NuttX Repo SHA
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
- name: Run Builds
run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json"
export ARTIFACTDIR=`pwd`/buildartifacts
git config --global --add safe.directory /github/workspace/sources/nuttx
git config --global --add safe.directory /github/workspace/sources/apps
cd sources/nuttx/tools/ci
./cibuild.sh -g -i -A -C -N -R testlist/${{matrix.boards}}.dat
- uses: actions/upload-artifact@v7.0.1
with:
name: msys2-${{matrix.boards}}-builds
path: buildartifacts/
continue-on-error: true
# Select the msvc Builds based on PR Arch Label
msvc-Arch:
uses: apache/nuttx-apps/.github/workflows/arch.yml@master
needs: Fetch-Source
with:
os: msvc
boards: |
["msvc_placeholder_with_sim_keyword"]
# Build with MSVC in Windows native
msvc:
needs: msvc-Arch
if: ${{ needs.msvc-Arch.outputs.skip_all_builds != '1' }}
runs-on: windows-2022
steps:
- uses: actions/checkout@v7
# Set up Python environment and install kconfiglib
- name: Set up Python and install kconfiglib
uses: actions/setup-python@v7
with:
python-version: '3.10'
- name: Install kconfiglib
run: |
pip install kconfiglib
- run: git config --global core.autocrlf false
- name: Download Source Artifact
uses: actions/download-artifact@v8
with:
name: source-bundle
path: .
- name: Extract sources
run: |
7z x sources.tar.gz -y
7z x sources.tar -y -snld
- name: Run Builds
run: |
"ARTIFACTDIR=${{github.workspace}}\sources\buildartifacts" >> $env:GITHUB_ENV
git config --global --add safe.directory ${{github.workspace}}\sources\nuttx
git config --global --add safe.directory ${{github.workspace}}\sources\apps
cd sources\nuttx\tools\ci
.\cibuild.ps1 -n -i -A -C -N testlist\windows.dat
- uses: actions/upload-artifact@v7.0.1
with:
name: msvc-builds
path: ./sources/buildartifacts/
continue-on-error: true

View file

@ -19,30 +19,36 @@ concurrency:
group: check-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Checkout nuttx repo
uses: actions/checkout@v2
uses: actions/checkout@v7
with:
repository: apache/incubator-nuttx
repository: apache/nuttx
path: nuttx
fetch-depth: 0
- name: Checkout apps repo
uses: actions/checkout@v2
uses: actions/checkout@v7
with:
repository: apache/incubator-nuttx-apps
repository: apache/nuttx-apps
path: apps
fetch-depth: 0
- name: Check Pull Request
run: |
echo "::add-matcher::nuttx/.github/nxstyle.json"
python3 -m venv .venv
source .venv/bin/activate
pip install codespell cmake-format black isort flake8 cvt2utf
cd apps
commits="${{ github.event.pull_request.base.sha }}..HEAD"
git log --oneline $commits
echo "../nuttx/tools/checkpatch.sh -g $commits"
../nuttx/tools/checkpatch.sh -g $commits
echo "../nuttx/tools/checkpatch.sh -c -u -m -g $commits"
../nuttx/tools/checkpatch.sh -c -u -m -g $commits

53
.github/workflows/issue_labeler.yml vendored Normal file
View file

@ -0,0 +1,53 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Issue Labeler
on:
issues:
types: [opened]
jobs:
label:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add labels issues automatically based on their body.
uses: actions/github-script@v9.0.0
with:
script: |
const body = context.payload.issue.body;
const bodySplit = body.split(/\[|\]/).map(e => e.toLowerCase());
const oskeywords = ['os: other', 'os: bsd', 'os: linux', 'os: mac', 'os: windows'];
const archkeywords1 = ['arch: all', 'arch: arm', 'arch: arm64', 'arch: avr', 'arch: ceva'];
const archkeywords2 = ['arch: hc', 'arch: mips', 'arch: misoc', 'arch: openrisc', 'arch:renesas'];
const archkeywords3 = ['arch: risc-v', 'arch: simulator', 'arch: sparc', 'arch: tricore'];
const archkeywords4 = ['arch: x86', 'arch: x86_64', 'arch: xtensa', 'arch: z16', 'arch: z80', 'arch:renesas'];
const areakeywords1 = ['area: applications', 'area: api', 'area: board support', 'area: build system'];
const areakeywords2 = ['area: configuring', 'area: debugging', 'area: drivers', 'area: file system', 'area: installing', 'area: kconfig'];
const areakeywords3 = ['area: kernel', 'area: memory management', 'area: native port', 'area: networking'];
const areakeywords4 = ['area: os components', 'area: posix', 'area: sensors', 'area: specific peripheral'];
var keywordsfound = new Set();
for (const keyword of keywords) {
if (bodySplit.includes(keyword)) {
keywordsfound.add(keyword)
}
}
if (keywordsfound.size !== 0) {
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: Array.from(keywordsfound)
})
}

150
.github/workflows/labeler.yml vendored Normal file
View file

@ -0,0 +1,150 @@
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This workflow will fetch the updated PR filenames, compute the Size Label
# and Arch Labels, then save the PR Labels into a PR Artifact. The
# PR Labels will be written to the PR inside the "workflow_run" trigger
# (pr_labeler.yml), because this "pull_request" trigger has read-only
# permission. Don't use "pull_request_target", it's unsafe.
# See https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=321719166#GitHubActionsSecurity-Buildstriggeredwithpull_request_target
name: "Pull Request Labeler"
on:
- pull_request
jobs:
labeler:
permissions:
contents: read
pull-requests: read
issues: read
runs-on: ubuntu-latest
steps:
# Checkout one file from our trusted source: .github/labeler.yml
# Never checkout and execute any untrusted code from the PR.
- name: Checkout labeler config
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: apache/nuttx-apps
ref: master
path: labeler
fetch-depth: 1
persist-credentials: false
sparse-checkout: .github/labeler.yml
sparse-checkout-cone-mode: false
# Fetch the updated PR filenames. Compute the Size Label and Arch Labels.
- name: Compute PR labels
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const pull_number = context.issue.number;
// Fetch the array of updated PR filenames:
// { status: 'added', filename: 'arch/arm/test.txt', additions: 3, deletions: 0, changes: 3 }
// { status: 'removed', filename: 'Documentation/legacy_README.md', additions: 0, deletions: 2531, changes: 2531 }
// { status: 'modified', filename: 'Documentation/security.rst', additions: 1, deletions: 0, changes: 1 }
const listFilesOptions = github.rest.pulls.listFiles
.endpoint.merge({ owner, repo, pull_number });
const listFilesResponse = await github.paginate(listFilesOptions);
// Sum up the number of lines changed
const sizeFiles = listFilesResponse
.filter(f => (f.status != 'removed')); // Ignore deleted files
var linesChanged = 0;
for (const file of sizeFiles) {
linesChanged += file.changes;
}
console.log({ linesChanged });
// Compute the Size Label
const sizeLabel =
(linesChanged <= 10) ? 'Size: XS'
: (linesChanged <= 100) ? 'Size: S'
: (linesChanged <= 500) ? 'Size: M'
: (linesChanged <= 1000) ? 'Size: L'
: 'Size: XL';
var prLabels = [ sizeLabel ];
// Parse the Arch Label Patterns in .github/labeler.yml. Condense into:
// "Arch: arm":
// - any-glob-to-any-file: 'arch/arm/**'
// - any-glob-to-any-file: ...
const fs = require('fs');
const config = fs.readFileSync('labeler/.github/labeler.yml', 'utf8')
.split('\n') // Split by newline
.map(s => s.trim()) // Remove leading and trailing spaces
.filter(s => (s != '')) // Remove empty lines
.filter(s => !s.startsWith('#')) // Remove comments
.filter(s => !s.startsWith('- changed-files:')); // Remove "changed-files"
// Convert the Arch Label Patterns from config to archLabels.
// archLabels will contain the mappings for Arch Label and Filename Pattern:
// { label: "Arch: arm", pattern: "arch/arm/.*" },
// { label: "Arch: arm64", pattern: "arch/arm64/.*" }, ...
var archLabels = [];
var label = "";
for (const c of config) {
// Get the Arch Label
if (c.startsWith('"')) { // "Arch: arm":
label = c.split('"')[1]; // Arch: arm
} else if (c.startsWith('- any-glob-to-any-file:')) { // - any-glob-to-any-file: 'arch/arm/**'
// Convert the Glob Pattern to Regex Pattern
const pattern = c.split("'")[1] // arch/arm/**
.split('.').join('\\.') // . becomes \.
.split('*').join('[^/]*') // * becomes [^/]*
.split('[^/]*[^/]*').join('.*'); // ** becomes .*
archLabels.push({
label, // Arch: arm
pattern: '^' + pattern + '$' // Match the Line Start and Line End
});
} else {
// We don't support all rules of `actions/labeler`
throw new Error('.github/labeler.yml should contain only changed-files and any-glob-to-any-file, not: ' + c);
}
}
// Search the filenames for matching Arch Labels
for (const archLabel of archLabels) {
if (prLabels.includes(archLabel.label)) {
break;
}
for (const file of listFilesResponse) {
const re = new RegExp(archLabel.pattern);
const match = re.test(file.filename);
if (match && !prLabels.includes(archLabel.label)) {
prLabels.push(archLabel.label);
break;
}
}
}
console.log({ prLabels });
// Save the PR Number and PR Labels into a PR Artifact
// e.g. 'Size: XS\nArch: avr\n'
const dir = 'pr';
fs.mkdirSync(dir);
fs.writeFileSync(dir + '/pr-id.txt', pull_number + '\n');
fs.writeFileSync(dir + '/pr-labels.txt', prLabels.join('\n') + '\n');
# Upload the PR Artifact as pr.zip
- name: Upload PR artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr
path: pr/

View file

@ -1,4 +1,4 @@
name: ❄️ Lint
name: Lint
on: [pull_request]
@ -6,14 +6,29 @@ concurrency:
group: lint-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
yamllint:
name: 🍺 YAML
lint:
permissions:
contents: read # for actions/checkout to fetch code
statuses: write # for github/super-linter to mark status of each linter run
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🧹 YAML Lint
uses: github/super-linter@v4
- uses: actions/checkout@v7
with:
fetch-depth: 0
- run: mkdir super-linter.report
- name: Lint
uses: github/super-linter@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: false
VALIDATE_PYTHON_BLACK: true
VALIDATE_PYTHON_FLAKE8: true
PYTHON_FLAKE8_CONFIG_FILE: setup.cfg
VALIDATE_PYTHON_ISORT: true
PYTHON_ISORT_CONFIG_FILE: setup.cfg
VALIDATE_YAML: true
FILTER_REGEX_INCLUDE: .*\.github/.*

90
.github/workflows/pr_labeler.yml vendored Normal file
View file

@ -0,0 +1,90 @@
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This workflow will fetch the PR Labels from the PR Artifact, and write
# the PR Labels into the PR. The workflow is called after the
# "pull_request" trigger (labeler.yml). This "workflow_run" trigger uses a
# GitHub Token with Write Permission, so we must never run any untrusted
# code from the PR, and we must always extract and use the PR Artifact
# safely. See https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=321719166#GitHubActionsSecurity-Buildstriggeredwithworkflow_run
name: "Set Pull Request Labels"
on:
workflow_run:
workflows: ["Pull Request Labeler"]
types:
- completed
jobs:
pr_labeler:
permissions:
contents: read
pull-requests: write
issues: write
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
# Download the PR Artifact, containing PR Number and PR Labels
- name: Download PR artifact
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
});
const matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
const fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
# Unzip the PR Artifact
- name: Unzip PR artifact
run: unzip pr.zip
# Write the PR Labels into the PR
- name: Write PR labels
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const fs = require('fs');
// Read the PR Number and PR Labels from the PR Artifact
// e.g. 'Size: XS\nArch: avr\n'
const issue_number = Number(fs.readFileSync('pr-id.txt'));
const labels = fs.readFileSync('pr-labels.txt', 'utf8')
.split('\n') // Split by newline
.filter(s => (s != '')); // Remove empty lines
console.log({ issue_number, labels });
// Write the PR Labels into the PR
// e.g. [ 'Size: XS', 'Arch: avr' ]
await github.rest.issues.setLabels({
owner,
repo,
issue_number,
labels
});

23
.gitignore vendored
View file

@ -1,30 +1,51 @@
*.a
*.dbo
*.dba
*.adb
*.asm
*.d
*.dSYM
*.exe
*.gcno
*.gcda
*.hobj
*.i
*.inf
*.lib
*.lst
*.o
*.wo
*.obj
*.rel
*.src
*.swp
*.sym
*.su
*.map
*~
.built
.context
.depend
.kconfig
*.lock
/bin
/bin_debug
/boot_romfsimg.h
/external
/Kconfig
/romfs.img
/staging
/symtab_apps.c
/wasm
cscope.out
Make.dep
.context
# nuttx/$(TOPDIR)/Makefile.[unix|win]::$(DIRLINKS_EXTERNAL_DIRS)
.dirlinks
.vscode
.DS_Store
build
.ccls-cache
compile_commands.json
.aider*
.clang-format
.cache

View file

@ -1,6 +1,8 @@
############################################################################
# apps/Application.mk
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
@ -23,12 +25,18 @@
# has the value "m"
ifneq ($(MAINSRC),)
ifeq ($(MODULE),m)
BUILD_MODULE = y
endif
ifeq ($(CONFIG_BUILD_KERNEL),y)
ifeq ($(DYNLIB),y)
BUILD_MODULE = y
MODAELFFLAGS = $(CMODULELFFLAGS)
MODCFLAGS = $(CMODULEFLAGS)
MODCXXFLAGS = $(CXXMODULEFLAGS)
MODLDFLAGS = $(LDMODULEFLAGS)
else ifneq ($(or $(filter y,$(CONFIG_BUILD_KERNEL)), $(filter m,$(MODULE))),)
BUILD_MODULE = y
MODAELFFLAGS = $(AELFFLAGS)
MODCFLAGS = $(CELFFLAGS)
MODCXXFLAGS = $(CXXELFFLAGS)
MODLDFLAGS = $(LDELFFLAGS)
endif
endif
@ -37,16 +45,18 @@ endif
# we need to fix up the path so the DELIM will match the actual delimiter.
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
CWD = $(strip ${shell echo %CD% | cut -d: -f2})
CWD = $(strip ${shell echo %CD% | cut -d: -f2})
else
CWD = $(CURDIR)
CWD = $(CURDIR)
endif
# Add the static application library to the linked libraries. Don't do this
# with CONFIG_BUILD_KERNEL as there is no static app library
ifneq ($(CONFIG_BUILD_KERNEL),y)
LDLIBS += $(call CONVERT_PATH,$(BIN))
endif
SUFFIX ?= $(subst $(DELIM),.,$(CWD))
PROGNAME := $(subst ",,$(PROGNAME))
# Add the static application library to the linked libraries.
LDLIBS += $(call CONVERT_PATH,$(BIN))
# When building a module, link with the compiler runtime.
# This should be linked after libapps. Consider that mbedtls in libapps
@ -55,39 +65,125 @@ ifeq ($(BUILD_MODULE),y)
# Revisit: This only works for gcc and clang.
# Do other compilers have similar?
COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name)
ifneq ($(COMPILER_RT_LIB),)
LDLIBS += $(COMPILER_RT_LIB)
ifeq ($(wildcard $(COMPILER_RT_LIB)),)
# if "--print-libgcc-file-name" unable to find the correct libgcc PATH
# then go ahead and try "--print-file-name"
COMPILER_RT_LIB := $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name $(notdir $(COMPILER_RT_LIB))))
endif
LDLIBS += $(COMPILER_RT_LIB)
endif
SUFFIX = $(subst $(DELIM),.,$(CWD))
PROGNAME := $(shell echo $(PROGNAME))
# Apps compilation can achieve out-of-tree intermediate products
# by specifying "PREFIX" to a directory in its own Makefile.
# Default value is NULL,
# Make sure the out-of-tree directory exists and ends with $(DELIM) when setting it.
PREFIX ?=
# Object files
RASRCS = $(filter %.s,$(ASRCS))
CASRCS = $(filter %.S,$(ASRCS))
RAOBJS = $(RASRCS:=$(SUFFIX)$(OBJEXT))
CAOBJS = $(CASRCS:=$(SUFFIX)$(OBJEXT))
COBJS = $(CSRCS:=$(SUFFIX)$(OBJEXT))
CXXOBJS = $(CXXSRCS:=$(SUFFIX)$(OBJEXT))
RUSTOBJS = $(RUSTSRCS:=$(SUFFIX)$(OBJEXT))
RAOBJS = $(RASRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
CAOBJS = $(CASRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
COBJS = $(CSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
CXXOBJS = $(CXXSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
RUSTOBJS = $(RUSTSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
ZIGOBJS = $(ZIGSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
DOBJS = $(DSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
SWIFTOBJS = $(SWIFTSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
MAINCXXSRCS = $(filter %$(CXXEXT),$(MAINSRC))
MAINCSRCS = $(filter %.c,$(MAINSRC))
MAINRUSTSRCS = $(filter %$(RUSTEXT),$(MAINSRC))
MAINCXXOBJ = $(MAINCXXSRCS:=$(SUFFIX)$(OBJEXT))
MAINCOBJ = $(MAINCSRCS:=$(SUFFIX)$(OBJEXT))
MAINRUSTOBJ = $(MAINRUSTSRCS:=$(SUFFIX)$(OBJEXT))
MAINZIGSRCS = $(filter %$(ZIGEXT),$(MAINSRC))
MAINDSRCS = $(filter %$(DEXT),$(MAINSRC))
MAINSWIFTSRCS = $(filter %$(SWIFTEXT),$(MAINSRC))
MAINCXXOBJ = $(MAINCXXSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
MAINCOBJ = $(MAINCSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
MAINRUSTOBJ = $(MAINRUSTSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
MAINZIGOBJ = $(MAINZIGSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
MAINDOBJ = $(MAINDSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
MAINSWIFTOBJ = $(MAINSWIFTSRCS:%=$(PREFIX)%$(SUFFIX)$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) $(MAINSRC)
OBJS = $(RAOBJS) $(CAOBJS) $(COBJS) $(CXXOBJS) $(RUSTOBJS)
OBJS = $(RAOBJS) $(CAOBJS) $(COBJS) $(CXXOBJS) $(RUSTOBJS) $(ZIGOBJS) $(DOBJS) $(SWIFTOBJS) $(EXTOBJS)
ifneq ($(BUILD_MODULE),y)
OBJS += $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ)
OBJS += $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ) $(MAINZIGOBJ) $(MAINDOBJ) $(MAINSWIFTOBJ)
endif
ifneq ($(strip $(PROGNAME)),)
PROGOBJ := $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ) $(MAINZIGOBJ) $(MAINDOBJ) $(MAINSWIFTOBJ)
PROGLIST := $(addprefix $(BINDIR)$(DELIM),$(PROGNAME))
REGLIST := $(addprefix $(BUILTIN_REGISTRY)$(DELIM),$(addsuffix .bdat,$(PROGNAME)))
NLIST := $(shell seq 1 $(words $(PROGNAME)))
$(foreach i, $(NLIST), \
$(eval PROGNAME_$(word $i,$(PROGOBJ)) := $(word $i,$(PROGNAME))) \
$(eval PROGSYM_$(word $i,$(PROGOBJ)) := $(subst -,_,$(word $i,$(PROGNAME)))) \
$(eval PROGOBJ_$(word $i,$(PROGLIST)) := $(word $i,$(PROGOBJ))) \
$(eval PRIORITY_$(word $i,$(REGLIST)) := \
$(if $(word $i,$(PRIORITY)),$(word $i,$(PRIORITY)),$(lastword $(PRIORITY)))) \
$(eval STACKSIZE_$(word $i,$(REGLIST)) := \
$(if $(word $i,$(STACKSIZE)),$(word $i,$(STACKSIZE)),$(lastword $(STACKSIZE)))) \
$(eval UID_$(word $i,$(REGLIST)) := \
$(if $(word $i,$(UID)),$(word $i,$(UID)),$(lastword $(UID)))) \
$(eval GID_$(word $i,$(REGLIST)) := \
$(if $(word $i,$(GID)),$(word $i,$(GID)),$(lastword $(GID)))) \
$(eval MODE_$(word $i,$(REGLIST)) := \
$(if $(word $i,$(MODE)),$(word $i,$(MODE)),$(lastword $(MODE)))) \
$(eval STACKSIZE_$(word $i,$(PROGLIST)) := $(STACKSIZE_$(word $i,$(REGLIST)))) \
$(eval PRIORITY_$(word $i,$(PROGLIST)) := $(PRIORITY_$(word $i,$(REGLIST)))) \
$(eval UID_$(word $i,$(PROGLIST)) := $(UID_$(word $i,$(REGLIST)))) \
$(eval GID_$(word $i,$(PROGLIST)) := $(GID_$(word $i,$(REGLIST)))) \
$(eval MODE_$(word $i,$(PROGLIST)) := $(MODE_$(word $i,$(REGLIST)))) \
)
# Emit the application's configured attributes as absolute ELF symbols
# (nx_stacksize, nx_priority, and nx_uid/nx_gid/nx_mode under
# CONFIG_SCHED_USER_IDENTITY) so the binary loader can recover them.
# Per-target so each PROGLIST entry picks up its own STACKSIZE_/PRIORITY_.
$(PROGLIST): MODLDFLAGS += \
$(if $(STACKSIZE_$@),--defsym nx_stacksize=$(STACKSIZE_$@)) \
$(if $(filter-out SCHED_PRIORITY_DEFAULT,$(PRIORITY_$@)),--defsym nx_priority=$(PRIORITY_$@))
ifeq ($(CONFIG_SCHED_USER_IDENTITY),y)
$(PROGLIST): MODLDFLAGS += \
$(if $(UID_$@),--defsym nx_uid=$(UID_$@)) \
$(if $(GID_$@),--defsym nx_gid=$(GID_$@)) \
$(if $(MODE_$@),--defsym nx_mode=$(MODE_$@))
endif
# Keep the attribute symbols through --strip-unneeded so the binary loader
# can still read them from the stripped runtime image in bin/.
$(PROGLIST): NX_KEEP = $(if $(STACKSIZE_$@),-K nx_stacksize) $(if $(filter-out SCHED_PRIORITY_DEFAULT,$(PRIORITY_$@)),-K nx_priority) $(if $(UID_$@),-K nx_uid) $(if $(GID_$@),-K nx_gid) $(if $(MODE_$@),-K nx_mode)
endif
# Condition flags
DO_REGISTRATION ?= y
ifeq ($(PROGNAME),)
DO_REGISTRATION = n
endif
ifeq ($(WASM_BUILD),y)
DO_REGISTRATION = n
endif
ifeq ($(BUILD_MODULE),y)
DO_REGISTRATION = n
endif
# Compile flags, notice the default flags only suitable for flat build
ZIGELFFLAGS ?= $(ZIGFLAGS)
RUSTELFFLAGS ?= $(RUSTFLAGS)
DELFFLAGS ?= $(DFLAGS)
SWIFTELFFLAGS ?= $(SWIFTFLAGS)
DEPPATH += --dep-path .
DEPPATH += --obj-path .
@ -95,141 +191,239 @@ VPATH += :.
# Targets follow
all:: $(OBJS)
all:: $(PREFIX).built
@:
.PHONY: clean depend distclean
.PRECIOUS: $(BIN)
define ELFASSEMBLE
@echo "AS: $1"
$(Q) $(CC) -c $(AELFFLAGS) $($(strip $1)_AELFFLAGS) $1 -o $2
$(ECHO_BEGIN)"AS: $1 "
$(Q) $(MODULECC) -c $(MODAELFFLAGS) $($(strip $1)_AELFFLAGS) $1 -o $2
$(ECHO_END)
endef
define ELFCOMPILE
@echo "CC: $1"
$(Q) $(CC) -c $(CELFFLAGS) $($(strip $1)_CELFFLAGS) $1 -o $2
$(ECHO_BEGIN)"CC: $1 "
$(Q) $(MODULECC) -c $(MODCFLAGS) $($(strip $1)_CELFFLAGS) $1 -o $2
$(ECHO_END)
endef
define ELFCOMPILEXX
@echo "CXX: $1"
$(Q) $(CXX) -c $(CXXELFFLAGS) $($(strip $1)_CXXELFFLAGS) $1 -o $2
$(ECHO_BEGIN)"CXX: $1 "
$(Q) $(CXX) -c $(MODCXXFLAGS) $($(strip $1)_CXXELFFLAGS) $1 -o $2
$(ECHO_END)
endef
define ELFCOMPILERUST
@echo "RUSTC: $1"
$(ECHO_BEGIN)"RUSTC: $1 "
$(Q) $(RUSTC) --emit obj $(RUSTELFFLAGS) $($(strip $1)_RUSTELFFLAGS) $1 -o $2
$(ECHO_END)
endef
# Remove target suffix here since zig compiler add .o automatically
define ELFCOMPILEZIG
$(ECHO_BEGIN)"ZIG: $1 "
$(Q) $(ZIG) build-obj $(ZIGELFFLAGS) $($(strip $1)_ZIGELFFLAGS) --name $(basename $2) $1
$(ECHO_END)
endef
define ELFCOMPILED
$(ECHO_BEGIN)"DC: $1 "
$(Q) $(DC) -c $(DELFFLAGS) $($(strip $1)_DELFFLAGS) $1 -of $2
$(ECHO_END)
endef
define ELFCOMPILESWIFT
$(ECHO_BEGIN)"SWIFTC: $1 "
$(Q) $(SWIFTC) -c $(SWIFTELFFLAGS) $($(strip $1)_SWIFTELFFLAGS) $1 -o $2
$(ECHO_END)
endef
define ELFLD
@echo "LD: $2"
$(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) $(ARCHCRT0OBJ) $1 $(LDLIBS) -o $2
$(ECHO_BEGIN)"LD: $2 "
$(Q) $(MODULELD) $(MODLDFLAGS) $(LDMAP) $(LDLIBPATH) $(ARCHCRT0OBJ) $1 $(LDSTARTGROUP) $(LDLIBS) $(LDENDGROUP) -o $2
$(ECHO_END)
endef
$(RAOBJS): %.s$(SUFFIX)$(OBJEXT): %.s
$(if $(and $(CONFIG_BUILD_LOADABLE),$(AELFFLAGS)), \
# rename "main()" in $1 to "xxx_main()" and save to $2
define RENAMEMAIN
$(ECHO_BEGIN)"Rename main() in $1 and save to $2"
$(Q) ${shell cat $1 | sed -e "s/fn[ ]\+main/fn $(addsuffix _main,$(PROGSYM_$@))/" > $2}
$(ECHO_END)
endef
$(RAOBJS): $(PREFIX)%.s$(SUFFIX)$(OBJEXT): %.s
$(if $(and $(CONFIG_MODULES),$(MODAELFFLAGS)), \
$(call ELFASSEMBLE, $<, $@), $(call ASSEMBLE, $<, $@))
$(CAOBJS): %.S$(SUFFIX)$(OBJEXT): %.S
$(if $(and $(CONFIG_BUILD_LOADABLE),$(AELFFLAGS)), \
$(CAOBJS): $(PREFIX)%.S$(SUFFIX)$(OBJEXT): %.S
$(if $(and $(CONFIG_MODULES),$(MODAELFFLAGS)), \
$(call ELFASSEMBLE, $<, $@), $(call ASSEMBLE, $<, $@))
$(COBJS): %.c$(SUFFIX)$(OBJEXT): %.c
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CELFFLAGS)), \
$(COBJS): $(PREFIX)%.c$(SUFFIX)$(OBJEXT): %.c
$(if $(and $(CONFIG_MODULES),$(MODCFLAGS)), \
$(call ELFCOMPILE, $<, $@), $(call COMPILE, $<, $@))
$(CXXOBJS): %$(CXXEXT)$(SUFFIX)$(OBJEXT): %$(CXXEXT)
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CXXELFFLAGS)), \
$(CXXOBJS): $(PREFIX)%$(CXXEXT)$(SUFFIX)$(OBJEXT): %$(CXXEXT)
$(if $(and $(CONFIG_MODULES),$(MODCXXFLAGS)), \
$(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@))
$(RUSTOBJS): %$(RUSTEXT)$(SUFFIX)$(OBJEXT): %$(RUSTEXT)
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CELFFLAGS)), \
$(RUSTOBJS): $(PREFIX)%$(RUSTEXT)$(SUFFIX)$(OBJEXT): %$(RUSTEXT)
$(if $(and $(CONFIG_MODULES),$(CELFFLAGS)), \
$(call ELFCOMPILERUST, $<, $@), $(call COMPILERUST, $<, $@))
archive:
$(call ARCHIVE_ADD, $(call CONVERT_PATH,$(BIN)), $(OBJS))
$(ZIGOBJS): $(PREFIX)%$(ZIGEXT)$(SUFFIX)$(OBJEXT): %$(ZIGEXT)
$(if $(and $(CONFIG_MODULES), $(CELFFLAGS)), \
$(call ELFCOMPILEZIG, $<, $@), $(call COMPILEZIG, $<, $@))
$(DOBJS): $(PREFIX)%$(DEXT)$(SUFFIX)$(OBJEXT): %$(DEXT)
$(if $(and $(CONFIG_MODULES), $(CELFFLAGS)), \
$(call ELFCOMPILED, $<, $@), $(call COMPILED, $<, $@))
$(SWIFTOBJS): $(PREFIX)%$(SWIFTEXT)$(SUFFIX)$(OBJEXT): %$(SWIFTEXT)
$(if $(and $(CONFIG_MODULES), $(CELFFLAGS)), \
$(call ELFCOMPILESWIFT, $<, $@), $(call COMPILESWIFT, $<, $@))
AROBJS :=
ifneq ($(OBJS),)
SORTOBJS := $(sort $(OBJS))
$(eval $(call SPLITVARIABLE,OBJS_SPILT,$(SORTOBJS),100))
$(foreach BATCH, $(OBJS_SPILT_TOTAL), \
$(foreach obj, $(OBJS_SPILT_$(BATCH)), \
$(eval substitute := $(patsubst %$(OBJEXT),%_$(BATCH)$(OBJEXT),$(obj))) \
$(eval AROBJS += $(substitute)) \
$(eval $(call AROBJSRULES, $(substitute),$(obj))) \
) \
)
endif
$(PREFIX).built: $(AROBJS)
$(call SPLITVARIABLE,ALL_OBJS,$(AROBJS),100)
$(foreach BATCH, $(ALL_OBJS_TOTAL), \
$(if $(strip $(ALL_OBJS_$(BATCH))), \
$(shell $(call ARLOCK, $(call CONVERT_PATH,$(BIN)), $(ALL_OBJS_$(BATCH)))) \
) \
)
$(Q) touch $@
ifeq ($(BUILD_MODULE),y)
$(MAINCXXOBJ): %$(CXXEXT)$(SUFFIX)$(OBJEXT): %$(CXXEXT)
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CXXELFFLAGS)), \
$(MAINCXXOBJ): $(PREFIX)%$(CXXEXT)$(SUFFIX)$(OBJEXT): %$(CXXEXT)
$(if $(and $(CONFIG_MODULES),$(MODCXXFLAGS)), \
$(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@))
$(MAINCOBJ): %.c$(SUFFIX)$(OBJEXT): %.c
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CELFFLAGS)), \
$(MAINCOBJ): $(PREFIX)%.c$(SUFFIX)$(OBJEXT): %.c
$(if $(and $(CONFIG_MODULES),$(MODCFLAGS)), \
$(call ELFCOMPILE, $<, $@), $(call COMPILE, $<, $@))
PROGLIST := $(wordlist 1,$(words $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ)),$(PROGNAME))
PROGLIST := $(addprefix $(BINDIR)$(DELIM),$(PROGLIST))
PROGOBJ := $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ)
$(MAINZIGOBJ): $(PREFIX)%$(ZIGEXT)$(SUFFIX)$(OBJEXT): %$(ZIGEXT)
$(if $(and $(CONFIG_MODULES),$(CELFFLAGS)), \
$(call ELFCOMPILEZIG, $<, $@), $(call COMPILEZIG, $<, $@))
$(PROGLIST): $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ)
$(MAINDOBJ): $(PREFIX)%$(DEXT)$(SUFFIX)$(OBJEXT): %$(DEXT)
$(if $(and $(CONFIG_MODULES),$(CELFFLAGS)), \
$(call ELFCOMPILED, $<, $@), $(call COMPILED, $<, $@))
$(MAINSWIFTOBJ): $(PREFIX)%$(SWIFTEXT)$(SUFFIX)$(OBJEXT): %$(SWIFTEXT)
$(if $(and $(CONFIG_MODULES),$(CELFFLAGS)), \
$(call ELFCOMPILESWIFT, $<, $@), $(call COMPILESWIFT, $<, $@))
$(PROGLIST): $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ) $(MAINZIGOBJ) $(MAINDOBJ) $(MAINSWIFTOBJ)
$(Q) mkdir -p $(BINDIR)
$(call ELFLD,$(firstword $(PROGOBJ)),$(call CONVERT_PATH,$(firstword $(PROGLIST))))
$(Q) chmod +x $(firstword $(PROGLIST))
ifneq ($(CONFIG_DEBUG_SYMBOLS),y)
$(Q) $(STRIP) $(firstword $(PROGLIST))
$(call ELFLD, $(PROGOBJ_$@), $(call CONVERT_PATH,$@))
$(Q) chmod +x $@
ifneq ($(CONFIG_DEBUG_SYMBOLS),)
$(Q) mkdir -p $(BINDIR_DEBUG)
$(Q) cp $@ $(BINDIR_DEBUG)
$(Q) $(MODULESTRIP) $(NX_KEEP) $@
endif
$(eval PROGLIST=$(filter-out $(firstword $(PROGLIST)),$(PROGLIST)))
$(eval PROGOBJ=$(filter-out $(firstword $(PROGOBJ)),$(PROGOBJ)))
install:: $(PROGLIST)
@:
else
MAINNAME := $(addsuffix _main,$(PROGNAME))
$(MAINCXXOBJ): %$(CXXEXT)$(SUFFIX)$(OBJEXT): %$(CXXEXT)
$(eval $<_CXXFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(firstword $(MAINNAME))})
$(eval $<_CXXELFFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(firstword $(MAINNAME))})
$(eval MAINNAME=$(filter-out $(firstword $(MAINNAME)),$(MAINNAME)))
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CXXELFFLAGS)), \
$(MAINCXXOBJ): $(PREFIX)%$(CXXEXT)$(SUFFIX)$(OBJEXT): %$(CXXEXT)
$(eval $<_CXXFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(addsuffix _main,$(PROGSYM_$@))})
$(eval $<_CXXELFFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(addsuffix _main,$(PROGSYM_$@))})
$(if $(and $(CONFIG_MODULES),$(MODCXXFLAGS)), \
$(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@))
$(MAINCOBJ): %.c$(SUFFIX)$(OBJEXT): %.c
$(eval $<_CFLAGS += ${shell $(DEFINE) "$(CC)" main=$(firstword $(MAINNAME))})
$(eval $<_CELFFLAGS += ${shell $(DEFINE) "$(CC)" main=$(firstword $(MAINNAME))})
$(eval MAINNAME=$(filter-out $(firstword $(MAINNAME)),$(MAINNAME)))
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CELFFLAGS)), \
$(MAINCOBJ): $(PREFIX)%.c$(SUFFIX)$(OBJEXT): %.c
$(eval $<_CFLAGS += ${DEFINE_PREFIX}main=$(addsuffix _main,$(PROGSYM_$@)))
$(eval $<_CELFFLAGS += ${DEFINE_PREFIX}main=$(addsuffix _main,$(PROGSYM_$@)))
$(if $(and $(CONFIG_MODULES),$(MODCFLAGS)), \
$(call ELFCOMPILE, $<, $@), $(call COMPILE, $<, $@))
$(MAINRUSTOBJ): %$(RUSTEXT)$(SUFFIX)$(OBJEXT): %$(RUSTEXT)
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CELFFLAGS)), \
$(MAINRUSTOBJ): $(PREFIX)%$(RUSTEXT)$(SUFFIX)$(OBJEXT): %$(RUSTEXT)
$(if $(and $(CONFIG_MODULES),$(CELFFLAGS)), \
$(call ELFCOMPILERUST, $<, $@), $(call COMPILERUST, $<, $@))
$(MAINZIGOBJ): $(PREFIX)%$(ZIGEXT)$(SUFFIX)$(OBJEXT): %$(ZIGEXT)
$(Q) $(call RENAMEMAIN, $<, $(basename $<)_tmp.zig)
$(if $(and $(CONFIG_MODULES),$(CELFFLAGS)), \
$(call ELFCOMPILEZIG, $(basename $<)_tmp.zig, $@), $(call COMPILEZIG, $(basename $<)_tmp.zig, $@))
$(Q) rm -f $(basename $<)_tmp.zig
$(MAINDOBJ): $(PREFIX)%$(DEXT)$(SUFFIX)$(OBJEXT): %$(DEXT)
$(if $(and $(CONFIG_MODULES),$(CELFFLAGS)), \
$(call ELFCOMPILED, $<, $@), $(call COMPILED, $<, $@))
$(MAINSWIFTOBJ): $(PREFIX)%$(SWIFTEXT)$(SUFFIX)$(OBJEXT): %$(SWIFTEXT)
$(if $(and $(CONFIG_MODULES),$(CELFFLAGS)), \
$(call ELFCOMPILESWIFT, $<, $@), $(call COMPILESWIFT, $<, $@))
install::
@:
endif # BUILD_MODULE
postinstall::
@:
context::
ifneq ($(PROGNAME),)
REGLIST := $(addprefix $(BUILTIN_REGISTRY)$(DELIM),$(addsuffix .bdat,$(PROGNAME)))
APPLIST := $(PROGNAME)
ifeq ($(DO_REGISTRATION),y)
$(REGLIST): $(DEPCONFIG) Makefile
$(call REGISTER,$(firstword $(APPLIST)),$(firstword $(PRIORITY)),$(firstword $(STACKSIZE)),$(if $(BUILD_MODULE),,$(firstword $(APPLIST))_main))
$(eval APPLIST=$(filter-out $(firstword $(APPLIST)),$(APPLIST)))
$(if $(filter-out $(firstword $(PRIORITY)),$(PRIORITY)),$(eval PRIORITY=$(filter-out $(firstword $(PRIORITY)),$(PRIORITY))))
$(if $(filter-out $(firstword $(STACKSIZE)),$(STACKSIZE)),$(eval STACKSIZE=$(filter-out $(firstword $(STACKSIZE)),$(STACKSIZE))))
register:: $(REGLIST)
$(eval PROGNAME_$@ := $(basename $(notdir $@)))
$(eval PROGSYM_$@ := $(subst -,_,$(PROGNAME_$@)))
ifeq ($(CONFIG_SCHED_USER_IDENTITY),y)
$(call REGISTER,$(PROGNAME_$@),$(PRIORITY_$@),$(STACKSIZE_$@),$(if $(BUILD_MODULE),,$(PROGSYM_$@)_main),$(UID_$@),$(GID_$@),$(MODE_$@))
else
register::
$(call REGISTER,$(PROGNAME_$@),$(PRIORITY_$@),$(STACKSIZE_$@),$(if $(BUILD_MODULE),,$(PROGSYM_$@)_main))
endif
.depend: Makefile $(wildcard $(foreach SRC, $(SRCS), $(addsuffix /$(SRC), $(subst :, ,$(VPATH))))) $(DEPCONFIG)
$(Q) $(MKDEP) $(DEPPATH) --obj-suffix .c$(SUFFIX)$(OBJEXT) "$(CC)" -- $(CFLAGS) -- $(filter %.c,$^) >Make.dep
$(Q) $(MKDEP) $(DEPPATH) --obj-suffix .S$(SUFFIX)$(OBJEXT) "$(CC)" -- $(CFLAGS) -- $(filter %.S,$^) >>Make.dep
$(Q) $(MKDEP) $(DEPPATH) --obj-suffix $(CXXEXT)$(SUFFIX)$(OBJEXT) "$(CXX)" -- $(CXXFLAGS) -- $(filter %$(CXXEXT),$^) >>Make.dep
register:: $(REGLIST)
@:
else
register::
@:
endif
$(PREFIX).depend: Makefile $(wildcard $(foreach SRC, $(SRCS), $(addsuffix /$(SRC), $(subst :, ,$(VPATH))))) $(DEPCONFIG)
$(shell echo "# Gen Make.dep automatically" >$(PREFIX)Make.dep)
$(call SPLITVARIABLE,ALL_DEP_OBJS,$^,100)
$(foreach BATCH, $(ALL_DEP_OBJS_TOTAL), \
$(shell $(MKDEP) $(DEPPATH) --obj-suffix .c$(SUFFIX)$(OBJEXT) "$(CC)" -- $(CFLAGS) -- $(filter %.c,$(ALL_DEP_OBJS_$(BATCH))) >>$(PREFIX)Make.dep) \
$(shell $(MKDEP) $(DEPPATH) --obj-suffix .S$(SUFFIX)$(OBJEXT) "$(CC)" -- $(CFLAGS) -- $(filter %.S,$(ALL_DEP_OBJS_$(BATCH))) >>$(PREFIX)Make.dep) \
$(shell $(MKDEP) $(DEPPATH) --obj-suffix $(CXXEXT)$(SUFFIX)$(OBJEXT) "$(CXX)" -- $(CXXFLAGS) -- $(filter %$(CXXEXT),$(ALL_DEP_OBJS_$(BATCH))) >>$(PREFIX)Make.dep) \
)
$(Q) touch $@
depend:: .depend
depend:: $(PREFIX).depend
@:
clean::
$(call DELFILE, .built)
$(call CLEANAROBJS)
$(call CLEAN)
distclean:: clean
$(call DELFILE, .kconfig)
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)
-include Make.dep
-include $(PREFIX)Make.dep
# Include Wasm specific definitions
include $(APPDIR)/tools/Wasm.mk

83
CMakeLists.txt Normal file
View file

@ -0,0 +1,83 @@
# ##############################################################################
# apps/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
# ~~~
# Important note:
# This CMakeLists.txt is not meant as a top-level CMakeLists.txt. Instead,
# CMake must be run using the top-level CMakeLists.txt from the nuttx
# repository and point to this directory via NUTTX_APPS_DIR. For example:
# cmake -S <nuttx-dir> -B <build-dir> [...] -DNUTTX_APPS_DIR=<apps-dir>
# ~~~
if(CONFIG_APPS_DIR)
# add apps cmake modules
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
include(nuttx_add_luamod)
include(nuttx_add_wamrmod)
include(nuttx_add_rust)
include(nuttx_wasm_interface)
nuttx_add_library(apps)
if(NOT EXISTS {NUTTX_APPS_BINDIR}/dummy.c)
file(TOUCH ${NUTTX_APPS_BINDIR}/dummy.c)
endif()
target_sources(apps PRIVATE ${NUTTX_APPS_BINDIR}/dummy.c)
endif()
file(MAKE_DIRECTORY ${NUTTX_APPS_BINDIR}/include)
include_directories(include)
include_directories(${NUTTX_APPS_BINDIR}/include)
add_subdirectory(audioutils)
add_subdirectory(benchmarks)
add_subdirectory(boot)
add_subdirectory(canutils)
add_subdirectory(crypto)
add_subdirectory(fsutils)
add_subdirectory(games)
add_subdirectory(graphics)
add_subdirectory(industry)
add_subdirectory(inertial)
add_subdirectory(interpreters)
add_subdirectory(logging)
add_subdirectory(lte)
add_subdirectory(math)
add_subdirectory(mlearning)
add_subdirectory(netutils)
add_subdirectory(nshlib)
add_subdirectory(platform)
add_subdirectory(sdr)
add_subdirectory(system)
add_subdirectory(tee)
add_subdirectory(testing)
add_subdirectory(videoutils)
add_subdirectory(wireless)
# add examples and external at the end to allow library dependencies
add_subdirectory(examples)
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/external)
add_subdirectory(external)
endif()
add_subdirectory(tools) # after traversing all subdirectories
add_subdirectory(builtin) # must be last
nuttx_generate_kconfig()

View file

@ -1,6 +0,0 @@
Apache NuttX is an effort undergoing incubation at The Apache Software Foundation (ASF),
sponsored by the Apache Incubator. Incubation is required of all newly accepted projects
until a further review indicates that the infrastructure, communications, and decision
making process have stabilized in a manner consistent with other successful ASF projects.
While incubation status is not necessarily a reflection of the completeness or stability
of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

View file

@ -1,6 +1,8 @@
############################################################################
# apps/Directory.mk
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
@ -22,11 +24,16 @@ include $(APPDIR)/Make.defs
# Sub-directories that have been built or configured.
SUBDIRS := $(dir $(wildcard *$(DELIM)Makefile))
CONFIGSUBDIRS := $(filter-out $(dir $(wildcard *$(DELIM)Kconfig)),$(SUBDIRS))
CLEANSUBDIRS += $(dir $(wildcard *$(DELIM).depend))
CLEANSUBDIRS += $(dir $(wildcard *$(DELIM).kconfig))
SUBDIRS := $(dir $(wildcard */Makefile))
CONFIGSUBDIRS := $(filter-out $(dir $(wildcard */Kconfig)),$(SUBDIRS))
CLEANSUBDIRS := $(dir $(wildcard *$(DELIM).built))
CLEANSUBDIRS += $(dir $(wildcard */.depend))
CLEANSUBDIRS += $(dir $(wildcard */.kconfig))
CLEANSUBDIRS := $(sort $(CLEANSUBDIRS))
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
CONFIGSUBDIRS := $(subst /,\,$(CONFIGSUBDIRS))
CLEANSUBDIRS := $(subst /,\,$(CLEANSUBDIRS))
endif
all: nothing
@ -43,15 +50,16 @@ install:
preconfig: $(foreach SDIR, $(CONFIGSUBDIRS), $(SDIR)_preconfig)
ifneq ($(MENUDESC),)
$(Q) $(MKKCONFIG) -m $(MENUDESC)
$(Q) touch .kconfig
endif
$(Q) touch .kconfig
clean: $(foreach SDIR, $(CLEANSUBDIRS), $(SDIR)_clean)
@:
distclean: $(foreach SDIR, $(CLEANSUBDIRS), $(SDIR)_distclean)
ifneq ($(MENUDESC),)
$(call DELFILE, Kconfig)
$(call DELFILE, .kconfig)
endif
$(call DELFILE, .kconfig)
-include Make.dep

553
LICENSE
View file

@ -1282,7 +1282,7 @@ apps/system/telnet/telnet_client.c
Copyright (C) 2017 Gregory Nutt. All rights reserved.
Author: Gregory Nutt <gnutt@nuttx.org>
The original authors of libtelnet are listed below. Per their licesne,
The original authors of libtelnet are listed below. Per their license,
"The author or authors of this code dedicate any and all copyright
interest in this code to the public domain. We make this dedication for
the benefit of the public at large and to the detriment of our heirs and
@ -1723,3 +1723,554 @@ apps/netutils/chat/chat.h
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
apps/testing/crypto/3descbc.c
=========================
$OpenBSD: des3.c,v 1.8 2010/10/15 10:39:12 jsg Exp $
Copyright (c) 2002 Markus Friedl. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
apps/testing/crypto/aesctr.c
=========================
$OpenBSD: aesctr.c,v 1.1 2005/05/25 05:47:53 markus Exp $
Copyright (c) 2005 Markus Friedl <markus@openbsd.org>
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
apps/testing/crypto/aesxts.c
=========================
$OpenBSD: aes_xts.c,v 1.2 2013/10/06 16:59:34 jsing Exp $
Copyright (c) 2002 Markus Friedl. All rights reserved.
Copyright (c) 2008 Damien Miller. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
apps/testing/crypto/hmac.c
=========================
Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr>
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
apps/crypto/tinydtls
======================
/*******************************************************************************
* Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016 Olaf Bergmann (TZI) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
* Contributors:
* Olaf Bergmann - initial API and implementation
* Hauke Mehrtens - memory optimization, ECC integration
*******************************************************************************/
apps/netutils/wakaama
=====================
*Eclipse Distribution License - v 1.0*
Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Eclipse Foundation, Inc. nor the names of
its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
apps/crypto/libsodium
=====================
ISC License
Copyright (c) 2013-2023
Frank Denis <j at pureftpd dot org>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
apps/crypto/wolfssl
===================
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
apps/testing/sd_stress
apps/testing/sd_bench
===================
Copyright (c) 2016-2021 PX4 Development Team. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. Neither the name PX4 nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
netutils/bare/
==============
MIT License
Copyright (c) 2022 Frank Smit
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

135
Make.defs
View file

@ -1,6 +1,8 @@
############################################################################
# apps/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
@ -19,17 +21,7 @@
############################################################################
TOPDIR ?= $(APPDIR)/import
include $(TOPDIR)/Make.defs
# The GNU make CURDIR will always be a POSIX-like path with forward slashes
# as path segment separators. This is fine for the above inclusions but
# will cause problems later for the native build. If we know that this is
# a native build, then we need to fix up the APPDIR path for subsequent
# use
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
APPDIR := ${shell echo %CD%}
endif
-include $(TOPDIR)/Make.defs
# Application Directories
@ -37,11 +29,16 @@ endif
# CLEANDIRS is the list of all top-level directories containing Makefiles.
# It is used only for cleaning.
BUILDIRS := $(dir $(wildcard $(APPDIR)$(DELIM)*$(DELIM)Make.defs))
BUILDIRS := $(filter-out $(APPDIR)$(DELIM)import$(DELIM),$(BUILDIRS))
CONFIGDIRS := $(filter-out $(APPDIR)$(DELIM)builtin$(DELIM),$(BUILDIRS))
CONFIGDIRS := $(filter-out $(dir $(wildcard $(APPDIR)$(DELIM)*$(DELIM)Kconfig)),$(CONFIGDIRS))
CLEANDIRS := $(dir $(wildcard $(APPDIR)$(DELIM)*$(DELIM)Makefile))
BUILDIRS := $(dir $(wildcard $(APPDIR)/*/Make.defs))
BUILDIRS := $(filter-out $(APPDIR)/import/,$(BUILDIRS))
CONFIGDIRS := $(filter-out $(APPDIR)/builtin/,$(BUILDIRS))
CONFIGDIRS := $(filter-out $(dir $(wildcard $(APPDIR)/*/Kconfig)),$(CONFIGDIRS))
CLEANDIRS := $(dir $(wildcard $(APPDIR)/*/Makefile))
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BUILDIRS := $(subst /,\,$(BUILDIRS))
CONFIGDIRS := $(subst /,\,$(CONFIGDIRS))
CLEANDIRS := $(subst /,\,$(CLEANDIRS))
endif
# CONFIGURED_APPS is the application directories that should be built in
# the current configuration.
@ -49,7 +46,7 @@ CLEANDIRS := $(dir $(wildcard $(APPDIR)$(DELIM)*$(DELIM)Makefile))
CONFIGURED_APPS :=
define Add_Application
include $(1)Make.defs
include $(1)Make.defs
endef
$(foreach BDIR, $(BUILDIRS), $(eval $(call Add_Application,$(BDIR))))
@ -58,6 +55,9 @@ $(foreach BDIR, $(BUILDIRS), $(eval $(call Add_Application,$(BDIR))))
CXXEXT ?= .cxx
RUSTEXT ?= .rs
ZIGEXT ?= .zig
DEXT ?= .d
SWIFTEXT ?= .swift
# Library path
@ -66,10 +66,12 @@ LIBPATH ?= $(TOPDIR)$(DELIM)staging
# The install path
BINDIR ?= $(APPDIR)$(DELIM)bin
BINDIR_DEBUG ?= $(APPDIR)$(DELIM)bin_debug
# The final build target
BIN ?= $(APPDIR)$(DELIM)libapps$(LIBEXT)
BIN ?= $(APPDIR)$(DELIM)libapps$(LIBEXT)
WBIN ?= $(APPDIR)$(DELIM)wasm$(DELIM)libwasm$(LIBEXT)
# Tools
@ -81,21 +83,108 @@ endif
# Builtin Registration
BUILTIN_REGISTRY = $(APPDIR)$(DELIM)builtin$(DELIM)registry
DEPCONFIG = $(TOPDIR)$(DELIM).config
BUILTIN_REGISTRY ?= $(APPDIR)$(DELIM)builtin$(DELIM)registry
DEPCONFIG ?= $(TOPDIR)$(DELIM).config
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
ifeq ($(CONFIG_SCHED_USER_IDENTITY),y)
define REGISTER
$(Q) echo Register: $1
$(Q) echo { \"$1\", $2, $3, $4 }, > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat"
$(Q) echo { "$(subst ",,$(1))", $2, $3, $(patsubst ,0,$(subst ",,$(4))), $(patsubst ,0,$(5)), $(patsubst ,0,$(6)), $(patsubst ,0555,$(7))}, > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat"
$(Q) echo int $(subst ",,$(4))(int argc, char *argv[]); > "$(BUILTIN_REGISTRY)$(DELIM)$1.pdat"
$(Q) touch $(BUILTIN_REGISTRY)$(DELIM).updated"
endef
else
define REGISTER
$(Q) echo Register: $1
$(Q) echo { "$(subst ",,$(1))", $2, $3, $(subst ",,$(4)) }, > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat"
$(Q) echo int $(subst ",,$(4))(int argc, char *argv[]); > "$(BUILTIN_REGISTRY)$(DELIM)$1.pdat"
$(Q) touch $(BUILTIN_REGISTRY)$(DELIM).updated"
endef
endif
else
ifeq ($(CONFIG_SCHED_USER_IDENTITY),y)
define REGISTER
$(Q) echo "{ \"$1\", $2, $3, $(patsubst ,0,$(4)), $(patsubst ,0,$(5)), $(patsubst ,0,$(6)), $(patsubst ,0555,$(7)) }," > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat"
$(Q) if [ ! -z $4 ]; then \
echo "int $4(int argc, char *argv[]);" > "$(BUILTIN_REGISTRY)$(DELIM)$1.pdat"; \
fi;
$(Q) touch "$(BUILTIN_REGISTRY)$(DELIM).updated"
endef
else
define REGISTER
$(Q) echo "Register: $1"
$(Q) echo "{ \"$1\", $2, $3, $4 }," > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat"
$(Q) if [ ! -z $4 ]; then \
echo "int $4(int argc, char *argv[]);" > "$(BUILTIN_REGISTRY)$(DELIM)$1.pdat"; \
fi;
$(Q) touch "$(BUILTIN_REGISTRY)$(DELIM).updated"
endef
endif
endif
# Standard include path
CFLAGS += ${shell $(INCDIR) "$(CC)" "$(APPDIR)$(DELIM)include"}
CXXFLAGS += ${shell $(INCDIR) "$(CC)" "$(APPDIR)$(DELIM)include"}
CFLAGS += ${INCDIR_PREFIX}"$(APPDIR)$(DELIM)include"
CXXFLAGS += ${INCDIR_PREFIX}"$(APPDIR)$(DELIM)include"
NUTTXLIB ?= $(call CONVERT_PATH,$(TOPDIR)$(DELIM)staging)
# SPLITVARIABLE - Split long variables into specified batches
# Usage: $(call SPLITVARIABLE, variable-def, variable-ref, batch-size)
#
# Example: VAR:= a b c x y z foo bar
# $(call SPLITVARIABLE, VAR, $(VAR), 3)
# $(foreach, num, $(VAR_TOTAL), $(shell echo $(VAR_$(num))))
# Return new variable definition:
# $(variable-def)_TOTAL : total split sequence , start with 1.
# $(variable-def)_$(num) : newly defined variable , ended with batch num.
# In the case above:
# $(VAR_TOTAL) = 1 2 3
# $(VAR_1) = a b c
# $(VAR_2) = x y z
# $(VAR_3) = foo bar
define SPLITVARIABLE
$(eval SPLITVARIABLE_PREFIX = $(1))
$(eval BATCH_SIZE = $(3))
$(eval TOTAL_BATCH = $(shell expr $(words $(2)) / $(BATCH_SIZE) + 1))
$(eval $(SPLITVARIABLE_PREFIX)_TOTAL = $(shell seq 1 $(TOTAL_BATCH)))
$(foreach idx, $($(SPLITVARIABLE_PREFIX)_TOTAL), \
$(eval FROMINDEX=$(shell expr 1 + $(idx) \* $(BATCH_SIZE) - $(BATCH_SIZE))) \
$(eval $(SPLITVARIABLE_PREFIX)_$(idx)=$(wordlist $(FROMINDEX), $(shell expr $(FROMINDEX) + $(BATCH_SIZE) - 1), $(2))) \
)
endef
define ARLOCK
flock $1.lock $(call ARCHIVE, $1, $(2))
endef
# dynamic AR target
define AROBJSRULES
$(1) : $(2)
@ cp $(2) $(1)
endef
# CLEANAROBJS - del AR target files exclusively
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define CLEANAROBJS
$(call DELFILE,$(subst /,\,$(AROBJS)))
$(call DELFILE,$(subst /,\,$(OBJS)))
$(eval OBJS :=)
endef
else
define CLEANAROBJS
$(call SPLITVARIABLE,CLEAN_AROBJS,${AROBJS},100)
$(foreach BATCH, $(CLEAN_AROBJS_TOTAL), \
$(shell rm -rf $(CLEAN_AROBJS_$(BATCH))))
$(call SPLITVARIABLE,CLEAN_OBJS,${OBJS},100)
$(foreach BATCH, $(CLEAN_OBJS_TOTAL), \
$(shell rm -rf $(CLEAN_OBJS_$(BATCH))))
$(eval OBJS :=)
endef
endif

107
Makefile
View file

@ -1,6 +1,8 @@
############################################################################
# apps/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
@ -20,8 +22,20 @@
export APPDIR = $(CURDIR)
include $(APPDIR)/Make.defs
include $(APPDIR)/tools/Wasm.mk
# The GNU make CURDIR will always be a POSIX-like path with forward slashes
# as path segment separators. This is fine for the above inclusions but
# will cause problems later for the native build. If we know that this is
# a native build, then we need to fix up the APPDIR path for subsequent
# use
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
export APPDIR = $(subst /,\,$(CURDIR))
endif
# Symbol table for loadable apps.
# SYMTABEXT: Extra arguments for mksymtab.sh
SYMTABSRC = symtab_apps.c
SYMTABOBJ = $(SYMTABSRC:.c=$(OBJEXT))
@ -31,16 +45,15 @@ SYMTABOBJ = $(SYMTABSRC:.c=$(OBJEXT))
# We first remove libapps.a before letting the other rules add objects to it
# so that we ensure libapps.a does not contain objects from prior build
all:
$(RM) $(BIN)
$(MAKE) $(BIN)
all: $(BIN)
.PHONY: import install dirlinks export .depdirs preconfig depend clean distclean
.PHONY: context clean_context context_all register register_all
.PHONY: context postinstall clean_context context_all postinstall_all register register_all
.PRECIOUS: $(BIN)
$(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),all)))
$(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),install)))
$(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),postinstall)))
$(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),context)))
$(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),register)))
$(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),depend)))
@ -55,6 +68,25 @@ $(INCDIR): $(TOPDIR)/tools/incdir.c
IMPORT_TOOLS = $(MKDEP) $(INCDIR)
ifeq ($(CONFIG_TOOLS_WASM_BUILD),y)
configure_wasm:
$(Q) cmake -B$(APPDIR)$(DELIM)tools$(DELIM)Wasm$(DELIM)build \
$(APPDIR)$(DELIM)tools$(DELIM)Wasm \
-DAPPDIR=$(APPDIR) -DTOPDIR=$(TOPDIR) \
-DWASI_SDK_PATH=$(WASI_SDK_PATH) \
-DKCONFIG_FILE_PATH=$(TOPDIR)$(DELIM).config
context_wasm: configure_wasm
$(Q) cmake --build $(APPDIR)$(DELIM)tools$(DELIM)Wasm$(DELIM)build
else
context_wasm:
endif
# In the KERNEL build, we must build and install all of the modules. No
# symbol table is needed
@ -62,12 +94,12 @@ ifeq ($(CONFIG_BUILD_KERNEL),y)
install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install)
.import: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all)
$(Q) for app in ${CONFIGURED_APPS}; do \
$(MAKE) -C "$${app}" archive ; \
done
$(BIN): $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all)
.import: $(BIN)
$(Q) install libapps.a $(APPDIR)$(DELIM)import$(DELIM)libs
$(Q) $(MAKE) install
$(Q) $(MAKE) postinstall
import: $(IMPORT_TOOLS)
$(Q) $(MAKE) context TOPDIR="$(APPDIR)$(DELIM)import"
@ -80,32 +112,37 @@ else
# In FLAT and protected modes, the modules have already been created. A
# symbol table is required.
ifeq ($(CONFIG_BUILD_LOADABLE),)
ifeq ($(CONFIG_MODULES),)
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
$(BIN): $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all)
$(Q) for app in ${CONFIGURED_APPS}; do \
$(MAKE) -C "$${app}" archive ; \
done
else
$(BIN): $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all)
$(call LINK_WASM)
endif
else
$(SYMTABSRC): $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all)
$(Q) for app in ${CONFIGURED_APPS}; do \
$(MAKE) -C "$${app}" archive ; \
done
$(Q) $(MAKE) install
$(Q) $(APPDIR)$(DELIM)tools$(DELIM)mksymtab.sh $(BINDIR) >$@.tmp
$(Q) $(APPDIR)$(DELIM)tools$(DELIM)mksymtab.sh $(BINDIR) $(SYMTABEXT) >$@.tmp
$(Q) $(call TESTANDREPLACEFILE, $@.tmp, $@)
ifneq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
$(SYMTABOBJ): %$(OBJEXT): %.c
$(call COMPILE, -fno-lto $<, $@)
$(call COMPILE, $<, $@, -fno-lto -fno-builtin)
else
$(SYMTABOBJ): %$(OBJEXT): %.c
$(call COMPILE, $<, $@, -Onolink)
endif
$(BIN): $(SYMTABOBJ)
$(call ARCHIVE_ADD, $(call CONVERT_PATH,$(BIN)), $^)
$(call ARLOCK, $(call CONVERT_PATH,$(BIN)), $^)
$(call LINK_WASM)
endif # !CONFIG_BUILD_LOADABLE
endif # !CONFIG_MODULES
install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install)
$(Q) $(MAKE) postinstall_all
# Link nuttx
@ -141,10 +178,15 @@ dirlinks:
context_all: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_context)
register_all: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_register)
postinstall_all: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_postinstall)
context:
staging:
$(Q) mkdir -p $@
context: | staging
$(Q) $(MAKE) context_all
$(Q) $(MAKE) register_all
$(Q) $(MAKE) context_wasm
Kconfig:
$(foreach SDIR, $(CONFIGDIRS), $(call MAKE_template,$(SDIR),preconfig))
@ -158,7 +200,9 @@ ifneq ($(EXPORTDIR),)
ifneq ($(CONFIG_BUILD_KERNEL),y)
ifneq ($(BUILTIN_REGISTRY),)
for f in "${BUILTIN_REGISTRY}"$(DELIM)*.bdat "${BUILTIN_REGISTRY}"$(DELIM)*.pdat ; do \
[ -f "$${f}" ] && cp -f "$${f}" "${EXPORTDIR}"$(DELIM)registry ; \
if [ -f "$${f}" ]; then \
cp -f "$${f}" "${EXPORTDIR}"$(DELIM)registry ; \
fi \
done
endif
endif
@ -181,27 +225,18 @@ clean: $(foreach SDIR, $(CLEANDIRS), $(SDIR)_clean)
$(call DELFILE, $(BIN))
$(call DELFILE, Kconfig)
$(call DELDIR, $(BINDIR))
$(call DELDIR, $(BINDIR_DEBUG))
$(call CLEAN)
distclean: $(foreach SDIR, $(CLEANDIRS), $(SDIR)_distclean)
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
$(Q) ( if exist external ( \
echo ********************************************************" \
echo * The external directory/link must be removed manually *" \
echo ********************************************************" \
)
else
$(Q) ( if [ -e external ]; then \
echo "********************************************************"; \
echo "* The external directory/link must be removed manually *"; \
echo "********************************************************"; \
fi; \
)
endif
$(call DELFILE, *.lock)
$(call DELFILE, .depend)
$(call DELFILE, $(SYMTABSRC))
$(call DELFILE, $(SYMTABOBJ))
$(call DELFILE, $(BIN))
$(call DELFILE, Kconfig)
$(call DELDIR, $(BINDIR))
$(call DELDIR, staging)
$(call DELDIR, wasm)
$(call DELDIR, $(APPDIR)$(DELIM)tools$(DELIM)Wasm$(DELIM)build)
$(call CLEAN)

View file

@ -34,7 +34,7 @@ NuttX directory. Like:
If all of the above conditions are TRUE, then NuttX will be able to find the
application directory. If your application directory has a different name or is
location at a different position, then you will have to inform the NuttX build
located at a different position, then you will have to inform the NuttX build
system of that location. There are several ways to do that:
1) You can define `CONFIG_APPS_DIR` to be the full path to your application
@ -140,7 +140,7 @@ project. One must:
main()
```
4. Set the requirements in the file: `Makefile`, specially the lines:
4. Set the requirements in the file: `Makefile`, specifically the lines:
```makefile
PROGNAME = progname
@ -181,10 +181,8 @@ A: Here are three:
You can copy any pieces that you like from the old apps/directory to your
custom apps directory as necessary.
This is documented in `NuttX/boards/README.txt` and
`nuttx/Documentation/NuttXPortingGuide.html` (Online at
https://bitbucket.org/nuttx/nuttx/src/master/Documentation/NuttXPortingGuide.html#apndxconfigs
under _Build options_). And in the `apps/README.txt` file.
This is documented in `NuttX/boards/README.txt` and `NuttX Porting Guide`
online at <https://cwiki.apache.org/confluence/display/NUTTX/Porting+Guide>.
3) If you like the random collection of stuff in the `apps/` directory but
just want to expand the existing components with your own, external
@ -256,4 +254,5 @@ Technology Software Unrestricted (TSU) exception (see the BIS Export Administrat
Regulations, Section 740.13) for both object code and source code.
The following provides more details on the included cryptographic software:
https://tls.mbed.org/supported-ssl-ciphersuites.
https://tls.mbed.org/supported-ssl-ciphersuites.
https://github.com/intel/tinycrypt

25
audioutils/CMakeLists.txt Normal file
View file

@ -0,0 +1,25 @@
# ##############################################################################
# apps/audioutils/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
nuttx_add_subdirectory()
nuttx_generate_kconfig(MENUDESC "Audio Utility libraries")

23
audioutils/Make.defs Normal file
View file

@ -0,0 +1,23 @@
############################################################################
# apps/audioutils/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(wildcard $(APPDIR)/audioutils/*/Make.defs)

25
audioutils/Makefile Normal file
View file

@ -0,0 +1,25 @@
############################################################################
# apps/audioutils/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
MENUDESC = "Audio Utility libraries"
include $(APPDIR)/Directory.mk

View file

@ -0,0 +1,25 @@
# ##############################################################################
# apps/audioutils/fmsynth/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
if(CONFIG_AUDIOUTILS_FMSYNTH_LIB)
target_sources(apps PRIVATE fmsynth.c fmsynth_eg.c fmsynth_op.c)
endif()

View file

@ -0,0 +1,10 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config AUDIOUTILS_FMSYNTH_LIB
bool "FM Synthesizer Library"
default n
---help---
Enable support for the FM Synthesizer library.

View file

@ -0,0 +1,25 @@
############################################################################
# apps/audioutils/fmsynth/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_AUDIOUTILS_FMSYNTH_LIB),)
CONFIGURED_APPS += $(APPDIR)/audioutils/fmsynth
endif

View file

@ -0,0 +1,27 @@
############################################################################
# apps/audioutils/fmsynth/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(APPDIR)/Make.defs
CSRCS = fmsynth.c fmsynth_eg.c fmsynth_op.c
include $(APPDIR)/Application.mk

View file

@ -0,0 +1,270 @@
/****************************************************************************
* apps/audioutils/fmsynth/fmsynth.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdlib.h>
#include <audioutils/fmsynth.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define WRAP_ROUND_TIME_SEC (10)
/****************************************************************************
* Private Data
****************************************************************************/
static int max_phase_time;
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* name: fetch_feedback
****************************************************************************/
static void fetch_feedback(FAR fmsynth_op_t *ops)
{
while (ops != NULL)
{
fmsynthop_update_feedback(ops);
ops = ops->parallelop;
}
}
/****************************************************************************
* name: update_phase
****************************************************************************/
static void update_phase(FAR fmsynth_sound_t *snd)
{
snd->phase_time++;
if (snd->phase_time >= max_phase_time)
{
snd->phase_time = 0;
}
}
/****************************************************************************
* name: sound_modulate
****************************************************************************/
static int sound_modulate(FAR fmsynth_sound_t *snd)
{
int out = 0;
FAR fmsynth_op_t *op;
if (snd->operators == NULL)
{
return out;
}
fetch_feedback(snd->operators);
for (op = snd->operators; op != NULL; op = op->parallelop)
{
out += fmsynthop_operate(op, snd->phase_time);
}
update_phase(snd);
return out * snd->volume / FMSYNTH_MAX_VOLUME;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* name: fmsynth_initialize
****************************************************************************/
int fmsynth_initialize(int fs)
{
max_phase_time = fs * WRAP_ROUND_TIME_SEC;
return fmsynthop_set_samplerate(fs);
}
/****************************************************************************
* name: create_fmsynthsnd
****************************************************************************/
FAR fmsynth_sound_t *create_fmsynthsnd(FAR fmsynth_sound_t *snd)
{
if (snd)
{
snd->own_allocate = 0;
snd->phase_time = 0;
snd->volume = FMSYNTH_MAX_VOLUME;
snd->operators = NULL;
snd->next_sound = NULL;
}
return snd;
}
/****************************************************************************
* name: fmsynthsnd_create
****************************************************************************/
FAR fmsynth_sound_t *fmsynthsnd_create(void)
{
FAR fmsynth_sound_t *ret;
ret = (FAR fmsynth_sound_t *)malloc(sizeof(fmsynth_sound_t));
if (ret)
{
create_fmsynthsnd(ret);
ret->own_allocate = 1;
}
return ret;
}
/****************************************************************************
* name: fmsynthsnd_delete
****************************************************************************/
void fmsynthsnd_delete(FAR fmsynth_sound_t *snd)
{
if (snd != NULL && snd->own_allocate == 1)
{
free(snd);
}
}
/****************************************************************************
* name: fmsynthsnd_set_operator
****************************************************************************/
int fmsynthsnd_set_operator(FAR fmsynth_sound_t *snd, FAR fmsynth_op_t *op)
{
snd->operators = op;
return OK;
}
/****************************************************************************
* name: fmsynthsnd_set_soundfreq
****************************************************************************/
void fmsynthsnd_set_soundfreq(FAR fmsynth_sound_t *snd, float freq)
{
FAR fmsynth_op_t *op;
for (op = snd->operators; op != NULL; op = op->parallelop)
{
fmsynthop_set_soundfreq(op, freq);
fmsynthop_start(op);
}
}
/****************************************************************************
* name: fmsynthsnd_stop
****************************************************************************/
void fmsynthsnd_stop(FAR fmsynth_sound_t *snd)
{
FAR fmsynth_op_t *op;
for (op = snd->operators; op != NULL; op = op->parallelop)
{
fmsynthop_stop(op);
}
}
/****************************************************************************
* name: fmsynthsnd_set_volume
****************************************************************************/
void fmsynthsnd_set_volume(FAR fmsynth_sound_t *snd, float vol)
{
snd->volume = vol * FMSYNTH_MAX_VOLUME;
}
/****************************************************************************
* name: fmsynthsnd_add_subsound
****************************************************************************/
int fmsynthsnd_add_subsound(FAR fmsynth_sound_t *top,
FAR fmsynth_sound_t *sub)
{
FAR fmsynth_sound_t *s = top;
if (!top || !sub)
{
return ERROR;
}
for (s = top; s->next_sound; s = s->next_sound);
s->next_sound = sub;
return OK;
}
/****************************************************************************
* name: fmsynth_rendering
****************************************************************************/
int fmsynth_rendering(FAR fmsynth_sound_t *snd,
FAR int16_t *sample, int sample_num, int chnum,
fmsynth_tickcb_t cb, unsigned long cbarg)
{
int i;
int ch;
int out;
FAR fmsynth_sound_t *itr;
for (i = 0; i < sample_num; i += chnum)
{
out = 0;
for (itr = snd; itr != NULL; itr = itr->next_sound)
{
out = out + sound_modulate(itr);
}
for (ch = 0; ch < chnum; ch++)
{
*sample++ = (int16_t)out;
}
if (cb != NULL)
{
cb(cbarg);
}
}
if (i > sample_num)
{
i -= chnum;
}
/* Return total bytes stored in the buffer */
return i * sizeof(int16_t);
}

View file

@ -0,0 +1,209 @@
/****************************************************************************
* apps/audioutils/fmsynth/fmsynth_eg.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdlib.h>
#include <limits.h>
#include <audioutils/fmsynth_eg.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define CONVERT_INITVAL(lv) (int)((lv) * FMSYNTH_MAX_EGLEVEL)
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* name: set_egparams
****************************************************************************/
static int set_egparams(int fs,
FAR fmsynth_egparam_t *param,
FAR struct fmsynth_eglevel_s *target_level,
FAR struct fmsynth_eglevel_s *last_level)
{
param->initval = CONVERT_INITVAL(last_level->level);
param->period = fs * target_level->period_ms / 1000;
param->diff2next = CONVERT_INITVAL(target_level->level)
- CONVERT_INITVAL(last_level->level);
if (param->initval < -FMSYNTH_MAX_EGLEVEL ||
param->initval > FMSYNTH_MAX_EGLEVEL || param->period < 0)
{
return -1;
}
return 0;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* name: create_fmsyntheg
****************************************************************************/
FAR fmsynth_eg_t *create_fmsyntheg(FAR fmsynth_eg_t *eg)
{
int i;
if (eg)
{
eg->state = EGSTATE_RELEASED;
eg->state_counter = 0;
for (i = 0; i < EGSTATE_MAX; i++)
{
eg->state_params[i].initval = 0;
eg->state_params[i].period = 0;
}
eg->state_params[EGSTATE_RELEASED].initval = FMSYNTH_MAX_EGLEVEL;
}
return eg;
}
/****************************************************************************
* name: fmsyntheg_create
****************************************************************************/
FAR fmsynth_eg_t *fmsyntheg_create(void)
{
FAR fmsynth_eg_t *ret = (FAR fmsynth_eg_t *)malloc(sizeof(fmsynth_eg_t));
return create_fmsyntheg(ret);
}
/****************************************************************************
* name: fmsyntheg_delete
****************************************************************************/
void fmsyntheg_delete(FAR fmsynth_eg_t *eg)
{
if (eg != NULL)
{
free(eg);
}
}
/****************************************************************************
* name: fmsyntheg_set_param
****************************************************************************/
int fmsyntheg_set_param(FAR fmsynth_eg_t *eg,
int fs, FAR fmsynth_eglevels_t *levels)
{
int errcnt = 0;
if (fs <= 0)
{
return ERROR;
}
errcnt += set_egparams(fs, &eg->state_params[EGSTATE_ATTACK],
&levels->attack, &levels->release);
errcnt += set_egparams(fs, &eg->state_params[EGSTATE_DECAYBREAK],
&levels->decaybrk, &levels->attack);
errcnt += set_egparams(fs, &eg->state_params[EGSTATE_DECAY],
&levels->decay, &levels->decaybrk);
errcnt += set_egparams(fs, &eg->state_params[EGSTATE_SUSTAIN],
&levels->sustain, &levels->decay);
errcnt += set_egparams(fs, &eg->state_params[EGSTATE_RELEASE],
&levels->release, &levels->sustain);
eg->state_params[EGSTATE_RELEASED].initval =
CONVERT_INITVAL(levels->release.level);
return errcnt ? ERROR : OK;
}
/****************************************************************************
* name: fmsyntheg_start
****************************************************************************/
void fmsyntheg_start(FAR fmsynth_eg_t *eg)
{
eg->state = EGSTATE_ATTACK;
eg->state_counter = 0;
}
/****************************************************************************
* name: fmsyntheg_stop
****************************************************************************/
void fmsyntheg_stop(FAR fmsynth_eg_t *eg)
{
eg->state = EGSTATE_RELEASED;
eg->state_counter = 0;
}
/****************************************************************************
* name: fmsyntheg_operate
****************************************************************************/
int fmsyntheg_operate(FAR fmsynth_eg_t *eg)
{
int val;
FAR fmsynth_egparam_t *param = &eg->state_params[eg->state];
val = param->initval;
if (eg->state != EGSTATE_RELEASED)
{
if (eg->state_counter >= eg->state_params[eg->state].period)
{
/* Reset the counter */
eg->state_counter = 0;
/* Search next available state */
do
{
eg->state++;
}
while (eg->state < EGSTATE_RELEASED
&& eg->state_params[eg->state].period == 0);
val = eg->state_params[eg->state].initval;
}
else
{
val = val + param->diff2next * eg->state_counter / param->period;
eg->state_counter++;
}
}
return val;
}

View file

@ -0,0 +1,548 @@
/****************************************************************************
* apps/audioutils/fmsynth/fmsynth_op.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdlib.h>
#include <audioutils/fmsynth_op.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define PHASE_ADJUST(th) \
(((th) < 0 ? (FMSYNTH_PI) - (th) : (th)) % (FMSYNTH_PI * 2))
/****************************************************************************
* Private Data
****************************************************************************/
static const short s_sintbl[] =
{
0xff37, /* Extra data for linear completion */
/* Actual sin table of half PI [256] */
0x0000, 0x00c9, 0x0192, 0x025b,
0x0324, 0x03ed, 0x04b6, 0x057e,
0x0647, 0x0710, 0x07d9, 0x08a1,
0x096a, 0x0a32, 0x0afb, 0x0bc3,
0x0c8b, 0x0d53, 0x0e1b, 0x0ee3,
0x0fab, 0x1072, 0x1139, 0x1200,
0x12c7, 0x138e, 0x1455, 0x151b,
0x15e1, 0x16a7, 0x176d, 0x1833,
0x18f8, 0x19bd, 0x1a82, 0x1b46,
0x1c0b, 0x1ccf, 0x1d93, 0x1e56,
0x1f19, 0x1fdc, 0x209f, 0x2161,
0x2223, 0x22e4, 0x23a6, 0x2467,
0x2527, 0x25e7, 0x26a7, 0x2767,
0x2826, 0x28e5, 0x29a3, 0x2a61,
0x2b1e, 0x2bdb, 0x2c98, 0x2d54,
0x2e10, 0x2ecc, 0x2f86, 0x3041,
0x30fb, 0x31b4, 0x326d, 0x3326,
0x33de, 0x3496, 0x354d, 0x3603,
0x36b9, 0x376f, 0x3824, 0x38d8,
0x398c, 0x3a3f, 0x3af2, 0x3ba4,
0x3c56, 0x3d07, 0x3db7, 0x3e67,
0x3f16, 0x3fc5, 0x4073, 0x4120,
0x41cd, 0x4279, 0x4325, 0x43d0,
0x447a, 0x4523, 0x45cc, 0x4674,
0x471c, 0x47c3, 0x4869, 0x490e,
0x49b3, 0x4a57, 0x4afa, 0x4b9d,
0x4c3f, 0x4ce0, 0x4d80, 0x4e20,
0x4ebf, 0x4f5d, 0x4ffa, 0x5097,
0x5133, 0x51ce, 0x5268, 0x5301,
0x539a, 0x5432, 0x54c9, 0x555f,
0x55f4, 0x5689, 0x571d, 0x57b0,
0x5842, 0x58d3, 0x5963, 0x59f3,
0x5a81, 0x5b0f, 0x5b9c, 0x5c28,
0x5cb3, 0x5d3d, 0x5dc6, 0x5e4f,
0x5ed6, 0x5f5d, 0x5fe2, 0x6067,
0x60eb, 0x616e, 0x61f0, 0x6271,
0x62f1, 0x6370, 0x63ee, 0x646b,
0x64e7, 0x6562, 0x65dd, 0x6656,
0x66ce, 0x6745, 0x67bc, 0x6831,
0x68a5, 0x6919, 0x698b, 0x69fc,
0x6a6c, 0x6adb, 0x6b4a, 0x6bb7,
0x6c23, 0x6c8e, 0x6cf8, 0x6d61,
0x6dc9, 0x6e30, 0x6e95, 0x6efa,
0x6f5e, 0x6fc0, 0x7022, 0x7082,
0x70e1, 0x7140, 0x719d, 0x71f9,
0x7254, 0x72ae, 0x7306, 0x735e,
0x73b5, 0x740a, 0x745e, 0x74b1,
0x7503, 0x7554, 0x75a4, 0x75f3,
0x7640, 0x768d, 0x76d8, 0x7722,
0x776b, 0x77b3, 0x77f9, 0x783f,
0x7883, 0x78c6, 0x7908, 0x7949,
0x7989, 0x79c7, 0x7a04, 0x7a41,
0x7a7c, 0x7ab5, 0x7aee, 0x7b25,
0x7b5c, 0x7b91, 0x7bc4, 0x7bf7,
0x7c29, 0x7c59, 0x7c88, 0x7cb6,
0x7ce2, 0x7d0e, 0x7d38, 0x7d61,
0x7d89, 0x7db0, 0x7dd5, 0x7df9,
0x7e1c, 0x7e3e, 0x7e5e, 0x7e7e,
0x7e9c, 0x7eb9, 0x7ed4, 0x7eef,
0x7f08, 0x7f20, 0x7f37, 0x7f4c,
0x7f61, 0x7f74, 0x7f86, 0x7f96,
0x7fa6, 0x7fb4, 0x7fc1, 0x7fcd,
0x7fd7, 0x7fe0, 0x7fe8, 0x7fef,
0x7ff5, 0x7ff9, 0x7ffc, 0x7ffe,
0x7fff, /* Extra data for linear completion */
};
static int local_fs;
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* name: pseudo_sin256
****************************************************************************/
static int pseudo_sin256(int theta)
{
int short_sin;
int rest;
int phase;
int tblidx;
theta = PHASE_ADJUST(theta);
rest = theta & 0x7f;
phase = theta / (FMSYNTH_PI / 2);
tblidx = (theta % (FMSYNTH_PI / 2)) >> 7;
if (phase & 0x01)
{
tblidx = 257 - tblidx;
short_sin = s_sintbl[tblidx];
short_sin = short_sin
+ (((s_sintbl[tblidx - 1] - short_sin) * rest) >> 7);
}
else
{
short_sin = s_sintbl[tblidx + 1];
short_sin = short_sin
+ (((s_sintbl[tblidx + 2] - short_sin) * rest) >> 7);
}
return phase & 0x02 ? -short_sin : short_sin;
}
/****************************************************************************
* name: triangle_wave
****************************************************************************/
static int triangle_wave(int theta)
{
int ret = 0;
int phase;
int offset;
int slope;
theta = PHASE_ADJUST(theta);
phase = theta / (FMSYNTH_PI / 2);
offset = theta % (FMSYNTH_PI / 2);
switch (phase)
{
case 0:
ret = 0;
slope = SHRT_MAX;
break;
case 1:
ret = SHRT_MAX;
slope = -SHRT_MAX;
break;
case 2:
ret = 0;
slope = -SHRT_MAX;
break;
case 3:
ret = -SHRT_MAX;
slope = SHRT_MAX;
break;
default:
ret = 0;
slope = SHRT_MAX;
break;
}
return ret + ((slope * offset) >> 15);
}
/****************************************************************************
* name: sawtooth_wave
****************************************************************************/
static int sawtooth_wave(int theta)
{
theta = PHASE_ADJUST(theta);
return (theta >> 1) - SHRT_MAX;
}
/****************************************************************************
* name: square_wave
****************************************************************************/
static int square_wave(int theta)
{
theta = PHASE_ADJUST(theta);
return theta < FMSYNTH_PI ? SHRT_MAX : -SHRT_MAX;
}
/****************************************************************************
* name: update_parameters
****************************************************************************/
static void update_parameters(FAR fmsynth_op_t *op)
{
if (local_fs != 0)
{
op->delta_phase = 2 * FMSYNTH_PI * op->sound_freq * op->freq_rate
/ (float)local_fs;
}
else
{
op->delta_phase = 0.f;
}
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* name: fmsynthop_set_samplerate
****************************************************************************/
int fmsynthop_set_samplerate(int fs)
{
if (fs < 0)
{
return ERROR;
}
local_fs = fs;
return OK;
}
/****************************************************************************
* name: create_fmsynthop
****************************************************************************/
FAR fmsynth_op_t *create_fmsynthop(FAR fmsynth_op_t *op,
FAR fmsynth_eg_t *eg)
{
if (op)
{
op->eg = eg;
op->own_allocate = 0;
op->wavegen = NULL;
op->cascadeop = NULL;
op->parallelop = NULL;
op->feedback_ref = NULL;
op->feedback_val = 0;
op->feedbackrate = 0;
op->last_sigval = 0;
op->freq_rate = 1.f;
op->sound_freq = 0.f;
op->delta_phase = 0.f;
op->current_phase = 0.f;
}
return op;
}
/****************************************************************************
* name: fmsynthop_create
****************************************************************************/
FAR fmsynth_op_t *fmsynthop_create(void)
{
FAR fmsynth_op_t *ret;
ret = (FAR fmsynth_op_t *)malloc(sizeof(fmsynth_op_t));
if (ret)
{
ret->eg = fmsyntheg_create();
if (!ret->eg)
{
free(ret);
return NULL;
}
create_fmsynthop(ret, ret->eg);
ret->own_allocate = 1;
}
return ret;
}
/****************************************************************************
* name: fmsynthop_delete
****************************************************************************/
void fmsynthop_delete(FAR fmsynth_op_t *op)
{
if (op != NULL && op->own_allocate == 1)
{
if (op->eg)
{
fmsyntheg_delete(op->eg);
}
free(op);
}
}
/****************************************************************************
* name: fmsynthop_select_opfunc
****************************************************************************/
int fmsynthop_select_opfunc(FAR fmsynth_op_t *op, int type)
{
int ret = ERROR;
if (op != NULL)
{
switch (type)
{
case FMSYNTH_OPFUNC_SIN:
op->wavegen = pseudo_sin256;
ret = OK;
break;
case FMSYNTH_OPFUNC_TRIANGLE:
op->wavegen = triangle_wave;
ret = OK;
break;
case FMSYNTH_OPFUNC_SAWTOOTH:
op->wavegen = sawtooth_wave;
ret = OK;
break;
case FMSYNTH_OPFUNC_SQUARE:
op->wavegen = square_wave;
ret = OK;
break;
}
}
return ret;
}
/****************************************************************************
* name: fmsynthop_set_envelope
****************************************************************************/
int fmsynthop_set_envelope(FAR fmsynth_op_t *op,
FAR fmsynth_eglevels_t *levels)
{
if (local_fs >= 0 && op && levels)
{
return fmsyntheg_set_param(op->eg, local_fs, levels);
}
return ERROR;
}
/****************************************************************************
* name: fmsynthop_cascade_subop
****************************************************************************/
int fmsynthop_cascade_subop(FAR fmsynth_op_t *op,
FAR fmsynth_op_t *subop)
{
FAR fmsynth_op_t *tmp;
if (!op || !subop)
{
return ERROR;
}
for (tmp = op; tmp->cascadeop; tmp = tmp->cascadeop);
tmp->cascadeop = subop;
return OK;
}
/****************************************************************************
* name: fmsynthop_parallel_subop
****************************************************************************/
int fmsynthop_parallel_subop(FAR fmsynth_op_t *op,
FAR fmsynth_op_t *subop)
{
FAR fmsynth_op_t *tmp;
if (!op || !subop)
{
return ERROR;
}
for (tmp = op; tmp->parallelop; tmp = tmp->parallelop);
tmp->parallelop = subop;
return OK;
}
/****************************************************************************
* name: fmsynthop_bind_feedback
****************************************************************************/
int fmsynthop_bind_feedback(FAR fmsynth_op_t *op,
FAR fmsynth_op_t *subop, float ratio)
{
if (!op || !subop)
{
return ERROR;
}
op->feedbackrate = (int)((float)FMSYNTH_MAX_EGLEVEL * ratio);
op->feedback_ref = &subop->last_sigval;
return OK;
}
/****************************************************************************
* name: fmsynthop_update_feedback
****************************************************************************/
int fmsynthop_update_feedback(FAR fmsynth_op_t *op)
{
FAR fmsynth_op_t *tmp;
for (tmp = op->cascadeop; tmp != NULL; tmp = tmp->parallelop)
{
fmsynthop_update_feedback(tmp);
}
if (op->feedback_ref)
{
op->feedback_val = *op->feedback_ref * op->feedbackrate
/ FMSYNTH_MAX_EGLEVEL;
}
return OK;
}
/****************************************************************************
* name: fmsynthop_set_soundfreq
****************************************************************************/
void fmsynthop_set_soundfreq(FAR fmsynth_op_t *op, float freq)
{
FAR fmsynth_op_t *tmp;
op->sound_freq = freq;
update_parameters(op);
for (tmp = op->cascadeop; tmp != NULL; tmp = tmp->parallelop)
{
fmsynthop_set_soundfreq(tmp, freq);
}
}
/****************************************************************************
* name: fmsynthop_set_soundfreqrate
****************************************************************************/
void fmsynthop_set_soundfreqrate(FAR fmsynth_op_t *op, float rate)
{
op->freq_rate = rate;
update_parameters(op);
}
/****************************************************************************
* name: fmsynthop_start
****************************************************************************/
void fmsynthop_start(FAR fmsynth_op_t *op)
{
FAR fmsynth_op_t *tmp;
fmsyntheg_start(op->eg);
for (tmp = op->cascadeop; tmp; tmp = tmp->parallelop)
{
fmsynthop_start(tmp);
}
}
/****************************************************************************
* name: fmsynthop_stop
****************************************************************************/
void fmsynthop_stop(FAR fmsynth_op_t *op)
{
FAR fmsynth_op_t *tmp;
fmsyntheg_stop(op->eg);
for (tmp = op->cascadeop; tmp; tmp = tmp->parallelop)
{
fmsynthop_stop(tmp);
}
}
/****************************************************************************
* name: fmsynthop_operate
****************************************************************************/
int fmsynthop_operate(FAR fmsynth_op_t *op, int phase_time)
{
int val;
int val2;
int phase;
FAR fmsynth_op_t *subop;
op->current_phase = phase_time ? op->current_phase + op->delta_phase : 0.f;
val = (int)op->current_phase;
val2 = (val / (2 * FMSYNTH_PI));
phase = (int)val + op->feedback_val;
op->current_phase = op->current_phase - (float)(val2 * (2 * FMSYNTH_PI));
subop = op->cascadeop;
while (subop)
{
phase += fmsynthop_operate(subop, phase_time);
subop = subop->parallelop;
}
op->last_sigval = fmsyntheg_operate(op->eg) * op->wavegen(phase)
/ FMSYNTH_MAX_EGLEVEL;
return op->last_sigval;
}

5
audioutils/fmsynth/test/.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
/fmsynth_alsa
/fmsynth_test
/fmsyntheg_test
/fmsynthop_test
/opfunctest

View file

@ -0,0 +1,46 @@
############################################################################
# apps/audioutils/fmsynth/test/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
SRCS = ../fmsynth_eg.c ../fmsynth_op.c ../fmsynth.c
CFLAGS = -DFAR= -DCODE= -DOK=0 -DERROR=-1 -I .. -I ../../../include -g
TARGETS = opfunctest fmsyntheg_test fmsynthop_test fmsynth_test fmsynth_alsa
all: $(TARGETS)
opfunctest: $(SRCS) opfunc_test.c
gcc $(CFLAGS) -o $@ $^ -lm
fmsyntheg_test: $(SRCS) fmsynth_eg_test.c
gcc $(CFLAGS) -o $@ $^
fmsynthop_test: $(SRCS) fmsynth_op_test.c
gcc $(CFLAGS) -o $@ $^
fmsynth_test: $(SRCS) fmsynth_test.c
gcc $(CFLAGS) -o $@ $^
fmsynth_alsa: $(SRCS) fmsynth_alsa_test.c
gcc $(CFLAGS) -o $@ $^ -lasound
clean:
rm -rf $(TARGETS)

View file

@ -0,0 +1,326 @@
/****************************************************************************
* apps/audioutils/fmsynth/test/fmsynth_alsa_test.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdio.h>
#include <stdint.h>
#include <termios.h>
#include <fcntl.h>
#include <alsa/asoundlib.h>
#include <audioutils/fmsynth_eg.h>
#include <audioutils/fmsynth_op.h>
#include <audioutils/fmsynth.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define FS (48000)
#define CHANNEL_NUM (2)
#define RESAMPLING_ALSA (1)
#define LATENCY_ALSA (10000)
#define SAMPLE_NUM (FS / 20)
#define BUFF_LENGTH (SAMPLE_NUM * CHANNEL_NUM)
#define CODE_C_FREQ (261.625565f)
#define CODE_D_FREQ (293.6647674f)
#define CODE_E_FREQ (329.6275561f)
#define CODE_F_FREQ (349.2282305f)
#define CODE_G_FREQ (391.9954347f)
#define CODE_A_FREQ (440.f)
#define CODE_B_FREQ (493.8833009f)
/****************************************************************************
* Private Data
****************************************************************************/
static int16_t samples[BUFF_LENGTH];
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* name: init_alsa
****************************************************************************/
static snd_pcm_t *init_alsa(int fs)
{
int ret;
snd_pcm_t *hndl = NULL;
ret = snd_pcm_open(&hndl, "default", SND_PCM_STREAM_PLAYBACK, 0);
if (ret < 0)
{
printf("sdn_pcm_open error\n");
return NULL;
}
ret = snd_pcm_set_params(hndl,
SND_PCM_FORMAT_S16,
SND_PCM_ACCESS_RW_INTERLEAVED,
CHANNEL_NUM, fs, RESAMPLING_ALSA, LATENCY_ALSA);
if (ret != 0)
{
printf("sdn_pcm_set_params error\n");
snd_pcm_close(hndl);
return NULL;
}
return hndl;
}
/****************************************************************************
* name: set_nonblocking
****************************************************************************/
static int set_nonblocking(struct termios *saved)
{
struct termios settings;
tcgetattr(0, saved);
settings = *saved;
settings.c_lflag &= ~(ECHO | ICANON);
settings.c_cc[VTIME] = 0;
settings.c_cc[VMIN] = 1;
tcsetattr(0, TCSANOW, &settings);
fcntl(0, F_SETFL, O_NONBLOCK);
return OK;
}
/****************************************************************************
* name: store_setting
****************************************************************************/
static void store_setting(struct termios *saved)
{
tcsetattr(0, TCSANOW, saved);
}
/****************************************************************************
* name: set_levels
****************************************************************************/
static fmsynth_eglevels_t *set_levels(fmsynth_eglevels_t *level,
float atk_lvl, int atk_peri,
float decbrk_lvl, int decbrk_peri,
float dec_lvl, int dec_peri,
float sus_lvl, int sus_peri,
float rel_lvl, int rel_peri)
{
level->attack.level = atk_lvl;
level->attack.period_ms = atk_peri;
level->decaybrk.level = decbrk_lvl;
level->decaybrk.period_ms = decbrk_peri;
level->decay.level = dec_lvl;
level->decay.period_ms = dec_peri;
level->sustain.level = sus_lvl;
level->sustain.period_ms = sus_peri;
level->release.level = rel_lvl;
level->release.period_ms = rel_peri;
return level;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* name: main
****************************************************************************/
int main(void)
{
int running;
int dump_count = 0;
int dump_enable = 0;
fmsynth_eglevels_t levels;
fmsynth_sound_t *snd1;
fmsynth_op_t *envop;
fmsynth_op_t *fbop;
snd_pcm_t *hndl = NULL;
struct termios save_param;
hndl = init_alsa(FS);
if (!hndl)
{
printf("Init alsa error\n");
return -1;
}
/* Initialize FM synthesizer */
fmsynth_initialize(FS);
/* Operator setup */
envop = fmsynthop_create();
fbop = fmsynthop_create();
set_levels(&levels, 0.6f, 100, 0.3f, 300, 0.1f, 500, 0.f, 0, 0.f, 70);
fmsynthop_set_envelope(envop, &levels);
fmsynthop_select_opfunc(envop, FMSYNTH_OPFUNC_SIN);
fmsynthop_set_envelope(fbop, &levels);
fmsynthop_select_opfunc(fbop, FMSYNTH_OPFUNC_SIN);
fmsynthop_bind_feedback(fbop, fbop, 0.6f);
fmsynthop_parallel_subop(envop, fbop);
/* Sound setup */
snd1 = fmsynthsnd_create();
fmsynthsnd_set_operator(snd1, envop);
fmsynthsnd_set_soundfreq(snd1, CODE_C_FREQ);
set_nonblocking(&save_param);
running = 1;
while (running)
{
switch (getchar())
{
case 'c':
fmsynthsnd_set_soundfreq(snd1, CODE_C_FREQ);
if (dump_enable)
{
dump_count = FS;
dump_enable = 0;
printf("DUMP: ");
}
printf("Do\n");
break;
case 'd':
fmsynthsnd_set_soundfreq(snd1, CODE_D_FREQ);
if (dump_enable)
{
dump_count = FS;
dump_enable = 0;
printf("DUMP: ");
}
printf("Le\n");
break;
case 'e':
fmsynthsnd_set_soundfreq(snd1, CODE_E_FREQ);
if (dump_enable)
{
dump_count = FS;
dump_enable = 0;
printf("DUMP: ");
}
printf("Mi\n");
break;
case 'f':
fmsynthsnd_set_soundfreq(snd1, CODE_F_FREQ);
if (dump_enable)
{
dump_count = FS;
dump_enable = 0;
printf("DUMP: ");
}
printf("Fha\n");
break;
case 'g':
fmsynthsnd_set_soundfreq(snd1, CODE_G_FREQ);
if (dump_enable)
{
dump_count = FS;
dump_enable = 0;
printf("DUMP: ");
}
printf("So\n");
break;
case 'a':
fmsynthsnd_set_soundfreq(snd1, CODE_A_FREQ);
if (dump_enable)
{
dump_count = FS;
dump_enable = 0;
printf("DUMP: ");
}
printf("Ra\n");
break;
case 'b':
fmsynthsnd_set_soundfreq(snd1, CODE_B_FREQ);
if (dump_enable)
{
dump_count = FS;
dump_enable = 0;
printf("DUMP: ");
}
printf("Shi\n");
break;
case 'z':
dump_enable = 1;
printf("Dump next code\n");
break;
case 'q':
running = 0;
break;
}
fmsynth_rendering(snd1, samples, BUFF_LENGTH, CHANNEL_NUM, NULL, 0);
if (dump_count)
{
for (int i = 0; i < BUFF_LENGTH; i += 2)
{
printf("%d\n", samples[i]);
}
dump_count -= SAMPLE_NUM;
}
snd_pcm_writei(hndl, samples, SAMPLE_NUM);
}
snd_pcm_drain(hndl);
snd_pcm_close(hndl);
fmsynthop_delete(envop);
fmsynthop_delete(fbop);
fmsynthsnd_delete(snd1);
store_setting(&save_param);
return 0;
}

View file

@ -0,0 +1,129 @@
/****************************************************************************
* apps/audioutils/fmsynth/test/fmsynth_eg_test.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdio.h>
#include <audioutils/fmsynth_eg.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define FS (48000)
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* name: state_name
****************************************************************************/
static const char *state_name(int s)
{
switch (s)
{
case EGSTATE_ATTACK:
return "Attack ";
case EGSTATE_DECAYBREAK:
return "DecayBreak";
case EGSTATE_DECAY:
return "Decay ";
case EGSTATE_SUSTAIN:
return "Sustain ";
case EGSTATE_RELEASE:
return "Release ";
case EGSTATE_RELEASED:
case -1:
return "RELEASED..";
}
return "";
}
/****************************************************************************
* name: dump_eg
****************************************************************************/
static void dump_eg(fmsynth_eg_t *env)
{
int i;
fmsynth_egparam_t *last = &env->state_params[EGSTATE_RELEASED];
printf("===== STATE : %s =======\n", state_name(env->state));
for (i = -1; i < EGSTATE_RELEASED; i++)
{
printf(" [%s] %5d <--------------> [%s] %5d\n",
state_name(i), last->initval,
state_name(i + 1), env->state_params[i + 1].initval);
printf(" per %d\n", env->state_params[i + 1].period);
printf(" dlt %d\n", env->state_params[i + 1].diff2next);
last = &env->state_params[i + 1];
}
printf("\n");
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* name: main
****************************************************************************/
int main(void)
{
fmsynth_eg_t *eg;
fmsynth_eglevels_t levels;
levels.attack.level = 0.6f;
levels.attack.period_ms = 10;
levels.decaybrk.level = 0.3f;
levels.decaybrk.period_ms = 20;
levels.decay.level = 0.5f;
levels.decay.period_ms = 15;
levels.sustain.level = 0.65f;
levels.sustain.period_ms = 5;
levels.release.level = 0.f;
levels.release.period_ms = 70;
eg = fmsyntheg_create();
fmsyntheg_set_param(eg, FS, &levels);
dump_eg(eg);
fmsyntheg_start(eg);
dump_eg(eg);
while (eg->state != EGSTATE_RELEASED)
{
printf("%d\n", fmsyntheg_operate(eg));
}
fmsyntheg_delete(eg);
return 0;
}

View file

@ -0,0 +1,145 @@
/****************************************************************************
* apps/audioutils/fmsynth/test/fmsynth_op_test.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdio.h>
#include <audioutils/fmsynth_op.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define FS (48000)
#define SOUNDFREQ (261.f)
#define TEST_LOOP (FS * (30 + 10 + 100 + 30 + 1) / 1000)
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* name: set_levels
****************************************************************************/
static fmsynth_eglevels_t *set_levels(fmsynth_eglevels_t *level,
float atk_lvl, int atk_peri,
float decbrk_lvl, int decbrk_peri,
float dec_lvl, int dec_peri,
float sus_lvl, int sus_peri,
float rel_lvl, int rel_peri)
{
level->attack.level = atk_lvl;
level->attack.period_ms = atk_peri;
level->decaybrk.level = decbrk_lvl;
level->decaybrk.period_ms = decbrk_peri;
level->decay.level = dec_lvl;
level->decay.period_ms = dec_peri;
level->sustain.level = sus_lvl;
level->sustain.period_ms = sus_peri;
level->release.level = rel_lvl;
level->release.period_ms = rel_peri;
return level;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* name: main
****************************************************************************/
int main(void)
{
int phase_time;
fmsynth_eglevels_t levels;
fmsynth_op_t *envop;
fmsynth_op_t *fbop;
fmsynth_op_t *triop;
fmsynth_op_t *mainop;
fmsynth_op_t *subop;
fmsynth_op_t *conv1;
fmsynth_op_t *conv2;
phase_time = 0;
fmsynthop_set_samplerate(FS);
set_levels(&levels, 0.12f, 10, 0.06f, 20, 0.1f, 16, 0.1f, 5, 0.f, 70);
envop = fmsynthop_create();
fmsynthop_set_envelope(envop, &levels);
fmsynthop_select_opfunc(envop, FMSYNTH_OPFUNC_SIN);
fmsynthop_set_soundfreq(envop, SOUNDFREQ);
fmsynthop_start(envop);
triop = fmsynthop_create();
fmsynthop_select_opfunc(triop, FMSYNTH_OPFUNC_TRIANGLE);
fmsynthop_set_soundfreq(triop, SOUNDFREQ);
fmsynthop_start(triop);
fbop = fmsynthop_create();
fmsynthop_select_opfunc(fbop, FMSYNTH_OPFUNC_SIN);
fmsynthop_set_soundfreq(fbop, SOUNDFREQ);
fmsynthop_bind_feedback(fbop, fbop, 0.6f);
fmsynthop_start(fbop);
mainop = fmsynthop_create();
subop = fmsynthop_create();
fmsynthop_select_opfunc(mainop, FMSYNTH_OPFUNC_SIN);
fmsynthop_select_opfunc(subop, FMSYNTH_OPFUNC_SIN);
fmsynthop_cascade_subop(mainop, subop);
fmsynthop_set_soundfreq(mainop, SOUNDFREQ);
fmsynthop_set_soundfreqrate(subop, 2.f);
fmsynthop_start(mainop);
printf("idx,EnvTest,FeedbackTest,CascadeTest,Triangle\n");
while (phase_time < TEST_LOOP)
{
fmsynthop_update_feedback(envop);
fmsynthop_update_feedback(fbop);
fmsynthop_update_feedback(mainop);
fmsynthop_update_feedback(triop);
printf("%d,%d,%d,%d,%d\n",
phase_time,
fmsynthop_operate(envop, phase_time),
fmsynthop_operate(fbop, phase_time),
fmsynthop_operate(mainop, phase_time),
fmsynthop_operate(triop, phase_time));
phase_time++;
}
fmsynthop_delete(envop);
fmsynthop_delete(fbop);
fmsynthop_delete(mainop);
fmsynthop_delete(subop);
return 0;
}

View file

@ -0,0 +1,132 @@
/****************************************************************************
* apps/audioutils/fmsynth/test/fmsynth_test.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdio.h>
#include <stdint.h>
#include <audioutils/fmsynth_eg.h>
#include <audioutils/fmsynth_op.h>
#include <audioutils/fmsynth.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define FS (48000)
#define SOUNDFREQ (3000.f)
#define TEST_LENGTH ((FS / 1000) * (10 + 20 + 16 + 5 + 30))
/****************************************************************************
* Private Data
****************************************************************************/
static int16_t my_sample[TEST_LENGTH];
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* name: set_levels
****************************************************************************/
static fmsynth_eglevels_t *set_levels(fmsynth_eglevels_t *level,
int atk_lvl, int atk_peri,
int decbrk_lvl, int decbrk_peri,
int dec_lvl, int dec_peri,
int sus_lvl, int sus_peri,
int rel_lvl, int rel_peri)
{
level->attack.level = atk_lvl;
level->attack.period_ms = atk_peri;
level->decaybrk.level = decbrk_lvl;
level->decaybrk.period_ms = decbrk_peri;
level->decay.level = dec_lvl;
level->decay.period_ms = dec_peri;
level->sustain.level = sus_lvl;
level->sustain.period_ms = sus_peri;
level->release.level = rel_lvl;
level->release.period_ms = rel_peri;
return level;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* name: main
****************************************************************************/
int main(void)
{
int phase_time;
fmsynth_eglevels_t levels;
fmsynth_sound_t *snd1;
fmsynth_op_t *envop;
fmsynth_op_t *fbop;
/* Initialize FM synthesizer */
fmsynth_initialize(FS);
/* Operator setup */
envop = fmsynthop_create();
fbop = fmsynthop_create();
set_levels(&levels, 0.12f, 10, 0.06f, 20, 0.1f, 16, 0.1f, 5, 0.f, 70);
fmsynthop_set_envelope(envop, &levels);
fmsynthop_select_opfunc(envop, FMSYNTH_OPFUNC_SIN);
fmsynthop_select_opfunc(fbop, FMSYNTH_OPFUNC_SIN);
fmsynthop_bind_feedback(fbop, fbop, 0.6f);
fmsynthop_parallel_subop(envop, fbop);
/* Sound setup */
snd1 = fmsynthsnd_create();
fmsynthsnd_set_operator(snd1, envop);
fmsynthsnd_set_soundfreq(snd1, SOUNDFREQ);
fmsynth_rendering(snd1, my_sample, TEST_LENGTH, 1, NULL, 0);
for (int i = 0; i < TEST_LENGTH; i++)
{
printf("%d\n", my_sample[i]);
}
fmsynthop_delete(envop);
fmsynthop_delete(fbop);
fmsynthsnd_delete(snd1);
return 0;
}

View file

@ -0,0 +1,167 @@
/****************************************************************************
* apps/audioutils/fmsynth/test/opfunc_test.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <audioutils/fmsynth_op.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define FS (48000)
#define DUMP_PERIOD (FS * 3 / 2000)
#define ACCURACY_TEST_PERIOD (FS * 3)
#define HZ (4186)
/****************************************************************************
* Private Data
****************************************************************************/
static opfunc_t func_sin;
static opfunc_t func_tri;
static opfunc_t func_saw;
static opfunc_t func_sqa;
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* name: prepare_opfuncs
****************************************************************************/
static void prepare_opfuncs(void)
{
fmsynth_op_t *op;
op = fmsynthop_create();
fmsynthop_select_opfunc(op, FMSYNTH_OPFUNC_SIN);
func_sin = op->wavegen;
fmsynthop_select_opfunc(op, FMSYNTH_OPFUNC_TRIANGLE);
func_tri = op->wavegen;
fmsynthop_select_opfunc(op, FMSYNTH_OPFUNC_SAWTOOTH);
func_saw = op->wavegen;
fmsynthop_select_opfunc(op, FMSYNTH_OPFUNC_SQUARE);
func_sqa = op->wavegen;
fmsynthop_delete(op);
}
/****************************************************************************
* name: wavegen_dump
****************************************************************************/
static void wavegen_dump(void)
{
int t;
float deltaact;
deltaact = (float)FMSYNTH_PI * 2. * (float)HZ / (float)FS;
printf("===== Wave generator Dump ====\n");
printf("SIN, TRIANGLE, SAWTOOTH, SQUARE\n");
for (t = 0; t < DUMP_PERIOD; t++)
{
printf("%d, %d, %d, %d\n",
func_sin((int)(deltaact * t)),
func_tri((int)(deltaact * t)),
func_saw((int)(deltaact * t)),
func_sqa((int)(deltaact * t))
);
}
printf("\n");
}
/****************************************************************************
* name: sin_accuracy_test
****************************************************************************/
static void sin_accuracy_test(void)
{
int t;
float delta;
float deltaact;
float max_diff = 0.f;
float ref_sin;
int sin_val;
float norm_sin;
float diff;
delta = M_PI * 2. * (float)HZ / (float)FS;
deltaact = (float)FMSYNTH_PI * 2. * (float)HZ / (float)FS;
printf("===== Local SIN function ACCURACY TEST ====\n");
for (t = 0; t < ACCURACY_TEST_PERIOD; t++)
{
sin_val = func_sin((int)(deltaact * t));
ref_sin = sinf(delta * t);
norm_sin = (float)sin_val / (float)SHRT_MAX;
printf("t=%d, operator-sin(%d)=%d, norm_sin=%f, sinf(%f)=%f ",
t, (int)(deltaact * t), sin_val, norm_sin, delta * t, ref_sin);
diff = fabsf(norm_sin - ref_sin);
max_diff = max_diff < diff ? diff : max_diff;
if (diff >= 0.005)
{
printf(" BIG-DIFF : %f\n", diff);
}
else
{
printf("\n");
}
}
printf("\n\nMAX DIFF = %f\n\n", max_diff);
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* name: main
****************************************************************************/
int main(void)
{
prepare_opfuncs();
sin_accuracy_test();
wavegen_dump();
return 0;
}

1
audioutils/lame/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
lame

View file

@ -0,0 +1,139 @@
# ##############################################################################
# apps/audioutils/lame/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
if(CONFIG_AUDIOUTILS_LAME)
# Determine destination path
if(NOT DEFINED DST_PATH)
set(DST_PATH ${CMAKE_CURRENT_BINARY_DIR}/lame)
else()
set(DST_PATH ${DST_PATH})
endif()
# Set configuration commands
set(CFG_CMDS "")
if(NOT "${CONFIG_ARCH}" STREQUAL "sim")
list(APPEND CFG_CMDS "--host=${CONFIG_ARCH}")
list(APPEND CFG_CMDS "--cross-prefix=${CROSSDEV}")
endif()
# The revision to check out. See the comment in Makefile: an unpinned
# checkout stops linking on the day lame's trunk grows its next vector tier.
# Raise this deliberately, together with the vector source list below.
if(NOT DEFINED LAME_VERSION)
set(LAME_VERSION 6720)
endif()
# # Download lame if no lame/configure found
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lame/configure")
execute_process(
COMMAND "svn" "checkout" "-r" "${LAME_VERSION}"
"https://svn.code.sf.net/p/lame/svn/trunk/lame" "lame"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
# Set source path
set(SRC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/lame")
# Add compiler flags
set(CFLAGS -DHAVE_CONFIG_H -Dfast_log2=lame_fast_log2)
set(CFLAGS
${CFLAGS}
-Wno-address
-Wno-array-parameter
-Wno-builtin-declaration-mismatch
-Wno-incompatible-pointer-types
-Wno-implicit-function-declaration
-Wno-shadow
-Wno-stringop-overflow
-Wno-unused-variable
-Wno-unused-but-set-variable
-msse)
set(INCDIR ${INCDIR_PREFIX}${DST_PATH} ${INCDIR_PREFIX}${SRC_PATH}/include
${INCDIR_PREFIX}${SRC_PATH}/libmp3lame)
# Set source files
set(CSRCS
"${SRC_PATH}/libmp3lame/bitstream.c"
"${SRC_PATH}/libmp3lame/encoder.c"
"${SRC_PATH}/libmp3lame/fft.c"
"${SRC_PATH}/libmp3lame/gain_analysis.c"
"${SRC_PATH}/libmp3lame/id3tag.c"
"${SRC_PATH}/libmp3lame/lame.c"
"${SRC_PATH}/libmp3lame/newmdct.c"
"${SRC_PATH}/libmp3lame/psymodel.c"
"${SRC_PATH}/libmp3lame/quantize.c"
"${SRC_PATH}/libmp3lame/quantize_pvt.c"
"${SRC_PATH}/libmp3lame/set_get.c"
"${SRC_PATH}/libmp3lame/vbrquantize.c"
"${SRC_PATH}/libmp3lame/reservoir.c"
"${SRC_PATH}/libmp3lame/tables.c"
"${SRC_PATH}/libmp3lame/takehiro.c"
"${SRC_PATH}/libmp3lame/util.c"
"${SRC_PATH}/libmp3lame/VbrTag.c"
"${SRC_PATH}/libmp3lame/version.c"
"${SRC_PATH}/libmp3lame/presets.c")
if(CONFIG_HOST_X86 OR CONFIG_HOST_X86_64)
list(
APPEND
CSRCS
"${SRC_PATH}/libmp3lame/vector/xmm_quantize_sub.c"
"${SRC_PATH}/libmp3lame/vector/xmm_choose_table.c"
"${SRC_PATH}/libmp3lame/vector/xmm_quantize_lines.c"
"${SRC_PATH}/libmp3lame/vector/xmm_calc_sfb_noise.c"
"${SRC_PATH}/libmp3lame/vector/avx2_choose_table.c"
"${SRC_PATH}/libmp3lame/vector/avx2_quantize_lines.c"
"${SRC_PATH}/libmp3lame/vector/avx512_choose_table.c"
"${SRC_PATH}/libmp3lame/vector/avx512_quantize_lines.c"
"${SRC_PATH}/libmp3lame/vector/avx512_calc_sfb_noise.c")
endif()
# Add custom target to generate config_h
set(CONFIG_H_FILE "${CMAKE_CURRENT_SOURCE_DIR}/lame/configure")
set(CONFIG_OPTIONS
--disable-cpml
--disable-decoder
--disable-efence
--disable-frontend
--disable-mp3x
--disable-gtktest
--disable-ipv6
--disable-rpath
--enable-static
${CFG_CMDS})
add_custom_command(
OUTPUT "${DST_PATH}/config.h"
COMMAND ${CONFIG_H_FILE} ${CONFIG_OPTIONS}
WORKING_DIRECTORY "${DST_PATH}"
COMMENT "Generating config.h file")
add_custom_target(generate_config_h DEPENDS "${DST_PATH}/config.h")
nuttx_add_library(libmp3lame STATIC)
add_dependencies(libmp3lame generate_config_h)
target_sources(libmp3lame PRIVATE ${CSRCS})
target_include_directories(libmp3lame PRIVATE ${INCDIR})
target_compile_options(libmp3lame PRIVATE ${CFLAGS})
endif()

8
audioutils/lame/Kconfig Normal file
View file

@ -0,0 +1,8 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config AUDIOUTILS_LAME
bool "Enable LAME MP3 Encoder"
default n

25
audioutils/lame/Make.defs Normal file
View file

@ -0,0 +1,25 @@
############################################################################
# apps/audioutils/lame/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_AUDIOUTILS_LAME),)
CONFIGURED_APPS += $(APPDIR)/audioutils/lame
endif

132
audioutils/lame/Makefile Normal file
View file

@ -0,0 +1,132 @@
############################################################################
# apps/audioutils/lame/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
# The revision to check out. lame's trunk grows vector tiers over time --
# SSE2, then AVX2, then AVX-512 -- and each one adds sources that this file
# and CMakeLists.txt have to name, so an unpinned checkout stops linking on
# the day upstream adds the next one. Raise this deliberately, together with
# the vector source list below.
LAME_VERSION ?= 6720
# Download lame if no lame/configure found
lame-svn:
$(Q) echo "svn checkout lame ..."
$(Q) svn checkout -r $(LAME_VERSION) \
https://svn.code.sf.net/p/lame/svn/trunk/lame lame
ifeq ($(wildcard lame/configure),)
context:: lame-svn
distclean::
$(call DELDIR, lame)
endif
ifeq ($(DST_PATH),)
include $(APPDIR)/Make.defs
# configure in place
DST_PATH := lame
else
# configure out of tree
DST_PATH := $(realpath $(DST_PATH))
include $(DST_PATH)/Make.defs
BIN := $(DST_PATH)/libmp3lame.a
# enable Application.mk PREFIX
PREFIX := $(DST_PATH)$(DELIM)
endif
ifneq ($(CONFIG_ARCH),sim)
CFG_CMDS += --host=$(CONFIG_ARCH)
CFG_CMDS += --cross-prefix=$(CROSSDEV)
endif
SRC_PATH := lame
CFLAGS += -DHAVE_CONFIG_H -D'fast_log2=lame_fast_log2'
CFLAGS += $(INCDIR_PREFIX)$(DST_PATH) \
$(INCDIR_PREFIX)$(SRC_PATH)/include \
$(INCDIR_PREFIX)$(SRC_PATH)/libmp3lame
CFLAGS += -Wno-address -Wno-array-parameter \
-Wno-builtin-declaration-mismatch \
-Wno-incompatible-pointer-types \
-Wno-implicit-function-declaration -Wno-shadow \
-Wno-stringop-overflow -Wno-unused-variable \
-Wno-unused-but-set-variable \
-msse
CSRCS += $(SRC_PATH)/libmp3lame/bitstream.c \
$(SRC_PATH)/libmp3lame/encoder.c \
$(SRC_PATH)/libmp3lame/fft.c \
$(SRC_PATH)/libmp3lame/gain_analysis.c \
$(SRC_PATH)/libmp3lame/id3tag.c \
$(SRC_PATH)/libmp3lame/lame.c \
$(SRC_PATH)/libmp3lame/newmdct.c \
$(SRC_PATH)/libmp3lame/psymodel.c \
$(SRC_PATH)/libmp3lame/quantize.c \
$(SRC_PATH)/libmp3lame/quantize_pvt.c \
$(SRC_PATH)/libmp3lame/set_get.c \
$(SRC_PATH)/libmp3lame/vbrquantize.c \
$(SRC_PATH)/libmp3lame/reservoir.c \
$(SRC_PATH)/libmp3lame/tables.c \
$(SRC_PATH)/libmp3lame/takehiro.c \
$(SRC_PATH)/libmp3lame/util.c \
$(SRC_PATH)/libmp3lame/VbrTag.c \
$(SRC_PATH)/libmp3lame/version.c \
$(SRC_PATH)/libmp3lame/presets.c
# lame's configure enables the SSE2, AVX2 and AVX-512 dispatch paths whenever
# the host compiler accepts their per-function target attributes, and the
# scalar code then calls into them, so the whole group has to be built on an
# x86 host. Other hosts keep lame's scalar implementation.
ifneq ($(CONFIG_HOST_X86)$(CONFIG_HOST_X86_64),)
CSRCS += $(SRC_PATH)/libmp3lame/vector/xmm_quantize_sub.c \
$(SRC_PATH)/libmp3lame/vector/xmm_choose_table.c \
$(SRC_PATH)/libmp3lame/vector/xmm_quantize_lines.c \
$(SRC_PATH)/libmp3lame/vector/xmm_calc_sfb_noise.c \
$(SRC_PATH)/libmp3lame/vector/avx2_choose_table.c \
$(SRC_PATH)/libmp3lame/vector/avx2_quantize_lines.c \
$(SRC_PATH)/libmp3lame/vector/avx512_choose_table.c \
$(SRC_PATH)/libmp3lame/vector/avx512_quantize_lines.c \
$(SRC_PATH)/libmp3lame/vector/avx512_calc_sfb_noise.c
endif
LAME_CONFIG_SCRIPT := $(CURDIR)$(DELIM)lame$(DELIM)configure
$(DST_PATH)/config.h:
$(Q)echo "lame configure... $(CONFIG_ARCH)"
$(Q)cd $(DST_PATH) && $(LAME_CONFIG_SCRIPT) \
--disable-cpml --disable-decoder --disable-efence \
--disable-frontend --disable-mp3x --disable-gtktest \
--disable-ipv6 --disable-rpath --enable-static \
$(CFG_CMDS)
context:: $(DST_PATH)/config.h
ifneq ($(PREFIX),)
@$(eval ALL_SRCS = $(CSRCS))
@$(foreach src,$(ALL_SRCS),$(shell mkdir -p $(PREFIX)$(dir $(src))))
endif
distclean::
$(Q)if [ -d $(DST_PATH) ]; then cd $(DST_PATH) && $(MAKE) distclean; fi
include $(APPDIR)/Application.mk

2
audioutils/libmad/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/libmad
/*.zip

View file

@ -0,0 +1,60 @@
# ##############################################################################
# apps/audioutils/libmad/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
if(CONFIG_AUDIOUTILS_LIBMAD)
# Download and unpack libmad if no libmad found
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/libmad/configure)
set(VERSION "master")
set(LIBMAD_URL
"https://github.com/markjeee/libmad/archive/refs/heads/master.zip")
file(DOWNLOAD ${LIBMAD_URL} ${CMAKE_CURRENT_SOURCE_DIR}/libmad.zip)
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar -xf ${CMAKE_CURRENT_SOURCE_DIR}/libmad.zip
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
execute_process(
COMMAND
${CMAKE_COMMAND} -E rename
${CMAKE_CURRENT_SOURCE_DIR}/libmad-${VERSION}
${CMAKE_CURRENT_SOURCE_DIR}/libmad)
add_custom_target(
distclean
COMMAND ${CMAKE_COMMAND} -E remove_directory
${CMAKE_CURRENT_SOURCE_DIR}/libmad
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_SOURCE_DIR}/libmad.zip)
endif()
nuttx_add_library(libmad STATIC)
file(GLOB LIBMAD_SRCS libmad/*.c)
set(CSRCS ${LIBMAD_SRCS})
set(CFLAGS -Wno-shadow -Wno-stringop-overflow -DFPM_DEFAULT -DSIZEOF_INT=4)
set(INCDIR ${CMAKE_CURRENT_LIST_DIR}/libmad
${CMAKE_CURRENT_LIST_DIR}/libmad/msvc++)
target_sources(libmad PRIVATE ${CSRCS})
target_include_directories(libmad PRIVATE ${INCDIR})
target_compile_options(libmad PRIVATE ${CFLAGS})
endif()

View file

@ -0,0 +1,8 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config AUDIOUTILS_LIBMAD
bool "Enable libmad"
default n

View file

@ -0,0 +1,25 @@
############################################################################
# apps/audioutils/libmad/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_AUDIOUTILS_LIBMAD),)
CONFIGURED_APPS += $(APPDIR)/audioutils/libmad
endif

View file

@ -0,0 +1,45 @@
############################################################################
# apps/audioutils/libmad/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(APPDIR)/Make.defs
CSRCS += $(wildcard libmad/*.c)
CFLAGS += -DFPM_DEFAULT -DSIZEOF_INT=4
CFLAGS += -Wno-shadow -Wno-stringop-overflow
# Download and unpack libmad if no git repo found
ifeq ($(wildcard libmad/.git),)
VERSION ?= master
libmad.zip:
$(Q) curl -L https://github.com/markjeee/libmad/archive/refs/heads/master.zip -o libmad.zip
$(Q) unzip -o libmad.zip
$(Q) mv libmad-$(VERSION) libmad
context:: libmad.zip
distclean::
$(call DELDIR, libmad)
$(call DELFILE, libmad.zip)
endif
include $(APPDIR)/Application.mk

View file

@ -0,0 +1,24 @@
# ##############################################################################
# apps/audioutils/mml_parser/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
if(CONFIG_AUDIOUTILS_MMLPARSER_LIB)
target_sources(apps PRIVATE mml_parser.c)
endif()

View file

@ -0,0 +1,10 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config AUDIOUTILS_MMLPARSER_LIB
bool "Music Macro Language(MML) Library"
default n
---help---
Enable support for the Music Macro Language library.

View file

@ -0,0 +1,25 @@
############################################################################
# apps/audioutils/mml_parser/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_AUDIOUTILS_MMLPARSER_LIB),)
CONFIGURED_APPS += $(APPDIR)/audioutils/mml_parser
endif

View file

@ -1,5 +1,7 @@
############################################################################
# apps/system/input/Makefile
# apps/audioutils/mml_parser/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@ -20,11 +22,8 @@
include $(APPDIR)/Make.defs
PROGNAME = input
PRIORITY = $(CONFIG_SYSTEM_INPUT_PRIORITY)
STACKSIZE = $(CONFIG_SYSTEM_INPUT_STACKSIZE)
MODULE = $(CONFIG_SYSTEM_INPUT)
# NSH Library
MAINSRC = input.c
CSRCS = mml_parser.c
include $(APPDIR)/Application.mk

View file

@ -0,0 +1,870 @@
/****************************************************************************
* apps/audioutils/mml_parser/mml_parser.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdbool.h>
#include <errno.h>
#include <audioutils/mml_parser.h>
#ifdef DEBUG_ON
#include <stdio.h>
#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define LENGTH_STATE_IDLE (0)
#define LENGTH_STATE_NUMBERD (1)
#define LENGTH_STATE_PLUS (2)
#define CHORD_START '['
#define CHORD_END ']'
#define TUPLET_START '{'
#define TUPLET_END '}'
#ifdef DEBUG_ON
#define DEBUG printf
#else
#define DEBUG(...)
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* name: skip_space
****************************************************************************/
static char *skip_space(char *str)
{
while (isspace(*str))
{
str++;
}
return str;
}
/****************************************************************************
* name: next_code
****************************************************************************/
static char next_code(char **score)
{
char ret;
*score = skip_space(*score);
ret = **score;
*score += 1;
return ret;
}
/****************************************************************************
* name: note_index
****************************************************************************/
static int note_index(char code)
{
int i;
const char *code_types = "C+D+EF+G+A+B";
for (i = 0; i < 12; i++)
{
if (code_types[i] == code)
{
return i;
}
}
return -1;
}
/****************************************************************************
* name: halfscale
****************************************************************************/
static int halfscale(char **score)
{
int ret = 0;
while (1)
{
switch (**score)
{
case '+':
case '#':
ret++;
break;
case '-':
ret--;
break;
default:
return ret;
}
*score += 1;
}
return ret;
}
/****************************************************************************
* name: strlendigits
****************************************************************************/
static int strlendigits(FAR const char *str)
{
int ret = 0;
while (isdigit(*str))
{
str++;
ret++;
}
return ret;
}
/****************************************************************************
* name: calc_samples
****************************************************************************/
static int calc_samples(int fs, int tempo, int num, int dots)
{
int div = 0;
int n = 0;
int mul = 16;
DEBUG("fs=%d, tempo=%d, num=%d, dots=%d\n", fs, tempo, num, dots);
switch (num)
{
case 0:
n = 3;
break;
case 1:
n = 2;
break;
case 2:
n = 1;
break;
case 4:
n = 0;
break;
case 8:
div = 1;
break;
case 16:
div = 2;
break;
case 32:
div = 3;
break;
case 64:
div = 4;
break;
default:
div = -1;
break;
}
if (dots <= 4)
{
while (dots)
{
mul += (1 << (4 - dots));
dots--;
}
}
else
{
dots = -1;
}
if (div < 0 || dots < 0)
{
return -EINVAL;
}
return (((15 * fs * mul) << n) >> (2 + div)) / tempo;
}
/****************************************************************************
* name: get_samples
****************************************************************************/
static int get_samples(FAR struct music_macro_lang_s *mml,
int samples, int num, int dots, bool plus_mode)
{
int len;
num = num < 0 ? mml->def_length : num;
len = calc_samples(mml->fs, mml->cur_tempo, num, dots);
if (len > 0)
{
return plus_mode ? samples + len : len;
}
return len;
}
/****************************************************************************
* name: is_qualifire
****************************************************************************/
static bool is_qualifire(char c)
{
if (isdigit(c) || c == '.')
{
return true;
}
return false;
}
/****************************************************************************
* name: sample_length
****************************************************************************/
static int sample_length(FAR struct music_macro_lang_s *mml,
FAR char **score)
{
int dots = 0;
int samples = 0;
int state = LENGTH_STATE_IDLE;
bool plus_mode = false;
bool parsing = true;
int num = -1;
samples = get_samples(mml, samples, num, dots, plus_mode);
if (!is_qualifire(**score))
{
return samples;
}
while (parsing)
{
DEBUG("In Length parser\n");
switch (state)
{
case LENGTH_STATE_IDLE:
if (isdigit(**score))
{
DEBUG("state[IDLE]: Digits\n");
num = atoi(*score);
*score += strlendigits(*score);
state = LENGTH_STATE_NUMBERD;
}
else if (**score == '.')
{
DEBUG("state[IDLE]: Dot\n");
state = LENGTH_STATE_NUMBERD;
dots++;
*score += 1;
}
else
{
DEBUG("state[IDLE]: Other\n");
samples = get_samples(mml, samples, num, dots, plus_mode);
parsing = false;
}
case LENGTH_STATE_NUMBERD:
if (**score == '.')
{
DEBUG("state[NUM]: Dot\n");
dots++;
*score += 1;
}
else if (**score == '+')
{
DEBUG("state[NUM]: PLUS\n");
samples = get_samples(mml, samples, num, dots, plus_mode);
if (samples < 0)
{
parsing = false;
}
plus_mode = true;
num = -1;
*score += 1;
state = LENGTH_STATE_PLUS;
}
else
{
DEBUG("state[NUM]: Other\n");
samples = get_samples(mml, samples, num, dots, plus_mode);
parsing = false;
}
break;
case LENGTH_STATE_PLUS:
if (isdigit(**score))
{
num = atoi(*score);
*score += strlendigits(*score);
DEBUG("state[PLUS]: Digits num=%d, restscore=%s,"
" parsing=%s\n",
num, *score, parsing ? "True" : "False");
state = LENGTH_STATE_NUMBERD;
}
else
{
DEBUG("state[PLUS]: Other\n");
samples = -EINVAL;
parsing = false;
}
break;
default:
parsing = false;
samples = -EPROTO;
break;
}
DEBUG("Out switch : state[%s]: Digits num=%d, restscore=%s,"
" parse=%s\n",
state == LENGTH_STATE_IDLE ? "IDLE" :
state == LENGTH_STATE_NUMBERD ? "NUM" :
state == LENGTH_STATE_PLUS ? "PLUS" : "Unknown",
num, *score, parsing ? "True" : "False");
}
DEBUG("Out while\n");
return samples;
}
/****************************************************************************
* name: tuple_length
****************************************************************************/
static int tuplet_length(FAR struct music_macro_lang_s *mml)
{
int ret;
ret = mml->tuplet_length / mml->tuplet_notes;
mml->cur_tuplet++;
if (mml->cur_tuplet == mml->tuplet_notes)
{
/* Adjust surplus */
ret = mml->tuplet_length - (ret * (mml->tuplet_notes - 1));
}
return ret;
}
/****************************************************************************
* name: handle_note
****************************************************************************/
static int handle_note(FAR struct music_macro_lang_s *mml, char code,
FAR char **score, FAR struct mml_result_s *result)
{
result->note_idx[0] = note_index(code) + halfscale(score)
+ mml->cur_octave * 12;
result->length = sample_length(mml, score);
return result->length < 0 ? MML_TYPE_NOTE_ERROR : MML_TYPE_NOTE;
}
/****************************************************************************
* name: handle_rest
****************************************************************************/
static int handle_rest(FAR struct music_macro_lang_s *mml,
FAR char **score, FAR struct mml_result_s *result)
{
if (mml->state == MML_STATE_TUPLET)
{
DEBUG("Tuplet : TTL %d, CUR %d\n", mml->tuplet_notes, mml->cur_tuplet);
result->length = tuplet_length(mml);
return MML_TYPE_REST;
}
else
{
result->length = sample_length(mml, score);
return result->length < 0 ? MML_TYPE_REST_ERROR : MML_TYPE_REST;
}
}
/****************************************************************************
* name: handle_tempo
****************************************************************************/
static int handle_tempo(FAR struct music_macro_lang_s *mml,
FAR char **score, FAR struct mml_result_s *result)
{
int ret = MML_TYPE_TEMPO;
if (isdigit(**score))
{
mml->cur_tempo = result->length = atoi(*score);
*score += strlendigits(*score);
}
else
{
ret = MML_TYPE_TEMPO_ERROR;
}
return ret;
}
/****************************************************************************
* name: handle_length
****************************************************************************/
static int handle_length(FAR struct music_macro_lang_s *mml,
FAR char **score, FAR struct mml_result_s *result)
{
int ret = MML_TYPE_LENGTH_ERROR;
DEBUG("length str : %c\n", **score);
if (isdigit(**score))
{
mml->def_length = result->length = atoi(*score);
*score += strlendigits(*score);
ret = MML_TYPE_LENGTH;
}
return ret;
}
/****************************************************************************
* name: handle_octave
****************************************************************************/
static int handle_octave(FAR struct music_macro_lang_s *mml, char code,
FAR char **score, FAR struct mml_result_s *result)
{
int ret = MML_TYPE_OCTAVE;
switch (code)
{
case '>':
mml->cur_octave++;
result->length = mml->cur_octave;
break;
case '<':
mml->cur_octave--;
result->length = mml->cur_octave;
break;
default:
if (isdigit(**score))
{
mml->cur_octave = result->length = atoi(*score);
*score += strlendigits(*score);
}
else
{
ret = MML_TYPE_OCTAVE_ERROR;
}
break;
}
return ret;
}
/****************************************************************************
* name: handle_volume
****************************************************************************/
static int handle_volume(FAR struct music_macro_lang_s *mml,
FAR char **score, FAR struct mml_result_s *result)
{
int ret = MML_TYPE_VOLUME;
result->length = atoi(*score);
*score += strlendigits(*score);
if (result->length < 0 || result->length > 100)
{
ret = MML_TYPE_VOLUME_ERROR;
}
return ret;
}
/****************************************************************************
* name: skip_until
****************************************************************************/
static char *skip_until(FAR char *score, char until)
{
while (*score != until && *score != '\0')
{
score++;
}
return score;
}
/****************************************************************************
* name: count_tupletnotes
****************************************************************************/
static int count_tupletnotes(FAR struct music_macro_lang_s *mml,
FAR char *score)
{
const char *notes = "CDEFGABR";
score = skip_space(score);
while (*score != TUPLET_END)
{
if (strchr(notes, *score))
{
mml->tuplet_notes++;
}
else if (*score == CHORD_START)
{
score = skip_until(score, CHORD_END);
mml->tuplet_notes++;
}
if (*score == '\0')
{
return -EINVAL;
}
score++;
score = skip_space(score);
}
score++; /* Skip TUPLET_END */
mml->tuplet_length = sample_length(mml, &score);
return mml->tuplet_notes != 0 ? OK : -EINVAL;
}
/****************************************************************************
* name: handle_starttuplet
****************************************************************************/
static int handle_starttuplet(FAR struct music_macro_lang_s *mml,
FAR char **score,
FAR struct mml_result_s *result)
{
int ret;
if (mml->state != MML_STATE_NORMAL)
{
return MML_TYPE_ILLIGAL_DOUBLE_TUPLET;
}
mml->tuplet_notes = 0;
ret = count_tupletnotes(mml, *score);
if (ret < 0 || mml->tuplet_notes == 0)
{
return MML_TYPE_TUPLET_ERROR;
}
mml->state = MML_STATE_TUPLET;
mml->cur_tuplet = 0;
result->length = mml->tuplet_length;
return MML_TYPE_TUPLETSTART;
}
/****************************************************************************
* name: handle_stoptuplet
****************************************************************************/
static int handle_stoptuplet(FAR struct music_macro_lang_s *mml,
FAR char **score,
FAR struct mml_result_s *result)
{
int ret = MML_TYPE_TUPLETDONE;
mml->state = MML_STATE_NORMAL;
/* Just for skip of length block */
sample_length(mml, score);
if (mml->cur_tuplet != mml->tuplet_notes)
{
ret = MML_TYPE_ILLIGAL_TOOFEW_NOTES;
}
return ret;
}
/****************************************************************************
* name: handle_tupletnote
****************************************************************************/
static int handle_tupletnote(FAR struct music_macro_lang_s *mml, char code,
FAR char **score,
FAR struct mml_result_s *result)
{
int ret = MML_TYPE_NOTE;
DEBUG("Tuplet : TTL %d, CUR %d\n", mml->tuplet_notes, mml->cur_tuplet);
if (mml->cur_tuplet < mml->tuplet_notes)
{
result->note_idx[0] = note_index(code) + halfscale(score)
+ mml->cur_octave * 12;
result->length = tuplet_length(mml);
}
else
{
ret = MML_TYPE_ILLIGAL_TOOMANY_NOTES;
}
return ret;
}
/****************************************************************************
* name: handle_notes
****************************************************************************/
static int handle_notes(FAR struct music_macro_lang_s *mml, char code,
FAR char **score,
FAR struct mml_result_s *result)
{
int ret;
result->chord_notes = 1;
if (mml->state == MML_STATE_TUPLET)
{
ret = handle_tupletnote(mml, code, score, result);
}
else
{
ret = handle_note(mml, code, score, result);
}
return ret;
}
/****************************************************************************
* name: handle_startchord
****************************************************************************/
static int handle_startchord(FAR struct music_macro_lang_s *mml,
FAR char **score,
FAR struct mml_result_s *result)
{
char code;
int note_idx;
code = next_code(score);
while (code != CHORD_END && code != '\0')
{
DEBUG("CHORD: %c\n", code);
note_idx = note_index(code);
DEBUG("CHORD note_idx = %d\n", note_idx);
if (note_idx >= 0)
{
note_idx += halfscale(score) + mml->cur_octave * 12;
if (result->chord_notes < MAX_CHORD_NOTES)
{
result->note_idx[result->chord_notes] = note_idx;
result->chord_notes++;
}
/* In case of chord notes are over than MAX_CHORD_NOTES,
* just ignore overflowed notes. Not behave as an error.
*/
}
else
{
switch (code)
{
case 'O':
case '>':
case '<':
if (handle_octave(mml, code, score, result) < 0)
{
return MML_TYPE_CHORD_ERROR;
}
break;
default:
return MML_TYPE_CHORD_ERROR;
break;
}
}
code = next_code(score);
}
if (code == '\0')
{
return MML_TYPE_CHORD_ERROR;
}
if (mml->state == MML_STATE_TUPLET)
{
result->length = tuplet_length(mml);
}
else
{
result->length = sample_length(mml, score);
}
return result->length < 0 ? MML_TYPE_CHORD_ERROR : MML_TYPE_CHORD;
}
/****************************************************************************
* name: handle_tone
****************************************************************************/
static int handle_tone(FAR struct music_macro_lang_s *mml,
FAR char **score, FAR struct mml_result_s *result)
{
int ret = MML_TYPE_TONE_ERROR;
if (isdigit(**score))
{
result->note_idx[0] = atoi(*score);
*score += strlendigits(*score);
ret = MML_TYPE_TONE;
}
return ret;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* name: init_mml
****************************************************************************/
int init_mml(FAR struct music_macro_lang_s *mml, int fs,
int tempo, int octave, int length)
{
mml->fs = fs;
mml->cur_tempo = tempo;
mml->cur_octave = octave;
mml->def_length = length;
mml->state = MML_STATE_NORMAL;
mml->cur_tuplet = 0;
mml->tuplet_notes = 0;
mml->tuplet_length = 0;
return 0;
}
/****************************************************************************
* name: parse_mml
****************************************************************************/
int parse_mml(FAR struct music_macro_lang_s *mml, FAR char **score,
FAR struct mml_result_s *result)
{
int ret;
char code;
code = next_code(score);
DEBUG("code=%c\n", code);
result->chord_notes = 0;
switch (code)
{
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
ret = handle_notes(mml, code, score, result);
break;
case 'R':
ret = handle_rest(mml, score, result);
break;
case 'T':
ret = handle_tempo(mml, score, result);
break;
case 'L':
ret = handle_length(mml, score, result);
break;
case 'O':
case '>':
case '<':
ret = handle_octave(mml, code, score, result);
break;
case 'V':
ret = handle_volume(mml, score, result);
break;
case CHORD_START:
ret = handle_startchord(mml, score, result);
break;
case TUPLET_START:
ret = handle_starttuplet(mml, score, result);
break;
case TUPLET_END:
ret = handle_stoptuplet(mml, score, result);
break;
case '@':
ret = handle_tone(mml, score, result);
break;
case '\0':
ret = MML_TYPE_EOF;
*score -= 1; /* Backward */
break;
default:
ret = MML_TYPE_ILLIGAL_COMPOSITION;
break;
}
return ret;
}

1
audioutils/morsey/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
morsey

View file

@ -0,0 +1,6 @@
config AUDIOUTILS_MORSEY
bool "Morse code playing library"
default n
---help---
Simple library for parsing ASCII text into playable Morse code. Not
necessarily restricted to audio.

View file

@ -0,0 +1,25 @@
############################################################################
# apps/audioutils/morsey/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_AUDIOUTILS_MORSEY),)
CONFIGURED_APPS += $(APPDIR)/audioutils/morsey
endif

View file

@ -0,0 +1,50 @@
############################################################################
# apps/audioutils/morsey/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(APPDIR)/Make.defs
CSRCS = $(MORSEY_DIR)/morsey.c
MORSEY_DIR = morsey
MORSEY_VERSION = v1.0.1
MORSEY_MORSEY_H_SHA256 = 55f45e7b9a4d810f928ffe3ee9bea4cc318e28b1f49abf9512aee2638bd1dbfa
MORSEY_MORSEY_C_SHA256 = 12babc90d3518e026c344c38dc3701287c41fd6b41a3ec96fb36c77907be78f8
$(MORSEY_DIR):
$(Q) echo "Cloning Morsey repo..."
$(Q) git clone --depth=1 --branch=$(MORSEY_VERSION) https://github.com/linguini1/morsey.git
$(Q) touch $(MORSEY_DIR)
$(Q) echo "Checking Morsey hashes..."
$(Q) $(APPDIR)/tools/check-hash.sh sha256 $(MORSEY_MORSEY_H_SHA256) $@/morsey.h
$(Q) $(APPDIR)/tools/check-hash.sh sha256 $(MORSEY_MORSEY_C_SHA256) $@/morsey.c
create_includes: $(MORSEY_DIR)/morsey.h
$(Q) cp $< $(APPDIR)/include/audioutils
context:: $(MORSEY_DIR)
$(Q) $(MAKE) create_includes
distclean::
$(call DELFILE, $(APPDIR)/include/audioutils/morsey.h)
$(call DELDIR, morsey)
include $(APPDIR)/Application.mk

View file

@ -0,0 +1,25 @@
# ##############################################################################
# apps/audioutils/nxaudio/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
if(CONFIG_AUDIOUTILS_NXAUDIO_LIB)
target_sources(apps PRIVATE nxaudio.c)
endif()

View file

@ -0,0 +1,26 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config AUDIOUTILS_NXAUDIO_LIB
bool "NX Audio Library"
default n
---help---
Enable support for the NX Audio library.
if AUDIOUTILS_NXAUDIO_LIB
config AUDIOUTILS_NXAUDIO_DEVPATH
string "Audio Device file path"
default "/dev/audio/pcm1"
---help---
Audio device file path of target audio device.
config AUDIOUTILS_NXAUDIO_MSGQNAME
string "Message queue name"
default "/tmp/fmaudio_mq"
---help---
Message queue name (file path) to communicate with audio message loop.
endif

View file

@ -0,0 +1,25 @@
############################################################################
# apps/audioutils/nxaudio/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_AUDIOUTILS_NXAUDIO_LIB),)
CONFIGURED_APPS += $(APPDIR)/audioutils/nxaudio
endif

View file

@ -0,0 +1,27 @@
############################################################################
# apps/audioutils/nxaudio/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(APPDIR)/Make.defs
CSRCS = nxaudio.c
include $(APPDIR)/Application.mk

View file

@ -0,0 +1,353 @@
/****************************************************************************
* apps/audioutils/nxaudio/nxaudio.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <mqueue.h>
#include <sys/ioctl.h>
#include <nuttx/audio/audio.h>
#include <errno.h>
#include <audioutils/nxaudio.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* name: configure_audio
****************************************************************************/
static int configure_audio(int fd, int ch, int fs, int bps, int chmap)
{
struct audio_caps_desc_s cap;
cap.caps.ac_len = sizeof(struct audio_caps_s);
cap.caps.ac_type = AUDIO_TYPE_OUTPUT;
cap.caps.ac_channels = ch;
cap.caps.ac_chmap = chmap;
cap.caps.ac_controls.hw[0] = fs;
cap.caps.ac_controls.b[2] = bps;
cap.caps.ac_controls.b[3] = 0; /* Just set 0 */
return ioctl(fd, AUDIOIOC_CONFIGURE, (unsigned long)(uintptr_t)&cap);
}
/****************************************************************************
* name: create_audiomq
****************************************************************************/
static mqd_t create_audiomq(const char *mqname, int fd, int buf_num)
{
mqd_t ret;
struct mq_attr attr;
attr.mq_maxmsg = buf_num;
attr.mq_msgsize = sizeof(struct audio_msg_s);
attr.mq_curmsgs = 0;
attr.mq_flags = 0;
ret = mq_open(mqname, O_RDWR | O_CREAT, 0644, &attr);
if (ret >= (mqd_t)0)
{
int rr;
if ((rr = ioctl(fd, AUDIOIOC_REGISTERMQ, (unsigned long)ret)) < 0)
{
printf("mq register failed: %d, %d\n", rr, errno);
}
}
return ret;
}
/****************************************************************************
* name: create_audio_buffers
****************************************************************************/
static FAR struct ap_buffer_s **create_audio_buffers(int fd, int num, int sz)
{
int i;
struct audio_buf_desc_s desc;
FAR struct ap_buffer_s **ret;
ret = (FAR struct ap_buffer_s **)calloc(num, sizeof(FAR void *));
for (i = 0; i < num; i++)
{
desc.numbytes = sz;
desc.u.pbuffer = &ret[i];
ioctl(fd, AUDIOIOC_ALLOCBUFFER, (unsigned long)(uintptr_t)&desc);
}
return ret;
}
/****************************************************************************
* name: free_audio_buffers
****************************************************************************/
static void free_audio_buffers(FAR struct nxaudio_s *nxaudio)
{
int x;
struct audio_buf_desc_s desc;
for (x = 0; x < nxaudio->abufnum; x++)
{
if (nxaudio->abufs[x] != NULL)
{
desc.u.buffer = nxaudio->abufs[x];
ioctl(nxaudio->fd, AUDIOIOC_FREEBUFFER,
(unsigned long)(uintptr_t)&desc);
}
}
free(nxaudio->abufs);
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* name: fin_nxaudio
****************************************************************************/
void fin_nxaudio(FAR struct nxaudio_s *nxaudio)
{
ioctl(nxaudio->fd, AUDIOIOC_SHUTDOWN, 0);
ioctl(nxaudio->fd, AUDIOIOC_UNREGISTERMQ, (unsigned long)nxaudio->mq);
ioctl(nxaudio->fd, AUDIOIOC_RELEASE, 0);
free_audio_buffers(nxaudio);
close(nxaudio->fd);
mq_close(nxaudio->mq);
mq_unlink(CONFIG_AUDIOUTILS_NXAUDIO_MSGQNAME);
}
/****************************************************************************
* name: init_nxaudio
****************************************************************************/
int init_nxaudio(FAR struct nxaudio_s *nxaudio,
int fs, int bps, int chnum)
{
return init_nxaudio_devname(nxaudio, fs, bps, chnum,
CONFIG_AUDIOUTILS_NXAUDIO_DEVPATH,
CONFIG_AUDIOUTILS_NXAUDIO_MSGQNAME);
}
/****************************************************************************
* name: init_nxaudio_devname
****************************************************************************/
int init_nxaudio_devname(FAR struct nxaudio_s *nxaudio,
int fs, int bps, int chnum,
const char *devname, const char *mqname)
{
struct ap_buffer_info_s buf_info;
nxaudio->fd = open(devname, O_RDWR | O_CLOEXEC);
if (nxaudio->fd >= 0)
{
if (ioctl(nxaudio->fd, AUDIOIOC_RESERVE, 0) < 0)
{
close(nxaudio->fd);
return -1;
}
/* Audio configuration: set channel num, FS and bps */
configure_audio(nxaudio->fd, chnum, fs, bps, 0);
nxaudio->chnum = chnum;
ioctl(nxaudio->fd, AUDIOIOC_GETBUFFERINFO,
(unsigned long)(uintptr_t)&buf_info);
/* Create message queue to communicate with audio driver */
nxaudio->mq = create_audiomq(mqname, nxaudio->fd,
buf_info.nbuffers + 8);
/* Create audio buffers to inject audio sample */
nxaudio->abufs = create_audio_buffers(nxaudio->fd,
buf_info.nbuffers, buf_info.buffer_size);
nxaudio->abufnum = buf_info.nbuffers;
return 0;
}
else
{
return -1;
}
}
/****************************************************************************
* name: nxaudio_enqbuffer
****************************************************************************/
int nxaudio_enqbuffer(FAR struct nxaudio_s *nxaudio,
FAR struct ap_buffer_s *apb)
{
struct audio_buf_desc_s desc;
desc.numbytes = apb->nbytes;
desc.u.buffer = apb;
return ioctl(nxaudio->fd, AUDIOIOC_ENQUEUEBUFFER,
(unsigned long)(uintptr_t)&desc);
}
/****************************************************************************
* name: nxaudio_pause
****************************************************************************/
int nxaudio_pause(FAR struct nxaudio_s *nxaudio)
{
return ioctl(nxaudio->fd, AUDIOIOC_PAUSE, 0);
}
/****************************************************************************
* name: nxaudio_resume
****************************************************************************/
int nxaudio_resume(FAR struct nxaudio_s *nxaudio)
{
return ioctl(nxaudio->fd, AUDIOIOC_RESUME, 0);
}
/****************************************************************************
* name: nxaudio_setvolume
****************************************************************************/
int nxaudio_setvolume(FAR struct nxaudio_s *nxaudio, uint16_t vol)
{
struct audio_caps_desc_s cap_desc;
cap_desc.caps.ac_len = sizeof(struct audio_caps_s);
cap_desc.caps.ac_type = AUDIO_TYPE_FEATURE;
cap_desc.caps.ac_format.hw = AUDIO_FU_VOLUME;
cap_desc.caps.ac_controls.hw[0] = vol;
return ioctl(nxaudio->fd, AUDIOIOC_CONFIGURE,
(unsigned long)(uintptr_t)&cap_desc);
}
/****************************************************************************
* name: nxaudio_start
****************************************************************************/
int nxaudio_start(FAR struct nxaudio_s *nxaudio)
{
return ioctl(nxaudio->fd, AUDIOIOC_START, 0);
}
/****************************************************************************
* name: nxaudio_start
****************************************************************************/
int nxaudio_stop(FAR struct nxaudio_s *nxaudio)
{
struct audio_msg_s term_msg;
term_msg.msg_id = AUDIO_MSG_STOP;
term_msg.u.data = 0;
mq_send(nxaudio->mq, (FAR const char *)&term_msg, sizeof(term_msg), 0);
ioctl(nxaudio->fd, AUDIOIOC_STOP, 0);
return OK;
}
/****************************************************************************
* name: nxaudio_msgloop
****************************************************************************/
int nxaudio_msgloop(FAR struct nxaudio_s *nxaudio,
FAR struct nxaudio_callbacks_s *cbs,
unsigned long arg)
{
bool running = true;
struct audio_msg_s msg;
unsigned int prio;
ssize_t size;
if (!cbs)
{
return -1;
}
while (running)
{
size = mq_receive(nxaudio->mq, (FAR char *)&msg, sizeof(msg), &prio);
if (size != sizeof(msg))
{
continue;
}
switch (msg.msg_id)
{
case AUDIO_MSG_DEQUEUE:
if (cbs->dequeue)
{
cbs->dequeue(arg, msg.u.ptr);
}
break;
case AUDIO_MSG_COMPLETE:
if (cbs->complete)
{
cbs->complete(arg);
}
break;
case AUDIO_MSG_STOP:
running = false;
break;
case AUDIO_MSG_USER:
if (cbs->user)
{
cbs->user(arg, &msg, &running);
}
break;
default:
break;
}
}
return 0;
}

1
audioutils/rtttl-c/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/rtttl-c

View file

@ -0,0 +1,21 @@
config AUDIOUTILS_RTTTL_C
bool "RTTTL parsing library"
default n
---help---
Simple library for parsing Ring Tone Text Transfer Language (RTTTL)
Define how to make a sound:
void
play_tone(struct rtttl_tone tone)
{
/* TODO: Make a sound with
* tone.frequency_100hz
* tone.period_us
* tone.duration_us
*/
}
and then play RTTTL string:
rtttl_play("...", play_tone);

View file

@ -0,0 +1,25 @@
############################################################################
# apps/audioutils/rtttl-c/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_AUDIOUTILS_RTTTL_C),)
CONFIGURED_APPS += $(APPDIR)/audioutils/rtttl-c
endif

View file

@ -0,0 +1,50 @@
############################################################################
# apps/audioutils/rtttl-c/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(APPDIR)/Make.defs
CSRCS = $(RTTTL_C_DIR)/rtttl.c
RTTTL_C_DIR = rtttl-c
RTTTL_C_VERSION = v0.1.0
RTTTL_C_RTTTL_H_SHA256 = 6331174ae34a419ad427d9755f8ba9d3b6a92c09ecc4f36bbe07ec5e4d0cc007
RTTTL_C_RTTTL_C_SHA256 = f0db64ef0b68136bac24616a3d62508bcc54ccdd68265d6447d99b264653b7b9
$(RTTTL_C_DIR):
$(Q) echo "Cloning rtttl-c repo..."
$(Q) git clone --depth=1 --branch=$(RTTTL_C_VERSION) https://git.sr.ht/~qeef/rtttl-c
$(Q) touch $(RTTTL_C_DIR)
$(Q) echo "Checking rtttl-c hashes..."
$(Q) $(APPDIR)/tools/check-hash.sh sha256 $(RTTTL_C_RTTTL_H_SHA256) $@/rtttl.h
$(Q) $(APPDIR)/tools/check-hash.sh sha256 $(RTTTL_C_RTTTL_C_SHA256) $@/rtttl.c
create_includes: $(RTTTL_C_DIR)/rtttl.h
$(Q) cp $< $(APPDIR)/include/audioutils
context:: $(RTTTL_C_DIR)
$(Q) $(MAKE) create_includes
distclean::
$(call DELFILE, $(APPDIR)/include/audioutils/rtttl.h)
$(call DELDIR, rtttl-c)
include $(APPDIR)/Application.mk

1
benchmarks/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/Kconfig

25
benchmarks/CMakeLists.txt Normal file
View file

@ -0,0 +1,25 @@
# ##############################################################################
# apps/benchmarks/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
nuttx_add_subdirectory()
nuttx_generate_kconfig(MENUDESC "Benchmark Applications")

23
benchmarks/Make.defs Normal file
View file

@ -0,0 +1,23 @@
############################################################################
# apps/benchmarks/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(wildcard $(APPDIR)/benchmarks/*/Make.defs)

25
benchmarks/Makefile Normal file
View file

@ -0,0 +1,25 @@
############################################################################
# apps/benchmarks/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
MENUDESC = "Benchmark Applications"
include $(APPDIR)/Directory.mk

View file

@ -0,0 +1,33 @@
# ##############################################################################
# apps/benchmarks/cachespeed/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
if(CONFIG_BENCHMARK_CACHESPEED)
nuttx_add_application(
NAME
${CONFIG_BENCHMARK_CACHESPEED_PROGNAME}
SRCS
cachespeed_main.c
STACKSIZE
${CONFIG_BENCHMARK_CACHESPEED_STACKSIZE}
PRIORITY
${CONFIG_BENCHMARK_CACHESPEED_PRIORITY})
endif()

View file

@ -0,0 +1,44 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config BENCHMARK_CACHESPEED
tristate "CACHE Speed Test"
depends on ARCH_ICACHE && ARCH_DCACHE
default n
---help---
Enable a simple CACHE speed test.
if BENCHMARK_CACHESPEED
config BENCHMARK_CACHESPEED_PROGNAME
string "Program name"
default "cachespeed"
---help---
This is the name of the program that will be used when the NSH ELF
program is installed.
config BENCHMARK_CACHESPEED_PRIORITY
int "CACHE speed test task priority"
default 100
config BENCHMARK_CACHESPEED_STACKSIZE
int "CACHE speed test stack size"
default DEFAULT_TASK_STACKSIZE
config CACHESPEED_MONOTONIC_TIME
bool "Using Clock Gettime"
default n
---help---
When you turn on this option, your test loop will go from 10000 -> 1000 times
Please consider the following scenario:
1. By default (PERFTIME) will have a relatively high precision, but this also
tends to cause failure in getting values on some smaller bytes, so reducing
the precision with this option can make it easier to get data values.
2. whether to compare data with the content of other tools (using CLOCK
GETTIME method), if so, it is recommended to turn on, so as to ensure that
the data precision of both consistent.
endif

View file

@ -0,0 +1,25 @@
############################################################################
# apps/benchmarks/cachespeed/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_BENCHMARK_CACHESPEED),)
CONFIGURED_APPS += $(APPDIR)/benchmarks/cachespeed
endif

View file

@ -0,0 +1,38 @@
############################################################################
# apps/benchmarks/cachespeed/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(APPDIR)/Make.defs
#CACHE speed test
ifneq ($(CONFIG_CACHESPEED_MONOTONIC_TIME),y)
CFLAGS += -DCACHESPEED_PERFTIME
endif
PROGNAME = $(CONFIG_BENCHMARK_CACHESPEED_PROGNAME)
PRIORITY = $(CONFIG_BENCHMARK_CACHESPEED_PRIORITY)
STACKSIZE = $(CONFIG_BENCHMARK_CACHESPEED_STACKSIZE)
MODULE = $(CONFIG_BENCHMARK_CACHESPEED)
MAINSRC = cachespeed_main.c
include $(APPDIR)/Application.mk

View file

@ -0,0 +1,254 @@
/****************************************************************************
* apps/benchmarks/cachespeed/cachespeed_main.c
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/arch.h>
#include <nuttx/cache.h>
#include <nuttx/config.h>
#include <nuttx/irq.h>
#include <inttypes.h>
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define CACHESPEED_PREFIX "CACHE Speed: "
#define REPEAT_NUM 1000
#ifdef CACHESPEED_PERFTIME
#define TIME uint64_t
#define CONVERT(cost) \
do \
{ \
struct timespec ts; \
perf_convert(cost, &ts); \
cost = ts.tv_sec * 1000000000 + ts.tv_nsec; \
} while (0)
#define TIMESTAMP(x) (x) = perf_gettime()
#else
#define TIME time_t
#define CONVERT(cost)
#define TIMESTAMP(x) \
do \
{ \
struct timespec ts; \
clock_gettime(CLOCK_MONOTONIC, &ts); \
x = ts.tv_sec * 1000000000 + ts.tv_nsec; \
} while (0)
#endif
#define GET_DCACHE_LINE up_get_dcache_linesize()
#define GET_ICACHE_LINE up_get_icache_linesize()
#define GET_DCACHE_SIZE up_get_dcache_size()
#define GET_ICACHE_SIZE up_get_icache_size()
/****************************************************************************
* Private Types
****************************************************************************/
struct cachespeed_s
{
uintptr_t addr;
size_t alloc;
};
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: setup
****************************************************************************/
static void setup(FAR struct cachespeed_s *cs)
{
struct mallinfo info = mallinfo();
/* Get the currently available memory from the system. We want the
* memset range to be as large as possible in our tests to ensure
* that the cache is filled with our dirty data
*/
cs->alloc = info.fordblks / 2;
cs->addr = (uintptr_t)malloc(cs->alloc);
if (cs->addr == 0)
{
printf(CACHESPEED_PREFIX "Unable to request memory.\n");
exit(EXIT_FAILURE);
}
/* Let's export the test message */
printf(CACHESPEED_PREFIX "address src: %" PRIxPTR "\n", cs->addr);
}
/****************************************************************************
* Name: teardown
****************************************************************************/
static void teardown(FAR struct cachespeed_s *cs)
{
free((void *)cs->addr);
printf(CACHESPEED_PREFIX "Done!\n");
}
/****************************************************************************
* Name: report_line
****************************************************************************/
static void report_line(size_t bytes, TIME cost)
{
double rate;
/* There is a situation: if the time is 0, then the
* calculated speed is wrong.
*/
CONVERT(cost);
if (cost == 0)
{
printf(CACHESPEED_PREFIX "%zu bytes cost time too small!\n", bytes);
return;
}
/* rate = Test Data Size / Execution Time */
rate = 1.00 * bytes * REPEAT_NUM / cost;
printf("%zu Bytes: %4lf, %4" PRIu64", %4" PRIu64"\n\r",
bytes, rate, cost / REPEAT_NUM, cost);
}
/****************************************************************************
* Name: test_skeleton
****************************************************************************/
static void test_skeleton(FAR struct cachespeed_s *cs,
const size_t cache_size,
const size_t cache_line_size, int align,
void (*func)(uintptr_t, uintptr_t),
const char *name)
{
size_t update_size;
printf("** %s [rate, avg, cost] in nanoseconds(bytes/nesc) %s **\n",
name, align ? "align" : "unalign");
if (!align)
{
update_size = cache_line_size - 1;
}
else
{
update_size = cache_line_size;
}
for (size_t bytes = update_size;
bytes <= cache_size; bytes = 2 * bytes)
{
irqstate_t irq;
TIME start;
TIME end;
TIME cost = 0;
/* Make sure that test with all the contents
* of our address in the cache.
*/
up_flush_dcache_all();
irq = enter_critical_section();
for (int i = 0; i < REPEAT_NUM; i++)
{
memset((void *)cs->addr, 1, cs->alloc);
TIMESTAMP(start);
func(cs->addr, (uintptr_t)(cs->addr + bytes));
TIMESTAMP(end);
cost += end - start;
}
leave_critical_section(irq);
report_line(bytes, cost);
}
}
/****************************************************************************
* Name: cachespeed_common
****************************************************************************/
static void cachespeed_common(struct cachespeed_s *cs)
{
test_skeleton(cs, GET_DCACHE_SIZE, GET_DCACHE_LINE, 1,
up_invalidate_dcache, "dcache invalidate");
test_skeleton(cs, GET_DCACHE_SIZE, GET_DCACHE_LINE, 0,
up_invalidate_dcache, "dcache invalidate");
test_skeleton(cs, GET_DCACHE_SIZE, GET_DCACHE_LINE, 1,
up_clean_dcache, "dcache clean");
test_skeleton(cs, GET_DCACHE_SIZE, GET_DCACHE_LINE, 0,
up_clean_dcache, "dcache clean");
test_skeleton(cs, GET_DCACHE_SIZE, GET_DCACHE_LINE, 1,
up_flush_dcache, "dcache flush");
test_skeleton(cs, GET_DCACHE_SIZE, GET_DCACHE_LINE, 0,
up_flush_dcache, "dcache flush");
test_skeleton(cs, GET_ICACHE_SIZE, GET_ICACHE_LINE, 1,
up_invalidate_icache, "icache invalidate");
test_skeleton(cs, GET_ICACHE_SIZE, GET_ICACHE_LINE, 0,
up_invalidate_icache, "icache invalidate");
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: cachespeed_main
****************************************************************************/
int main(int argc, FAR char *argv[])
{
struct cachespeed_s cs =
{
.addr = 0,
.alloc = 0
};
setup(&cs);
cachespeed_common(&cs);
teardown(&cs);
return 0;
}

1
benchmarks/coremark-pro/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/coremark-pro

View file

@ -0,0 +1,333 @@
# ##############################################################################
# apps/benchmarks/coremark-pro/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
if(CONFIG_BENCHMARK_COREMARK_PRO)
set(COREMARKAPP_DIR ${CMAKE_CURRENT_LIST_DIR}/coremark-pro)
if(NOT EXISTS ${COREMARKAPP_DIR})
FetchContent_Declare(
coremark_fetch
URL https://github.com/eembc/coremark-pro/archive/refs/heads/main.zip
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/coremark-pro BINARY_DIR
${CMAKE_BINARY_DIR}/apps/benchmarks/coremark/coremark-pro
DOWNLOAD_NO_PROGRESS true
TIMEOUT 30)
FetchContent_GetProperties(coremark_fetch)
if(NOT coremark_fetch_POPULATED)
FetchContent_Populate(coremark_fetch)
endif()
endif()
nuttx_add_library(coremark_pro STATIC)
set(CSRCS
coremark-pro/mith/src/md5.c
coremark-pro/mith/src/mith_lib.c
coremark-pro/mith/src/mith_workload.c
coremark-pro/mith/src/th_bignum.c
coremark-pro/mith/src/th_encode.c
coremark-pro/mith/src/th_lib.c
coremark-pro/mith/src/th_math.c
coremark-pro/mith/src/th_rand.c)
file(GLOB MITH_AL_SRCS coremark-pro/mith/al/src/*.c)
list(APPEND CSRCS ${MITH_AL_SRCS})
set(CFLAGS
-Wno-undef
-Wno-strict-prototypes
-Wno-unused-variable
-Wno-pointer-sign
-Wno-unused-but-set-variable
-Wno-shadow
-DNDEBUG
-DHOST_EXAMPLE_CODE=1
-DHAVE_SYS_STAT_H=1
-DGCC_INLINE_MACRO=1
-DMAX_CONTEXTS=100
-DEE_SIZEOF_INT=4
-DUSE_FP128=0)
set(INCDIR ${CMAKE_CURRENT_LIST_DIR}/coremark-pro/mith/include
${CMAKE_CURRENT_LIST_DIR}/coremark-pro/mith/al/include)
if(CONFIG_BENCHMARK_COREMARK_PRO_USE_SINGLE_CONTEXT)
list(APPEND CFLAGS -DUSE_SINGLE_CONTEXT=1 -DHAVE_PTHREAD=0
-DUSE_NATIVE_PTHREAD=0)
else()
list(APPEND CFLAGS -DUSE_SINGLE_CONTEXT=0 -DHAVE_PTHREAD=1
-DUSE_NATIVE_PTHREAD=1)
endif()
if(CONFIG_BENCHMARK_COREMARK_PRO_SMP)
list(APPEND CFLAGS -DHAVE_PTHREAD_SETAFFINITY_NP=1 -DHAVE_PTHREAD_SELF=1)
endif()
if(CONFIG_BENCHMARK_COREMARK_PRO_64BIT)
list(APPEND CFLAGS -DEE_SIZEOF_PTR=8 -DEE_PTR_ALIGN=8 -DEE_SIZEOF_LONG=8)
endif()
if(CONFIG_BENCHMARK_COREMARK_PRO_USE_FP64)
list(APPEND CFLAGS -DUSE_FP64=1 -DUSE_FP32=0)
list(APPEND CSRCS coremark-pro/benchmarks/fp/linpack/ref/inputs_f64.c)
else()
list(APPEND CFLAGS -DUSE_FP32=1 -DUSE_FP64=0)
list(APPEND CSRCS coremark-pro/benchmarks/fp/linpack/ref/inputs_f32.c)
endif()
if(CONFIG_BENCHMARK_COREMARK_PRO_CORE_TEST)
file(GLOB CORE_TEST_SRCS coremark-pro/benchmarks/core/*.c)
set(CORE_TEST_CSRCS coremark-pro/workloads/core/core.c ${CORE_TEST_SRCS})
nuttx_add_application(
NAME
core
PRIORITY
${CONFIG_BENCHMARK_COREMARK_PRO_PRIORITY}
STACKSIZE
${CONFIG_BENCHMARK_COREMARK_PRO_STACKSIZE}
MODULE
${CONFIG_BENCHMARK_COREMARK_PRO}
COMPILE_FLAGS
${CFLAGS}
SRCS
${CORE_TEST_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
coremark_pro)
endif()
if(CONFIG_BENCHMARK_COREMARK_PRO_CJPEG_TEST)
file(GLOB CJPEG_SRCS coremark-pro/benchmarks/consumer_v2/cjpeg/*.c)
set(CJPEG_CSRCS
coremark-pro/workloads/cjpeg-rose7-preset/cjpeg-rose7-preset.c
coremark-pro/benchmarks/consumer_v2/cjpeg/data/Rose256_bmp.c
${CJPEG_SRCS})
nuttx_add_application(
NAME
cjpeg_rose7_preset
PRIORITY
${CONFIG_BENCHMARK_COREMARK_PRO_PRIORITY}
STACKSIZE
${CONFIG_BENCHMARK_COREMARK_PRO_STACKSIZE}
MODULE
${CONFIG_BENCHMARK_COREMARK_PRO}
COMPILE_FLAGS
${CFLAGS}
SRCS
${CJPEG_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
coremark_pro)
endif()
if(CONFIG_BENCHMARK_COREMARK_PRO_SHA_TEST)
file(GLOB SHA_TEST_SRCS coremark-pro/benchmarks/darkmark/sha/*.c)
set(SHA_TEST_CSRCS coremark-pro/workloads/sha-test/sha-test.c
${SHA_TEST_SRCS})
nuttx_add_application(
NAME
sha_test
PRIORITY
${CONFIG_BENCHMARK_COREMARK_PRO_PRIORITY}
STACKSIZE
${CONFIG_BENCHMARK_COREMARK_PRO_STACKSIZE}
MODULE
${CONFIG_BENCHMARK_COREMARK_PRO}
COMPILE_FLAGS
${CFLAGS}
SRCS
${SHA_TEST_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
coremark_pro)
endif()
if(CONFIG_BENCHMARK_COREMARK_PRO_ZIP_TEST)
set(ZIP_TEST_CSRCS coremark-pro/workloads/zip-test/zip-test.c
coremark-pro/benchmarks/darkmark/zip/zip_darkmark.c)
set(ZIP_TEST_FLAGS ${CFLAGS} -Dgzclose_r=coremark_zip_gzclose_r
-Dgzclose_w=coremark_zip_gzclose_w)
set(ZIP_TEST_INCDIR ${INCDIR} ${NUTTX_APPS_DIR}/system/zlib/zlib)
nuttx_add_application(
NAME
zip_test
PRIORITY
${CONFIG_BENCHMARK_COREMARK_PRO_PRIORITY}
STACKSIZE
${CONFIG_BENCHMARK_COREMARK_PRO_STACKSIZE}
MODULE
${CONFIG_BENCHMARK_COREMARK_PRO}
COMPILE_FLAGS
${ZIP_TEST_FLAGS}
SRCS
${ZIP_TEST_CSRCS}
INCLUDE_DIRECTORIES
${ZIP_TEST_INCDIR}
DEPENDS
coremark_pro)
endif()
if(CONFIG_BENCHMARK_COREMARK_PRO_LINEAR_ALG_MID_TEST)
set(ALG_MID_CSRCS
coremark-pro/workloads/linear_alg-mid-100x100-sp/linear_alg-mid-100x100-sp.c
coremark-pro/benchmarks/fp/linpack/linpack.c)
nuttx_add_application(
NAME
linear_alg_mid_100x100_sp
PRIORITY
${CONFIG_BENCHMARK_COREMARK_PRO_PRIORITY}
STACKSIZE
${CONFIG_BENCHMARK_COREMARK_PRO_STACKSIZE}
MODULE
${CONFIG_BENCHMARK_COREMARK_PRO}
COMPILE_FLAGS
${CFLAGS}
SRCS
${ALG_MID_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
coremark_pro)
endif()
if(CONFIG_BENCHMARK_COREMARK_PRO_RADIX_TEST)
if(CONFIG_BENCHMARK_COREMARK_PRO_USE_FP64)
file(GLOB RADIX_SRCS coremark-pro/benchmarks/fp/fft_radix2/ref/*.c)
else()
file(GLOB RADIX_SRCS coremark-pro/benchmarks/fp/fft_radix2/ref-sp/*.c)
endif()
set(RADIX_CSRCS
coremark-pro/workloads/radix2-big-64k/radix2-big-64k.c
coremark-pro/benchmarks/fp/fft_radix2/fft_radix2.c ${RADIX_SRCS})
nuttx_add_application(
NAME
radix2_big_64k
PRIORITY
${CONFIG_BENCHMARK_COREMARK_PRO_PRIORITY}
STACKSIZE
${CONFIG_BENCHMARK_COREMARK_PRO_STACKSIZE}
MODULE
${CONFIG_BENCHMARK_COREMARK_PRO}
COMPILE_FLAGS
${CFLAGS}
SRCS
${RADIX_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
coremark_pro)
endif()
if(CONFIG_BENCHMARK_COREMARK_PRO_LOOPS_ALL_MID_TEST)
if(CONFIG_BENCHMARK_COREMARK_PRO_USE_FP64)
file(GLOB MID_SRCS coremark-pro/benchmarks/fp/loops/ref/*.c)
else()
file(GLOB MID_SRCS coremark-pro/benchmarks/fp/loops/ref-sp/*.c)
endif()
set(MID_CSRCS
coremark-pro/workloads/loops-all-mid-10k-sp/loops-all-mid-10k-sp.c
coremark-pro/benchmarks/fp/loops/loops.c ${MID_SRCS})
nuttx_add_application(
NAME
loops_all_mid_10k_sp
PRIORITY
${CONFIG_BENCHMARK_COREMARK_PRO_PRIORITY}
STACKSIZE
${CONFIG_BENCHMARK_COREMARK_PRO_STACKSIZE}
MODULE
${CONFIG_BENCHMARK_COREMARK_PRO}
COMPILE_FLAGS
${CFLAGS}
SRCS
${MID_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
coremark_pro)
endif()
if(CONFIG_BENCHMARK_COREMARK_PRO_NNET_TEST)
if(CONFIG_BENCHMARK_COREMARK_PRO_USE_FP64)
file(GLOB NNET_SRCS coremark-pro/benchmarks/fp/nnet/ref/*.c)
else()
file(GLOB NNET_SRCS coremark-pro/benchmarks/fp/nnet/ref-sp/*.c)
endif()
file(GLOB FP_NNET_SRCS coremark-pro/benchmarks/fp/nnet/*.c)
set(NNET_CSRCS coremark-pro/workloads/nnet_test/nnet_test.c ${FP_NNET_SRCS}
${NNET_SRCS})
nuttx_add_application(
NAME
nnet_test
PRIORITY
${CONFIG_BENCHMARK_COREMARK_PRO_PRIORITY}
STACKSIZE
${CONFIG_BENCHMARK_COREMARK_PRO_STACKSIZE}
MODULE
${CONFIG_BENCHMARK_COREMARK_PRO}
COMPILE_FLAGS
${CFLAGS}
SRCS
${NNET_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
coremark_pro)
endif()
if(CONFIG_BENCHMARK_COREMARK_PRO_PARSER_125K)
file(GLOB PARSER_SRCS coremark-pro/benchmarks/darkmark/parser/*.c)
set(PARSER_CSRCS coremark-pro/workloads/parser-125k/parser-125k.c
${PARSER_SRCS})
nuttx_add_application(
NAME
parser_125k
PRIORITY
${CONFIG_BENCHMARK_COREMARK_PRO_PRIORITY}
STACKSIZE
${CONFIG_BENCHMARK_COREMARK_PRO_STACKSIZE}
MODULE
${CONFIG_BENCHMARK_COREMARK_PRO}
COMPILE_FLAGS
${CFLAGS}
SRCS
${PARSER_CSRCS}
INCLUDE_DIRECTORIES
${INCDIR}
DEPENDS
coremark_pro)
endif()
target_sources(coremark_pro PRIVATE ${CSRCS})
target_include_directories(coremark_pro PRIVATE ${INCDIR})
target_compile_options(coremark_pro PRIVATE ${CFLAGS})
endif()

View file

@ -0,0 +1,81 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menuconfig BENCHMARK_COREMARK_PRO
tristate "Coremark Pro Benchmark"
default n
depends on LIBC_FLOATINGPOINT
if BENCHMARK_COREMARK_PRO
config BENCHMARK_COREMARK_PRO_STACKSIZE
int "Coremark Pro stack size"
default 131072
config BENCHMARK_COREMARK_PRO_PRIORITY
int "Coremark Pro priority"
default 100
config BENCHMARK_COREMARK_PRO_USE_SINGLE_CONTEXT
bool "use single context"
default n
config BENCHMARK_COREMARK_PRO_SMP
bool "Relevant configurations in case of SMP"
default n
depends on SMP && !BENCHMARK_COREMARK_PRO_USE_SINGLE_CONTEXT
config BENCHMARK_COREMARK_PRO_64BIT
bool "Running on 64-bit operating systems"
default n
config BENCHMARK_COREMARK_PRO_USE_FP64
bool "USE FP64 Data for Test"
default n
config BENCHMARK_COREMARK_PRO_CORE_TEST
bool "Core Test"
default n
config BENCHMARK_COREMARK_PRO_CJPEG_TEST
bool "cjpeg-rose7-preset"
default n
---help---
Before using this case, place the files in coremark-pro/benchmarks/libbmp
and coremark-pro/benchmarks/libjpeg in /data/libbmp and /data/libjpeg
respectively
config BENCHMARK_COREMARK_PRO_LINEAR_ALG_MID_TEST
bool "Linear_alg_mid TEST"
default n
config BENCHMARK_COREMARK_PRO_SHA_TEST
bool "SHA Test"
default n
config BENCHMARK_COREMARK_PRO_ZIP_TEST
bool "Zip Test"
depends on LIB_ZLIB
default n
choice
prompt "Coremark Pro FP Test Case configuration"
default BENCHMARK_COREMARK_PRO_RADIX_TEST
config BENCHMARK_COREMARK_PRO_RADIX_TEST
bool "Radix Test"
config BENCHMARK_COREMARK_PRO_LOOPS_ALL_MID_TEST
bool "Loops-all-mid test"
config BENCHMARK_COREMARK_PRO_NNET_TEST
bool "Nnet Test"
config BENCHMARK_COREMARK_PRO_PARSER_125K
bool "Parser 125K Test"
endchoice
endif

View file

@ -0,0 +1,25 @@
############################################################################
# apps/benchmarks/coremark-pro/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO),)
CONFIGURED_APPS += $(APPDIR)/benchmarks/coremark-pro
endif

View file

@ -0,0 +1,160 @@
############################################################################
# apps/benchmarks/coremark-pro/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(APPDIR)/Make.defs
PRIORITY = $(CONFIG_BENCHMARK_COREMARK_PRO_PRIORITY)
STACKSIZE = $(CONFIG_BENCHMARK_COREMARK_PRO_STACKSIZE)
MODULE = $(CONFIG_BENCHMARK_COREMARK_PRO)
CFLAGS += -Wno-undef -Wno-strict-prototypes -Wno-unused-variable \
-Wno-pointer-sign -Wno-unused-but-set-variable -Wno-shadow
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/benchmarks/coremark-pro/coremark-pro/mith/include
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/benchmarks/coremark-pro/coremark-pro/mith/al/include
CFLAGS += -DNDEBUG -DHOST_EXAMPLE_CODE=1 -DHAVE_SYS_STAT_H=1 \
-DGCC_INLINE_MACRO=1 -DMAX_CONTEXTS=100 -DEE_SIZEOF_INT=4 \
-DUSE_FP128=0
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_USE_SINGLE_CONTEXT),)
CFLAGS += -DUSE_SINGLE_CONTEXT=1 -DHAVE_PTHREAD=0 -DUSE_NATIVE_PTHREAD=0
else
CFLAGS += -DUSE_SINGLE_CONTEXT=0 -DHAVE_PTHREAD=1 -DUSE_NATIVE_PTHREAD=1
endif
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_SMP),)
CFLAGS += -DHAVE_PTHREAD_SETAFFINITY_NP=1 -DHAVE_PTHREAD_SELF=1
endif
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_64BIT),)
CFLAGS += -DEE_SIZEOF_PTR=8 -DEE_PTR_ALIGN=8 -DEE_SIZEOF_LONG=8
endif
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_USE_FP64),)
CFLAGS += -DUSE_FP64=1 -DUSE_FP32=0
CSRCS += coremark-pro/benchmarks/fp/linpack/ref/inputs_f64.c
else
CFLAGS += -DUSE_FP32=1 -DUSE_FP64=0
CSRCS += coremark-pro/benchmarks/fp/linpack/ref/inputs_f32.c
endif
CSRCS += coremark-pro/mith/src/md5.c
CSRCS += coremark-pro/mith/src/mith_lib.c
CSRCS += coremark-pro/mith/src/mith_workload.c
CSRCS += coremark-pro/mith/src/th_bignum.c
CSRCS += coremark-pro/mith/src/th_encode.c
CSRCS += coremark-pro/mith/src/th_lib.c
CSRCS += coremark-pro/mith/src/th_math.c
CSRCS += coremark-pro/mith/src/th_rand.c
CSRCS += $(wildcard coremark-pro/mith/al/src/*.c)
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_CORE_TEST),)
CSRCS += $(wildcard coremark-pro/benchmarks/core/*.c)
MAINSRC += coremark-pro/workloads/core/core.c
PROGNAME += core
endif
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_CJPEG_TEST),)
CSRCS += $(wildcard coremark-pro/benchmarks/consumer_v2/cjpeg/*.c)
CSRCS += $(wildcard coremark-pro/benchmarks/consumer_v2/cjpeg/data/Rose256_bmp.c)
MAINSRC += coremark-pro/workloads/cjpeg-rose7-preset/cjpeg-rose7-preset.c
PROGNAME += cjpeg_rose7_preset
endif
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_SHA_TEST),)
CSRCS += $(wildcard coremark-pro/benchmarks/darkmark/sha/*.c)
MAINSRC += coremark-pro/workloads/sha-test/sha-test.c
PROGNAME += sha_test
endif
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_ZIP_TEST),)
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/system/zlib/zlib
CFLAGS += -Dgzclose_r=coremark_zip_gzclose_r -Dgzclose_w=coremark_zip_gzclose_w
CSRCS += coremark-pro/benchmarks/darkmark/zip/zip_darkmark.c
MAINSRC += coremark-pro/workloads/zip-test/zip-test.c
PROGNAME += zip_test
endif
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_LINEAR_ALG_MID_TEST),)
CSRCS += coremark-pro/benchmarks/fp/linpack/linpack.c
MAINSRC += coremark-pro/workloads/linear_alg-mid-100x100-sp/linear_alg-mid-100x100-sp.c
PROGNAME += linear_alg_mid_100x100_sp
endif
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_RADIX_TEST),)
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_USE_FP64),)
CSRCS += $(wildcard coremark-pro/benchmarks/fp/fft_radix2/ref/*.c)
else
CSRCS += $(wildcard coremark-pro/benchmarks/fp/fft_radix2/ref-sp/*.c)
endif
CSRCS += coremark-pro/benchmarks/fp/fft_radix2/fft_radix2.c
MAINSRC += coremark-pro/workloads/radix2-big-64k/radix2-big-64k.c
PROGNAME += radix2_big_64k
endif
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_LOOPS_ALL_MID_TEST),)
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_USE_FP64),)
CSRCS += $(wildcard coremark-pro/benchmarks/fp/loops/ref/*.c)
else
CSRCS += $(wildcard coremark-pro/benchmarks/fp/loops/ref-sp/*.c)
endif
CSRCS += coremark-pro/benchmarks/fp/loops/loops.c
MAINSRC += coremark-pro/workloads/loops-all-mid-10k-sp/loops-all-mid-10k-sp.c
PROGNAME += loops_all_mid_10k_sp
endif
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_NNET_TEST),)
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_USE_FP64),)
CSRCS += $(wildcard coremark-pro/benchmarks/fp/nnet/ref/*.c)
else
CSRCS += $(wildcard coremark-pro/benchmarks/fp/nnet/ref-sp/*.c)
endif
CSRCS += $(wildcard coremark-pro/benchmarks/fp/nnet/*.c)
MAINSRC += coremark-pro/workloads/nnet_test/nnet_test.c
PROGNAME += nnet_test
endif
ifneq ($(CONFIG_BENCHMARK_COREMARK_PRO_PARSER_125K),)
CSRCS += $(wildcard coremark-pro/benchmarks/darkmark/parser/*.c)
MAINSRC += coremark-pro/workloads/parser-125k/parser-125k.c
PROGNAME += parser_125k
endif
ifeq ($(wildcard coremark-pro/.git),)
VERSION ?= main
coremark-pro.zip:
$(Q) curl -L https://github.com/eembc/coremark-pro/archive/refs/heads/main.zip -o coremark-pro.zip
$(Q) unzip -o coremark-pro.zip
$(Q) mv coremark-pro-$(VERSION) coremark-pro
context:: coremark-pro.zip
distclean::
$(call DELDIR, coremark-pro)
$(call DELFILE, coremark-pro.zip)
endif
include $(APPDIR)/Application.mk

2
benchmarks/coremark/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/coremark
/*.zip

View file

@ -0,0 +1,153 @@
# ##############################################################################
# apps/benchmarks/coremark/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
if(CONFIG_BENCHMARK_COREMARK)
# ############################################################################
# Config and Fetch Coremark application
# ############################################################################
set(COREMARKAPP_DIR ${CMAKE_CURRENT_LIST_DIR}/coremark)
if(NOT EXISTS ${COREMARKAPP_DIR})
FetchContent_Declare(
coremark_fetch
URL https://github.com/eembc/coremark/archive/main.zip SOURCE_DIR
${CMAKE_CURRENT_LIST_DIR}/coremark BINARY_DIR
${CMAKE_BINARY_DIR}/apps/benchmarks/coremark/coremark
DOWNLOAD_NO_PROGRESS true
TIMEOUT 30)
FetchContent_GetProperties(coremark_fetch)
if(NOT coremark_fetch_POPULATED)
FetchContent_Populate(coremark_fetch)
endif()
endif()
if(CONFIG_COREMARK_MULTITHREAD_OVERRIDE)
set(COREMARK_NTHREADS ${CONFIG_COREMARK_MULTITHREAD_COUNT})
endif()
if(CONFIG_SMP_NCPUS)
set(COREMARK_NTHREADS ${CONFIG_SMP_NCPUS})
else()
set(COREMARK_NTHREADS 1)
endif()
if(CONFIG_COREMARK_PRINT_ARGS)
set(COREMARK_PRINT_ARGS 1)
else()
set(COREMARK_PRINT_ARGS 0)
endif()
# ############################################################################
# Flags
# ############################################################################
if(CONFIG_COREMARK_MULTITHREAD_OVERRIDE)
set(COREMARK_NTHREADS ${CONFIG_COREMARK_MULTITHREAD_COUNT})
else()
if(CONFIG_SMP_NCPUS)
set(COREMARK_NTHREADS ${CONFIG_SMP_NCPUS})
else()
set(COREMARK_NTHREADS 1)
endif()
endif()
if(CONFIG_COREMARK_PRINT_ARGS)
set(COREMARK_PRINT_ARGS 1)
else()
set(COREMARK_PRINT_ARGS 0)
endif()
get_target_property(FLAGS_STR_LIST nuttx COMPILE_OPTIONS)
list(JOIN FLAGS_STR_LIST " " FLAGS_STR)
set(CFLAGS -Dcrc16=coremark_crc16 -Wno-strict-prototypes -Wno-undef)
if("${CONFIG_COREMARK_MEM_METHOD}" STREQUAL "1")
list(APPEND CFLAGS -DMEM_LOCATION=\"HEAP\")
elseif("${CONFIG_COREMARK_MEM_METHOD}" STREQUAL "2")
list(APPEND CFLAGS -DMEM_LOCATION=\"STACK\")
else()
list(APPEND CFLAGS -DMEM_LOCATION=\"GLOBAL\")
endif()
list(
APPEND
CFLAGS
-DCALLGRIND_RUN=0
-DCOMPILER_REQUIRES_SORT_RETURN=0
-DCORE_DEBUG=${CONFIG_COREMARK_DEBUG}
-DFLAGS_STR="${FLAGS_STR}"
-DMEM_METHOD=${CONFIG_COREMARK_MEM_METHOD}
-DMICA=0
-DMULTITHREAD=${COREMARK_NTHREADS}
-DPERFORMANCE_RUN=1
-DPRINT_ARGS=${COREMARK_PRINT_ARGS}
-DSEED_METHOD=${CONFIG_COREMARK_SEED_METHOD}
-DUSE_CLOCK=1
-DUSE_PTHREAD)
if(CONFIG_COREMARK_ITERATIONS_OVERRIDE)
list(APPEND CFLAGS -DITERATIONS=${CONFIG_COREMARK_ITERATIONS_COUNT})
else()
list(APPEND CFLAGS -DITERATIONS=0)
endif()
# ############################################################################
# Sources
# ############################################################################
set(CSRCS
${COREMARKAPP_DIR}/core_main.c ${COREMARKAPP_DIR}/core_list_join.c
${COREMARKAPP_DIR}/core_matrix.c ${COREMARKAPP_DIR}/core_state.c
${COREMARKAPP_DIR}/core_util.c ${COREMARKAPP_DIR}/posix/core_portme.c)
# ############################################################################
# Include Directory
# ############################################################################
set(INCDIR ${COREMARKAPP_DIR} ${COREMARKAPP_DIR}/posix)
# ############################################################################
# Applications Configuration
# ############################################################################
nuttx_add_application(
NAME
${CONFIG_COREMARK_PROGNAME}
PRIORITY
${CONFIG_COREMARK_PRIORITY}
STACKSIZE
${CONFIG_COREMARK_STACKSIZE}
MODULE
${CONFIG_BENCHMARK_COREMARK}
COMPILE_FLAGS
${CFLAGS}
SRCS
${CSRCS}
INCLUDE_DIRECTORIES
${INCDIR})
endif()

View file

@ -0,0 +1,86 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menuconfig BENCHMARK_COREMARK
tristate "CoreMark Benchmark"
select LIBC_FLOATINGPOINT
default n
---help---
Enable support for the EEMBC's CoreMark benchmark application.
if BENCHMARK_COREMARK
config COREMARK_PROGNAME
string "CoreMark program name"
default "coremark"
---help---
This is the name of the program that will be used when the NSH ELF
program is installed.
config COREMARK_PRIORITY
int "CoreMark task priority"
default 100
config COREMARK_STACKSIZE
int "CoreMark task stack size"
default 4096
config COREMARK_SEED_METHOD
int "Coremark Seed Method"
default 2
---help---
Set Coremark Seed Method:
0: SEED_ARG
1: SEED_FUNC
2: SEED_VOLATILE
config COREMARK_MEM_METHOD
int "Coremark Memory Method"
default 1
---help---
Set Coremark Memory Method:
0: MEM_STATIC
1: MEM_MALLOC
2: MEM_STACK
config COREMARK_DEBUG
int "Coremark Core Debug"
default 0
---help---
Enable the Core Debug:
0: Disable
1: Enable
config COREMARK_PRINT_ARGS
bool "Print CoreMark arguments when executing"
default n
---help---
Print the command line arguments passed on to coremark.
config COREMARK_MULTITHREAD_OVERRIDE
bool "Override number of threads"
default n
---help---
Override the default number of threads to be executed.
The default value is the same as the number of CPU cores.
config COREMARK_MULTITHREAD_COUNT
depends on COREMARK_MULTITHREAD_OVERRIDE
int "Number of threads to be executed"
default 1
config COREMARK_ITERATIONS_OVERRIDE
bool "Override number of iterations"
default n
---help---
Override the default number of iterations for the benchmark.
The default value is defined by the application based on the system.
config COREMARK_ITERATIONS_COUNT
depends on COREMARK_ITERATIONS_OVERRIDE
int "Number of iterations"
default 100
endif # BENCHMARK_COREMARK

View file

@ -0,0 +1,27 @@
############################################################################
# apps/benchmarks/coremark/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_BENCHMARK_COREMARK),)
CONFIGURED_APPS += $(APPDIR)/benchmarks/coremark
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/benchmarks/coremark/coremark
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/benchmarks/coremark/coremark/posix
endif

View file

@ -0,0 +1,145 @@
############################################################################
# apps/benchmarks/coremark/Makefile
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(APPDIR)/Make.defs
# Coremark application
############################################################################
# Flags
############################################################################
COREMARK_URL ?= "https://github.com/eembc/coremark/archive"
COREMARK_VERSION = main
COREMARK_ZIP = $(COREMARK_VERSION).zip
COREMARK_UNPACKNAME = coremark
UNPACK ?= unzip -q -o
VPATH += $(COREMARK_UNPACKNAME)
VPATH += $(COREMARK_UNPACKNAME)$(DELIM)posix
DEPPATH += --dep-path $(COREMARK_UNPACKNAME)
DEPPATH += --dep-path $(COREMARK_UNPACKNAME)$(DELIM)posix
CFLAGS += -Dcrc16=coremark_crc16
CFLAGS += -Wno-strict-prototypes -Wno-undef
ifeq ($(CONFIG_COREMARK_MULTITHREAD_OVERRIDE),y)
COREMARK_NTHREADS = $(CONFIG_COREMARK_MULTITHREAD_COUNT)
else
ifneq ($(CONFIG_SMP_NCPUS),)
COREMARK_NTHREADS = $(CONFIG_SMP_NCPUS)
else
COREMARK_NTHREADS = 1
endif
endif
ifeq ($(CONFIG_COREMARK_PRINT_ARGS),y)
COREMARK_PRINT_ARGS = 1
else
COREMARK_PRINT_ARGS = 0
endif
ifeq ($(CONFIG_COREMARK_MEM_METHOD), 1)
CFLAGS += ${DEFINE_PREFIX}MEM_LOCATION=\"HEAP\"
else ifeq ($(CONFIG_COREMARK_MEM_METHOD), 2)
CFLAGS += ${DEFINE_PREFIX}MEM_LOCATION=\"STACK\"
else
CFLAGS += ${DEFINE_PREFIX}MEM_LOCATION=\"GLOBAL\"
endif
CFLAGS += ${DEFINE_PREFIX}CALLGRIND_RUN=0
CFLAGS += ${DEFINE_PREFIX}COMPILER_REQUIRES_SORT_RETURN=0
CFLAGS += ${DEFINE_PREFIX}CORE_DEBUG=$(CONFIG_COREMARK_DEBUG)
CFLAGS += ${DEFINE_PREFIX}FLAGS_STR=\""$(ARCHOPTIMIZATION)\""
CFLAGS += ${DEFINE_PREFIX}MEM_METHOD=$(CONFIG_COREMARK_MEM_METHOD)
CFLAGS += ${DEFINE_PREFIX}MICA=0
CFLAGS += ${DEFINE_PREFIX}MULTITHREAD=$(COREMARK_NTHREADS)
CFLAGS += ${DEFINE_PREFIX}PERFORMANCE_RUN=1
CFLAGS += ${DEFINE_PREFIX}PRINT_ARGS=$(COREMARK_PRINT_ARGS)
CFLAGS += ${DEFINE_PREFIX}SEED_METHOD=$(CONFIG_COREMARK_SEED_METHOD)
CFLAGS += ${DEFINE_PREFIX}USE_CLOCK=1
CFLAGS += ${DEFINE_PREFIX}USE_PTHREAD
ifeq ($(CONFIG_COREMARK_ITERATIONS_OVERRIDE),y)
CFLAGS += ${DEFINE_PREFIX}ITERATIONS=$(CONFIG_COREMARK_ITERATIONS_COUNT)
else
CFLAGS += ${DEFINE_PREFIX}ITERATIONS=0
endif
CFLAGS += ${DEFINE_PREFIX}crcu8=coremark_crcu8
CFLAGS += ${DEFINE_PREFIX}crcu16=coremark_crcu16
CFLAGS += ${DEFINE_PREFIX}crcu32=coremark_crcu32
CFLAGS += ${DEFINE_PREFIX}crc16=coremark_crc16
CSRCS += core_list_join.c
CSRCS += core_matrix.c
CSRCS += core_state.c
CSRCS += core_util.c
CSRCS += core_portme.c
############################################################################
# Targets
############################################################################
$(COREMARK_ZIP):
@echo "Downloading: $(COREMARK_URL)/$(COREMARK_ZIP)"
$(Q) curl -O -L $(COREMARK_URL)/$(COREMARK_ZIP)
$(COREMARK_UNPACKNAME): $(COREMARK_ZIP)
@echo "Unpacking: $(COREMARK_ZIP) -> $(COREMARK_UNPACKNAME)"
$(Q) $(UNPACK) $(COREMARK_ZIP)
$(Q) mv coremark-$(COREMARK_VERSION) $(COREMARK_UNPACKNAME)
$(Q) patch -p0 < add_init_message.patch # Update init message
$(Q) touch $(COREMARK_UNPACKNAME)
clean::
$(call DELFILE, $(OBJS))
# Download and unpack tarball if no git repo found
ifeq ($(wildcard $(COREMARK_UNPACKNAME)/.git),)
context:: $(COREMARK_UNPACKNAME)
distclean::
$(call DELDIR, $(COREMARK_UNPACKNAME))
$(call DELFILE, $(COREMARK_ZIP))
endif
############################################################################
# Applications Configuration
############################################################################
MODULE = $(CONFIG_BENCHMARK_COREMARK)
PROGNAME += $(CONFIG_COREMARK_PROGNAME)
PRIORITY += $(CONFIG_COREMARK_PRIORITY)
STACKSIZE += $(CONFIG_COREMARK_STACKSIZE)
MAINSRC += core_main.c
# Build with WebAssembly when CONFIG_INTERPRETERS_WAMR is enabled
WASM_BUILD = both
include $(APPDIR)/Application.mk

View file

@ -0,0 +1,12 @@
--- coremark/posix/core_portme.c
+++ coremark/posix/core_portme.c
@@ -208,6 +208,9 @@ ee_u32 default_num_contexts = MULTITHREAD;
void
portable_init(core_portable *p, int *argc, char *argv[])
{
+
+ ee_printf("Running CoreMark...\n");
+
#if PRINT_ARGS
int i;
for (i = 0; i < *argc; i++)

View file

@ -0,0 +1,55 @@
# ##############################################################################
# apps/benchmarks/cyclictest/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################
if(CONFIG_BENCHMARK_CYCLICTEST)
# ############################################################################
# Config and Fetch Coremark application
# ############################################################################
set(CYCLICTEST_DIR ${CMAKE_CURRENT_LIST_DIR})
# ############################################################################
# Sources
# ############################################################################
set(CSRCS ${CYCLICTEST_DIR}/cyclictest.c)
# ############################################################################
# Applications Configuration
# ############################################################################
nuttx_add_application(
NAME
cyclictest
PRIORITY
${CONFIG_CYCLICTEST_PRIORITY}
STACKSIZE
${CONFIG_CYCLICTEST_STACKSIZE}
MODULE
${CONFIG_BENCHMARK_CYCLICTEST}
COMPILE_FLAGS
${CFLAGS}
SRCS
${CSRCS}
INCLUDE_DIRECTORIES
${INCDIR})
endif()

View file

@ -0,0 +1,29 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menuconfig BENCHMARK_CYCLICTEST
bool "Cyclictest"
default n
---help---
Enable the cyclictest application.
if BENCHMARK_CYCLICTEST
config BENCHMARK_CYCLICTEST_PROGNAME
string "Cyclictest App Name"
default "cyclictest"
---help---
This is the name of the program that will be used when the NSH ELF
program is installed.
config BENCHMARK_CYCLICTEST_PRIORITY
int "Cyclictest task priority"
default 100
config BENCHMARK_CYCLICTEST_STACKSIZE
int "Cyclictest task stack size"
default 4096
endif # BENCHMARK_CYCLICTEST

View file

@ -0,0 +1,23 @@
############################################################################
# apps/benchmarks/cyclictest/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_BENCHMARK_CYCLICTEST),)
CONFIGURED_APPS += $(APPDIR)/benchmarks/cyclictest
endif

View file

@ -0,0 +1,39 @@
############################################################################
# apps/benchmarks/cyclictest/Makefile
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(APPDIR)/Make.defs
# spinlock_bench application
############################################################################
# Applications Configuration
############################################################################
MODULE = $(CONFIG_BENCHMARK_CYCLICTEST)
PROGNAME += $(CONFIG_BENCHMARK_CYCLICTEST_PROGNAME)
PRIORITY += $(CONFIG_BENCHMARK_CYCLICTEST_PRIORITY)
STACKSIZE += $(CONFIG_BENCHMARK_CYCLICTEST_STACKSIZE)
MAINSRC += cyclictest.c
# Build with WebAssembly when CONFIG_INTERPRETERS_WAMR is enabled
include $(APPDIR)/Application.mk

File diff suppressed because it is too large Load diff

2
benchmarks/dhrystone/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/dhrystone
/dhrystone.zip

Some files were not shown because too many files have changed in this diff Show more