mr_w

  • *
  • 207
    • LibrePilot
F3 based flight controller firmware support
« on: January 12, 2017, 01:01:39 pm »
Beecore (and also another one that is used on Eachine QX70) is based off SPRacing F3_EVO platform, and all the basic hardware features do work. Hardware drivers that are not implemented yet are led strip ir transponder, sonar, buzzer and sdcard logging. On the firmware side, F3 support is more like F4 board than F1, so even gps navigation flight should be possible.

Flight controller boards that do work so far:
  • Seriously Pro SPRacingF3
  • Seriously Pro SPRacingF3 EVO (and others based on same reference design, such as Beecore, FrSky XMPF3E)
  • Furious FPV PikoBLX
  • tinyFISH FC
  • STM NucleoF303RE development board
  • CCF3D (CC3D with F303 MCU)

Install instructions:

For SPRacingF3 EVO, PikoBLX and tinyFISH FC which have full USB connectivity (unlike older non-evo spracingf3), one should first build bootloader in hex format.

Code: [Select]
make bl_spracingf3evo_hexor
Code: [Select]
make bl_pikoblx_hex
That will give fair amount of output, ending with line
Code: [Select]
BIN/HEX     ...../build/firmware/bl_pikoblx/bl_pikoblx.hex
This is full path to .hex file which is good for flashing with Cleanflight or Betaflight configurator. This is easiest way. After flashing the bootloader, CF/BF configurator will not connect to the board anymore. Time to use LP GCS: Disconnect your F3 board, hit 'Upgrade' button on Firmware tab and follow instructions.

The branch with F3 support, which is work-in-progress, currently being reviewed for merge in next can be found at https://bitbucket.org/mindnever/librepilot/branch/LP-512_Support_F3_boards

Update May 30, 2017:
- again new branch name (sorry), now accessible from pull-request: https://bitbucket.org/librepilot/librepilot/pull-requests/426 or as directly here https://bitbucket.org/mindnever/librepilot/branch/LP-512_Support_F3_boards
- tinyFISH FC board support

Update: April 28, 2017:
- New branch name - it is now https://bitbucket.org/mindnever/librepilot/branch/LP-512_F3_board_support
- PikoBLX board support
- Fixed PPM input on SPracingF3 EVO
- Merged in newest next
- Merged in DSHOT support
- Merged in LP-480
- make package builds all boards again

Update: March 16, 2017:
- WS2811 led strip driver is now included (Betaflight port ;)). Notifications are the same as on F4 boards (Revo, Sparky2) [ https://librepilot.atlassian.net/wiki/display/LPDOC/Setup+WS281x+Led - with exception that configuration is not HWSettings > WS2811LED_Out, but rather HWBoardNameSettings -> LEDPort ]
- make package will build package with F3 firmware only

Update: March 01, 2017:
I have pushed some updates in F3 branch (which is still work in progress, but getting tested daily):

- ADC driver, so reading analog voltage/current/rssi sensors is now possible.
- Fix for settings save error / hang.
- Fix for usart initialization error that prevented some protocols from working (for example MSP for osd, etc).
- Fix for usb cdc (virtual com port) baud rate negotiation - so ComBridge is now working again.
« Last Edit: May 30, 2017, 10:47:12 pm by mr_w »

Re: Re: TinyPilot F3?
« Reply #1 on: January 12, 2017, 07:57:56 pm »
That's great!  I was considering doing this myself as I have built several SP F3 brushed micro quads and wanted to run Librepilot.  If you can use any help testing or anything let me know.  I several SP F3 variants on hand.


mr_w

  • *
  • 207
    • LibrePilot
Re: Re: TinyPilot F3?
« Reply #2 on: January 13, 2017, 12:24:44 pm »
@jcoffman98

EVO versions are easier to work on, as they have USB port attached directly to F3, and it works with GCS just like any other LP supported board. non-evo has USB-UART bridge and fw updating is trickier - currently not possible from GCS. Also, it seems that currently non-evo have slightly higher cpu load than EVO boards, which might be due to different connection being used for gyro/acc connection. (EVO uses spi and non-evo i2c).

Re: Re: TinyPilot F3?
« Reply #3 on: January 13, 2017, 11:09:05 pm »
Hello,

I have both the brushed EVO and none EVO.  I was going to try the EVO version first.  So I've built the evo firmware and bootloader  from your branch.  I am not clear on how to reflash this since it had cleanflight on it originally.  I've searched around and found some instructions that use the STM32 flash demonstrator but this board comes up in DFU mode and it appears I need another tool.  I am new to STM uC's so I am muddling through it.  What is the best procedure to flash this board?

Thanks

mr_w

  • *
  • 207
    • LibrePilot
Re: Re: TinyPilot F3?
« Reply #4 on: January 13, 2017, 11:12:24 pm »
Best thing is to get dfu-util and then use it to flash .bin file to "Internal Flash" section.

For initial flash of the bootloader (and rest of it), do make ef_spracingf3evo

Re: Re: TinyPilot F3?
« Reply #5 on: January 13, 2017, 11:48:44 pm »
I was just trying this:

https://forum.librepilot.org/index.php?topic=208

I installed the boot loader and it appears to come up at least the activity light is on.  Getting there I think.  Once the bootloader is flashed, I should be able to use gcs to install the fw?  I assume there is a new board ID or somthing so will need to build gcs out of your branch?

Thanks for your help


mr_w

  • *
  • 207
    • LibrePilot
Re: Re: TinyPilot F3?
« Reply #6 on: January 14, 2017, 12:15:00 am »
Flashing only bootloader should work, but for a reason or two, this probably won't work as expected, yet ;) You will be better with flashing entire flash image (make ef_spracingf3evo), but after you get it running (familiar blinking led), GCS should connect just fine and you'll be able to update via GCS.


Re: Re: TinyPilot F3?
« Reply #7 on: January 14, 2017, 12:36:08 am »
i got everything working...but got still problems with output...used channel 1-4 with 32Hz (cause cleanflight uses a value of 32000), but when i connect battery, motors starts spinning, even if i put 500us to the output...any ideas? Do i need some special config? Different channels?
Another problem is that ATTI is red...

board is SPRacing F3 EVO Brush...
Hardware: F450 Frame--Revolution Board--EMax 2213-935kv--BullTec 30A Opto--5000mAh 3S 30C LiPo--NEO M8N GPS+MAG--Fr Sky Taranis Plus + OPLink Mini
Addon: sj5000x + two axis gimbal + minimosd + eachine VT + easycap
Software: Black Rhino, LP2GO

hwh

  • *
  • 1018
Re: Re: TinyPilot F3?
« Reply #8 on: January 14, 2017, 12:40:21 am »
jcoffman98  since you mentioned CleanFlight I thought I'd pass on another tip.  For boards that go into DFU the CF configurator will flash anything on the board if you have a hex file.  So does the BetaFlight one.  For bin files I often use the RaceFlight configurator since unlike the other two it flashes bin files instead of hex. I use them to flash boards back and forth to different project's firmware all the time.

If you don't have the right format file (hex or bin) it's easy to convert between them.
Code: [Select]
arm-none-eabi-objcopy -I binary -O ihex --set-start 0x8000000 ef_blahblah.bin ef_blahblah.hex

mr_w

  • *
  • 207
    • LibrePilot
Re: Re: TinyPilot F3?
« Reply #9 on: January 14, 2017, 12:43:08 am »
To fix ATTI alarm, this is due to missing barometer. No problem, just go to Attitude / Settings / Attitude State Algorithm and select Acro (No Sensors).


Output is more tricky, as you need to use System tab and change

Settings, Actuator Settings and set BankUpdateFreq to 4000 for banks 1 and 2
Set ChannelMax to 250 for channels 0,1,2 & 3.
ChannelNeutral to 10
and ChannelMin to 0. (all for channels 0,1,2 & 3)

Note: if you go to Output tab and change something there, this will probably mess up the settings, as this page is not really brushed-friendly yet.

With this settings you will get 4khz PWM switching speed, which can be annoying, but this is best thing for the moment. The problem is that with classic PWM, timers run at 1Mhz only, and for 4khz switching speed maximum period is 250uS with resolution of 1uS, gives 250 levels.. any higher speed would degrade resolution.

The high frequency PWM is definitely the problem separate from F3 support and will be addressed as such, hopefully soon.


Re: Re: TinyPilot F3?
« Reply #10 on: January 14, 2017, 12:57:31 am »
Thx! Works perfect now...Now teach me how to fly like you did in your video  ;D
Hardware: F450 Frame--Revolution Board--EMax 2213-935kv--BullTec 30A Opto--5000mAh 3S 30C LiPo--NEO M8N GPS+MAG--Fr Sky Taranis Plus + OPLink Mini
Addon: sj5000x + two axis gimbal + minimosd + eachine VT + easycap
Software: Black Rhino, LP2GO

Re: Re: TinyPilot F3?
« Reply #11 on: January 14, 2017, 01:14:53 am »
Well the entire flash image worked :)  So now its alive, just trying to figure out how configure it to work with my frsky.


Re: Re: TinyPilot F3?
« Reply #12 on: January 14, 2017, 01:54:33 am »
@DocHardinger

What TX are you using I can't seem to get my frsky with sbus working.

Re: Re: TinyPilot F3?
« Reply #13 on: January 14, 2017, 01:57:39 am »
Look under System>Settings>HWSPRacingF3EVOSettings>UARTPort and set Port 1 to S.Bus if you have connected your Receiver to Port 1
Then restart the board...Then you should be able to use the transmitter wizard

But be careful not to change to much settings because after changing to much settings my board wont accept saving anymore...after hit save anywhere, also under settings, the board disconnects and starts again and again and again.......only thing that helps then is to reflash the board ;-)
« Last Edit: January 14, 2017, 02:01:25 am by DocHardinger »
Hardware: F450 Frame--Revolution Board--EMax 2213-935kv--BullTec 30A Opto--5000mAh 3S 30C LiPo--NEO M8N GPS+MAG--Fr Sky Taranis Plus + OPLink Mini
Addon: sj5000x + two axis gimbal + minimosd + eachine VT + easycap
Software: Black Rhino, LP2GO

Re: Re: TinyPilot F3?
« Reply #14 on: January 14, 2017, 02:11:37 am »
Should be on UART 1 for me but no luck, I also set up the channel groups to be S.BUS for TRPY.  The receiver is bound and its the same board I had setup with cleanflight so I must still have something setup wrong.  Did you have to do anything for s.bus inversion?  Trying to remember if this board had an inverter built in
« Last Edit: January 14, 2017, 02:15:26 am by jcoffman98 »