The Error Active frame populates the TX and RX error counter bytes
but does not set CAN_ERR_ID_CNT.
Set CAN_ERR_ID_CNT so consumers know the counter fields are valid.
The RX overflow handling writes REG_COMMAND_CDO to CTUCANFD_TX_COMMAND
instead of CTUCANFD_COMMAND.
This writes the CDO bit to the transmit-command register (which is
reserved) so the data-overrun condition is not actually cleared.
Use CTUCANFD_COMMAND instead.
The RX overflow handling uses CAN_ERR_ID_LOSTARB, which is an
err_frame.header.can_id mask, as an err_frame.data index.
Correct it to use CAN_ERR_DATA_BYTE_TRX_CTRL as intended.
This clarifies the flashdev out of band read and write interfaces and
updates any consumers of those interfaces. This was partially refactored
at one point and the refactoring didn't extend to the consumers as it
should have.
More i2c drivers from cpukit to bsps/shared to allow them use BSP
infrastructure if needed. The framework code i2c-bus.c and i2c-dev.c
kept at its original location.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Move CAN controllers from cputik to bsps/shared directory. This will
allow to use BSP level interface which may be needed for some
controllers. Generic CAN stack implementation is still kept in the
original directory as this shoudl be independent from the low level
driver interface.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Fix this error:
xnandpsu_onfi.c: In function 'XNandPsu_OnfiParamPageCrc':
xnandpsu_onfi.c:62:13: error: variable 'DataByteCount' set but not used
[-Werror=unused-but-set-variable=]
62 | u32 DataByteCount = 0U;
| ^~~~~~~~~~~~~
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
In rtems_gpio_define_pin_group(), several malloc() calls did not
check their return values. This could lead to NULL pointer
dereferences in later initialization steps.
The previous error handling also leaked memory and hardware pin
resources if an intermediate step.
This patch refactors the error handling path to address these issues.
Fix parity handling in zynq_uart_set_attributes() by clearing existing
parity bits before setting a new mode instead of always ORing PAR_NONE,
which caused incorrect or ignored parity; also fix inverted PARODD logic
and add ZYNQ_UART_MODE_PAR_MASK to manage the parity field correctly.
Fixes#5554
This code was flagged as maybe-uninitialized when compiling at -Og.
The underlying problem was functional code in an assert(). If
compiled with asserts disabled, there would have been no mutex
lock/unlock. Changed the macros to obtain and release the mutex
independent of assert() being enabled or not and switched to using
the RTEMS assert _Assert() which lets this check follow the
RTEMS_DEBUG setting.
In SMP systems, the interrupt handler may run concurrently with tasks
trying to transmit. Properly protect the transmit state through the
device lock. Simplify the transmit process.
Close#5552.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
These changes eliminate the year 2100 as a limit for TOD. The new
limit is the year 4096. This limit is not due to any RTEMS limitation
but just before the year 4183 when the rounding error in the length
of the year adds up to an entire day. See
https://de.wikipedia.org/wiki/Schaltjahr for details.
There are still limits on Classic APIs which use the 32-bit rtems_interval
type. This corresponds to the Score Watchdog_Interval type. This impacts
delays, timeouts, and Classic API "after" timers.
Closes#5143
Co-authored-by: Joel Sherrill <joel@rtems.org>
Co-authored-by: Gedare Bloom <gedare@rtems.org>
This warning occurs when comparing a signed variable to an unsigned one.
This addresses warnings that only occurred on 64-bit targets. For the
ones which only appeared on 64-bit targets, the cause was frequently
a mismatch when comparing a combination off_t, ssize_t, and int.
This warning occurs when comparing a signed variable to an unsigned one.
This is frequently an int or ssize_t variable compared to a uint32_t or
size_t. Sometimes the size_t is from a sizeof() use.
This adds a backend for flashdev that simulates a flash device with
adjustable delays to simulate real flash devices and offers
configurable flash parameters. This also migrates the JFFS2
filesystem tests to the flashdev framework and eliminates the
purpose-built simulated flash in the testsuite in favor of a more
generic and widely usable solution.
GCC generates type limit warnings when comparison is always true or
always false due to the limited range of the data type, This was in a
termios structure. For most of the cases in RTEMS, this was when
a variable of an unsigned type was compared to be < or <= 0.
Return the actual out of bounds size per page instead of the ioctl
return status. JFFS2 will happily operate with an OOB size of 0 and
instead put cleanmarkers in the normal page space of the flash.
The maximum size of JFFS2 is 4GB minus the block size of the flash.
Enforce this limitation when setting up a filesystem on a flashdev
region that is larger than the maximum.
This also resolves some off-nominal memory leaks.
This adds an API call allowing for unregistration to include destruction
of private data that is not managed by the flashdev framework. This also
updates the existing consumers of flashdev to use the new private data
destructor callback.
Previously this RTC was using the file system-based i2c interface in
/dev. Since the RTC is initialized pretty early on during system init,
we call open() before stdin/stdout/stderr have been opened. RTEMS
assumes that stdin == 0, stdout == 1, etc., and fails when that isn't
the case. In particular, when stdin != 0, RTEMS assumes that it wasn't
configured with a console driver and skips opening stdout/stderr,
leading to confusing issues with the standard I/O streams.
The RTEMS Software Engineering Guide specifies that the SPDX license
annotation shouldbe the first line of the file and not part of the
copyright/license comment block.
GCC currently has issues with false positive warnings about array bounds
violations when the value used as the index is a pointer. This slightly
reworks the code to make it cleaner and to avoid this warning.