Skip to content

Commit

Permalink
Fix SPI so that SPI4 Clock will not be 2 times requested
Browse files Browse the repository at this point in the history
The clocks assigned to the SPI blocks spi4 to spi6  were using the APB1 prescaler (42 mHZ) constant and should have been the APB2 prescaler (84 mHZ) constant. Thus the actual SPI clock on the bus was 2 times what is should have been (After adjustment for requested to actual)

IE: Request for 11 mHz maps to an Actual 10.5 mHz but would have produced a clock of 21 mHz on the bus.

This change fixes that.
  • Loading branch information
David Sidrane committed Feb 13, 2015
1 parent 834051b commit 0857d37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/arm/src/stm32/stm32_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ static struct stm32_spidev_s g_spi4dev =
{
.spidev = { &g_sp4iops },
.spibase = STM32_SPI4_BASE,
.spiclock = STM32_PCLK1_FREQUENCY,
.spiclock = STM32_PCLK2_FREQUENCY,
#ifdef CONFIG_STM32_SPI_INTERRUPTS
.spiirq = STM32_IRQ_SPI4,
#endif
Expand Down Expand Up @@ -445,7 +445,7 @@ static struct stm32_spidev_s g_spi5dev =
{
.spidev = { &g_sp5iops },
.spibase = STM32_SPI5_BASE,
.spiclock = STM32_PCLK1_FREQUENCY,
.spiclock = STM32_PCLK2_FREQUENCY,
#ifdef CONFIG_STM32_SPI_INTERRUPTS
.spiirq = STM32_IRQ_SPI5,
#endif
Expand Down Expand Up @@ -484,7 +484,7 @@ static struct stm32_spidev_s g_spi6dev =
{
.spidev = { &g_sp6iops },
.spibase = STM32_SPI6_BASE,
.spiclock = STM32_PCLK1_FREQUENCY,
.spiclock = STM32_PCLK2_FREQUENCY,
#ifdef CONFIG_STM32_SPI_INTERRUPTS
.spiirq = STM32_IRQ_SPI6,
#endif
Expand Down

0 comments on commit 0857d37

Please sign in to comment.