Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DMA support for ICM-42688-P #11160

Closed
wants to merge 2 commits into from

Conversation

SteveCEvans
Copy link
Member

Add DMA support for the ICM-42688-P as used and tested on the SPRACINGH7RF.

@hydra
Copy link
Contributor

hydra commented Dec 27, 2021

@haslinghuis @ctzsnooze This should be in 4.3 RC2 right? This should have been part of the gyro dma work in #10573 but wasn't due to @SteveCEvans not having an FC with the Gyro in time.

@haslinghuis haslinghuis added this to the 4.3 milestone Dec 27, 2021
@haslinghuis haslinghuis added this to For discussion in Finalizing Firmware 4.3 Release via automation Dec 27, 2021
@haslinghuis haslinghuis moved this from For discussion to In Progress in Finalizing Firmware 4.3 Release Dec 27, 2021
haslinghuis
haslinghuis previously approved these changes Dec 28, 2021
daleckystepan
daleckystepan previously approved these changes Dec 28, 2021
@daleckystepan
Copy link
Member

Haven't tested as I don't have HW. Code LGTM.

@hydra
Copy link
Contributor

hydra commented Dec 29, 2021

I did a quick test of this code on actual hardware.

I pulled the two commits from this PR into this H7RF branch.

https://github.com/spracing/betaflight/commits/bf-h7rf-and-config-in-memory-mapped-flash-and-elrs-v2

I checked the CLI status which gives this:

# status
MCU H730 Clock=520MHz, Vref=3.28V, Core temp=53degC
...
Devices detected: SPI:1, I2C:1
Gyros detected: gyro 1 locked dma
GYRO=ICM42605, ACC=ICM42605, BARO=BMP388
OSD: SPRACINGOSD
System Uptime: 12 seconds, Current Time: 2021-12-29T12:21:46.574+00:00
CPU:1%, cycle time: 128, GYRO rate: 7812, RX rate: 15, System rate: 10
# dma show

Currently active DMA:
--------------------
DMA1 Stream 0: SPI_MOSI 2
DMA1 Stream 1: SPI_MISO 2
DMA1 Stream 2: SPI_MOSI 3
DMA1 Stream 3: SPI_MISO 3
DMA1 Stream 4: FREE
DMA1 Stream 5: FREE
DMA1 Stream 6: FREE
DMA1 Stream 7: FREE
DMA2 Stream 0: FREE
DMA2 Stream 1: FREE
DMA2 Stream 2: ADC 3
DMA2 Stream 3: FREE
DMA2 Stream 4: LED_STRIP
DMA2 Stream 5: OSD
DMA2 Stream 6: OSD
DMA2 Stream 7: OSD

# get gyro_1
gyro_1_bustype = SPI
Allowed values: NONE, I2C, SPI, SLAVE

gyro_1_spibus = 3
Allowed range: 0 - 6
Default value: 6

Code path seems correct:

image

image

Diff:

# diff

# version
# Betaflight / SPRACINGH7RF (SP7R) 4.3.0 Dec 29 2021 / 13:19:20 (12093fbac9) MSP API: 1.44

# start the command batch
batch start

board_name SPRACINGH7RF

# resources
resource SPI_SCK 6 NONE
resource SPI_MISO 6 NONE
resource SPI_MOSI 6 NONE

# master
set gyro_1_spibus = 3

profile 0

rateprofile 0

# end the command batch
batch end

Seems ok to me.

Binaries for testing:

betaflight_4.3.0_SPRACINGH7RF_12093fbac9.zip

@SteveCEvans
Copy link
Member Author

Do not merge as will be included in #11198

@haslinghuis haslinghuis moved this from In Progress to Steve's PR in Mashup in Finalizing Firmware 4.3 Release Jan 4, 2022
@haslinghuis
Copy link
Member

Merged with #11198

@haslinghuis haslinghuis closed this Jan 7, 2022
Finalizing Firmware 4.3 Release automation moved this from Steve's PR in Mashup to Finished (Merged) Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants