-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 BF config to INAV target converter #9556
Conversation
The target can be used as a starting point for a full featured INAV target, but won't include any fixed wing functionality.
- Leds - Beeper - WS2811 - UART - SOFTSERIAL - SPI - I2C
Works for BEFH-BETAFPVF411.config Fails for HAMO-CRAZYBEEF4SX1280.config Still need to add ADC definition
+ unofficial target for betafpvf411 5a aio
Currently only cover AT32F435
Target files generated, probably needs reviewing pin mappings
Great! |
Quick and dirty test before I got to bed, doesn't seem to like the betaflight/AIKONF7 config
I'll look into it more tomorrow when I have some more braincells dancing together so I can give more useful feedback. Git status Untracked files: Git log |
OK testing it more (now that I am much more awake :) ) neither AIKONF4 or AIKONF7 work but when I do the one that you have in your example it works fine.
And doing a diff of the BETAFPVF405 vs AIKONF7 I see that as per the error message Looking at the gyro code (https://github.com/betaflight/betaflight/blob/master/src/main/pg/gyrodev.c#L62), it seems that the absence of the Adding |
OK finally got it compiled and it worked OK. There was some minor gremlins. It miscalculated? the number of serial ports for my target, not sure why but it said 4 serial ports when it should have said 5 (I think it didn't count the USB MCP), This caused UART_5 to be AWOL, was an easy fix thou. GRYO_1_ALIGN gremlin as mentioned above. File dropping was a bit buggy for me, running it the same way as I did in previous examples I had hit and miss behavior and it also dropped the target.c target.h and CMakeTarget.txt in the wrong directory (it dropped it into the PWD, which has to be src/utils otherwise it fails due to YAML error) instead of the third parameter directory. Not sure if that is a PEBKAC error on my part or bug in the code. I have a ton of hardware testing to do which I am not sure if I am going to get time to do it before I go back to work. I also have a lot of other priorities (like getting my target contribution completed, tested and PR submitted before I go back to work so I have time to answer any questions & apply any feedback) Overall the script is a beauty, definitely made my life getting to the point I am at waaaay easier. Nicely done mate :) |
No current fc lacks it.
@mbainrot Should be fixed now. Thanks for testing it. Let me know if this gets you in the air :) |
Thanks @mmosca I manually fixed the issues so I could get a PR moving (PR# 9603). But will retest and diff to see. There were problems in compilation with the baro which I had to fix too, I will reproduce them for you and also include the changes I did to get the baro bit to compile. In my late night post I forgot to mention those, sorry! But will do let you know once I get airborne on iNAV, just have to work out motor mixes (I built my quad up on betaflight so I hardware configured it for QUAD-X 1234, but iNAV doesn't seem to support that config) and finish testing the peripherals. The script was a huge help thou nonetheless, did all the hard stuff like figuring out the timers for me which was super helpful. |
Ok as promised here is the error I now get after generating the target, this is the baro related error that I forgot to talk about in my post last night 😅
This is the code generated before me going in and tweaking with it
This is the code after
Doing some digging it's to do with the
But we haven't set I am not sure of what the best fix would be for you, whether you can do some logic to only add the specific baro based on what it detects when it adds the USE_BARO_SPI_BMP280 or whether it's a wider bug that's outside the scope of this script. The risk with the logic is it creates a massive rabbit hole for you to figure out the mapping for But nonetheless, hopefully this info helps 😄 edit: Forgot to add, the changes worked a treat! it still dumps the files in the present working directory but everything else works a treat |
Seems to be ok now.
|
Yup works a treat for me, thanks!
|
bf2inav.py: clearer error messages, number PWM outputs
I did some testing on this as well, and added a couple things. I note it doesn't change anything in the INAV code and so can't break anything, as I mash the merge button. |
Add a script that can generate a workable INAV target, from a config.h from https://github.com/betaflight/config.
The generated target, while not perfect, often works.
User may need to fine tune the timer selection to be able to use DSHOT or to get an optimal distribution of outputs and timers.
Example usage:
TODO: