Skip to content
This repository has been archived by the owner on Jan 25, 2025. It is now read-only.

I2C and SPI support for Dev A #6

Open
chengguizi opened this issue Dec 26, 2020 · 2 comments
Open

I2C and SPI support for Dev A #6

chengguizi opened this issue Dec 26, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@chengguizi
Copy link

Development Board A has the following peripherals:

  • IST8310 Magnetometer Sensor (I2C, connected to MPU6500 as a I2C slave)
  • MPU6500 IMU Sensor (SPI connection)

IST8310

MPU6500

After initial investigation, the I2C interface seems not needed. SPI5 is used by MPU6500 (PF6 to PF9)

There are interrupt pins as well:
PB8 for MPU6500
PE3 for IST8310

IST8310 has an additional PE2 as the set/reset pin

There is a header around IMU unit, PWM controlled by PB5.
image

@chengguizi
Copy link
Author

On Dev Board A, SPI4 and SPI5 are connected

SPI4 is not used, but connected to the user defined pinouts
SPI5 is connected to the IMU

There is a system tool that can be enabled within nsh, should set the maximum bus number from 3 to at least 5

image

It will check if the file /dev/spi%d exist. This shows that if spi is working, it should mount itself within the /dev/ folder

@chengguizi chengguizi added the enhancement New feature or request label Dec 26, 2020
@chengguizi
Copy link
Author

chengguizi commented Dec 26, 2020

image
image

Successfully bring up SPI 4 and 5, but have not tested with the real IMU driver yet. The config is to be pasted into PX4 Autopilot, for testing. After that, will merge into main branch here.

The working commit: 2919d6b

Note: stm32_spibus_initialize(int) is the key function to call, to initialise SPI, I believe.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant