RTEMS | bsps/arm/stm32f4: Add SPI bus driver (!1294)

Moksh Panicker (@mokshpanicker) gitlab at rtems.org
Mon Jun 8 10:54:52 UTC 2026




Moksh Panicker commented on a discussion on bsps/arm/stm32f4/spi/spi.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1294#note_152110

 > +{
 > +  stm32f4_spi_bus      *bus  = arg;
 > +  volatile stm32f4_spi *regs = bus->regs;
 > +  uint32_t              sr   = regs->sr;
 > +
 > +  if (sr & STM32F4_SPI_SR_TXE) {
 > +    uint8_t byte = 0;
 > +    if (bus->tx_buf != NULL) {
 > +      byte = *bus->tx_buf++;
 > +    }
 > +    regs->dr = byte;
 > +    /*
 > +     * One byte is now in the shift register.  Disable TXE and wait
 > +     * for RXNE so we do not send another byte before the current one
 > +     * has been received (full-duplex, one byte in flight).
 > +     */

Good point, updated. The transfer now writes the first byte to DR directly, then uses only RXNE. Each received byte triggers writing the next TX byte immediately. TXE interrupt is no longer used.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1294#note_152110
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260608/9ecb2421/attachment-0001.htm>


More information about the bugs mailing list