Skip to content

SPI speed calculated wrong on RPi3 #2094

Closed
@TuxCoder

Description

@TuxCoder

Problem

The SPI speed on a RPi3 is currently miscalculated is is 0.6 from the set speed.

This comes from the way how the speed is calculated, over an divider from the core clock.
Currently the SPI speed is fix calculated from 250Mhz coreclock.
This clock changed from RPi2 to RPi3 to 400MHz. -> 250/400 = 5/8 ~ 0.66

As the the core clock can be set in /boot/config.txt ist should be dynamic.

Set SPI speed to 3.2MHz result in a clock signal of 2Mhz.
As a workaround I set the core clock to 250MHz.
I measured everything with an logic analysiere before and after.
Now the spi clock is as set at 3.2MHz.

Testet

Platform is based on https://github.com/drtyhlpr/rpi23-gen-image
Debian Stretch 32bit arm
kernels:

  • current main branch
  • 4.12.0 rc7

Workaround

add core_freq=250 into /boot/config.txt/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions