MegaPirateNG / ardupilot-mpng

MegaPirateNG
GNU General Public License v3.0
117 stars 105 forks source link

HK_RED_MULTIWII_PRO won't boot on 3.0.1 R3 #94

Closed bpopp closed 10 years ago

bpopp commented 10 years ago

New HK Multiwii Pro with nothing hooked up (no GPS, motors, or receiver). I can compile and upload, but do not get RED, GREEN, BLUE LEDs after upload completes. Config:

// Select Megapirate board type:

define MPNG_BOARD_TYPE HK_RED_MULTIWII_PRO

I can connect from Terminal in Mission Planner, but all IMU related tests fail. Oddly enough, when I run compass, I get:

Failed to boot MPU6000 5 times (obviously wrong sensor for my board)

With Multiwii firmware it loads, LEDs blink, and all sensors appear to work fine so the hardware appears to be okay. Any help is greatly appreciated!

motivecodex commented 10 years ago

So far I had the same problem. I noticed that my GPS was not working, so I fixed GPS with setting the baud at 57600. This fixed my GPS. About not getting it to work; I used the flashtool to flash the latest MPNG on it, http://docs.megapirateng.com/documentation/flashtool and setup everything as you need it to be. I have the same board as you and have , board type hobbyking red multiwii pro, rc input regular pwm on A8-A15, MultiWii, APM: Copter-quad, GPS type NMEA, BAUD at 57600. Flashed, did all the calibrations, also the compass calibration! Then it armed. It has arming safe on it, you can turn it off. More information can be found here http://copter.ardupilot.com/wiki/prearm_safety_check/

smurfy commented 10 years ago

Try a EEPROM Clear

bpopp commented 10 years ago

Yeah, I meant to add that to my notes. I did an EEPROM Clear and verified that it was clear. I'm still having the same issue. Does anyone know if it is required that the receiver inputs be connected to the board before starting MPNG? I don't have a receiver yet to test this with.

smurfy commented 10 years ago

The board works even without a RC Receiver. I think something went wrong with your configuration / flashing. the hl red board uses as you also noticed a different sensor.

You either can use the flashtool and select the correct board or make sure you defined the boardtype in APM_Config.h in the ArduCopter directory, also you should make sure the leading // are removed.

bpopp commented 10 years ago

I'll double check my code when I get home, but the APM_Config file is pretty straight forward and I copy and pasted my board definition above. The only other thing I changed was the FRAME_CONFIG to set it to QUAD_FRAME. I'm a programmer by day and am comfortable with code.

It's clearly instantiating the wrong sensor, though, because that error message is only found in the AP_InertialSensor_MPU6000 files.

Maybe a silly question, but Is there any way to debug microcontroller code? To test, for example, which sensor is initialized after config.h is included? Is there a better way than turning LED's on and off?

I see where my sensor is supposed to be included (ArduCopter.pde:208) and you're right, it looks like it would unless I had the board type wrong.

smurfy commented 10 years ago

I don't know how to debug the code properly to test if it defines the correct sensor you can add a wrong code snipped like asddadadasdasdsd and look if it fails to compile :)

it should enter line 94 in config.h and define the correct sensor based on your configuration.

bpopp commented 10 years ago

Yeah, so somehow I missed the step clearly marked as "Important" where you're supposed to replace the IDE's .pde.jar with the copy from the source code. Everything is working as expected now.Closing.