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 BETAFLIGHTF4 target support #2573

Closed

Conversation

shellixyz
Copy link
Collaborator

@shellixyz shellixyz commented Dec 9, 2017

@shellixyz
Copy link
Collaborator Author

@Christiangrau @Rampiks1 Please test this

@shellixyz shellixyz changed the title Add BETAFLIGHT4 target support Add BETAFLIGHTF4 target support Dec 9, 2017
@Rampiks1
Copy link

Rampiks1 commented Dec 9, 2017

Hey, I tried flashing it, but after flash is done it doesn't reboot and when I remove the USB and connect it again I get a popup saying somthing like "Windows can't detect this device", if i flash in betaflight it connects and works fine, and if a flash a Omnibus f4 clone in iNav it also works fine
Hope this helps

@shellixyz
Copy link
Collaborator Author

@Rampiks1 Hello. Thanks for the feedback. What is the status LED doing when you power up the board ?

@shellixyz
Copy link
Collaborator Author

shellixyz commented Dec 10, 2017

I updated the test build, please test it: inav_1.8.1_BETAFLIGHTF4.hex

@Rampiks1
Copy link

Hey, I got to test it now, No change to the new test build, and the activity led is glowing blue constant even after removing the USB and connecting it again

@shellixyz
Copy link
Collaborator Author

@Rampiks1 I don't know what's going on for the moment then :/
@digitalentity Do you have any idea about what could be the blockage point ?

@digitalentity
Copy link
Member

Not sure. I'm going to order a BFF4 board to troubleshoot. Any idea where I can get one?

@shellixyz
Copy link
Collaborator Author

@digitalentity
Copy link
Member

Ordered one from FPVModel. Fingers crossed I'll get it before New Year 😄

@shellixyz
Copy link
Collaborator Author

Great, fingers crossed :)

I updated the defines for ACC/GYRO/BARO maybe it is as simple as that.
@Rampiks1 Please test the updated build: inav_1.8.1_BETAFLIGHTF4.hex

@Rampiks1
Copy link

@shellixyz Hey, it still has the exact same issue

@wx4cb
Copy link

wx4cb commented Dec 12, 2017

i have a board if you need help testing, also Racedayquads here in florida has them too: https://www.racedayquads.com/collections/betaflight-products

Their shipping is top notch less than a week all over the us.

@wx4cb
Copy link

wx4cb commented Dec 13, 2017

@shellixyz i just installed the code, any way i can get your target directory? i'm assuming that's all I would need to add into my git clone? Would love to work on this as well

@shellixyz
Copy link
Collaborator Author

@wx4cb
Copy link

wx4cb commented Dec 13, 2017

I noticed that there are a couple of defines missing when i compared it to the betaflight version for the same board. could it be that they are missing that's causing the issue?

namely the ones for the MAX chip etc?

`//#define USE_ESC_SENSOR
#define MPU6000_SPI_BUS BUS_SPI1
#define USE_ACC_MPU6000
#define ACC_MPU6000_ALIGN CW180_DEG
#define USE_GYRO_MPU6000
#define GYRO_MPU6000_ALIGN CW180_DEG
#define BMP280_SPI_BUS BUS_SPI2
#define BMP280_CS_PIN PB3
#define MAX7456_SPI_BUS BUS_SPI2
#define MAX7456_CS_PIN PB12
//#define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD) // 10MHz // XXX
//#define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST) // XXX
#define USB_IO
#define VBUS_SENSING_ENABLED
//#define USE_SOFTSERIAL1
//#define USE_SOFTSERIAL2
#define SERIAL_PORT_COUNT 5 //VCP, USART1, USART2, USART3, USART6, SOFTSERIAL1, SOFTSERIAL2
//#define USE_ESCSERIAL // XXX
//#define ESCSERIAL_TIMER_TX_PIN PB8 // (Hardware=0, PPM)
#define SPI1_NSS_PIN NONE
#define SPI1_SCK_PIN PA5
#define SPI1_MISO_PIN PA6
#define SPI1_MOSI_PIN PA7
/* XXX
*/
#define ADC_CHANNEL_1_PIN PC1
#define ADC_CHANNEL_2_PIN PC2
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
#define VBAT_ADC_CHANNEL ADC_CHN_2
//#define LED_STRIP
//#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL // XXX
//#define SBUS_TELEMETRY_UART SERIAL_PORT_USART2 // XXX
#define SPEKTRUM_BIND
// USART3,
#define BIND_PIN PB11

#define MAX_PWM_OUTPUT_PORTS 4
#define USABLE_TIMER_CHANNEL_COUNT 5
//#define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) | TIM_N(9) | TIM_N(10) )
#define USED_TIMERS ( TIM_N(3) | TIM_N(8) | TIM_N(10) )`

@shellixyz
Copy link
Collaborator Author

shellixyz commented Dec 13, 2017

MAX7456_SPI_CLK and MAX7456_RESTORE_CLK are not used in iNav
I thought so but it looks like I'm wrong you can uncomment and try.

@wx4cb
Copy link

wx4cb commented Dec 13, 2017

I compiled your tree @shellixyz and flashed it to my brand new BFF4 board and it flashed ok and I can open it up in the conflagulator :D

I see the 16 meg data flash, the gyro and the accellerometer, i don't see a baro on this board so evreything looks right so far.

2017-12-13 @ 18:05:08 -- USB device successfully opened with ID: 12
2017-12-13 @ 18:05:09 -- Detected device with total flash size 1024 kiB
2017-12-13 @ 18:05:09 -- Read protection not active
2017-12-13 @ 18:05:27 -- Erased 1024 kB of flash successfully
2017-12-13 @ 18:05:48 -- USB device successfully closed
2017-12-13 @ 18:06:21 -- Serial port successfully opened with ID: 92
2017-12-13 @ 18:06:21 -- MultiWii API version received - 2.1.0
2017-12-13 @ 18:06:21 -- Flight controller info, identifier: INAV, version: 1.8.1
2017-12-13 @ 18:06:21 -- Running firmware released on: Dec 13 2017 17:52:57
2017-12-13 @ 18:06:21 -- Board: BFF4, version: 0
2017-12-13 @ 18:06:21 -- Unique device ID received - 0x32003d3436511937353431
2017-12-13 @ 18:06:21 -- PWM output is disabled. Motors and servos will not work. Use Configuration tab to enable!

@shellixyz
Copy link
Collaborator Author

@wx4cb Nice ! Did you change anything ?

@wx4cb
Copy link

wx4cb commented Dec 14, 2017

@shellixyz no i downloaded the tree that you gave me as a zip file, extracted into a VM compiled and flashed onto the BFF4 board. in the process of wiring it up now so i can test later

@wx4cb
Copy link

wx4cb commented Dec 14, 2017

here's a diff after i did some basic config and setup the receiver. I havent done anything else yet, i'm working on wiring up the esc and some servo leads etc

although i did just notice that I have uart6 as the sbus receiver, vcp for the configurator and msp on uart 1 was turned on, so i turned that off.

I also turned on the voltage and current monitoring and also things like the telemetry etc

version

INAV/BETAFLIGHTF4 1.8.1 Dec 13 2017 / 17:52:57 ()

resources

mixer

mixer AIRPLANE

servo

servo mix

feature

feature VBAT
feature MOTOR_STOP
feature CURRENT_METER
feature LED_STRIP
feature AIRMODE
feature PWM_OUTPUT_ENABLE

beeper

map

name

serial

serial 0 0 115200 38400 0 115200

aux

adjrange

rxrange

master

set gyro_sync = ON
set gyro_hardware_lpf = 188HZ
set acc_hardware = MPU6000
set baro_hardware = NONE
set pitot_hardware = NONE
set receiver_type = SERIAL
set rssi_channel = 16
set min_throttle = 1070
set max_throttle = 1900
set small_angle = 180
set gps_provider = UBLOX7

profile

profile 1

set fw_p_pitch = 20
set fw_i_pitch = 30
set fw_ff_pitch = 15
set fw_p_roll = 20
set fw_i_roll = 30
set fw_ff_roll = 15
set fw_p_yaw = 45
set fw_i_yaw = 5
set fw_ff_yaw = 15
set fw_i_level = 15
set pitch_rate = 15
set yaw_rate = 9

@shellixyz
Copy link
Collaborator Author

shellixyz commented Dec 14, 2017

It's odd it didn't work for @Rampiks1. @wx4cb could you try the build linked in the first comment ?

@wx4cb
Copy link

wx4cb commented Dec 14, 2017

this one worked fine @shellixyz

version

INAV/BETAFLIGHTF4 1.8.1 Dec 11 2017 / 14:45:28 (33695c5)

Based on CF/BF target definitionLinked issue: #2564Untested, feedback needed, I do not own this board.Test build: inav_1.8.1_BETAFLIGHTF4.hex

@wx4cb
Copy link

wx4cb commented Dec 14, 2017

that being said.... i mean i can flash it and connect it to the configurator. i haven't tested it further than that yet

@wx4cb
Copy link

wx4cb commented Dec 14, 2017

i do get the same as @Rampiks1 where windows says it doesn't recognise the device, but it still works fine. on all three builds, but i can still connect ok

@tasi0000
Copy link

Right, I wasn't aware! Thanx! In BF firmware you have to reassign UART 1 and 3 TX pins to soft serial in order to have smartport and smart audio working. Would it be possible to have some kind of routine/script in this target to have this or similar command executed via a switch depending on user preference?

@wx4cb
Copy link

wx4cb commented Dec 15, 2017

@tasi0000 according to Oscar Liang, uart2 is inverted on both legs:

"You can use UART2 for SmartPort with some modification: you will need to get a small signal schottky diode connecting TX to RX, and connect Smart Port to the RX. And turn off tlm_halfduplex in CLI"

https://oscarliang.com/betaflight-f4-flight-controller/

@tasi0000
Copy link

and peeps, how are we doing ? Im still on rev4 :) tried some gps stuff today like autolaunch and alti hold but took ages to get a lock for some reason...everything seems to work fine! Any ideas with what to mess around now? Has anybody tried smartport, smartaudio and sbus ? I'm done till new year :)

@wx4cb
Copy link

wx4cb commented Dec 16, 2017

@tasi0000 I know sbus works as that's how i'm doin g my receiver, on the SBUS p[in which comes in as UART 6

GPS is on UART1 here although bein g inside i can't get a lock but i do see gps messages going into the system. As far as smartport/audio i haven't done that yet, i'm working on trying to figure out th e mixes etc.

@shellixyz
Copy link
Collaborator Author

@tasi0000 I never used smartaudio nor S.Port with iNav. I can't say anything about smartaudio but I already used S.Port with Betaflight and as you said you will need either a Softserial port or a hardware inverter like this one. What is the model of your GPS module (link) ? All GPS modules are not created equal. I know the first I had were shitty ones and it was very annoying. Difficult to get a lock, losing lock when changing orientation... But also you need to keep it away from RF noise. The farther away from your control link receiver, ESC, VTX, telemetry modem the better. For flying wings I put the receiver in one wing, the GPS in the other and the VTX in the middle section.

@wx4cb
Copy link

wx4cb commented Dec 17, 2017

@tasi0000 this is the GPS/Compass that I bought.

haven't tried it in earnest yet, it's all just spaghetti wired on my bench as i don't have a target to put it into yet.

As far as smartport/sport for the telemetry, see that oscar liang link i posted earlier. as far as locations, ytes i do the same thing. one in each wing.

https://www.amazon.com/gp/product/B012RNLG0K/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1

@wx4cb
Copy link

wx4cb commented Dec 19, 2017

@shellixyz where is the number of LEDs defined (currently says 0 leds)? i can't seem to find it. That or im blind lol

@shellixyz
Copy link
Collaborator Author

@wx4cb If you are talking about the LED_STRIP feature here is how to define the LEDs:
https://youtu.be/0E_4K-H16Jk?t=4m8s

@wx4cb
Copy link

wx4cb commented Dec 19, 2017

@shellixyz No. i know how to define the LEDS and their functions, but when you go into there it says you have "zero" leds available and won't let you place any. I don't think this is aBFF4 issue as ive seen other issues posted

@shellixyz
Copy link
Collaborator Author

@wx4cb I disabled the LED_STRIP on this board for testing purposes. You can enable it back by uncommenting this line in target.h:156

//#define LED_STRIP

@shellixyz
Copy link
Collaborator Author

@wx4cb If you test the LEDs and it is working please tell us I will enable the feature back.

@shellixyz
Copy link
Collaborator Author

@wx4cb Little mistake the right symbol is USE_LED_STRIP

@wx4cb
Copy link

wx4cb commented Dec 21, 2017

I did that, and still shows 0 leds available for assigning. Not a big deal right now, working on an osd change - if i can ever get my board to go back into DFU mode lol

untitled

@CircuitBender
Copy link

hi there guys, I am currently testing the unstable BetaflightF4 version for inav on the hardware itself
if you have any questions what I should test or look for, let me know.

Current Issues:
unexpected dropouts of the TX (FRSKY X8R)
while rebooting in inav: FC is not properly unmounted and cannot reconnect via USB
in inav modes: auto assign function does not work, channels are not the same numbering (ch1-ch16 instead of ch1-4 and aux1-8)

@CircuitBender
Copy link

CircuitBender commented Dec 28, 2017

LED are not working on inav (working in Betaflight)
i cannot assign LED, there are 8 LED hooked up, betaflight shows in wiring mode 0

  • have to test if it works with USE_LED

shellixyz: "I disabled the LED_STRIP on this board for testing purposes. You can enable it back by uncommenting this line in target.h:156 "

//#define LED_STRIP

@CircuitBender
Copy link

CircuitBender commented Dec 28, 2017

@wx4cb check impulse rc bootloader driver fixer, or zadig

@wx4cb
Copy link

wx4cb commented Dec 28, 2017

@CircuitBender Been flying inav now for the last 2 weeks not noticed an y drop outs on my X8R, i have noticed that it doesn't init the OSD every now and again though.

The unable to connect via USB is one i noticed yesterday and was a real pain. This i think is also the cause of me not being able to get into DFU mode reliably.

And of course same issue with the LEDs. Not had chance to work on it properly over christmas what with work and other crap

@CircuitBender
Copy link

CircuitBender commented Dec 29, 2017

I believe unplugging usb slightly and replugging it without losing power on the FC lets me connect after a few tries

  • dfu mode: check impulse rc`s driver fixer

@stronnag stronnag mentioned this pull request Dec 30, 2017
@digitalentity
Copy link
Member

@shellixyz what's the status of this PR? I've received my board today, ready to test and debug 😄

@wx4cb
Copy link

wx4cb commented Dec 31, 2017

@digitalentity nice... it generally works with the exception of the servo outputs being mapped wrong (see above) and the LED strip. I have it running on a calypso with an m8n gps and i2c compass, due to the output issues with the servos i cannot really test any further, plus with work i haven't had much time to play,

Here's a YT video from the other day (ignore the compass crap it's not REALLY calibrated :D
https://www.youtube.com/watch?v=-h4shq2lArM

@digitalentity
Copy link
Member

I'm taking this over. Superseded by #2637

@tasi0000
Copy link

tasi0000 commented Jan 4, 2018

Gents, where can we find the latest .hex now? is it still the r7?

@tasi0000
Copy link

tasi0000 commented Jan 4, 2018

@wx4cb what servo output issues are you running into?
I tested this on a flying wing and all outputs worked fine.

@wx4cb
Copy link

wx4cb commented Jan 4, 2018

i haven't tested it since @digitalentity took it over - work, holidays etc. but basically the rudder channel was on "motor 6" which doesn't exist on that board

@tasi0000
Copy link

tasi0000 commented Jan 4, 2018

@wx4cb alright! must have missed the regular plane setup part :) thanx buddy!
what about the hex? would you know where to find the latest? @digitalentity any input ?

@wx4cb
Copy link

wx4cb commented Jan 17, 2018

@digitalentity @shellixyz i'm ready to reflash with whatever we have. where can i find the latest code etc? is it in the main branch yet ?

@shellixyz shellixyz deleted the BETAFLIGHTF4_target branch February 3, 2018 17:57
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.

7 participants