Skip to content

Fix SPI + MPU #31

@Peque

Description

@Peque

MPU is currently not responding for unknown reasons. We should investigate this further.

Also, SPI communications seem to be broken and require some wait time before reading/writing:

diff --git a/src/platform.c b/src/platform.c
index 6776f13..f9472a7 100644
--- a/src/platform.c
+++ b/src/platform.c
@@ -74,6 +74,7 @@ uint8_t mpu_read_register(uint8_t address)
        spi_send(SPI3, 0x00);
        reading = spi_read(SPI3);
        gpio_set(GPIOA, GPIO15);
+       sleep_us(4);
 
        return reading;
 }
@@ -92,6 +93,7 @@ void mpu_write_register(uint8_t address, uint8_t value)
        spi_send(SPI3, value);
        spi_read(SPI3);
        gpio_set(GPIOA, GPIO15);
+       sleep_us(4);
 }
 
 /**

That was not the case with Bulebule. Why did it change? Could we use hardware chip-select?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions