Commit Graph

50750 Commits

Author SHA1 Message Date
yinshengkai
02d0762c6e driver/note: fix trace dump: dump failed
Exceeding the length limit may cause an error when using sched_note_printf

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-29 00:09:10 +08:00
Michal Lenc
03e5c0217b samv7: allow usage of QSPI in SPI mode for all MCUs
Current implementation of QSPI in SPI mode was available only for MCUs
that do not have standard SPI at all. MCUs with both QSPI and SPI can
however also use QSPI in SPI mode and thus have one more SPI bus. This
commit adds required defines and config options to support QSPI in SPI
mode for all SAMv7 MCUs.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-28 17:39:51 +03:00
chao an
518dcbdaad sim/internal: add typedef pid_t to enhance sim compatibility
enhance sim compatibility on windows

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-28 17:12:45 +03:00
chao an
3a9088c144 libs/alloca: add alloca implement for MSVC
Reference:
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/alloca?view=msvc-170

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-28 11:10:08 -03:00
Ville Juven
01cc1687b3 mpfs/mpfs_i2c.c: Replace 1 second timeout with Time-on-Air based timeout
Calculate how long an I2C transation will take in microseconds, and use
this as the timeout for mpfs_i2c_sem_waitdone.

The reason for doing this is not to keep an i2c bus reserved for the full
1 second timeout, if e.g. a sensor is not on the bus / is faulty and
non-responsive. Reading the other sensors will be blocked for a relatively
long time (1 second) in this case. This fixes such behavior.
2023-08-28 21:16:23 +08:00
Xiang Xiao
47faeeb360 tls: Move task_tls_alloc and task_tls_destruct to libc
so task_tls_destruct can be called from usrspace, which is required by:
https://github.com/apache/nuttx/pull/10288

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-28 11:02:18 +03:00
Xiang Xiao
cb8df39207 binfmt/elf: Fix the minor style issue
and remove the unused macros and unnecessary cast

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-27 18:46:40 -03:00
makejian
98bb66998b spresense/lte: use mbedtls version configured
Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-28 01:48:47 +08:00
Xin Xu
e152391022 Apply suggestions from code review
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-27 21:41:53 +08:00
xuxin19
27c0e12d25 cmake:support newlib cmake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-27 21:41:53 +08:00
raiden00pl
af4a065efb nrf52840-dk: add lsm9ds1 sensor support 2023-08-27 10:05:05 +08:00
raiden00pl
8665acaffa lsm9ds1.c: fix printf warnings 2023-08-27 10:05:05 +08:00
raiden00pl
7109fd6121 sensors/Kconfig: fix wrong depends on SN_XXX 2023-08-26 20:00:12 +08:00
liaoao
3da7775543 libfdt: modify makefile
update LIBFDT to LIBC_FDT
update CONFIG_LIBFDT_DTC_VERSION to CONFIG_LIBC_FDT_DTC_VERSION
move dtc source code to fdt/dtc
move version_gen.h from apps/system/fdt to current dir

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-26 17:07:02 +08:00
xuxin19
5dd4af19f2 cmake:export_header support origin link and export install
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-26 17:01:59 +08:00
Alexis Christoforides
033f265e53 Meadow.OS source code migration - Part 1 - Take 2
This patch starts to implement the ability to build Meadow.OS for the Meadow F7 board with the NuttX  mainline. It will be followed by more patches, progressively enabling full Meadow.OS functionality. This configuration is a work in progress.

The Meadow.OS source code is needed to build this configuration. Meadow.OS is being open-sourced under the Apache 2.0 license. A prototype of the source code release and integration with NuttX  is at https://github.com/WildernessLabs/Meadow.OS/tree/prototype

This is the second revision of this patch, as the first one (https://github.com/apache/nuttx/pull/9997) was causing build issues on NuttX CI and was reverted.

This should only impact the Meadow F7 board configurations.

No testing to be done, as the configuration is under development.
2023-08-26 08:49:17 +02:00
raiden00pl
81a9a2e5e0 boards/stm32h7: normalize configurations 2023-08-26 03:35:32 +08:00
raiden00pl
5407dfccc3 boards: disable CM4 for stm32h745i-disco and stm32h747i-disco 2023-08-26 03:35:32 +08:00
raiden00pl
03b058dddc boards/stm32h7: add nucleo-h745zi 2023-08-26 03:35:32 +08:00
raiden00pl
2fffd7dad6 arch/stm32h7: add RPTUN support 2023-08-26 03:35:32 +08:00
raiden00pl
a6c25f657d arch/stm32h7: add CM4 core support 2023-08-26 03:35:32 +08:00
raiden00pl
86134461f3 arch/stm32h7: use STM32_CPUCLK_FREQUENCY to initialize perf 2023-08-26 03:35:32 +08:00
raiden00pl
4c358419f0 arch/stm32h7: add an option to bypass clock configuration 2023-08-26 03:35:32 +08:00
raiden00pl
5ddded5561 arch/stm32h7/rcc: default value for BOARD_FLASH_PROGDELAY 2023-08-26 03:35:32 +08:00
raiden00pl
4c9d405a97 arch/stm32h7: add HSEM support 2023-08-26 03:35:32 +08:00
Xiang Xiao
a967da5270 arch/riscv: Move -mcmodel=medany from Make.defs to Toolchain.defs
to avoid the code duplication

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-25 21:22:47 +03:00
Xiang Xiao
940a68d6a4 boards/riscv: Add -melf64lriscv to 64bit USER_LDFLAGS/LDELFFLAGS
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-25 21:22:47 +03:00
zhanghongyu
32b1af3008 tcp_send_buffered: change Not connected message level from error to warning
Non-blocking sockets are almost never in the connected state when app try to
get result of connect success through poll, to avoid confusion because of
this error print, so downgrade the print level to warning.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-25 20:38:59 +03:00
wanggang26
3dbface167 Revert commit 35602cc2ef
Reason for revert: when block device enable bch proxy, fsync calling would be failed

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-08-25 20:37:38 +03:00
chao an
563125fde3 make/archive: Use the full path name when matching or storing names in the archive
This pr will avoid targets with the same name can not be archive in the same library

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-26 01:21:10 +08:00
SPRESENSE
6d44c42707 arch/arm/src/cxd56xx: Fix file path on top comment
Fix file path described in top comment for each files.
2023-08-26 01:20:32 +08:00
SPRESENSE
f7400a857d drivers/audio/cxd56: Move cxd56 sources into arch/cxd56xx
CXD56 audio functions are inside of the CXD56.
So implementation of it should be under arch directory.
2023-08-26 01:20:32 +08:00
raiden00pl
c795e06e01 Documentation: various improvements for stm32xx documentation 2023-08-26 01:20:00 +08:00
simbit18
612b8320bb Documentation/quickstart/install.rst: update fix incorrect version
10.1.0 -> 12.2.1
2023-08-26 00:46:56 +08:00
ligd
b743d62703 syslog: remove unsed check
To simplify the code

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-25 17:31:31 +08:00
Jiuzhu Dong
904ca21a00 syslog & ramlog: add BOARDIOC_RESET_CAUSE for syslog & ramlog
cold boot should clear syslog & ramlog buffer

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-25 17:31:31 +08:00
chengkai
d867c46bbc serial/uart/h5: add bt h5 uart serial driver
Signed-off-by: chengkai <chengkai@xiaomi.com>
2023-08-25 17:17:37 +08:00
wangchen
99ee94728a net:add IP_MULTICAST_IF & IPV6_MULTICAST_IF function implementation
refer to https://man7.org/linux/man-pages/man7/ip.7.html
IP_MULTICAST_IF (since Linux 1.2)
              Set the local device for a multicast socket.  The argument
              for setsockopt(2) is an ip_mreqn or (since Linux 3.5)
              ip_mreq structure similar to IP_ADD_MEMBERSHIP, or an
              in_addr structure.  (The kernel determines which structure
              is being passed based on the size passed in optlen.)  For
              getsockopt(2), the argument is an in_addr structure.
refer to https://man7.org/linux/man-pages/man7/ipv6.7.html
IPV6_MULTICAST_IF
              Set the device for outgoing multicast packets on the
              socket.  This is allowed only for SOCK_DGRAM and SOCK_RAW
              socket.  The argument is a pointer to an interface index
              (see netdevice(7)) in an integer.
testcase1:
TEST_IMPL(udp_multicast_interface) {
/* TODO(gengjiawen): Fix test on QEMU. */
  RETURN_SKIP("Test does not currently work in QEMU");

  int r;
  uv_udp_send_t req;
  uv_buf_t buf;
  struct sockaddr_in addr;
  struct sockaddr_in baddr;

  close_cb_called = 0;
  sv_send_cb_called = 0;
  ASSERT(0 == uv_ip4_addr("239.255.0.1", TEST_PORT, &addr));

  r = uv_udp_init(uv_default_loop(), &server);
  ASSERT(r == 0);

  ASSERT(0 == uv_ip4_addr("0.0.0.0", 0, &baddr));
  r = uv_udp_bind(&server, (const struct sockaddr*)&baddr, 0);
  ASSERT(r == 0);

  r = uv_udp_set_multicast_interface(&server, "0.0.0.0");
  ASSERT(r == 0);

  /* server sends "PING" */
  buf = uv_buf_init("PING", 4);
  r = uv_udp_send(&req,
                  &server,
                  &buf,
                  1,
                  (const struct sockaddr*)&addr,
                  sv_send_cb);
  ASSERT(r == 0);

  ASSERT(close_cb_called == 0);
  ASSERT(sv_send_cb_called == 0);

  /* run the loop till all events are processed */
  uv_run(uv_default_loop(), UV_RUN_DEFAULT);

  ASSERT(sv_send_cb_called == 1);
  ASSERT(close_cb_called == 1);

  ASSERT(client.send_queue_size == 0);
  ASSERT(server.send_queue_size == 0);

  MAKE_VALGRIND_HAPPY();
  return 0;
}
testcase2:
TEST_IMPL(udp_multicast_interface6) {
/* TODO(gengjiawen): Fix test on QEMU. */
  RETURN_SKIP("Test does not currently work in QEMU");

  int r;
  uv_udp_send_t req;
  uv_buf_t buf;
  struct sockaddr_in6 addr;
  struct sockaddr_in6 baddr;

  if (!can_ipv6())
    RETURN_SKIP("IPv6 not supported");

  close_cb_called = 0;
  sv_send_cb_called = 0;

  ASSERT(0 == uv_ip6_addr("::1", TEST_PORT, &addr));

  r = uv_udp_init(uv_default_loop(), &server);
  ASSERT(r == 0);

  ASSERT(0 == uv_ip6_addr("::", 0, &baddr));
  r = uv_udp_bind(&server, (const struct sockaddr*)&baddr, 0);
  ASSERT(r == 0);

  r = uv_udp_set_multicast_interface(&server, "::1%lo0");
  r = uv_udp_set_multicast_interface(&server, NULL);
  ASSERT(r == 0);

  /* server sends "PING" */
  buf = uv_buf_init("PING", 4);
  r = uv_udp_send(&req,
                  &server,
                  &buf,
                  1,
                  (const struct sockaddr*)&addr,
                  sv_send_cb);
  ASSERT(r == 0);

  ASSERT(close_cb_called == 0);
  ASSERT(sv_send_cb_called == 0);

  /* run the loop till all events are processed */
  uv_run(uv_default_loop(), UV_RUN_DEFAULT);

  ASSERT(sv_send_cb_called == 1);
  ASSERT(close_cb_called == 1);

  MAKE_VALGRIND_HAPPY();
  return 0;
}

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-08-25 17:16:50 +08:00
Stuart Ianna
50f0fd4df2 risc-v/litex: Add system reset and access to core control registers. 2023-08-25 17:16:28 +08:00
Roy Feng
937312242e esp32: Fix build warning
And an incorrect log output
2023-08-25 17:06:32 +08:00
SPRESENSE
4393f47e5d sensors: Remove undefined SCU functions for fxos8700cq
Remove undefined SCU functions for fxos8700cq.
2023-08-25 17:06:00 +08:00
SPRESENSE
7d0d6234eb sensors: Move SCU-specific bmp280 sensor into spresense board
Move SCU-specific bmp280 sensor into spresense board layer.
2023-08-25 17:06:00 +08:00
SPRESENSE
ffcea1da4f sensors: Move SCU-specific bmi160 sensor into spresense board
Move SCU-specific bmi160 sensor into spresense board layer.
2023-08-25 17:06:00 +08:00
SPRESENSE
795dcee521 sensors: Move SCU-specific ak09912 sensor into spresense board
Move SCU-specific ak09912 sensor into spresense board layer.
Rename a function name to register SCU sensor driver
from ak09912_register to ak09912_scu_register.
2023-08-25 17:06:00 +08:00
Michal Lenc
606b6d9310 samv7: add support for PWM polarity settings
This commit adds function pwm_set_polarity() that setups channel
polarity based on input info from application layer.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-24 18:25:47 -03:00
Michal Lenc
f851b79f89 pwm: add option to set channel output polarity with IOCTL command
Channel polarity can now be set with PWMIOC_SETCHARACTERISTICS ioctl
command as field cpol was added to pwm_info_s structure. This way the
polarity can be easily set from application layer for each channel
apart and also can be change on at runtime if required (although this is
not likely).

Helper defines were also added to simplify the definition of low and high
polarity level. Architecture level should take care of writing the
polarity to correct MCU registers.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-24 18:25:47 -03:00
raiden00pl
9117cf44e1 Documentation: migrate STM32F1 2023-08-25 00:11:05 +08:00
Ville Juven
9cd8ea32d1 net/xx/wrbuffer: Do not use SEM_INITIALIZER for buffers
Using the macro places the buffers into .data section which means they
will consume the full buffer size of flash / read only memory as well.

Place the buffers into .bss to avoid this case.
2023-08-25 00:02:07 +08:00
xuxin19
48d95b8d82 cmake:replace custom_patch_target with PATCH_COMMAND
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-24 17:46:43 +02:00
Xiang Xiao
b090b7340b github: Skip the build if the change is under tools/ci/docker/linux
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-24 12:09:11 -03:00