This fixes useless -Wpointer-sign errors with clang when doing atomic operations on unsigned datatypes.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This makes units compatible with what Linux uses for SocketCAN bitrate
and allows representing usual Single Wire Can (SAE J2411) usual bitrates
of 33333 and 83333 bps.
Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
Renaming "modlib" to "libelf" is more in line with the implementation content,
which makes it easier for individual developers to understand the capabilities of this module.
CONFIG_LIBC_MODLIB -> CONFIG_LIBC_ELF
Signed-off-by: chao an <anchao.archer@bytedance.com>
test:
1.use mps3-an547 build helloxx as module and run it
2.use qemu-armv7a:knsh test kernel build helloxx and run it
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
There is no need for a gettid() syscall, as the thread ID is stable through
the life of the process. It is safe to put a copy of TID to TLS. This way
a user processes can access TID quickly via its own stack, instead of
having to use an expensive syscall.
Signed-off-by: Ville Juven <ville.juven@unikie.com>
On AVR architecture, the compiler apparently sometimes truncates NSEC_PER_TICK
to 16bit value, leading to clock_time2ticks returning incorrect results. This
was encountered while attempting to add tickless OS support for AVR
architecture but seemed to affect non-tickless mode of operation as well.
This patch marks NSEC_PER_USEC (and to be safe, USEC_PER_MSEC and MSEC_PER_SEC
too) as long.
This avoids unnecessary syscalls in memory protected builds, when mutex
lock/unlock can be done with only atomic counter access
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This patch adds support for the NAU7802 24 bit ADC from Nuvoton.
Please read the documentation for more details.
Signed-off-by: Daniel Byshkin <online@bskdany.com>
Add no_builtin for memcpy/memset to the startup code of boards
with CONFIG_ARCH_RAMFUNCS, because certain compilers call memcpy/memset
instead of the explicit for loop. This will cause a crash if memcpy/memset
are mapped to RAM because the function that copies them to RAM is called later,
resulting in undefined code being executed.
Signed-off-by: Alexander Lerach <alexander@auterion.com>
arch/arm: Use decorator for entry point
Use a decorator that contains the required no_builtin instead of adding
them explicitly to the startup code. This way it will be easier to
maintain them in the future when changes to the no_builtin used are required.
Signed-off-by: Alexander Lerach <alexander@auterion.com>
arch/arm: Rename decorator
Rename the entry point decorator used for the startup code to a less explicit name.
This way the style is more consistent with other decorators.
Signed-off-by: Alexander Lerach <alexander@auterion.com>
After pthread mutexes changed to nxmutex, the priority inheritance
was set on by default; even if one tried to control it with
CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_INHERIT.
Also the CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_PROTECT is not effective.
Fix this by setting the default mutex priority adjustment flags according
to CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_INHERIT and CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_PROTECT.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Adds a device ID to ramtron_initialize, which is stored in the ramtron_dev_s structure.
This ID is used when calling SPI_SELECT to board specific logic to allow chip select on the SPI bus.
This change is NOT backwards compatible, as it changes the function signature of ramtron_initialize.
This implementation is based on the handling of chip select in nuttx/drivers/mtd/sst26.c:sst26_initialize_spi().
Additional Changes:
- Add MB85RS64V to ramtron supported parts list.
This patch adds initial support for the Texas Instruments ADS1115 ADC.
Please read the documentation for more details.
Signed-off-by: Tony Lin <99093620+justapotato213@users.noreply.github.com>
This PR is a follow-up of issue #15856 and the mailing list proposal "Proposal: Common IOCTL API for RF Modulation Technologies"
Before this PR, the IOCTL API for character-driven RF devices lacked a common
interface across different modulation technologies, such as LoRa, FSK, and
OOK. The result was, driver-specific IOCTL commands were created even when they
could be shared across multiple radios. This fragmentation made
application portability more difficult to maintain.
This PR will add a common API that can be shared across all new drivers.
Such as
* LoRa
* FSK
* OOK / ASK
* read() return struct
Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
Use the CDCACM as a SYSLOG output device, send message to remote proc.
If there are more than one CDCACM devices, then a device minor number
may also need to be provided. Default: 0
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
This commit addresses an issue where calling `wd_cancel_period` within the periodic watchdog callback would fail to cancel the watchdog timer.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
radio transceivers. This initial support includes transmit and receive
functionality and configuration and reading of radio parameters like
frequency and bandwidth.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Data form serial framework will be written to usb reqbuf directly,
and data form cdcacm will be read form reqbuf directly.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
Replace inline functions with macros to avoid confilcts with builtin definition
nuttx/include/strings.h:80:28: warning: declaration of 'ffs' shadows a built-in function [-Wshadow]
80 | static inline_function int ffs(int j)
| ^~~
nuttx/include/strings.h:94:28: warning: declaration of 'ffsl' shadows a built-in function [-Wshadow]
94 | static inline_function int ffsl(long j)
| ^~~~
nuttx/include/strings.h:109:28: warning: declaration of 'ffsll' shadows a built-in function [-Wshadow]
109 | static inline_function int ffsll(long long j)
| ^~~~~
Signed-off-by: chao an <anchao.archer@bytedance.com>
[Experimental]
This adds a driver for the SX126x (SX1261 and SX1262) LoRa chips.
All functions and definitions are coming directly from the DS SX1261-2 V2.1 datasheet.
Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
This ioctl clears the active fault inputs. Some faults can be latched
(still active even if the source is not active anymore), so they have
to be cleared from the software. The argument is a pointer to unsigned
long bitmask variable. This bitmask specifies which faults are to be
cleared.
The ioctl also can fetch the faults active prior to the clear. These
faults are saved to the argument specifying which faults are to be
cleared. Therefore passing zero bitmask means the driver will only return
active faults and clear none. Passing NULL pointer means the driver
will clear all active and return none.
The implementation of this ioctl is per driver.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Some improvements are made to the following commits:
| commit f22b93b337
| Author: hujun5 <hujun5@xiaomi.com>
| Date: Fri Jan 31 07:01:07 2025 +0800
|
| sched/spin_lock: rename raw_spin_lock to spin_lock_notrace
|
| Signed-off-by: hujun5 <hujun5@xiaomi.com>
Signed-off-by: chao an <anchao.archer@bytedance.com>
Spliting `THERMAL_NORMAL` to `THERMAL_ACTIVE` and `THERMAL_PASSIVE`,
to support different update intervals for thermal zone.
Active/Passive from [kernel.org](https://www.kernel.org/doc/Documentation/devicetree/bindings/thermal/thermal.txt):
* Cooling device nodes
Cooling devices are nodes providing control on power dissipation. There
are essentially two ways to provide control on power dissipation. First
is by means of regulating device performance, which is known as passive
cooling. A typical passive cooling is a CPU that has dynamic voltage and
frequency scaling (DVFS), and uses lower frequencies as cooling states.
Second is by means of activating devices in order to remove
the dissipated heat, which is known as active cooling, e.g. regulating
fan speeds. In both cases, cooling devices shall have a way to determine
the state of cooling in which the device is.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit add support to the serial_icounter_s struct used with
TIOCGICOUNT to report U[S]ART errors such as frame, parity, overrun,
etc.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
Fixes bug where stm32_phyinit will succeed even when no PHY is connected. This is because there is no check that a PHY is actually communicating and returning data.
Update include/nuttx/net/mii.h
Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
Adds support for the LSM6DSO32 IMU by STM using the uORB framework. This
only contains limited support for the I2C interface, interrupt and
polling driven measurement and standard modes of operation (high
performance ODRs). Features like interrupts besides DRDY, filtering,
gesture recognition and acting as a bus master are not implemented.
For clearing some variables corresponding with the pollfds of the felip in can_close API, we modify poll logic by binding can_reader_s and pollfd.
Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
search the device tree and register cfi flash
test flowchart:
mount -t littlefs -o autoformat /dev/cfi-flash1 /data
fstest -m /data
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
The `$(APPDIR)` folder is added to the `$(KERNDEPDIRS)` when
`CONFIG_BUILD_KERNEL=y`. The `depend` phase iterates over the
`$(KERNDEPDIRS)` folders and executes the `depend` recipe of these
folders (including the apps' recipes) with the `__KERNEL__` macro
defined, which prevents `system()`'s prototype from being declared.
Add support for network statistics for CAN.
It includes counters for receive, sent
and drop frames.
Signed-off-by: Javier Casas <javiercasas@geotab.com>
Firstly call arm_coredump_add_region in up_initialize to add nvic region, then call
coredump_set_memory_region to add board mem region, at this moment, an overlap occurs.
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>