Commit graph

56627 commits

Author SHA1 Message Date
Huang Qi
fd1b52579b Fix some minor style issues
Fix typo and comment style in:
* audio/audio_comp.c
* drivers/drivers_initialize.c
* drivers/pipes/fifo.c

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-20 10:51:07 +01:00
Huang Qi
3a6de58904 riscv/syscall.h: Update comment for syscall
Change RV64GC to RISC-V since this file is for all RISC-V based platform.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-20 10:50:50 +01:00
YAMAMOTO Takashi
788f8fc495 esp32s3_partition.c: Appease a compiler warning (-Wdiscarded-qualifiers) 2024-11-20 17:43:12 +08:00
YAMAMOTO Takashi
032b2bcd4b syslog.rst: mention the correct kconfig option 2024-11-20 17:41:38 +08:00
Jukka Laitinen
b088369014 arch/arm64/src/imx9/imx9_lpi2c.c: Clear NACK properly on last RX byte
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-11-20 17:36:00 +08:00
Jukka Laitinen
02a3437289 arch/arm64/src/imx9/imx9_lpi2c.c: Add error recovery on timeout
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-11-20 17:36:00 +08:00
Jukka Laitinen
3afa58cdda arch/arm64/src/imx9/imx9_lpi2c.c: Clean up the irq handling logic
Both RX and TX interrupts can be enabled after the setup of the transfer; the TX interrupt
must be enabled after queuing the first byte as done before. It is not possible to miss the
RX interrupts, as it pends as long as the byte gets read from the FIFO

When starting the TX, the first byte can be queued instantly, it won't be sent out to the
bus if there is NACK to the address. This also prevents spurious TX interrupts in error
cases, since the TX queue is not empty after initiating a transfer.

In some error cases controller sends STOP by itself even if AUTOSTOP is disabled.
It is better to tell the controller to ABORT, which will also generate STOP only when needed.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-11-20 17:36:00 +08:00
Ville Juven
244a560be9 sched/addrenv.c: Fix usage of atomic_fetch_sub
addrenv_give should return the new reference counter (after subtraction)
instead of the old one.
2024-11-20 18:28:26 +09:00
wangmingrong1
d41e3da911 Fix ALIGN_UP duplicate definition error
ALIGN_UP has been defined in nuttx.h

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-20 14:51:54 +08:00
wangchen
540036ab60 udp:add tls cleanup protection to protect udp_callback info in psock_udp_recvfrom
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-11-20 13:42:58 +08:00
wangchen
b0d8fd9d75 udp:add tls cleanup protection to protect waitsem in udp_txdrain
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-11-20 13:42:58 +08:00
Ville Juven
3146ea04b8 risc-v/up_testset: Implement test-and-set with AMOSWAP
It should be a bit more efficient to do compared to the LR/SC pair.
2024-11-20 13:27:40 +08:00
Neo Xu
edc410f26f format code to pass CI
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-11-20 09:04:22 +08:00
buxiasen
96a3bc2b5c tools/gdb: fix if restore_regs failed script abort
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
eded2017d4 memdump.py:Enhance the printing function of memdump
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
477f7b92ee tools/gdb/memdump.py:fix mempool memory traversal missing nodes
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
xuxingliang
8264c05c15 tools/gdb: use f string where possible
misc update.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-20 09:04:22 +08:00
Gao Jiawei
06d640a677 implement ps nx shell utility for ez debugging with GDB
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-11-20 09:04:22 +08:00
Gao Jiawei
e31fe0fb55 add custom command and APIs for retrieving/displaying stack statistics
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-11-20 09:04:22 +08:00
Gao Jiawei
8edb9283ba trivial modification on the utility module
1. add get macro related inteface, for now we have't fully implemented
the way to expand and evalute macros at runtime. We just deal with some macros that can be expand and evaluate into essential constants that will be needed later.
2. rearrange utility functions in a different order
3. reimplment the get register API to make it more commonly used

Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-11-20 09:04:22 +08:00
Gao Jiawei
76db3c8939 enable stack trace printing on excpetion
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
e0bea987d1 gdb python plugin:support dump list member
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
daac426f79 gdb python plugin:add hexdump command support
hexdump useful to debug

format such as:

(gdb) hexdump 0x0062fd30 500
0062fd30  73 68 6f 77 5f 76 61 72 69 61 62 6c 65 3a 20 45  show_variable: E
0062fd40  52 52 4f 52 20 56 61 72 69 61 62 6c 65 3d 25 73  RROR Variable=%s
0062fd50  20 68 61 73 20 74 68 65 20 77 72 6f 6e 67 20 76   has the wrong v
0062fd60  61 6c 75 65 0a 00 6f 73 74 65 73 74 5f 6d 61 69  alue..ostest_mai
0062fd70  6e 2e 63 00 73 68 6f 77 5f 76 61 72 69 61 62 6c  n.c.show_variabl
0062fd80  65 3a 20 45 52 52 4f 52 20 56 61 72 69 61 62 6c  e: ERROR Variabl
0062fd90  65 3d 25 73 20 68 61 73 20 61 20 76 61 6c 75 65  e=%s has a value
0062fda0  20 77 68 65 6e 20 69 74 20 73 68 6f 75 6c 64 20   when it should
0062fdb0  6e 6f 74 0a 00 73 68 6f 77 5f 76 61 72 69 61 62  not..show_variab

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
635e324e9a gdb/thread.py:simplify the logic of nxsetregs
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
wangmingrong
8eb1047595 gdb python tools: fix command "info thread" echo error
Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
eccd26a162 gdb/thread.py:Print colorful
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
5aaa31337a gdb/thread.py:fix a bug when use 'up' then use 'thread'
Python Exception <class 'gdb.error'>: Attempt to assign to an unmodifiable value.
Python Exception <class 'gdb.error'>: Error occurred in Python: Attempt to assign to an unmodifiable value.
Error occurred in Python: Error occurred in Python: Attempt to assign to an unmodifiable value.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
2292a36983 gdb/thread.py:change show gdb index/tid/pid format
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
852e683fa3 python/gdb:fix use thread command on running task bug
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
ligd
5c939d8140 gdb: devide tid & pid, add holder logout when waiting mutex
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-11-20 09:04:22 +08:00
stbenn
8def1764a4 arch/stm32h5: add basic ADC support
Adds ADC support with minimal feature set (no DMA or Timers etc). A new nucleo-h563zi configuration was added to
provide easy testing with the adc example NSH addon.

Fix Kconfig spacing to tabs
2024-11-20 08:51:27 +08:00
zhangyuan29
b524179572 xtensa/esp32: Remove duplicate board Make.defs
$(TOPDIR)/Make.defs was already include in common/Makefile.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-11-20 02:07:10 +08:00
Ville Juven
1abcb6a090 mm/gran: Speed optimize gran_match
The original code did the speedup only from the other direction (from end
to start). If the starting GAT index has reservations, they are not skipped
as a bunch, but instead the GAT is iterated bit-by-bit, causing a massive
performance issue.

Fix this by:
- Skipping full GATs right away
- Skipping all of the reserved bits from the starting GAT as a bunch
2024-11-20 01:07:01 +08:00
Ville Juven
97ed62b797 irq/irq.h: Remove extern of non-existent global 2024-11-20 01:04:47 +08:00
Ville Juven
e2616e7866 addrenv/addrenv.c: Use atomic_ functions to handle the reference counter
The performance penalty in SMP mode is too big for taking the big kernel
lock simply to bump the address environment reference counter; fix this
by using the compiler provided atomic macros.
2024-11-20 01:04:31 +08:00
BitBender334
bd7074460c arch/risc-v/src/mpfs/mpfs_irq.c: Default global interrupt priorities 2024-11-19 22:24:39 +08:00
chenrun1
6a19264c97 littlefs_fstat:Ignore When the error is LFS_ERR_NOENT, we assume that the attr attribute is not set.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-11-19 11:08:07 -03:00
chenrun1
27eaa23219 lfs:Added LITTLEFS_USE_ATTR to control whether to save attributes when
create file

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-11-19 11:08:07 -03:00
liamHowatt
27e587b179 arch/esp32s3: fb add pandisplay
Signed-off-by: liamHowatt <liamjmh0@gmail.com>
2024-11-19 20:51:50 +08:00
chao an
f8ccfc3f7f arm/efm32: fix regression by PR#14810
itm syslog should use syslog_write() not up_putc()

Signed-off-by: chao an <anchao@lixiang.com>
2024-11-19 20:50:33 +08:00
chao an
c328650aa5 arm/cortex-m: itm syslog should select SYSLOG_REGISTER
Signed-off-by: chao an <anchao@lixiang.com>
2024-11-19 20:50:33 +08:00
chao an
5582134c04 arm/efm: fix build warning
chip/efm32_start.c:150:3: warning: implicit declaration of function 'itm_syslog_initialize';
                                   did you mean 'syslog_initialize'? [-Wimplicit-function-declaration]
  150 |   itm_syslog_initialize();
      |   ^~~~~~~~~~~~~~~~~~~~~
      |   syslog_initialize

Signed-off-by: chao an <anchao@lixiang.com>
2024-11-19 20:50:33 +08:00
chao an
8ffe5bdc1e arm/efm32: fix build break caused by undeclared error
Old upstream from @acassis:
d97227eddd/nuttx/configs/efm32gg-pnbfano/include/board.h

chip/efm32_clockconfig.c:860:24: error: 'BOARD_SWOPORT_LOCATION' undeclared (first use in this function);
                                 did you mean 'BOARD_UART0_ROUTE_LOCATION'?
  860 |   regval |= ((uint32_t)BOARD_SWOPORT_LOCATION <<
      |                        ^~~~~~~~~~~~~~~~~~~~~~
      |                        BOARD_UART0_ROUTE_LOCATION
chip/efm32_clockconfig.c:860:24: note: each undeclared identifier is reported only once for each function it appears in
chip/efm32_clockconfig.c:866:20: error: 'BOARD_GPIO_SWOPORT' undeclared (first use in this function)
  866 |   efm32_configgpio(BOARD_GPIO_SWOPORT);
      |                    ^~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao@lixiang.com>
2024-11-19 20:50:33 +08:00
raiden00pl
79e220d43b boards/Kconfig: fix bad indent
fix bad indent in boards/Kconfig
2024-11-19 13:28:42 +01:00
raiden00pl
7e42ca2538 boards/stm32: split nucleo-f4x1re into separate boards
Split nucleo-f4x1re into nucleo-f401re and nucleo-f411re.
These are separate boards and should be in separate directories as it's
done for all other nucleo boards in NuttX
2024-11-19 13:28:42 +01:00
4cfdaa0105 CI: Kill CI Test after 2 hours
CI Test will sometimes run for 6 hours (before getting auto-terminated by GitHub):
- https://github.com/apache/nuttx/issues/14808
- https://github.com/apache/nuttx/issues/14680

This is a problem because:
- It will increase our usage of GitHub Runners. Which may overrun the [GitHub Actions Budget](https://infra.apache.org/github-actions-policy.html) allocated by ASF.
- Suppose right after CI Test there's another build. If CI Test runs for all 6 hours, then the build after CI Test will never run.

For this PR: We assume that Every CI Job (e.g. risc-v-05) will complete normally within 2 hours. If any CI Job exceeds 2 hours: This PR will kill the CI Test Process `pytest` and allow the next build to run.
2024-11-19 17:17:43 +08:00
hujun5
9f835f63bd mm/iob: fix some comment in https://github.com/apache/nuttx/pull/14764
reason:
Since we decoupled counting and sem count,
we changed the meanings of three key global variables:

g_iob_count: A positive number indicates the available number
  of IOBs, while a negative number indicates the number of waiters in iob_alloc (when throttle == false).
g_throttle_wait: Represents the number of waiters in
  iob_alloc (when throttle == true), and it will not be negative.
g_qentry_wait: Represents the number of waiters for
  qentry, and it will not be negative.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-19 15:39:00 +08:00
SPRESENSE
f142d04b91 arch: cxd56xx: Fix compile error of cxd56_gnss.c
Fix error: 'g_rtc_enabled' undeclared (first use in this function).
2024-11-19 15:37:42 +08:00
Masayuki Ishikawa
1d6ece71b8 arch: arm: Fix cxd56xx for SMP
Summary:
- In https://github.com/apache/nuttx/pull/14465,
  atomic_compare_exchange_weak_explicit() was newly introduced
  in semaphore. However, cxd56xx has an issue with the API
  if SMP is enabled (see up_testset2 in cxd56_testset.c).
- This commit fixes the issue by using LIBC_ARCH_ATOMIC.

Impact:
- Only cxd56xx SoCs in SMP mode.

Testing:
- Tested with spresense:smp, spresense:wifi_smp
- NOTE: If DEBUG_ASSERTIONS is enabled assert would be happend.
  I think this might be another issue.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2024-11-19 15:17:28 +08:00
raiden00pl
af5252c8f9 boards/arm/stm32/nucleo-f4x1re/stm32_adc.c: remove dependency on AJOYSTICK
remove dependency on AJOYSTICK, ADC can be used without analog joystick,
so there is no reason to depends on it
2024-11-18 16:56:43 -03:00