PageSourceSearch

https://betaflight.com/assets/js/202cd1c0.8ab8ffc6.js

js betaflight.com collected 2026-10-03 19:39:20 UTC 16,452 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([["24689"],{60213(e,n,t){t.r(n),t.d(n,{metadata:()=>i,default:()=>c,frontMatter:()=>o,contentTitle:()=>d,toc:()=>a,assets:()=>l});var i=JSON.parse('{"id":"wiki/boards/legacy/SPARKY","title":"Sparky","description":"The Sparky is a very low cost and very powerful board.","source":"@site/docs/wiki/boards/legacy/SPARKY.md","sourceDirName":"wiki/boards/legacy","slug":"/wiki/boards/legacy/SPARKY","permalink":"/docs/wiki/boards/legacy/SPARKY","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{},"sidebar":"wiki","previous":{"title":"SIRINFPV","permalink":"/docs/wiki/boards/legacy/SIRINFPV"},"next":{"title":"Seriously Pro SP Racing F3 (Acro/Deluxe)","permalink":"/docs/wiki/boards/legacy/SPRACINGF3"}}'),r=t(74848),s=t(28453);let o={},d="Sparky",l={},a=[{value:"TODO",id:"todo",level:2},{value:"Via Device Firmware Upload (DFU, USB) - Windows",id:"via-device-firmware-upload-dfu-usb---windows",level:2},{value:"Via Device Firmware Upload (DFU, USB) - Mac OS X / Linux",id:"via-device-firmware-upload-dfu-usb---mac-os-x--linux",level:2},{value:"Via SWD",id:"via-swd",level:2},{value:"TauLabs bootloader",id:"taulabs-bootloader",level:2},{value:"Voltage Monitoring",id:"voltage-monitoring",level:2},{value:"Example Circuit",id:"example-circuit",level:3},{value:"Current Monitoring",id:"current-monitoring",level:2}];function h(e){let n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"sparky",children:"Sparky"})}),"\n",(0,r.jsx)(n.p,{children:"The Sparky is a very low cost and very powerful board."}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"3 hardware serial ports."}),"\n",(0,r.jsx)(n.li,{children:"Built-in serial port inverters which allows S.BUS receivers to be used without external inverters."}),"\n",(0,r.jsx)(n.li,{children:"USB (can be used at the same time as the serial ports)."}),"\n",(0,r.jsx)(n.li,{children:"10 PWM outputs."}),"\n",(0,r.jsx)(n.li,{children:"Dedicated PPM/SerialRX input pin."}),"\n",(0,r.jsx)(n.li,{children:"MPU9150 I2C Acc/Gyro/Mag"}),"\n",(0,r.jsx)(n.li,{children:"Baro"}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Tested with revision 1 & 2 boards."}),"\n",(0,r.jsx)(n.h2,{id:"todo",children:"TODO"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Display (via Flex port)"}),"\n",(0,r.jsx)(n.li,{children:"SoftSerial - though having 3 hardware serial ports makes it a little redundant."}),"\n",(0,r.jsx)(n.li,{children:"Airplane PWM mappings."}),"\n"]}),"\n",(0,r.jsx)(n.h1,{id:"voltage-and-current-monitoring-adc-support",children:"Voltage and Current Monitoring (ADC Support)"}),"\n",(0,r.jsxs)(n.p,{children:["Voltage monitoring is possible when enabled via PWM9 pin and current can be monitored via PWM8 pin. The voltage divider and current sensor need to be connected externally. The vbatscale cli parameter need to be adjusted to fit the sensor specification. For more details regarding the sensor hardware you can check here: ",(0,r.jsx)(n.a,{href:"https://github.com/TauLabs/TauLabs/wiki/User-Guide:-Battery-Configuration",children:"https://github.com/TauLabs/TauLabs/wiki/User-Guide:-Battery-Configuration"})]}),"\n",(0,r.jsx)(n.h1,{id:"flashing",children:"Flashing"}),"\n",(0,r.jsx)(n.h2,{id:"via-device-firmware-upload-dfu-usb---windows",children:"Via Device Firmware Upload (DFU, USB) - Windows"}),"\n",(0,r.jsxs)(n.p,{children:["These instructions are for flashing the Sparky board under Windows using DfuSE.\nCredits go to Thomas Shue (Full video of the below steps can be found here: ",(0,r.jsx)(n.a,{href:"https://www.youtube.com/watch?v=I4yHiRVRY94",children:"https://www.youtube.com/watch?v=I4yHiRVRY94"}),")"]}),"\n",(0,r.jsxs)(n.p,{children:["Required Software:\nDfuSE Version 3.0.2 (latest version 3.0.4 causes errors): ",(0,r.jsx)(n.a,{href:"http://code.google.com/p/multipilot32/downloads/detail?name=DfuSe.rar",children:"http://code.google.com/p/multipilot32/downloads/detail?name=DfuSe.rar"}),"\nSTM VCP Driver 1.4.0: ",(0,r.jsx)(n.a,{href:"http://www.st.com/web/en/catalog/tools/PF257938",children:"http://www.st.com/web/en/catalog/tools/PF257938"})]}),"\n",(0,r.jsx)(n.p,{children:"A binary file is required for DFU, not a .hex file. If one is not included in the release then build one as follows."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'Unpack DfuSE and the STM VCP Drivers into a folder on your Hardrive\nDownload the latest Sparky release (cleanflight_SPARKY.hex) from:\nhttps://github.com/cleanflight/cleanflight/releases and store it on your Hardrive\n\nIn your DfuSE folder go to BIN and start DfuFileMgr.exe\nSelect: "I want to GENERATE a DFUfile from S19,HEX or BIN files" press OK\nPress: "S19 or Hex.."\nGo to the folder where you saved the cleanflight_SPARKY.hex file, select it  and press open\n(you might need to change the filetype in the DfuSE explorer window to "hex Files (*.hex)" to be able to see the file)\nPress: "Generate" and select the .dfu output file and location\nIf all worked well you should see " Success for \'Image for lternate Setting 00 (ST..)\'!"\n\n'})}),"\n",(0,r.jsx)(n.p,{children:"Put the device into DFU mode by powering on the sparky with the bootloader pins temporarily bridged. The only light that should come on is the blue PWR led."}),"\n",(0,r.jsx)(n.p,{children:'Check the windows device manager to make sure the board is recognized correctly.\nIt should show up as "STM Device in DFU mode" under Universal Serial Bus Controllers'}),"\n",(0,r.jsx)(n.p,{children:'If it shows up as "STMicroelectronics Virtual COM" under Ports (COM & LPT) instead then the board is not in DFU mode. Disconnect the board, short the bootloader pins again while connecting the board.'}),"\n",(0,r.jsx)(n.p,{children:'If the board shows up as "STM 32 Bootloader" device in the device manager, the drivers need to be updated manually.\nSelect the device in the device manager, press "update drivers", select "manual update drivers" and choose the location where you extracted the STM VCP Drivers, select "let me choose which driver to install". You should now be able to select either the STM32 Bootloader driver or the STM in DFU mode driver. Select the later and install.'}
1),"\n",(0,r.jsx)(n.p,{children:"Then flash the binary as below."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'In your DfuSE folder go to BIN and start DfuSeDemo.exe\nSelect the Sparky Board (STM in DFU Mode) from the Available DFU and compatible HID Devices drop down list\nPress "Choose.." at the bootom of the window and select the .dfu file created in the previous step\n"File correctly loaded" should appear in the status bar\nPress "Upgrade" and confirm with "Yes"\nThe status bar will show the upload progress and confirm that the upload is complete at the end\n\n'})}),"\n",(0,r.jsx)(n.p,{children:"Disconnect and reconnect the board from USB and continue to configure it via the Cleanflight configurator as per normal"}),"\n",(0,r.jsx)(n.h2,{id:"via-device-firmware-upload-dfu-usb---mac-os-x--linux",children:"Via Device Firmware Upload (DFU, USB) - Mac OS X / Linux"}),"\n",(0,r.jsx)(n.p,{children:"These instructions are for dfu-util, tested using dfu-util 0.7 for OSX from the OpenTX project."}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"http://www.open-tx.org/2013/07/15/dfu-util-07-for-mac-taranis-flashing-utility/",children:"http://www.open-tx.org/2013/07/15/dfu-util-07-for-mac-taranis-flashing-utility/"})}),"\n",(0,r.jsx)(n.p,{children:"A binary file is required for DFU, not a .hex file. If one is not included in the release then build one as follows."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"make TARGET=SPARKY clean\nmake TARGET=SPARKY binary\n"})}),"\n",(0,r.jsx)(n.p,{children:"Put the device into DFU mode by powering on the sparky with the bootloader pins temporarily bridged. The only light that should come on is the blue PWR led."}),"\n",(0,r.jsx)(n.p,{children:"Run 'dfu-util -l' to make sure the device is listed, as below."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'$ dfu-util -l\ndfu-util 0.7\n\nCopyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.\nCopyright 2010-2012 Tormod Volden and Stefan Schmidt\nThis program is Free Softw
1are and has ABSOLUTELY NO WARRANTY\nPlease report bugs to [email protected]\n\nFound DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash  /0x08000000/128*0002Kg"\nFound DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=1, name="@Option Bytes  /0x1FFFF800/01*016 e"\n'})}),"\n",(0,r.jsx)(n.p,{children:"Then flash the binary as below."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"dfu-util -D obj/cleanflight_SPARKY.bin --alt 0 -R -s 0x08000000\n"})}),"\n",(0,r.jsx)(n.p,{children:"The output should be similar to this:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'dfu-util 0.7\n\nCopyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.\nCopyright 2010-2012 Tormod Volden and Stefan Schmidt\nThis program is Free Software and has ABSOLUTELY NO WARRANTY\nPlease report bugs to [email protected]\n\nOpening DFU capable USB device... ID 0483:df11\nRun-time device DFU version 011a\nFound DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash  /0x08000000/128*0002Kg"\nClaiming USB DFU Interface...\nSetting Alternate Setting #0 ...\nDetermining device status: state = dfuERROR, status = 10\ndfuERROR, clearing status\nDetermining device status: state = dfuIDLE, status = 0\ndfuIDLE, continuing\nDFU mode device DFU version 011a\nDevice returned transfer size 2048\nNo valid DFU suffix signature\nWarning: File has no DFU suffix\nDfuSe interface name: "Internal Flash  "\nDownloading to address = 0x08000000, size = 76764\n......................................\nFile downloaded successfully\ncan\'t detach\nResetting USB to switch back to runtime mode\n\n'})}),"\n",(0,r.jsxs)(n.p,{children:["On Linux you might want to take care that the modemmanager isn't trying to use your sparky as modem getting it into bootloader mode while doing so. In doubt you probably want to uninstall it. It could also be good idea to get udev fixed. It looks like teensy did just that -> ",(0,r.jsx)(n.a,{href:"http://www.pjrc.com/teensy/49-teensy.rules",children:"http://www.pjrc.com/teensy/49-teensy.rules"})," (untested)"]}),"\n",(0,r.jsx)(n.p,{children:"To make a full chip erase you can use a file created by"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"dd if=/dev/zero of=zero.bin bs=1 count=262144\n"})}),"\n",(0,r.jsx)(n.p,{children:"This can be used by dfu-util."}),"\n",(0,r.jsx)(n.h2,{id:"via-swd",children:"Via SWD"}),"\n",(0,r.jsx)(n.p,{children:"On the bottom of the board there is an SWD header socket onto switch a JST-SH connector can be soldered.\nOnce you have SWD connected you can use the st-link or j-link tools to flash a binary."}),"\n",(0,r.jsx)(n.p,{children:"See Sparky schematic for CONN2 pinouts."}),"\n",(0,r.jsx)(n.h2,{id:"taulabs-bootloader",children:"TauLabs bootloader"}),"\n",(0,r.jsx)(n.p,{children:"Flashing cleanflight will erase the TauLabs bootloader, this is not a problem and can easily be restored using the st flashloader tool."}),"\n",(0,r.jsx)(n.h1,{id:"serial-ports",children:"Serial Ports"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Value"}),(0,r.jsx)(n.th,{children:"Identifier"}),(0,r.jsx)(n.th,{children:"RX"}),(0,r.jsx)(n.th,{children:"TX"}),(0,r.jsx)(n.th,{children:"Notes"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"1"}),(0,r.jsx)(n.td,{children:"USB VCP"}),(0,r.jsx)(n.td,{children:"RX (USB)"}),(0,r.jsx)(n.td,{children:"TX (USB)"}),(0,r.jsx)(n.td,{})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"2"}),(0,r.jsx)(n.td,{children:"USART1"}),(0,r.jsx)(n.td,{children:"RX / PB7"}),(0,r.jsx)(n.td,{children:"TX / PB6"}),(0,r.jsx)(n.td,{children:"Conn1 / Flexi Port."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"3"}),(0,r.jsx)(n.td,{children:"USART2"}),(0,r.jsx)(n.td,{children:"RX / PA3"}),(0,r.jsx)(n.td,{children:"PWM6 / PA2"}),(0,r.jsx)(n.td,{children:"On RX is on INPUT header. Best port for Serial RX input"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"4"}),(0,r.jsx)(n.td,{children:"USART3"}),(0,r.jsx)(n.td,{children:"RX / PB11"}),(0,r.jsx)(n.td,{children:"TX / PB10"}),(0,r.jsx)(n.td,{children:"RX/TX is on one end of the 6-pin header above the PWM outputs."})]})]})]}),"\n",(0,r.jsxs)(n.p,{children:["USB VCP ",(0,r.jsx)(n.em,{children:"can"})," be used at the same time as other serial ports (unlike Naze32)."]}),"\n",(0,r.jsx)(n.p,{children:"All USART ports all support automatic hardware inversion which allows direct connection of serial rx re
1ceivers like the FrSky X4RSB - no external inverter needed."}),"\n",(0,r.jsx)(n.h1,{id:"sonar-connections",children:"Sonar Connections"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Pin"}),(0,r.jsx)(n.th,{children:"Signal"}),(0,r.jsx)(n.th,{children:"Function"}),(0,r.jsx)(n.th,{children:"Resistor"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"PWM6"}),(0,r.jsx)(n.td,{children:"PA2"}),(0,r.jsx)(n.td,{children:"Trigger pin"}),(0,r.jsx)(n.td,{children:"1K Ohm"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"PWM7"}),(0,r.jsx)(n.td,{children:"PB1"}),(0,r.jsx)(n.td,{children:"Echo pin"}),(0,r.jsx)(n.td,{children:"1K Ohm"})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"WARNING: Both PWM6 and PWM7 pins are NOT 5 volt tolerant, so a 1K Ohm resistor is required between the sensor and the FC pins."}),"\n",(0,r.jsx)(n.h1,{id:"battery-monitoring-connections",children:"Battery Monitoring Connections"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Pin"}),(0,r.jsx)(n.th,{children:"Signal"}),(0,r.jsx)(n.th,{children:"Function"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"PWM9"}),(0,r.jsx)(n.td,{children:"PA4"}),(0,r.jsx)(n.td,{children:"Battery Voltage"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"PWM8"}),(0,r.jsx)(n.td,{children:"PA7"}),(0,r.jsx)(n.td,{children:"Current Meter"})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"voltage-monitoring",children:"Voltage Monitoring"}),"\n",(0,r.jsx)(n.p,{children:"The Sparky has no battery divider cricuit, PWM9 has an inline 10k resistor which has to be factored into the resistor calculations.\nThe divider circuit should eventally create a voltage between 0v and 3.3v (MAX) at the MCU input pin."}),"\n",(0,r.jsxs)(n.p,{children:["WARNING: Double check the output of your voltage divider using a voltmeter ",(0,r.jsx)(n.em,{children:"before"})," connecting to the FC."]}),"\n",(0,r.jsx)(n.h3,{id:"example-circuit",children:"Example Circuit"}),"\n",(0,r.jsx)(n.p,{children:"For a 3Cell battery divider the following circuit works:"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"Battery (+) ---< R1 >--- PWM9 ---< R2 >--- Battery (-)"})}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"R1 = 8k2 (Grey Red Red)"}),"\n",(0,r.jsx)(n.li,{children:"R2 = 2k0 (Red Black Red)"}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["This gives a 2.2k for an 11.2v battery. The ",(0,r.jsx)(n.code,{children:"vbat_scale"})," for this divider should be set around ",(0,r.jsx)(n.code,{children:"52"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"current-monitoring",children:"Current Monitoring"}),"\n",(0,r.jsx)(n.p,{children:"Connect a current sensor to PWM8/PA7 that gives a range between 0v and 3.3v out (MAX)."})]})}function c(e={}){let{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},28453(e,n,t){t.d(n,{R:()=>o,x:()=>d});var i=t(96540);let r={},s=i.createContext(r);function o(e){let n=i.useContext(s);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.