Commit Graph

51847 Commits

Author SHA1 Message Date
chao an
1ce1a19afd arm/clang: replace deprecated parameter
In LLVM Clang 17.0.1, the `--config` parameter has been deprecated and replaced by the `-target` parameter

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-29 03:58:05 -08:00
chenwen@espressif.com
e2a82f008a xtensa/esp32s3: Invalidate cache if the flash address used has a cache mapping.
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2023-11-29 03:57:50 -08:00
Michal Lenc
e852f28710 ci: add open_memestream CI test
CI test for open_memestream() stdio function was added.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-11-29 02:13:19 -08:00
Michal Lenc
eea7db24f3 libc: add support for open_memstream
Adds support for POSIX interface open_memstream() that allows writing
to dynamic memory buffer stream. The stream is dynamically reallocated
as the buffer grows with initial size set to zero.

The caller has to free the buffer after the stream is closed.

The implementation uses fopencookie() for custom stream operations and
callbacks.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-11-29 02:13:19 -08:00
yaojingwei
a57e3f365a video.c: modify set_buf call seqence in start_capture function.
To avoid losing the first frame, the set_buf needs to excute first. At the same time, imgdata->start_capture should excuted before the imgsensor->start_capture.

Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2023-11-29 02:01:34 -08:00
chenwen@espressif.com
54b71de23a xtensa/esp32s3: Fix some ESP32S3 module reboot and QVL issues
1. Increase the data length in timing tuning.
2. Add MSPI Error-Correcting Code function when accessing SPIRAM.
3. Add delay before timing tuning.
2023-11-29 01:51:58 -08:00
Ville Juven
8494fd2097 mpfs/mpfs_corespi.c: Round up divider to prevent overlock of SPI
The divider should be rounded to the next full integer to ensure that
the resulting SPI frequency is <= target frequency, i.e. the SPI is
not overclocked.
2023-11-29 01:47:55 -08:00
raiden00pl
9858dfde32 Documentation: disable parallel build 2023-11-29 01:37:10 -08:00
raiden00pl
de199faed6 Documentation: turn warnings into errors 2023-11-29 01:37:10 -08:00
Takumi Ando
e11627d0fb boards: Use MS56XX instead of MS5611
Signed-off-by: Takumi Ando <t-ando@advaly.co.jp>
2023-11-28 16:48:50 -03:00
Takumi Ando
3353bd3ced sensors: mx5611: Add support for MS5607
MS5607 has few differences between MS5611.

Signed-off-by: Takumi Ando <t-ando@advaly.co.jp>
2023-11-28 16:48:50 -03:00
raiden00pl
6dfe1bf58c Documentation: port warnings_filter Sphinx extension from Zephyr
ignore known warnings:

/home/raiden00/git/RTOS/nuttx/nuttx/Documentation/reference/os/netdev.rst:61: WARNING: Duplicate C declaration, also defined at reference/os/netdev:39.
Declaration is '.. c:struct:: net_driver_s'.
/home/raiden00/git/RTOS/nuttx/nuttx/Documentation/reference/user/07_signals.rst:180: WARNING: Duplicate C declaration, also defined at reference/user/structures:112.
Declaration is '.. c:struct:: sigaction'.
2023-11-28 09:18:29 -08:00
Ville Juven
e39ef8563e semaphore/_SEM_XX: Remove the _SEM redirection macros as unnecessary 2023-11-27 04:52:54 -08:00
Ville Juven
5f36a43609 sched/semaphore: Move named semaphores to user space 2023-11-27 04:52:54 -08:00
Ville Juven
c9bdadd541 sched/semaphore: Move cancel point and errno handling to libc / user-space
This moves all the public POSIX semaphore functions into libc and with
this most of the user-space logic is also moved; namely cancel point and
errno handling.

This also removes the need for the _SEM_XX macros used to differentiate
which API is used per user-/kernel mode. Such macros are henceforth
unnecessary.
2023-11-27 04:52:54 -08:00
Michal Lenc
34afef5cfb Documentation: add open_memstream test entry
Test tool for open_memstream() function added to documentation.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-11-27 03:24:53 -08:00
Xiang Xiao
a28ad5299a tools/ci: Upgrade macOS arm64 toolchain to 12.3.rel1
and enable arm64 ci build on macOS

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-11-26 14:10:00 +02:00
Xiang Xiao
d30daa54b0 tools/ci: Upgrade clang arm toolchain to 17.0.1
from https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/tag/release-17.0.1

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-11-26 12:49:55 +01:00
Rodrigo Sim
89ddb2f709 stm32f401rc-rs485: Add sdcard support 2023-11-25 23:16:44 -08:00
Rodrigo Sim
01c5ec1622 Documentation: Fix errors on linum-stm32h753bi 2023-11-25 17:59:42 -08:00
Nathan Hartman
3ed629274e mm: Fix some typos 2023-11-24 09:57:10 -08:00
Ville Juven
20eb1831b1 rv-virt/knsh: Set correct RAM_START and RAM_SIZE
Also, set RAM_VSTART, because we have vaddr=paddr mapping. Otherwise
RAM_VSTART gets its default value which is 0.
2023-11-24 04:39:25 -08:00
ligd
00121f9812 sched: delete check when pick nexttcb in readytorun list
CPU0                     CPU1
1. feed0 thread             feed1 thread
   (prio 1 affinity)        (prio 1 affinity)
2. nsh_main
   sched_lock()
3. waitpid()                hello_main
4. ------                   hello exit()
5. ------                   exit()->exit_wakeup()->wakeup nsh ->
                            add_readytorun()->
                            nsh at schedlock state set g_cpu_schedlock
6. -----                    exit()->nxtask_exit()->remove_readytorun()
                            -> check g_cpu_schedlock -> pick idle1
7. waitpid() return         idle thread
8. sched_unlock             idle thread

The error is in step 6:
pick a idle thread to execute not feed1 thread.

resolve:
remove the schedlocked-check in remove_readytorun()

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-11-24 12:43:54 +09:00
Eren Terzioglu
438cb4a16a xtensa/esp32s3: Add rtc heap support 2023-11-23 16:49:48 -08:00
Ville Juven
8a2b83c482 mm/kmap: Finalize kmap implementation for RISC-V
After this, RISC-V fully supports the kmap interface.

Due to the current design limitations of having only a single L2 table
per process, the kernel kmap area cannot be mapped via any user page
directory, as they do not contain the page tables to address that range.

So a "kernel address environment" is added, which can do the mapping. The
mapping is reflected to every process as only the root page directory (L1)
is copied to users, which means every change to L2 / L3 tables will be
seen by every user.
2023-11-23 16:38:41 -08:00
Nathan Hartman
26e4dd5638 Documentation: Fix various typos 2023-11-23 16:38:19 -08:00
Nathan Hartman
9b77b2ba0b Documentation: Remove executable bit from reStructuredText file. 2023-11-23 16:37:28 -08:00
guotong ma
8d72edf72f fix f401rc flash size in documentation. 2023-11-23 08:15:06 -08:00
guotong ma
6c25d2a2f5 fix f401rc flash size. 2023-11-23 08:15:06 -08:00
SPRESENSE
6ba30033b3 libm: Fix an issue that public header files are not exported
Fix an issue that math library header files are not exported by make export.
Create symbolic links of libmcs, newlib and openlibm header to nuttx/include.
2023-11-23 16:32:53 +01:00
hujun5
5a04354832 driver/tee: add some comments and document files in LICENSE
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-11-23 06:25:48 -08:00
hujun5
0c2cfc767d driver/tee: add optee client driver module
The driver's main purpose is to support the porting of the open source
component optee_client (https://github.com/OP-TEE/optee_client) to nttux.

The basic function of the driver module is to convert the REE application layer data and send it to the TEE through rpmsg.

The main functions include
1 driver registration.
we need to register a device driver(/dev/tee0) through optee_register function.
2 open the driver
3 ioctl the driver
The ioctl command passes different parameters and commands, and interacts with the TEE through rpmsg.
4 close the driver

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-11-23 06:25:48 -08:00
Daniel P. Carvalho
ed877fd494 drivers:mtd: Adds support for W25 2Mbit memories.
Tested with W25Q20CL.
2023-11-22 19:39:40 -03:00
liaoao
ea0be3b490 rpmsgblk: split mmc_ioc_multi_cmd to mmc_ioc_cmd for less share memory allocation
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-11-22 08:08:12 -08:00
liaoao
cf27a8484f rpmsgblk: use a fixed length struct to transfer between two cpus
It may cause out_of_bounds when two side have different configuartion
on NAME_MAX and FS_LARGEFILE(affects size of blkcnt_t)

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-11-22 08:08:12 -08:00
liaoao
4b25a0dfa5 rpmsgblk: check if the block device has been removed before calling its ops
it may cause use after free if server has removed block device before calling
its operations,such as:
server: rm /dev/testrpmsgblk
client: ls /dev/testrpmsgblk

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-11-22 08:08:12 -08:00
liaoao
12d66da892 rpmsgblk: do not actually unlink blockdevice in rpmsgblk client
rpmsgblk client should not affect the server's use of blockdevice.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-11-22 08:08:12 -08:00
liaoao
27f672d55a rpmsgblk: bind block inode to ept when create ept
A segmentfault might happen when read/write/unlink ops called without an open
ops called because it bind ept's ops in rpmsgblk_open_handler.

proxy> rm /dev/ram1
segmentfault

proxy> ls /dev/ram1
segmentfault

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-11-22 08:08:12 -08:00
Ville Juven
57de6484e9 task/pthread_cancelpt: Fix task_delete from another task group
PR #11165 causes an unnecessary regression; task_delete no longer works,
if the deleted task is from another group.

The logic that prevents this comes from:

nxnotify_cancellation() ->
tls_get_info_pid() ->
nxsched_get_stackinfo()

Which checks for permissions, which does not make sense in this case since
it is the kernel asking for the stack information.

Fix this by partially reverting 11165 and implementing a direct path for
the kernel to query for any tasks TLS.
2023-11-22 08:05:58 -08:00
Eero Nurkkala
83f5ca6158 risc-v/mpfs: ihc: cleanup DEBUGASSERTs and irq enabling
Replace DEBUGASSERTs with sanity checks. DEBUGASSERT()s are
not necessarily enabled at all, thus risking the functionality
especially in that case. Remove PANICs as well.

Don't enable the ihc irq too early. If enabled, and the master
is already up, the irq is being issued so that the system gets
stuck or is severely slowed down. Master may be already up if
this NuttX hart only is rebooted, for example.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-11-22 08:05:36 -08:00
Petteri Aimonen
0648a61668 sigaction: Expand si_user for non-kernel signals
Commit 9244b5a737 added support
for non-standard field si_user that is useful for passing context
pointers to signal handlers.

This commits makes it work for all signals, not just SA_KERNELHAND.
Previously si_user for normal signals was uninitialized garbage.
2023-11-22 08:00:43 -08:00
chao an
59cf308eff sched/taskspawn: fix spawn fail if enable FDCHECK
protect file descriptor before compare

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-22 16:05:36 +01:00
jianglianfang
817e02c0c8 video/fb: move wdog from fb_chardev_s to fb_paninfo_s
every pan_info should have it own wdog

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-11-22 02:01:20 -08:00
jianglianfang
10991cf5f4 video/fb: wait when the vsync queue is full in FBIO_WAITFORVSYNC
In FBIO_WAITFORVSYNC mode, if vsync queue is full it should wait
until fb_sem_post.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-11-22 02:01:20 -08:00
chao an
e560111dbb tiva/sock_can: correct mutex lock cycle
Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-22 01:57:44 -08:00
chao an
6bbb7c0046 fs/spiffs: correct mutex lock cycle of spiffs
This PR will fix the below issues:
1. double lock() on dup
2. use after free on unbind

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-22 01:57:44 -08:00
qinshijing
e5eabbb411 arch/sim: sim support 16bbp
Signed-off-by: qinshijing <qinshijing@xiaomi.com>
2023-11-21 21:53:06 -08:00
anjiahao
749655d785 tcbinfo:remove total_num form tcbinfo.
total_num is not required
test:

make -f tools/Makefile.host
cp tools/jlink-nuttx /opt/SEGGER/JLink_V786a/libnuttxplugin.so
JLinkGDBServer -if SWD -speed 5000 -device STM32F429ZI -NoGui 1 -rtos libnuttxplugin

can run normally

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-11-21 21:52:24 -08:00
hujun5
1a65f5ed88 sched_lock refine: remove sched_[un]lock in xxx_waitsample
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-11-21 20:03:43 -08:00
hujun5
b2e6d7b9d7 fs/tmpfs: fix an integer overflow
newsize = newsize + CONFIG_FS_TMPFS_FILE_ALLOCGUARD;

When newsize is a large value,
adding a relatively small value can cause the result to become very small,
resulting in program logic errors.
For example:
0xffffffff + 0x2 = 1

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-11-21 20:02:00 -08:00