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

Board support : Pixhawk Pro #6473

Closed
wants to merge 21 commits into from
Closed

Conversation

klopezal
Copy link
Contributor

This pull request brings changes in order to use ArduPilot on Pixhawk Pro hardware. As this board uses a different processor (with more flash and RAM, but also different register definitions), it also needs subsequent changes in PX4NuttX and PX4Firmware : these two pull requests should be tested and validated before considering merging :

ArduPilot/archived-PX4NuttX#11
ArduPilot/archived-PX4Firmware#76

@@ -63,6 +63,7 @@ class AP_BoardConfig {
PX4_BOARD_PIXRACER = 4,
PX4_BOARD_PHMINI = 5,
PX4_BOARD_PH2SLIM = 6,
PX4_BOARD_PIXHAWK_PRO = 7,
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought 7 was used somewhere hidden which is why AEROFC moved up to 13? Need to double-check this.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, 7 to 12 is occupied with VRBrain boards.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is now corrected, thanks!

AP_Compass_AK8963::name, false);
// ADD_BACKEND(AP_Compass_LIS3MDL::probe(*this, hal.spi->get_device(HAL_COMPASS_LIS3MDL_NAME),
// false, ROTATION_PITCH_180),
// AP_Compass_LIS3MDL::name, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

as a rule, we don't like to add code that is commented out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also corrected.

@tridge
Copy link
Contributor

tridge commented Jun 21, 2017

Thank you very much for this, you've saved me a lot of time!
I've pushed the PX4NuttX and PX4Firmware changes to pr-ppro branches on the ArduPilot repos. That will allow travis to work on them.
I've also pushed the ArduPilot changes, rebased on master, to https://github.com/tridge/ardupilot/commits/pr-ppro
I tested it on a ppro here (thank you for sending me one btw!). It does build and load fine, and boots up, but there are a few issues I've noticed so far:

  • power status shows USB, Brick and servo power, when it only has USB power
  • primary mag seems ok, 2nd mag is giving crazy output
  • both accels and gyros are working
  • CPU load looks fine

I haven't tried external i2c or any other peripherals yet. Great start though, thanks!

@tridge
Copy link
Contributor

tridge commented Jun 21, 2017

we should also add this to travis

@klopezal
Copy link
Contributor Author

Thanks!

  • I spotted the power error, it is in PX4Firmware, I'll suggest a correction
  • true, SPI communication with LIS3MDL does not work well for the moment, I always get 0x00 or 0xFF bytes on the bus, pending investigation
  • ok
  • ok

@klopezal
Copy link
Contributor Author

@tridge There was an issue with DMA configuration that is now solved. LIS3MDL now gives correct output. Right now the SPI bus is used at 1 MHz, we could go up to 10 MHz according to the datasheet, I haven't tested yet.

@tridge tridge self-assigned this Jul 4, 2017
@klopezal
Copy link
Contributor Author

klopezal commented Jul 6, 2017

LIS3MDL now works correctly, I had to decrease SPI speed down to 500 KHz, otherwise there are constant communication errors on the first bit of OUT_XXX_L registers.

The LIS3MDL sensor has an intrinsic bigger offset on Z axis, hence the MAX_OFFSET modification. Should we make this change specific to this sensor or let the modification for all compasses?

@tridge
Copy link
Contributor

tridge commented Jul 13, 2017

I don't mind increasing that default to 850.
glad to hear the lis3mdl is working now!

@tridge
Copy link
Contributor

tridge commented Jul 15, 2017

I've done some commit msg cleanup to follow our coding guidelines, plus pushed the PX4Firmware and PX4NuttX changes
the commit cleanups are here:
https://github.com/tridge/ardupilot/tree/ppro-wip

@tridge
Copy link
Contributor

tridge commented Jul 15, 2017

looks like it breaks the build for px4-v1:
armv7-m/up_vectors.c:50:4: error: #error ARMV7M_PERIPHERAL_INTERRUPTS must be defined to the number of I/O interrupts to be supported

error ARMV7M_PERIPHERAL_INTERRUPTS must be defined to the number of I/O interrupts to be supported

@tridge
Copy link
Contributor

tridge commented Jul 19, 2017

I've updated your PR branch with a patch to PX4Firmware that fixes the FMUv1 build. Note that I only fixed the build, I haven't yet tested the build and run on FMUv1, FMUv2 and FMUv4. We'll need to carefully test all boards before merging.
The problem turned out to be simple, we weren't defining CONFIG_STM32_STM32F405 on FMUv1
ArduPilot/archived-PX4Firmware@528daaf

@tridge
Copy link
Contributor

tridge commented Jul 19, 2017

I've now done basic testing on FMUv1, FMUv2, FMUv4 and the v4pro
The only failure I'm seeing is the IO firmware on FMUv1. That needs some more work.

@tridge
Copy link
Contributor

tridge commented Jul 21, 2017

I have found the bug with px4io on fmuv1. It is an existing bug, not related to this PR. It is caused by the way px4io update uses a uart instead of i2c for the update, and that uart is already registered in HAL_PX4. That is unique to the v1 boards.
I'll fix the bug soon.

@tridge
Copy link
Contributor

tridge commented Jul 22, 2017

this PR fixes the FMUv1 problem:
#6645
once that is merged I think we'll be ready to add this v4pro PR

@tridge
Copy link
Contributor

tridge commented Jul 24, 2017

this has now been merged into master
@klopezal many thanks for your work on this!

@tridge tridge closed this Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants