RTEMS | bsps/arm/stm32f4: Add SPI bus driver (!1294)
Gedare Bloom (@gedare)
gitlab at rtems.org
Mon Jun 8 18:55:50 UTC 2026
Gedare Bloom started a new discussion on bsps/arm/stm32f4/spi/spi.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1294#note_152125
> +
> + /* Enable the peripheral clock before touching registers */
> + stm32f4_rcc_set_clock(rcc, true);
> +
> + bus->base.bits_per_word = 8;
> + bus->base.mode = 0;
> + bus->base.speed_hz = pclk / 256; /* conservative default */
> + bus->base.max_speed_hz = pclk / 2;
> + bus->base.delay_usecs = 0;
> + bus->base.cs = 0;
> + bus->base.cs_change = 0;
> +
> + rv = stm32f4_spi_setup(&bus->base);
> + if (rv != 0) {
> + stm32f4_rcc_set_clock(rcc, false);
> + spi_bus_destroy_and_free(&bus->base);
although not strictly necessary, you should probably call `rtems_binary_semaphore_destroy()` in the error handling paths here.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1294#note_152125
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/88d7cecb/attachment-0001.htm>
More information about the bugs
mailing list