- introduces a variant-aware tms570_vim_t struct so the ECC version
(on the 4357 variants) can be represented and we can set the required
flags
- adds the required LC4357 VIM ECC initialization sequence: set
fallback vector (FBVECADDR), enable ECC and then clear ECC error
flags after the for loop rewrites the vector table.
See TRM section 19.5.1 Interrupt Vector Table Operation which states:
It is recommended to restore the content of the VIM before clearing the ECCSTAT.
Mark the VIM vector table entries volatile so the compiler does
not try to optimise or re-order these. They can have side-effects
and should be explicitly forced as real hardware writes.
This commit adds ECC-related VIM Control Register definitions and
access macros for setting up and modifying the VIM ECC/SECDED
feature on the 4357x variants.
TMS570_ADC_EVRAMWRADDR_G1_RAM_ADDR is somehow a combination of the
ADC Event Group RAM Write Address Register with the ADC Group1 RAM
Write Address Register.
This commit corrects it.
This adds the missing HTU MPCS memory protection config macros to
set the fields in TRM Table 24-39. Memory Protection Control and
Status Register (HTU MPCS) Field Descriptions.
Adds the missing ACPE (Active Control Packet and Error Register)
status/diagnostic field macros so HTU error handling can decode
the active/error transfer context.
Previously we could just check ERRF true or not, now we can get the
full detail.
Adds the INTMAP (Interrupt Mapping Register) to the tms570_htu_t
struct which was missing before inside a padding block. Adds the
access macros as well.
Adds an interrupt-driven SPI bus driver for the STM32F4 SPI
peripheral implementing the RTEMS spi_bus API (dev/spi/spi.h).
The STM32F4 SPI has no hardware FIFO - the data register holds
a single byte - so the driver handles one byte per TXE/RXNE
interrupt pair. This is a hardware constraint, not an
implementation choice. DMA support can be added in a future
version.
Supports 8-bit full-duplex master mode, SPI modes 0-3 (all
CPOL/CPHA combinations), MSB/LSB-first, and automatic baud-rate
prescaler selection. Chip select is left to the application
via GPIO.
New files:
- stm32f4xxxx_spi.h: register definitions (RM0090 section 28.5)
- stm32f4-spi.h: public driver interface
- spi.c: driver implementation
stm32f4.h updated with STM32F4_SPI1/2/3 peripheral accessors.
SPI base addresses per RM0090 table 1: SPI1 on APB2 at
0x40013000, SPI2 and SPI3 on APB1 at 0x40003800 and 0x40003C00.
Verified to compile cleanly for arm/stm32f4 and
arm/realview_pbx_a9_qemu with GCC 15.2.0.
Using signed integers for bit fields may result in undefined or
implementation-defined behaviour. Use an unsigned type instead.
Requires a matching Newlib version.
Update #4864.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
The inclusive comparison against st_size incorrectly rejects mappings
ending exactly at the file boundary.
This patch:
1.Changes >= to > to allow valid mappings up to the file size.
2.Uses subtraction-based logic to prevent potential integer overflow.
rtems_flashdev_register() cleared the region allocator bitmap with
memset( table->bit_allocator, 0, alloc_array_len ) where alloc_array_len
held the number of uint32_t words. Since bit_allocator is a uint32_t
array, only one byte per word was zeroed, leaving the rest of the bitmap
uninitialised. Stale bits can make
rtems_flashdev_find_unallocated_region() report region slots as
allocated and fail REGION_SET with ENOMEM while slots are actually free.
Rename RTEMS_FLASHDEV_BITALLOC_LENGTH to RTEMS_FLASHDEV_BITALLOC_WORD_LENGTH
to make the word count explicit, add RTEMS_FLASHDEV_BITALLOC_BYTE_LENGTH for
the size in bytes, and clear the whole bitmap using the byte length.
The 'in' field (bit 0) is missing from the DCAN TIOC macros. It looks
like the auto-gen did not pick it up as it's broken onto the next page
in both the 3137 and 4357 TRMS.
The generated LIN and SCI headers used a generic CLEARINTLVL_8 macro for
the TX interrupt level clear bit, and used CE names for bit 25, which is
the overrun-error interrupt.
Add the missing CLR_TX_INT_LVL names, use OE consistently for bit 25,
and remove the duplicate CLEARINTLVL definitions.
Only enter the if block to clear the channel when IOFFHR != 0. Then
subtract 1 inside there to get the correct channel (e.g. IOFFHR == 1
maps to channel 0).
Commit 3a0dcd5ee9 cleaned up the
TMS570_MMR_SELECT_GMII_SEL somewhat, creating the
TMS570_MMR_SELECT_MII_MODE and TMS570_MMR_SELECT_RMII_MODE
macros.
There remains one reference to the TMS570_MMR_SELECT_GMII_SEL macro
in the 3137 code. This commit replaces it with TMS570_MMR_SELECT_MII_MODE
which preserves the same encoding as the pinmux was at the time (and is
correct): TMS570_PIN_AND_FNC(TMS570_BALL_WITH_MMR(29, 3), 0)
LS31x variants have this ETO field in POMGLBCTRL but the LC43x
variants do not.
Guard the write so LC43x variants aren't trying to program a
non-existent field.