Add an "lvglterm" configuration that runs the on-screen NuttShell terminal
(apps/examples/lvglterm, touch input variant) on the display: an on-screen
LVGL keyboard driven by the FT5X06 touchscreen feeds the shell and the NSH
output is rendered in an LVGL text area.
Update the apps/examples/lvglterm documentation to describe the two input
variants (on-screen touch keyboard and physical keyboard) and their
configuration options (input source, keyboard device and font choices).
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
Add the 56-key matrix keyboard driver for the M5Stack Cardputer. The keys
form an 8x7 matrix behind a 74HC138 3-to-8 demultiplexer; the driver scans it
on the low-priority work queue and registers a keyboard device at /dev/kbd0,
reporting ASCII codes with SHIFT/CTRL and Fn (cursor) handling.
Add an "lvglterm" configuration that runs the on-screen NuttShell terminal
(apps/examples/lvglterm, physical-keyboard input variant) on the ST7789
display: the shell output is rendered in an LVGL text area and the keyboard
feeds the input. Wi-Fi is included so the on-screen shell can associate with
an access point using wapi.
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
It is very easy to get NXDoom running on NuttX, but the instructions
was omitting the needed steps to get it running on Simulator.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
The existing first-order LCG (seed = 470001 * seed % 999563) has several
quality problems:
- Output range limited to [1, 999562] (~20 bits) instead of full 32-bit
- Lower bits have very short periods (8-bit period = 1, 16-bit = 105)
- Overall period only ~1M, far too short for many applications
- Causes mbedtls_rsa_gen_key to loop forever when rand() consumption
aligns with the cycle length (issue #16760)
Replace the entire order-based LCG implementation (CONFIG_LIBC_RAND_ORDER
0-3) with Marsaglia's xorshift32:
- Full 32-bit output range
- Period 2^32 - 1 (~4.29 billion)
- Fast: just three XOR/shift operations
- No floating-point math needed
- No CONFIG_LIBC_RAND_ORDER configuration required
Remove the CONFIG_LIBC_RAND_ORDER Kconfig option and clean up all
defconfig references (12 boards) and related comments.
Signed-off-by: hanzhijian <hanzhijian@zepp.com>
1. The .kasan.unused and .kasan.global sections contain compiler-generated
data with the WRITE flag (.data..LASAN*), but the linker script placed
them before .text without specifying a memory region. The linker could
not put writable sections into the read-only ROM (rx) region, so it
silently placed them at 0x40000000 in RAM, creating an extra LOAD
segment that conflicts with QEMU virt's RAM layout and causes boot
failure.
2. The .kasan.global should be placed before .data because .data
patten (*(.data*)) includes .kasan.global pattern (*(.data..LASAN0)),
and it cause kasan_global.py cannot find .kasan.global section to
generate the g_global_region array.
3. Move .kasan.shadows from before .text to after .rodata. Placing it
before .text causes .text to shift when .kasan.shadows transitions
from empty (pass 1) to populated (pass 2+), preventing the multi-pass
link addresses from converging. After .rodata it does not affect any
upstream section addresses.
4. Add CMake post-build step to strip .kasan.unused and .kasan.global
sections from the final binary, matching the Makefile build behavior.
Signed-off-by: leisiji <2265215145@qq.com>
When CONFIG_BUILD_KERNEL is enabled, user-space and kernel-space have
separate address spaces. User-space addresses passed via syscalls
(e.g., open) are registered by KASAN but should not be monitored,
as they are not kernel heap allocations. This causes KASAN to
report false positives on user-space pointers accessed through
system calls.
Mark the user-space heap with nokasan=true so KASAN skips checking
its address range, consistent with how rptun already handles this.
Signed-off-by: leisiji <2265215145@qq.com>
When CONFIG_MM_KASAN_GLOBAL is enabled, hook.c is also linked into
libmm.a. However, g_global_region (defined in global.c) is only
injected into the nuttx ELF by kasan_global.py — it does not process
the app binary. This causes undefined symbol errors when linking an
app against libmm.a.
Guard the inclusion of global.c with __KERNEL__ so that only kernel
builds pull in the global KASAN region, while app builds fall back
to the no-op stub.
Signed-off-by: leisiji <2265215145@qq.com>
Includes a defconfig to play NXDoom on the simulator. Keyboard input is
available through X11, as well as graphics rendering. The `/data` folder
is used as the default home for game files.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Includes documentation about the current state of the DOOM port, where
it came from, how to play and what the requirements are. Includes all of
the warnings about experimental/unfinished features.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit updates Espressif's common source code to ensure that
critical sections are properly handled by the common source code.
Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
Add a new section under Implementation Details explaining the CRC32
variants available in NuttX, including the difference between the
native crc32() and the new Linux/zlib-compatible crc32_ieee().
Signed-off-by: hanzhijian <hanzhijian@zepp.com>
Add crc32_ieee() and crc32_ieeepart() that produce CRC32 values
compatible with Linux/zlib. The difference from the existing crc32():
crc32(): init=0, no final XOR (NuttX native)
crc32_ieee(): init=0xFFFFFFFF, final XOR 0xFFFFFFFF (Linux/zlib)
The existing crc32() and crc32part() are unchanged to avoid breaking
existing callers (bbsram, sbram, etc.).
New functions:
crc32_ieee(src, len) - full CRC, Linux-compatible
crc32_ieeepart(src, len, crcval) - incremental CRC, Linux-compatible
Verified on sim:nsh against known Linux zlib test vectors:
crc32_ieee("hello") = 0x3610a686 (Linux: 0x3610a686) PASS
crc32_ieee("123456789") = 0xcbf43926 (Linux: 0xcbf43926) PASS
crc32_ieee("") = 0x00000000 (Linux: 0x00000000) PASS
crc32_ieeepart incremental = 0xcbf43926 PASS
crc32("hello") = 0xf032519b (unchanged) PASS
Signed-off-by: hanzhijian <hanzhijian@zepp.com>
Replace the bare "README.txt literal include" with a proper reStructuredText
page for the Sony Spresense board, and remove the now-redundant README.txt
(all of its content has been migrated into index.rst):
- Add board, extension and camera pinout figures (sony*.png).
- Add Features, Serial Console, Buttons and LEDs sections.
- Add "Flashing the bootloader" and "Building and Flashing" sections,
including the official firmware download link and the flash_writer.py
workflow.
- Document all board configurations (audio, audio_sdk, camera, charger,
coremark, elf, example_camera, example_lcd, fmsynth, getprime, lcd, lte,
module, mpy, nsh, nsh_automount, nsh_trace, ostest, posix_spawn, rndis,
rndis_composite, rndis_smp, smp, usbmsc, usbnsh, wifi, wifi_smp), each of
which was verified to build.
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
This reuses implementation of trunc in case long double has same size as
double.
The previous implementation is used only in case x87 80-bit float point
is the long double. In other cases the logic is intentionally replaced
with panic to not provide a wrong result.
Signed-off-by: Karel Kočí <kkoci@elektroline.cz>
NuttX defines constants for the sizes of types just as constants
directly in the code. The real values depend on compiler and target
platform. It is possible that value declared by NuttX header is wrong
compared to the compiler configuration. This is more likely in case of
floating points.
Not all compilers supported by NuttX provide required info through
defines and thus it is more generic to specify limits as constants, but
in case compiler provides them then it is a good idea to compare. This
commit adds such set of comparisons for limits.h and float.h constants.
The comparisons were tested with GCC and Clang. They will be ignored in
case compiler doesn't provide them.
Signed-off-by: Karel Kočí <kkoci@elektroline.cz>
This addresses "FIX ME" definitions for the long double. These might not
be all long double format supported by NuttX.
The support was also added only for GCC alike compilers. Other compilers
that have CONFIG_HAVE_LONG_DOUBLE defined will fail with error that
mantisage digits have to be defined for that compiler.
Signed-off-by: Karel Kočí <kkoci@elektroline.cz>
An attacker can specify an arbitrary page address when reading MIFARE tags.
Without validation, this could read beyond intended memory regions on the
tag, potentially causing a crash.
The mfrc522_mifare_read() command is also not robust and does not check
that the page address is valid. From section 7.6.5 of the *MIFARE Ultralight
contactless single-ticket IC
(https://www.nxp.com/docs/en/data-sheet/MF0ICU1.pdf) document:
>> The READ command needs the page address as a parameter. Only addresses
00h to 0Fh are decoded.
Testing: Builds fine.
Signed-off-by: Catalin Visinescu <catalin_visinescu@yahoo.com>
This port adds support for the M5Stack Cardputer (M5Stamp S3 /
ESP32-S3FN8, dual Xtensa LX7 @ 240 MHz, 8 MB flash, no PSRAM).
It reuses the common ESP32-S3 board helpers and ships these
configurations:
- nsh: NuttShell over the USB-Serial-JTAG console
- sdcard: microSD card on SPI3 (FAT)
- fb: ST7789 240x135 display exposed as a framebuffer
- wifi: Wi-Fi station
- softap: Wi-Fi SoftAP with DHCP server
- lvgl: LVGL graphics on the ST7789 (lvgldemo)
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
Currently stm32l0538-disco is using all its space on NuttX mainline
After some investigation I noticed that DD is using more than 1500
bytes. After disabling it the board returned to compile.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
Fixes undocumented configurations in the list of configs and the typo in
the 'userleds' configuration.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Add the chip-level and board-level documentation for both Ameba WHC
SoCs and their evaluation boards. Each board document follows the
board.rst template with tags, features, configurations, building and
flashing instructions, and license exceptions.
Signed-off-by: raul_chen <raul_chen@realsil.com.cn>
Add board-level support for two Realtek Ameba WHC evaluation boards:
- pke8721daf (RTL8721Dx)
- rtl8720f_evb (RTL8720F)
Each board provides:
- defconfig for NSH with WiFi networking support
- CMakeLists.txt (make-only build helper that fails fast on cmake)
- Board-specific bring-up and initialization (leds, SDIO, flash)
- Scripts/Make.defs including the IC-level build fragment and the
make flash target (tools/ameba/Config.mk)
Signed-off-by: raul_chen <raul_chen@realsil.com.cn>
This fix is based on the same fix for LPC2378, however it wasn't
tested on real hardware because I don't have a LPC214x board.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
Fill in the previously empty rexecd page with a description of the
daemon, its listening port/RPMsg name, usage, and all command-line
options (-4/-6/-r/-t), including the new -t threadless option that
serves each connection inline without a per-connection worker thread.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Align the NuttX open(2) flag constants with the Linux asm-generic
values so that the FUSE wire protocol and other cross-platform
interfaces work without conversion.
All code that used '(flags & O_RDONLY)' as a bitmask check (always 0
now that O_RDONLY=0) has been updated to use '(flags & O_ACCMODE)'
comparisons.
The NUTTX_O_* constants in include/nuttx/fs/hostfs.h are updated to
match, and the sim hostfs open flag mapping is fixed.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This file does not build with minor modifications due to nxstyle issues.
Adding symbols to the white_content_list to address_this.
Testing: "gcc -o nxstyle nxstyle.c" builds fine.
Signed-off-by: Catalin Visinescu <catalin_visinescu@yahoo.com>
Driver May Cause a DoS
Invalid data is passed to the NXP Plug & Trust Nano Package used by the
NuttX secure element driver. If the NXP code is not handling the malformed
data, a corruption can occur. Alternatively, if the attacker is able to
point create_signature_args->algorithm in memory at an address that is not
accessible, a crash can occur.
Applicable to:
* `signature_algorithm_mapping[create_signature_args->algorithm]`
* `signature_algorithm_mapping[verify_signature_args->algorithm]`
Signed-off-by: Catalin Visinescu <catalin_visinescu@yahoo.com>
Provide correct pin name BOARD_LED1 and associated bit mask
BOARD_LED1_BIT. Also use non-negated `ledon`. Add initialization into
bringup code.
Signed-off-by: Martin Vajnar <martin.vajnar@gmail.com>
O_RDOK and O_WROK are non-standard aliases for O_RDONLY and O_WRONLY
respectively. Having two names for the same flag creates confusion,
especially when aligning the flag values with Linux. Remove the
aliases and replace all uses with the standard O_RDONLY/O_WRONLY.
No functional change — O_RDOK was defined as O_RDONLY and O_WROK as
O_WRONLY, so the replacement is a pure text substitution.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
The fence.i instruction is only available when the Zifencei extension
(CONFIG_ARCH_RV_ISA_ZICSR_ZIFENCEI) is supported by the hardware.
This commit adds a macro wrapper around fence.i usages to prevent
compilation errors on toolchains or targets where the Zifencei
extension is absent.
Signed-off-by: Chengdong Wang <wangcd91@gmail.com>
Describe how to enable and use the Dropbear SSH server on the ESP32-C3
DevKit, including Wi-Fi, host key, and login configuration.
Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
Add a board configuration that enables the Dropbear SSH server on the ESP32-C3 DevKit with Wi-Fi networking and the required crypto support.
Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
The audio tone generator stopped working with the 'echo' command
since https://github.com/apache/nuttx-apps/pull/1559
Before that PR:
nsh> echo "t120o1l16b9n0baan0bn0bn0baaan0b9n0baan0b" > /dev/tone0
tone_write: Received 41 bytes
nsh>
After that PR:
nsh> echo "t120o1l16b9n0baan0bn0bn0baaan0b9n0baan0b" > /dev/tone0
tone_write: Received 40 bytes
tone_write: Received 1 bytes
nsh>
Unfortunately the Audio Tone was not block new write attempts even
when it was already playing a melody.
This commit fix it and avoids the issue caused by that PR.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
The up_saveusercontext symbol was declared with .globl twice in a
row. The .globl directive is idempotent, so the duplicate line has
no effect on the generated object; drop it to match the single
declaration used by the other .S files in this directory.
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
The up_saveusercontext symbol was declared with .globl twice in a
row. The .globl directive is idempotent, so the duplicate line has
no effect on the generated object; drop it to match the single
declaration used by the other .S files in this directory.
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>