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

initial ICM426xx support #891

Merged
merged 23 commits into from
Jun 1, 2023

Conversation

nerdCopter
Copy link
Member

@nerdCopter nerdCopter commented May 19, 2023

  • initial ICM426xx support
  • WIP
  • needs testing
  • needs target definitions separately PR'd
  • may need fixes
  • may need cleanup (especially GYRO_HARDWARE_LPF_* options)

This code is ported from Betaflight. Thanks to Betaflight team and GPL licensed opensource.
https://github.com/betaflight/betaflight/blob/master/LICENSE

Massive thanks to @Peck07 for investigting and fixing some pre-existing failed works.
Massive thanks to @BeauBrewski for target definitions.

closes #869

Co-authored-by: tbolin tobias_bolin@hotmail.com
Co-authored-by: KarateBrot Rm2k-Freak@web.de
Co-authored-by: Steve Evans Steve@SCEvans.com
Co-authored-by: Dominic Clifton dominic.clifton@cleanflight.com
Co-authored-by: Peck07 28628457+Peck07@users.noreply.github.com
Co-authored-by: nerdCopter 56646290+nerdCopter@users.noreply.github.com

nerdCopter and others added 6 commits May 15, 2023 15:22
FOXEERF722V4

ICM_42688P & ICM_42605 ; CAUTION / really no idea if this is anything good

more ICM_42688P & ICM_42605 ; CAUTION / really no idea if this is anything good

FOXEERF745V3_AIO
#define GYRO_ICM42688P_ALIGN GYRO_1_ALIGN
#define ICM42688P_CS_PIN GYRO_1_CS_PIN
#define ICM42688P_SPI_INSTANCE GYRO_1_SPI_INSTANCE

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is not defined as a dual gyro quad, and there is no GYRO_2, you cannot use defines for GYRO_1

#define GYRO_ICM42688P_ALIGN  CW270_DEG
#define ACC_ICM42688P_ALIGN  CW270_DEG
#define ICM42688P_CS_PIN       PA4
#define ICM42688P_EXTI_PIN        PC4
#define ICM42688P_SPI_INSTANCE SPI1

#define USE_MPU_DATA_READY_SIGNAL

#define ACC_MPU6000_ALIGN         ACC_ICM42688P_ALIGN
#define GYRO_MPU6000_ALIGN        GYRO_ICM42688P_ALIGN
#define MPU6000_CS_PIN            ICM42688P_CS_PIN
#define MPU6000_SPI_INSTANCE      ICM42688P_SPI_INSTANCE
#define MPU_INT_EXTI              ICM42688P_EXTI_PIN

Don't need MPU6500 defines, and probably don't need the MPU6000 defines since pretty certain this is an ICM42xxxp specific target and FC

Copy link
Member Author

@nerdCopter nerdCopter Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BF shows mpu6000, but not 6500

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, i'm wrong, i keep mixing up 722_2022B with 405_2022B 🍌

BF:

#define BOARD_NAME        MAMBAF405_2022B
#define MANUFACTURER_ID   DIAT

#define USE_ACC
#define USE_ACC_SPI_MPU6000
#define USE_GYRO
#define USE_GYRO_SPI_MPU6000
#define USE_ACC_SPI_MPU6500
#define USE_GYRO_SPI_MPU6500
#define USE_GYRO_SPI_ICM42688P
#define USE_ACC_SPI_ICM42688P

#define UART4_RX_PIN PA1
#define UART5_RX_PIN PD2
#define UART6_RX_PIN PC7
#define INVERTER_PIN_UART1 PC0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diatone Mamba wiring diagram and manual lists the S/F.Port as being UART5
image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so #define RSSI_ADC_PIN PC12 ???

@nerdCopter nerdCopter marked this pull request as ready for review June 1, 2023 14:10
@nerdCopter
Copy link
Member Author

ready for review/merge

@nerdCopter nerdCopter merged commit 53a8da3 into master Jun 1, 2023
5 of 6 checks passed
@nerdCopter
Copy link
Member Author

please see #890 (comment)

i.e. ICM42688P_EXTI_PIN is not a valid define in source-code. use GYRO_1_EXTI_PIN or MPU_INT_EXTI instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] ICM42688P
4 participants