Commit Graph

7315 Commits

Author SHA1 Message Date
Petteri Aimonen
fcd0729e21 ptpd: Fix reserved word 'class'
When ptpd.h is included in C++ code, the use of identifier 'class'
caused a compilation error. Changed to "clockclass".
2023-12-07 18:26:39 -08:00
Zhe Weng
9abc82c792 nshlib/ifconfig: Generate default IPv4 gateway with netmask
Generate default gateway using configured netmask instead of fixed
255.255.255.0, which may be more flexible under certain situations.
e.g. A subnet like 10.0.23.16/28 may not contain the .1 address.

Before:

ifconfig eth0 10.0.23.22 netmask 255.255.255.252 => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 netmask 255.255.255.240 => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 netmask 255.255.255.0   => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 netmask 255.255.0.0     => DRaddr:10.0.23.1

ifconfig eth0 10.0.23.22 => Mask:255.255.255.0      DRaddr:10.0.23.1

After:

ifconfig eth0 10.0.23.22 netmask 255.255.255.252 => DRaddr:10.0.23.21
ifconfig eth0 10.0.23.22 netmask 255.255.255.240 => DRaddr:10.0.23.17
ifconfig eth0 10.0.23.22 netmask 255.255.255.0   => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 netmask 255.255.0.0     => DRaddr:10.0.0.1

ifconfig eth0 10.0.23.22 => Mask:255.255.255.0      DRaddr:10.0.23.1

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-12-07 07:16:43 -08:00
Zhe Weng
fb72849089 nshlib/ifconfig: Set network mask before setting gateway
Switch the order of setting network mask and gateway, re-order only, no
logic change.

In IPv6 cases, we may set `addr6` and prefix length together to an
interface, but the gateway logic may change the value in `addr6`, and
result in wrong address set to the interface.

The order doesn't change behavior in network stack, so we just need to
make sure the value is correct.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-12-07 07:16:43 -08:00
liqinhui
91a697a3f4 renew6: Optimize the process of obtaining an IPv6 address.
If Managed Address Congfiguration flag in the Router Advertisement
Messsage is set, we would obtain the IPv6 address though the stateful
DHCPv6 procedure.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-12-07 06:26:50 -08:00
Huang Qi
f57cd2cf0c tools: Move final wasm module to bin/wasm as elf
And leave all intermediate file in apps/wasm,
such as .map file, entry object etc used in
wasm module build.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-06 08:29:00 -08:00
Huang Qi
3c624d38cd tools: Allow customize ld flags for each wasm module
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-06 08:29:00 -08:00
Huang Qi
bd159e103c tools: Split origin Wasm.mk into Wasm.mk and WASI-SDK.defs
Try to follow current NuttX's toolchain parttern:
Wasm.mk: Provide target rule for building wasm module
WASI-SDK.defs: Provide compile flags for building

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-06 08:29:00 -08:00
Huang Qi
f55b8face6 wamr: Add support for thumb target triple in Toolchain.defs
Before WAMR 1.3.0, eabihf in wamrc is `gnueabihf`, so without
this patch call wamrc will failed with target abi was `eabihf`,
we should convert the standard llvm target to wamrc required.

Both `eabihf` and `gnueabihf` supported after WAMR 1.3.0.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-06 08:29:00 -08:00
Huang Qi
3129b7a465 tools: Emit map file for wasm module
Emit map file like NuttX's `System.map` for more
debug information.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-06 08:29:00 -08:00
YAMAMOTO Takashi
733b6de818 toywasm: regen for v35
```
REF=e2ec1b60e06dbe360ae638970d01906ded5ab497 ./regen.sh
```
2023-12-06 08:17:42 -08:00
YAMAMOTO Takashi
282f9a744c toywasm: update to v35 2023-12-06 08:17:42 -08:00
Alan Carvalho de Assis
454426547c examples/modbus: Fix modbus example to keep running 2023-12-04 06:52:14 -08:00
Petteri Aimonen
6dd9adbb5b ptpd: Code quality improvements 2023-12-04 00:30:26 -08:00
Xiang Xiao
083eb5e993 Fix the wrong comment banner
"Private Type"->"Private Types"
"Public Data Type"->"Public Types"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-12-03 14:27:14 -03:00
raiden00pl
6a8344bf37 examples/nxscope: change the vector data sent by nxscope to be a 3-phase sin waveform
A changing waveform is nicer to visualize than a static vector.
2023-12-02 20:11:21 -08:00
raiden00pl
e7bb97cb5f examples/nxscope: make channel 19 configurable
Channel 19 uses an additional thread to send a text message.
This commit makes this behaviour configurable.
2023-12-02 20:11:21 -08:00
raiden00pl
5cfcd769bf examples/nxscope: make main interval configurable 2023-12-02 20:11:21 -08:00
Michal Lenc
aa49523bb3 testing: add open_memstream test tool
Test tool application for open_memstream for CI testing. Performs basic
write/seek operations.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-11-29 02:12:58 -08:00
chao an
f289cdb2ec lvgl/makefile: workaround for lvgl.v8
Since this change is only merged into the lvgl.v9, let us workaround for v8:
 37835260ca

 ./lvgl/src/core/lv_obj.c:363:25: warning: variable 'x' set but not used [-Wunused-but-set-variable]
   363 |         static uint32_t x = 0;
       |                         ^
 1 warning generated.

CFLAGS += -Wno-unused-but-set-variable

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-28 03:52:27 -08:00
Petteri Aimonen
af6e4d2cb9 ptpd: Code style and FAR pointer fixes 2023-11-24 20:15:38 -08:00
Petteri Aimonen
0adce22400 ptpd: Implement status & stop interfaces 2023-11-24 20:15:38 -08:00
Petteri Aimonen
efc6cfddb4 ptpd: Fix compilation error when debug messages disabled
The debug macros did not get declared in all setups.
2023-11-24 20:15:38 -08:00
Petteri Aimonen
e2168abe9a ptpd: Implement delay reqs, fix timing bugs
Fixed bug where negative offsets were not properly handled because
clock_timespec_subtract clamps values to zero.

Implement support for SO_TIMESTAMP to get accurate packet
reception timestamp.

Implemented delay requests for measuring packet transfer delay.

Implemented clock drift estimation to bring the clocks closer to
sync and to filter out measurement jitter.
2023-11-24 20:15:38 -08:00
Petteri Aimonen
8dbf26016a ptpd: Re-join multicast group after timeout
If multicast PTP packets are not being received, rejoin the multicast group.
This automatically recovers from situations such as rebooting a network switch.
2023-11-24 20:15:38 -08:00
zhanghongyu
ae59177279 matter: download chip and dependent source for open source version
The community version needs to dynamically fetch the matter source code at compile time and apply the required nuttx adaptation patch

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-23 00:19:37 -08:00
zhanghongyu
72e67e9d6d jsoncpp: add cmake scripts for jsoncpp
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-23 00:19:37 -08:00
zhanghongyu
891c5e0cc8 matter: add cmake support
A nuttx with the matter command can be compiled using cmake and enable CONFIG_MATTER option.
The matter compiled by the current script is just a lighting example of
a limited number of commands that can be tested by chip-tool.

After nuttx is connected to the LAN and the matter command is executed, other devices in the LAN, such as linux PCS, can run the following commands to scan, connect, turn on and off, adjust brightness and contrast, and so on.

chip-tool pairing onnetwork 1 20202021
chip-tool onoff on 1 1
chip-tool levelcontrol move-to-level 128 10 0 0 1 1
chip-tool colorcontrol move-to-hue-and-saturation 240 100 0 0 0 1 1

Depends on the following configuration options:
CONFIG_CRYPTO_MBEDTLS=y
CONFIG_DEV_URANDOM=y
CONFIG_LIBCXX=y
CONFIG_LIBM=y
CONFIG_NET_IPv6=y
CONFIG_NET_ICMPv6=y
CONFIG_NET_ICMPv6_AUTOCONF=y
CONFIG_NET_ICMPv6_NEIGHBOR=y
CONFIG_NET_ICMPv6_ROUTER=y
CONFIG_NET_ICMPv6_SOCKET=y
CONFIG_NET_IGMP=y
CONFIG_NET_MLD=y
CONFIG_NET_MLD_ROUTER=y

This initial version does not yet have Bluetooth and OTA support.

The community version needs to dynamically fetch the matter source code at compile time and apply the required nuttx adaptation patch.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-23 00:19:37 -08:00
Huang Qi
097411de49 wamr: Add support for custom section loading
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-11-21 08:11:59 -08:00
Marco Casaroli
ba43911a77 libtest: add PRIVATE to CMakeLists.txt
It looks like this word is needed for this build to work with cmake
2023-11-21 08:05:02 -08:00
raiden00pl
27588be53e examples/foc: replace CONFIG_INDUSTRY_FOC_* with CONFIG_EXAMPLES_FOC_*
Decouple the FOC example configuration from the FOC lib configuration.
Purely cosmetic change, without affecting functionality.
2023-11-18 08:40:16 -08:00
raiden00pl
d589443980 industry/foc: fix direction alignment
CCW direction wasn't properly detected when we start alignment from near zero position
2023-11-18 08:39:40 -08:00
Huang Qi
1cf9640bb6 Wasm.mk: Allow application defined linker flags
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-11-17 18:46:51 -08:00
raiden00pl
cdbd14eb5f cmake: support for system/uorb 2023-11-17 03:32:54 -08:00
simbit18
6a35182033 Fix Kconfig style
Remove spaces from Kconfig files
Replace help => ---help---
Add TABs
Add comments
2023-11-16 20:31:08 -08:00
Masayuki Ishikawa
79c7962af6 apps: Replace CONFIG_ARCH_HAVE_VFORK with CONFIG_ARCH_HAVE_FORK
Summary:

- Resolves an issue where `vfork_test` was not executed following
  the renaming from CONFIG_ARCH_HAVE_VFORK to CONFIG_ARCH_HAVE_FORK,
  as detailed in https://github.com/apache/nuttx/pull/9755.

Impact:
- Please merge https://github.com/apache/nuttx/pull/11200 before
  merging this PR.

Testing:
- Successfully tested with rv-virt:smp64, spresense:smp, and sim:smp.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-11-16 07:58:57 -08:00
raiden00pl
144bf0bd1f examples/foc: remove obsolete CONFIG_EXAMPLES_FOC_IPHASE_ADC option 2023-11-15 18:49:42 +01:00
chao an
6754d42715 system/popen: popen should depends on pipe()
Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-15 08:27:28 -08:00
raiden00pl
fa19b71ba4 examples/foc: get iphase scale from the FOC device interface 2023-11-15 03:48:53 -08:00
raiden00pl
9eb5bd4091 examples/foc: pass from velocity controller to torque controller 2023-11-14 09:46:07 -08:00
raiden00pl
ce53f0fc4c examples/foc: add torque saturation 2023-11-14 09:46:07 -08:00
raiden00pl
dc4330476d examples/foc: add velocity saturation 2023-11-14 09:46:07 -08:00
raiden00pl
32a8c29753 examples/foc: don't raise error when EXAMPLES_FOC_IPHASE_ADC isn't set
This is the first step towards getting rid of CONFIG_EXAMPLES_FOC_IPHASE_ADC completely
2023-11-14 04:42:13 -08:00
raiden00pl
eeacbdde3a examples/foc: get velocity from observer if sensored mode 2023-11-14 10:30:52 +01:00
raiden00pl
c5314b54a4 examples/foc: fix active brake for sensored mode 2023-11-14 10:30:52 +01:00
raiden00pl
cb36d9c8b2 examples/foc: fix compilation for open-loop without angle observer 2023-11-14 10:30:52 +01:00
raiden00pl
b52f7dae0c examples/foc: set direction when updating new setpoint 2023-11-13 08:49:21 -08:00
raiden00pl
1095aec162 examples/foc: start from the beginning if control loop is started
After the start request to FOC device, we should return to the
beginning of the loop and wait for the first synchronization event.

This also fixes the problem with the extended first loop cycle,
so we can remove the workaround in foc_perf.
2023-11-13 08:48:22 -08:00
raiden00pl
f9a4ace59a examples/foc: fix warning for sensored configurations 2023-11-13 08:47:21 -08:00
raiden00pl
87dcf877e7 examples/foc: raise error if both sensorless and sensored modes enabled 2023-11-13 08:47:21 -08:00
raiden00pl
8a04e2b282 examples/foc: add #error messages 2023-11-13 08:47:21 -08:00