Commit Graph

52639 Commits

Author SHA1 Message Date
Eren Terzioglu
8b931b43b1 boards/esp32c6: Remove sotest config for esp32c6
boards/esp32c3: Add ostest config for esp32c3
boards/esp32h2: Add ostest config for esp32h2
2024-03-06 00:49:50 +08:00
chao an
8592e7e009 sched/task: save argument counter to avoid limit check
The maximum startup parameters have been checked accordingly in nxtask_setup_stackargs(),
let us save argument counter to avoid limit check.

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-05 22:25:28 +08:00
chao an
0902231deb drivers/sensors: fix comments typo
Signed-off-by: chao an <anchao@lixiang.com>
2024-03-05 22:25:28 +08:00
chao an
7cb1f3b3c0 sched/group: replace group_findbypid to task_getgroup
Task group could find from process id, replace group_findbypid to
task_getgroup to simplify the search logic

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-05 22:24:52 +08:00
chao an
dfd1e38b40 sched/environ: check envcp validity before hold sched_lock()
check envcp validity before hold sched_lock() to avoid unnecessary schedule lock

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-05 22:24:14 +08:00
Marco Casaroli
73c4f2f1e7 fix(esp32s3_spiflash_mtd): debug type specifiers
These log messages are wrong if we use CONFIG_FS_LARGEFILE.
2024-03-05 22:23:50 +08:00
ligd
d45a45da94 sched.h: add empty realize when NO CONFIG_SMP
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-05 17:50:58 +08:00
ligd
27de65edc0 sched.h: fix CPU_EQUAL(s1, s2) write error
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-05 17:50:58 +08:00
Michal Lenc
44a087111d samv7: add support for USART TX DMA transfers
This commit adds support for TX DMA transfers for USART peripheral. Code
refactor in sam_serial.h was also required in order to have correct
defines for all possible cases (both RX and TX DMA used, just one used,
none used).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-03-05 09:48:03 +08:00
Tiago Medicci Serrano
dcad39a962 arch: Fix style warnings regarding included header files
This commit fixes style warnings regarding including header files
outside the `Included Files` section.
2024-03-05 09:45:49 +08:00
Tiago Medicci Serrano
658dd94863 procfs: Change variable name to ease debugging 2024-03-05 09:45:49 +08:00
Tiago Medicci Serrano
e287ed9090 documentation: implement on-demand paging for RISC-V devices
It documents how the on-demand paging was implemented for RISC-V
devices and how it can be extended to other architectures.
2024-03-05 09:45:49 +08:00
Tiago Medicci Serrano
c67502d9b4 riscv: Implement page-fault exception and on-demand paging
When an application is being loaded `up_addrenv_create ` calls
`create_region` to create the address environment. Only the first
entry is mapped when the region is created. Virtual memory that is
not mapped will trigger an exception when accessed. Other memory
pages are allocated and mapped on-demand. This enables setting
larger heap and stack for the process without compromising the
overall system memory.
2024-03-05 09:45:49 +08:00
Tiago Medicci Serrano
ae9ef972c0 paging: Rename existing CONFIG_PAGING to CONFIG_LEGACY_PAGING
Current `CONFIG_PAGING` refers to an experimental implementation
to enable embedded MCUs with some limited RAM space to execute
large programs from some non-random access media.

On-demand paging should be implemented for the kernel mode with
address environment implementation enabled.
2024-03-05 09:45:49 +08:00
ligd
264e8116b0 armv7-a/r: use _ebss as idle stack both in SMP mode or not
this commit fix:
7d45afe871

which in PR:
https://github.com/apache/nuttx/pull/11814

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-04 20:42:21 -03:00
Saurav Pal
1bec133385 drivers/mtd/mtd_nandram: Adds virtual NAND Flash device simulator.
Adds virtual NAND Flash device simulator, NAND flash log wrapper, and documentation for it.

Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
2024-03-04 10:38:08 -03:00
SPRESENSE
3b3f2d97e9 arch: cxd56: Follow interface change of set_buf() operation
set_buf() operation is changed to have the argument about
format. Follow the change.
2024-03-04 20:39:44 +08:00
Philippe Leduc
8de922186e Exported CMake toolchain file is broken when the target is linked against NuttX and another library that shall also be linked against NuttX too.
Fix: ensure that NuttX libraries are linked at the end as they are the root of linkage dependency tree.
2024-03-04 20:38:37 +08:00
chao an
9489953230 sched/tcb: add free tcb flag to support static tcb
Add support for static tcb, applications in some special case can
initialize system resources in advance through static tcb.

|  static struct task_tcb_s g_tcb;
|
|  memset(&g_tcb, 0, sizeof(struct task_tcb_s));
|  g_tcb.cmn.flags = TCB_FLAG_TTYPE_KERNEL;
|  nxtask_init(&g_tcb, "PTCB", 101, NULL, 1024, ptcb_task, NULL, NULL, NULL);
|
|  ...
|  nxtask_activate(&g_tcb.cmn);

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-04 20:05:11 +08:00
ligd
91f0a0f1a8 Revert "goldfish & qemu: handle MMU table and CONFIG_RAM_END"
This reverts commit 2f7b107608.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-04 18:08:15 +08:00
ligd
b599fdbc0e stm32: fix compile failed
Error: chip/stm32_sdmmc.c:1911:7: error: variable 'regaddress' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
 1911 |   if (priv->base == STM32_SDMMC1_BASE)

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-04 18:08:15 +08:00
chenrun1
3f872807bf sh:Change expansion path logic
We will first check whether the target file path exists. If it does not exist, we will check whether the common exists. If not, we will restore the path that should be spliced ​​at the beginning.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-03-04 01:18:45 +08:00
chenrun1
97da73d9b8 sh:Enhanced compilation system
We'll look for ETC resources from two paths
1.board/src/etc
2.common/etc

Search for the content in the board/src/etc directory first

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-03-04 01:18:45 +08:00
Yanfeng Liu
a4d61dea80 risc-v/k230: improvements to support K230 vendor u-boot
Previously we need turn off the PMP locks in K230 vendor u-boot to use
NuttX, this complicates the setup process. This patch supports running
NuttX with original vendor u-boot so that to reduce setup complexity.

It also enables empty NSH prompt string in AMP master config as the apps
side support is ready.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-03-03 12:04:14 -03:00
Rodrigo Sim
634b605476 board/stm32f401rc-rs485: Add support to ADC
Signed-off-by: Rodrigo Sim <rcsim10@gmail.com>
2024-03-03 12:03:18 -03:00
Jorge Guzman
d11f5b4763 stm32h7/linum-stm32h753bi: Add support to sdcard
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2024-03-03 10:24:42 -03:00
ligd
2f7b107608 goldfish & qemu: handle MMU table and CONFIG_RAM_END
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-03 18:57:32 +08:00
simbit18
1cd8413d19 tools/ci/platforms/darwin.sh: fix mkdir: wamrc: File exists
mkdir wamrc -> mkdir -p wamrc
2024-03-03 02:30:54 +08:00
ligd
7d45afe871 armv7-a/r: use _ebss as idle stack both in SMP mode or not
It is better take the _ebss as IDLE_STACK_BASE like armv8-m

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-03 02:25:03 +08:00
p-szafonimateusz
d4b17f963d arch/intel64: add HPET timer support as oneshot timer
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-03 02:24:40 +08:00
ligd
51d8bbfbd9 armv7-a/r: use arm_timer to setup perf
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-03 02:19:37 +08:00
ligd
5aeab4a36c armv7-a timer:fix timer overflow.
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-03 02:19:37 +08:00
ligd
8eddf00212 armv7a/r: use register cval to set timer
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-03 02:19:37 +08:00
ligd
dabed3c7fb armv7-a/r: correct maxdelay calculating
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-03 02:19:37 +08:00
ligd
fd2da7f4bc cpuload: change cpuload type to clock_t
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-03 02:15:40 +08:00
ligd
3521e6ba27 cpuload: remove ciritical_section() to fix recursive
Recursive:
25 0x44000e5a in up_cpu_paused (cpu=cpu@entry=1) at armv7-a/arm_cpupause.c:120
26 0x440032f2 in enter_critical_section () at irq/irq_csection.c:275
27 0x44006f24 in nxsched_process_taskload_ticks (tcb=tcb@entry=0x442ba638 <g_idletcb+256>, ticks=0) at sched/sched_cpuload.c:104
28 0x44007310 in nxsched_suspend_critmon (tcb=tcb@entry=0x442ba638 <g_idletcb+256>) at sched/sched_critmonitor.c:303
29 0x44006ef0 in nxsched_suspend_scheduler (tcb=tcb@entry=0x442ba638 <g_idletcb+256>) at sched/sched_suspendscheduler.c:78
30 0x44000e5a in up_cpu_paused (cpu=cpu@entry=1) at armv7-a/arm_cpupause.c:120
31 0x440032f2 in enter_critical_section () at irq/irq_csection.c:275
32 0x44000f1a in arm_pause_handler (irq=<optimized out>, context=<optimized out>, arg=<optimized out>) at armv7-a/arm_cpupause.c:216
33 0x44002ffe in irq_dispatch (irq=irq@entry=2, context=context@entry=0x4449f6b8 <g_cpu1_idlestack+1720>) at irq/irq_dispatch.c:146
34 0x44001612 in arm_doirq (irq=2, irq@entry=0, regs=0x4449f6b8 <g_cpu1_idlestack+1720>) at armv7-a/arm_doirq.c:72
35 0x44000940 in arm_decodeirq (regs=<optimized out>) at armv7-a/arm_gicv2.c:403
36 0x440000b4 in arm_vectorirq () at armv7-a/arm_vectors.S:236

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-03 02:15:40 +08:00
ligd
661d382322 syslog_rpmsg: handle syslog_rpmsg_transfer() return value
in case of only update head

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-03 02:14:28 +08:00
Michał Łyszczek
768e533123 drivers/analog/hx711.c: fix tare calculation
Taring was done with user defined sign, which later resulted in tare
being "resigned" twice. Because of that taring was workign correctly
for one sign, and not the other.

Fix it to disable user sign when tarring, and tare always without
changing sign.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2024-03-03 01:56:40 +08:00
Michał Łyszczek
459b4434b1 drivers/analog/hx711.c: fix averaging on negative values
ptype of ((int32_t)0 * (uint32_t)0) is (unsigned). "i" counter was
declared unsigned to not make comparision with "unsigned char" in for loop.
This resulted in calculation in average to be implicitly casted to unsigned,
and when negative number was added to it, it turned into huge value.

Change type of "i" to signed, and just cast (unsigned char) to (int)
to fix this.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2024-03-03 01:56:40 +08:00
Yanfeng Liu
3bd35487f0 docs/comments: add simple document and fix typo
This patch adds simple document for the shared memory file system.
with typos fix in a other places.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-03-03 01:55:07 +08:00
Marco Casaroli
0c50af583d feat(esp32s3-bootloader): allow 32MB flash
The scripts already support, we are just
missing the entry in the config.
2024-03-01 16:51:47 -03:00
Marco Casaroli
246ef2ffa4 test: add libtest build
Build libtest with the module configuration
to make sure that the split library build
functionality works.
2024-03-01 12:59:16 -03:00
Marco Casaroli
447cc9698f use apps-or-nuttx-Make.defs for archs
This will allow apps to tweak build configuration of NuttX
2024-03-01 12:59:16 -03:00
Marco Casaroli
4c27036ea8 Add apps-or-nuttx-Make.defs
This is a wrapper for apps/Make.defs or nuttx/Make.defs

Since apps/Make.defs include nuttx/Make.defs, we check if it the
apps dir is available and include it, otherwise we just include
nuttx/Make.defs and keep the old behavior.

This allows EXTRA_LIBS and some other system-wide tweaks be
applied in any apps and make it work with the nuttx Makefiles.
2024-03-01 12:59:16 -03:00
simbit18
fd86cf70cc tools/ci: Modify cibuild.sh to adapt to new platforms.
cibuild.sh -> modify scripts
platforms -> new folder +scripts
add header

tools/ci/platforms: Set the execute permissions on the updated files.

tools/ci/platforms/linux.sh: fix header

Corrected Apache Foundation copyright header.

tools/ci: Modify cibuild.sh to adapt to new platforms.

cibuild.sh -> modify scripts
platforms -> new folder +scripts
add header

tools/ci/platforms: Set the execute permissions on the updated files.

tools/ci: Modify cibuild.sh to adapt to new platforms.

cibuild.sh -> modify scripts
platforms -> new folder +scripts
add header

tools/ci/platforms: Set the execute permissions on the updated files.

tools/ci: Kept the common code in cibuild.sh.

Kept the common code in cibuild.sh.

tools/ci: Storing all Environment Variables in env.sh script.

Added in cibuild.sh this command "source "${CIWORKSPACE}"/tools/env.sh" to activate installed tools.

tools/ci: shared the tools path in cibuild.sh

Added in cibuild.sh enviroment variable "NUTTXTOOLS" for installed tools.

Removed bashisms from scripts darwin.sh, linux.sh, msys2.sh and ubuntu.sh.

tools/ci: Fixed build problems with macOS

Fix Error: /Users/runner/work/nuttx/nuttx/sources/tools/bloaty-src/build is not a directory
2024-03-01 21:30:03 +08:00
Junbo Zheng
850be17142 Documentation: correct CMakeList.txt to CMakeLists.txt
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2024-03-01 20:15:10 +08:00
ligd
2241969e5a SMP: fix crash when switch to new task which is still running
cpu0 thread0:                        cpu1:
sched_yield()
nxsched_set_priority()
nxsched_running_setpriority()
nxsched_reprioritize_rtr()
nxsched_add_readytorun()
up_cpu_pause()
                                     IRQ enter
                                     arm64_pause_handler()
                                     enter_critical_section() begin
                                     up_cpu_paused() pick thread0
                                     arm64_restorestate() set thread0 tcb->xcp.regs to CURRENT_REGS
up_switch_context()
  thread0 -> thread1
arm64_syscall()
    case SYS_switch_context
     change thread0 tcb->xcp.regs
    restore_critical_section()
                                     enter_critical_section() done
                                     leave_critical_section()
                                     IRQ leave with restore CURRENT_REGS
                                     ERROR !!!

Reason:
As descript above, cpu0 swith task: thread0 -> thread1, and the
syscall() execute slowly, this time cpu1 pick thread0 to run at
up_cpu_paused(). Then cpu0 syscall execute, cpu1 IRQ leave error.

Resolve:
Move arm64_restorestate() after enter_critical_section() done

This is a continued fix with:
https://github.com/apache/nuttx/pull/6833

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-01 21:05:00 +09:00
ligd
27ef7576ff arm64/defconfig: improve the arm64 defconfig
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-01 21:05:00 +09:00
ligd
85bc84f5c5 arm64: remove the CONFIG_DEBUG_SCHED_INFO=y
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-01 21:05:00 +09:00
chao an
954bffcbd7 sched/tls: inline group info in flat mode to improve performance
inline group info in flat mode to improve the task create/destroy performance

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-01 17:27:26 +08:00