Saturday, October 18, 2014

OpenPilot com stm32f103vet6, FreeRTOS e USB HID

O Openpilot é um projeto para criação de UAVs.
O projeto faz uso de microcontroladores STM32.



O modelo mais básico usa um stm32f103cb com 20kb de ram e 128kb de flash, um sensor mpu6050 e mais uma memória spi de 8mb para logs de vôo.
O software é baseado no FreeRTOS que é um RTOS de código aberto que apenas 3 arquivos C provê threads, mutex, queues, e muito mais. Também possui um bootloader que faz isso da porta USB como dispositivo HID.

Em teoria qualquer stm32 com configuração maior ou igual ao stm32f103cb pode rodar o software do Openpilot e sair voando por ai.

Comecei um teste usando o stm32f103vet6 que tem 64kb de ram e 512kb de flash, um sensor mpu6050, e removendo a memória spi de 8mb do projeto inicial.
Segue os passos do experimento feito no Ubuntu 14.04:

# obter o código fonte
git clone https://github.com/openpilot/OpenPilot.git
cd OpenPilot

------------------------------------------------------------------------------

1) No ubuntu

Instalar o GNU ARM embedded que é mantido pela própria ARM.
(ARM employees are maintaining this project.)

https://launchpad.net/gcc-arm-embedded

Step1: Inside Ubuntu, open a terminal and input
       "sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded"
Step2: Continue to input
       "sudo apt-get update"
Step3: Continue to input to install toolchain
       "sudo apt-get install gcc-arm-none-eabi"


2) No ArchLinux

# instala o toolchain para cross compilar com o GNU ARM embedded
make arm_sdk_install

 no Archlinux é preciso habilitar o repositorio multilib e instalar o skype ou wine para instalar as lib32* que o U ARM Embedded depende.

# muda o path se necessário
export PATH=$PWD/tools/gcc-arm-none-eabi-4_8-2014q1/bin/:$PATH

------------------------------------------------------------------------------

#limpar tudo
21:16:11 murix@localhost:~/workspace/OpenPilot$make all_clean
 CLEAN      build

# gerar o firmware completo (bootloader+app)
21:17:07 murix@localhost:~/workspace/OpenPilot$make ef_coptercontrol


Making bootloader for CopterControl, board revision 0x02
Use BOARD_REVISION=1 for CC, BOARD_REVISION=2 for CC3D (default)
 AS          flight/pios/stm32f10x/startup_stm32f10x_MD_CC.S
 CC          flight/pios/stm32f10x/libraries/CMSIS/Core/CM3/system_stm32f10x.c
 CC          flight/pios/stm32f10x/pios_adc.c
 CC          flight/pios/stm32f10x/pios_bkp.c
 CC          flight/pios/stm32f10x/pios_bl_helper.c
 CC          flight/pios/stm32f10x/pios_debug.c
 CC          flight/pios/stm32f10x/pios_delay.c
 CC          flight/pios/stm32f10x/pios_dsm.c
 CC          flight/pios/stm32f10x/pios_eeprom.c
 CC          flight/pios/stm32f10x/pios_exti.c
 CC          flight/pios/stm32f10x/pios_flash_internal.c
 CC          flight/pios/stm32f10x/pios_gpio.c
 CC          flight/pios/stm32f10x/pios_i2c.c
 CC          flight/pios/stm32f10x/pios_irq.c
 CC          flight/pios/stm32f10x/pios_ppm.c
 CC          flight/pios/stm32f10x/pios_ppm_out.c
 CC          flight/pios/stm32f10x/pios_pwm.c
 CC          flight/pios/stm32f10x/pios_rtc.c
 CC          flight/pios/stm32f10x/pios_servo.c
 CC          flight/pios/stm32f10x/pios_spi.c
 CC          flight/pios/stm32f10x/pios_sys.c
 CC          flight/pios/stm32f10x/pios_tim.c
 CC          flight/pios/stm32f10x/pios_usart.c
 CC          flight/pios/stm32f10x/pios_usb.c
 CC          flight/pios/stm32f10x/pios_usb_cdc.c
 CC          flight/pios/stm32f10x/pios_usb_hid.c
 CC          flight/pios/stm32f10x/pios_usb_hid_istr.c
 CC          flight/pios/stm32f10x/pios_usb_hid_pwr.c
 CC          flight/pios/stm32f10x/pios_usb_rctx.c
 CC          flight/pios/stm32f10x/pios_usbhook.c
 CC          flight/pios/stm32f10x/pios_wdg.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/misc.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_adc.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_bkp.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_can.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_cec.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_crc.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_dac.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_dbgmcu.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_dma.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_exti.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_fsmc.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_iwdg.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_pwr.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_rtc.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_sdio.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_spi.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_tim.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_wwdg.c
 CC          flight/pios/stm32f10x/libraries/STM32_USB-FS-Device_Driver/src/usb_core.c
 CC          flight/pios/stm32f10x/libraries/STM32_USB-FS-Device_Driver/src/usb_init.c
 CC          flight/pios/stm32f10x/libraries/STM32_USB-FS-Device_Driver/src/usb_int.c
 CC          flight/pios/stm32f10x/libraries/STM32_USB-FS-Device_Driver/src/usb_mem.c
 CC          flight/pios/stm32f10x/libraries/STM32_USB-FS-Device_Driver/src/usb_regs.c
 CC          flight/pios/stm32f10x/libraries/STM32_USB-FS-Device_Driver/src/usb_sil.c
 CC          flight/targets/boards/coptercontrol/pios_usb_board_data.c
 CC          flight/targets/boards/coptercontrol/bootloader/main.c
 CC          flight/targets/boards/coptercontrol/bootloader/pios_board.c
 CC          flight/pios/common/pios_board_info.c
 CC          flight/pios/common/pios_com_msg.c
 CC          flight/pios/common/pios_iap.c
 CC          flight/pios/common/pios_usb_desc_hid_only.c
 CC          flight/pios/common/pios_usb_util.c
 CC          flight/pios/common/pios_led.c
 CC          flight/libraries/op_dfu.c
 CC          flight/libraries/printf-stdarg.c
 LD          build/bl_coptercontrol/bl_coptercontrol.elf
 BIN/HEX     build/bl_coptercontrol/bl_coptercontrol.bin
compiling ../../ground/uavobjgenerator/main.cpp
compiling ../../ground/uavobjgenerator/uavobjectparser.cpp
compiling ../../ground/uavobjgenerator/generators/generator_io.cpp
compiling ../../ground/uavobjgenerator/generators/java/uavobjectgeneratorjava.cpp
compiling ../../ground/uavobjgenerator/generators/flight/uavobjectgeneratorflight.cpp
compiling ../../ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp
compiling ../../ground/uavobjgenerator/generators/matlab/uavobjectgeneratormatlab.cpp
compiling ../../ground/uavobjgenerator/generators/python/uavobjectgeneratorpython.cpp
compiling ../../ground/uavobjgenerator/generators/wireshark/uavobjectgeneratorwireshark.cpp
compiling ../../ground/uavobjgenerator/generators/generator_common.cpp
linking uavobjgenerator
- OpenPilot UAVObject Generator -
Done: processed 101 XML files and generated 101 objects with no ID collisions. Total size of the data fields is 3923 bytes.
generating flight code
 AS          flight/pios/stm32f10x/startup_stm32f10x_MD_CC.S
 CC          flight/libraries/notification.c
 CC          flight/pios/stm32f10x/libraries/CMSIS/Core/CM3/system_stm32f10x.c
 CC          flight/targets/boards/coptercontrol/pios_usb_board_data.c
 CC          flight/modules/System/systemmod.c
 CC          flight/targets/boards/coptercontrol/firmware/coptercontrol.c
 CC          flight/targets/boards/coptercontrol/firmware/pios_board.c
 CC          flight/libraries/alarms.c
 CC          flight/libraries/instrumentation.c
 CC          flight/uavtalk/uavtalk.c
 CC          flight/uavobjects/uavobjectmanager.c
 CC          flight/uavobjects/eventdispatcher.c
 CC          build/uavobject-synthetics/flight/accessorydesired.c
 CC          build/uavobject-synthetics/flight/objectpersistence.c
 CC          build/uavobject-synthetics/flight/gcstelemetrystats.c
 CC          build/uavobject-synthetics/flight/flighttelemetrystats.c
 CC          build/uavobject-synthetics/flight/faultsettings.c
 CC          build/uavobject-synthetics/flight/flightstatus.c
 CC          build/uavobject-synthetics/flight/systemstats.c
 CC          build/uavobject-synthetics/flight/systemalarms.c
 CC          build/uavobject-synthetics/flight/systemsettings.c
 CC          build/uavobject-synthetics/flight/stabilizationdesired.c
 CC          build/uavobject-synthetics/flight/stabilizationsettings.c
 CC          build/uavobject-synthetics/flight/stabilizationsettingsbank1.c
 CC          build/uavobject-synthetics/flight/stabilizationsettingsbank2.c
 CC          build/uavobject-synthetics/flight/stabilizationsettingsbank3.c
 CC          build/uavobject-synthetics/flight/stabilizationstatus.c
 CC          build/uavobject-synthetics/flight/stabilizationbank.c
 CC          build/uavobject-synthetics/flight/actuatorcommand.c
 CC          build/uavobject-synthetics/flight/actuatordesired.c
 CC          build/uavobject-synthetics/flight/actuatorsettings.c
 CC          build/uavobject-synthetics/flight/accelstate.c
 CC          build/uavobject-synthetics/flight/accelgyrosettings.c
 CC          build/uavobject-synthetics/flight/gyrostate.c
 CC          build/uavobject-synthetics/flight/attitudestate.c
 CC          build/uavobject-synthetics/flight/manualcontrolcommand.c
 CC          build/uavobject-synthetics/flight/i2cstats.c
 CC          build/uavobject-synthetics/flight/watchdogstatus.c
 CC          build/uavobject-synthetics/flight/manualcontrolsettings.c
 CC          build/uavobject-synthetics/flight/flightmodesettings.c
 CC          build/uavobject-synthetics/flight/mixersettings.c
 CC          build/uavobject-synthetics/flight/firmwareiapobj.c
 CC          build/uavobject-synthetics/flight/attitudesettings.c
 CC          build/uavobject-synthetics/flight/camerastabsettings.c
 CC          build/uavobject-synthetics/flight/cameradesired.c
 CC          build/uavobject-synthetics/flight/gpspositionsensor.c
 CC          build/uavobject-synthetics/flight/gpsvelocitysensor.c
 CC          build/uavobject-synthetics/flight/gpssettings.c
 CC          build/uavobject-synthetics/flight/hwsettings.c
 CC          build/uavobject-synthetics/flight/gcsreceiver.c
 CC          build/uavobject-synthetics/flight/receiveractivity.c
 CC          build/uavobject-synthetics/flight/relaytuningsettings.c
 CC          build/uavobject-synthetics/flight/relaytuning.c
 CC          build/uavobject-synthetics/flight/taskinfo.c
 CC          build/uavobject-synthetics/flight/callbackinfo.c
 CC          build/uavobject-synthetics/flight/mixerstatus.c
 CC          build/uavobject-synthetics/flight/ratedesired.c
 CC          build/uavobject-synthetics/flight/barosensor.c
 CC          build/uavobject-synthetics/flight/txpidsettings.c
 CC          build/uavobject-synthetics/flight/airspeedstate.c
 CC          build/uavobject-synthetics/flight/mpu6000settings.c
 CC          build/uavobject-synthetics/flight/perfcounter.c
 CC          flight/pios/common/libraries/FreeRTOS/Source/croutine.c
 CC          flight/pios/common/libraries/FreeRTOS/Source/event_groups.c
 CC          flight/pios/common/libraries/FreeRTOS/Source/list.c
 CC          flight/pios/common/libraries/FreeRTOS/Source/queue.c
 CC          flight/pios/common/libraries/FreeRTOS/Source/tasks.c
 CC          flight/pios/common/libraries/FreeRTOS/Source/timers.c
 CC          flight/pios/stm32f10x/pios_adc.c
 CC          flight/pios/stm32f10x/pios_bkp.c
 CC          flight/pios/stm32f10x/pios_bl_helper.c
 CC          flight/pios/stm32f10x/pios_debug.c
 CC          flight/pios/stm32f10x/pios_delay.c
 CC          flight/pios/stm32f10x/pios_dsm.c
 CC          flight/pios/stm32f10x/pios_eeprom.c
 CC          flight/pios/stm32f10x/pios_exti.c
 CC          flight/pios/stm32f10x/pios_flash_internal.c
 CC          flight/pios/stm32f10x/pios_gpio.c
 CC          flight/pios/stm32f10x/pios_i2c.c
 CC          flight/pios/stm32f10x/pios_irq.c
 CC          flight/pios/stm32f10x/pios_ppm.c
 CC          flight/pios/stm32f10x/pios_ppm_out.c
 CC          flight/pios/stm32f10x/pios_pwm.c
 CC          flight/pios/stm32f10x/pios_rtc.c
 CC          flight/pios/stm32f10x/pios_servo.c
 CC          flight/pios/stm32f10x/pios_spi.c
 CC          flight/pios/stm32f10x/pios_sys.c
 CC          flight/pios/stm32f10x/pios_tim.c
 CC          flight/pios/stm32f10x/pios_usart.c
 CC          flight/pios/stm32f10x/pios_usb.c
 CC          flight/pios/stm32f10x/pios_usb_cdc.c
 CC          flight/pios/stm32f10x/pios_usb_hid.c
 CC          flight/pios/stm32f10x/pios_usb_hid_istr.c
 CC          flight/pios/stm32f10x/pios_usb_hid_pwr.c
 CC          flight/pios/stm32f10x/pios_usb_rctx.c
 CC          flight/pios/stm32f10x/pios_usbhook.c
 CC          flight/pios/stm32f10x/pios_wdg.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/misc.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_adc.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_bkp.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_can.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_cec.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_crc.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_dac.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_dbgmcu.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_dma.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_exti.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_fsmc.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_iwdg.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_pwr.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_rtc.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_sdio.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_spi.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_tim.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c
 CC          flight/pios/stm32f10x/libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_wwdg.c
 CC          flight/pios/stm32f10x/libraries/STM32_USB-FS-Device_Driver/src/usb_core.c
 CC          flight/pios/stm32f10x/libraries/STM32_USB-FS-Device_Driver/src/usb_init.c
 CC          flight/pios/stm32f10x/libraries/STM32_USB-FS-Device_Driver/src/usb_int.c
 CC          flight/pios/stm32f10x/libraries/STM32_USB-FS-Device_Driver/src/usb_mem.c
 CC          flight/pios/stm32f10x/libraries/STM32_USB-FS-Device_Driver/src/usb_regs.c
 CC          flight/pios/stm32f10x/libraries/STM32_USB-FS-Device_Driver/src/usb_sil.c
 CC          flight/pios/common/libraries/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c
 CC          flight/pios/common/libraries/FreeRTOS/Source/portable/MemMang/heap_1.c
 CC          flight/pios/common/pios_adxl345.c
 CC          flight/pios/common/pios_bma180.c
 CC          flight/pios/common/pios_bmp085.c
 CC          flight/pios/common/pios_etasv3.c
 CC          flight/pios/common/pios_gcsrcvr.c
 CC          flight/pios/common/pios_hcsr04.c
 CC          flight/pios/common/pios_hmc5843.c
 CC          flight/pios/common/pios_hmc5883.c
 CC          flight/pios/common/pios_i2c_esc.c
 CC          flight/pios/common/pios_l3gd20.c
 CC          flight/pios/common/pios_mpu6000.c
 CC          flight/pios/common/pios_mpxv.c
 CC          flight/pios/common/pios_ms4525do.c
 CC          flight/pios/common/pios_ms5611.c
 CC          flight/pios/common/pios_oplinkrcvr.c
 CC          flight/pios/common/pios_video.c
 CC          flight/pios/common/pios_wavplay.c
 CC          flight/pios/common/pios_iap.c
 CC          flight/pios/common/pios_com.c
 CC          flight/pios/common/pios_com_msg.c
 CC          flight/pios/common/pios_crc.c
 CC          flight/pios/common/pios_flashfs_logfs.c
 CC          flight/pios/common/pios_flash_jedec.c
 CC          flight/pios/common/pios_debuglog.c
 CC          flight/pios/common/pios_deltatime.c
 CC          flight/pios/common/pios_rcvr.c
 CC          flight/pios/common/pios_rfm22b.c
 CC          flight/pios/common/pios_rfm22b_com.c
 CC          flight/pios/common/pios_sbus.c
 CC          flight/pios/common/pios_sdcard.c
 CC          flight/pios/common/pios_led.c
 CC          flight/pios/common/pios_usb_desc_hid_cdc.c
 CC          flight/pios/common/pios_usb_desc_hid_only.c
 CC          flight/pios/common/pios_usb_util.c
 CC          flight/pios/common/pios_task_monitor.c
 CC          flight/pios/common/pios_callbackscheduler.c
 CC          flight/pios/common/pios_notify.c
 CC          flight/pios/common/pios_instrumentation.c
 CC          flight/pios/common/pios_mem.c
 CC          flight/libraries/fifo_buffer.c
 CC          flight/libraries/sanitycheck.c
 CC          flight/libraries/CoordinateConversions.c
 CC          flight/libraries/math/sin_lookup.c
 CC          flight/libraries/math/pid.c
 CC          flight/libraries/math/mathmisc.c
 CC          flight/libraries/printf-stdarg.c
 CC          flight/modules/Attitude/attitude.c
 CC          flight/modules/Stabilization/altitudeloop.c
 CC          flight/modules/Stabilization/cruisecontrol.c
 CC          flight/modules/Stabilization/innerloop.c
 CC          flight/modules/Stabilization/outerloop.c
 CC          flight/modules/Stabilization/relay_tuning.c
 CC          flight/modules/Stabilization/stabilization.c
 CC          flight/modules/Stabilization/virtualflybar.c
 CC          flight/modules/Actuator/actuator.c
 CC          flight/modules/Receiver/receiver.c
 CC          flight/modules/ManualControl/armhandler.c
 CC          flight/modules/ManualControl/manualcontrol.c
 CC          flight/modules/ManualControl/manualhandler.c
 CC          flight/modules/ManualControl/pathfollowerhandler.c
 CC          flight/modules/ManualControl/pathplannerhandler.c
 CC          flight/modules/ManualControl/stabilizedhandler.c
 CC          flight/modules/ManualControl/takeofflocationhandler.c
 CC          flight/modules/FirmwareIAP/firmwareiap.c
 CC          flight/modules/Telemetry/telemetry.c
 CC          flight/modules/CameraStab/camerastab.c
 CC          flight/modules/ComUsbBridge/ComUsbBridge.c
 CC          flight/modules/GPS/GPS.c
 CC          flight/modules/GPS/NMEA.c
 CC          flight/modules/GPS/UBX.c
 CC          flight/modules/TxPID/txpid.c
 CC          flight/modules/Osd/osdoutput/osdoutput.c
 LD          build/fw_coptercontrol/fw_coptercontrol.elf
 BIN/HEX     build/fw_coptercontrol/fw_coptercontrol.bin
 FWINFO      build/fw_coptercontrol/fw_coptercontrol.bin.firmware_info.c
 CC          build/fw_coptercontrol/fw_coptercontrol.bin.firmware_info.c
 BIN/HEX     build/fw_coptercontrol/fw_coptercontrol.bin.firmware_info.bin
 OPFW        build/fw_coptercontrol/fw_coptercontrol.opfw
 FLASH_IMG   /home/murix/workspace/OpenPilot/build/ef_coptercontrol/ef_coptercontrol.bin
21:18:16 murix@localhost:~/workspace/OpenPilot$

#gravar por SWD
st-flash  write build/ef_coptercontrol/ef_coptercontrol.bin 0x08000000


STM32F103VET6 com Openpilot detectado como USB HID
Openpilot  Ground Control station (GCS)
bootloader reconhecido,
problema com o firmware que está resetando

Testando também o fork TauLabs (no Ubuntu 14.04 e no Archlinux)
https://github.com/TauLabs/TauLabs

# compila tudo
make package -j4
# gera imagem inteira da flash (bootloader+dados+app)
make ef_coptercontrol
# gravar a imagem no stm32f103vet6 com o stlink via SWD (pinos PA13 e PA14)
st-flash  write build/ef_coptercontrol/ef_coptercontrol.bin 0x08000000
# executa a ground control station
./build/ground/gcs/bin/taulabsgcs

Taulabs Ground Control station (GCS)
é um fork do Openpilot que tem mais placas e mais plugins.
O firmware para o stm32f103vet6 já ficou melhor, já está reconhecendo sem reboot,
porém nem o boot e nem o safeboot funcionaram ainda


Observações finais:

O Openpilot é muito bem estruturado.
Também é ótimo para quem quiser aprender a programar multi-linguagens (C, C++, Java).


A Control Ground Station (GCS) em Qt5 é muito completa e suporta plugins para estender ainda mais.

Também conta com Control Ground Station (GCS) para Android, então dá para pilot usando o telefone ou tablet pelo WiFi.

O firmware para placas STM32F1 (legado) e STM32F4 (atual),
contam com ajuda do FreeRTOS (que é um sistema operacional de real - RTOS - em apenas 3 arquivos),
também faz uso das placas USB configuradas como dispositivos HID,
possuem um bootloader com suporte USB.
O controle de vôo implementa um filtro estendido de Kalman (EKF) rodando a 500Hz é uma das melhores, senão a melhor solução conhecida.


No comments:

Post a Comment