HAL_F4Light: added support scripts for binaries with bootloader, fixed non-BL versions

This commit is contained in:
night-ghost 2018-03-19 15:31:06 +05:00 committed by Andrew Tridgell
parent a5934c721e
commit a3ebb5c069
30 changed files with 153 additions and 79 deletions

View File

@ -133,16 +133,13 @@
#define BOARD_DATAFLASH_PAGES 0x10000
#define BOARD_DATAFLASH_ERASE_SIZE (4096)// in bytes
#if 1// if board's dataflash supports 4k erases then we can use it as FAT and share it via USB
// if board's dataflash supports 4k erases then we can use it as FAT and share it via USB
#define BOARD_DATAFLASH_FATFS
#define BOARD_HAS_SDIO
#define USB_MASSSTORAGE
#define HAL_BOARD_LOG_DIRECTORY "0:"
#define HAL_BOARD_TERRAIN_DIRECTORY "0:/TERRAIN"
//#define HAL_PARAM_DEFAULTS_PATH "0:/defaults.parm"
#else
// old dataflash logs
#endif
#define BOARD_UARTS_LAYOUT 2

View File

@ -4,9 +4,7 @@
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduCopter/f4light_Airbot_bl.bin 0x08000000
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000
/usr/local/stlink/st-flash --reset write ../../../../../ArduCopter/f4light_Airbot.bin 0x08010000
/usr/local/stlink/st-util -m

View File

@ -4,9 +4,7 @@
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduPlane/f4light_Airbot_bl.bin 0x08000000 && \
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduPlane/f4light_Airbot.bin 0x08010000 && \
/usr/local/stlink/st-util -m

View File

@ -0,0 +1,8 @@
#!/bin/sh
#production binary for bootloader
dfu-util -a 0 --dfuse-address 0x08010000:leave -D ../../../../../ArduCopter/f4light_Airbot.bin
# bare metal binary
#dfu-util -a 0 --dfuse-address 0x08000000:unprotect:force -D ../../../../../ArduCopter/f4light_Airbot.bin

View File

@ -0,0 +1,12 @@
#!/bin/sh
# production binary with bootloader
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduCopter/f4light_Airbot_bl.bin 0x08000000
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000
/usr/local/stlink/st-util -m

View File

@ -0,0 +1,12 @@
#!/bin/sh
# production binary with bootloader
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduPlane/f4light_Airbot_bl.bin 0x08000000 && \
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000 && \
/usr/local/stlink/st-util -m

View File

@ -148,17 +148,7 @@
#define BOARD_DATAFLASH_NAME "dataflash"
#define BOARD_DATAFLASH_PAGES 0x2000
#define BOARD_DATAFLASH_ERASE_SIZE (65536)// in bytes
#if 0// use it as FAT and share it via USB
#define BOARD_DATAFLASH_FATFS
#define USB_MASSSTORAGE
#define HAL_BOARD_LOG_DIRECTORY "0:/"
#define HAL_BOARD_TERRAIN_DIRECTORY "0:/TERRAIN"
//#define HAL_PARAM_DEFAULTS_PATH "0:/APM/defaults.parm"
#else
// old dataflash logs
#endif
#define HAL_BOARD_LOG_DIRECTORY "" // should be defined to logs works
#define BOARD_UARTS_LAYOUT 1
#define USE_SOFTSERIAL 1
@ -186,10 +176,10 @@
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
//#define HAL_CONSOLE USB_Driver // console on USB
//#define HAL_CONSOLE_PORT 0 // USB
#define HAL_CONSOLE uart1Driver // console on radio
#define HAL_CONSOLE_PORT 1 // console on radio
#define HAL_CONSOLE USB_Driver // console on USB
#define HAL_CONSOLE_PORT 0 // USB
//#define HAL_CONSOLE uart1Driver // console on radio
//#define HAL_CONSOLE_PORT 1 // console on radio
/*
// @Param: FLEXI_I2C
@ -198,9 +188,8 @@
// @Values: 0:USART, 1:I2C
// @User: Advanced
AP_GROUPINFO("FLEXI_I2C", 6, AP_Param_Helper, _flexi_i2c, 0) \
*/
#define BOARD_HAL_VARINFO \
AP_GROUPINFO("FLEXI_I2C", 30, AP_Param_Helper, _flexi_i2c, 0),

View File

@ -4,9 +4,7 @@
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary or binary with bootloader
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduCopter/f4light_Revolution_bl.bin 0x08000000 && \
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduCopter/f4light_Revolution.bin 0x08010000 && \
/usr/local/stlink/st-util -m

View File

@ -4,9 +4,7 @@
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduPlane/f4light_Revolution_bl.bin 0x08000000 && \
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduPlane/f4light_Revolution.bin 0x08010000 && \
/usr/local/stlink/st-util -m

View File

@ -0,0 +1,12 @@
#!/bin/sh
# production binary without bootloader
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary or binary with bootloader
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../../ArduCopter/f4light_Revolution_bl.bin 0x08000000 && \
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000 && \
/usr/local/stlink/st-util -m

View File

@ -0,0 +1,12 @@
#!/bin/sh
# production binary with bootloader
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduPlane/f4light_Revolution_bl.bin 0x08000000 && \
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000 && \
/usr/local/stlink/st-util -m

View File

@ -149,15 +149,11 @@
#define BOARD_DATAFLASH_PAGES 0x10000
#define BOARD_DATAFLASH_ERASE_SIZE (4096)// in bytes
#if 1// use it as FAT and share it via USB
#define BOARD_DATAFLASH_FATFS
#define USB_MASSSTORAGE
#define HAL_BOARD_LOG_DIRECTORY "0:/"
#define HAL_BOARD_TERRAIN_DIRECTORY "0:/TERRAIN"
//#define HAL_PARAM_DEFAULTS_PATH "0:/APM/defaults.parm"
#else
// old dataflash logs
#endif
#define BOARD_UARTS_LAYOUT 1

View File

@ -49,3 +49,4 @@ TGT_BIN += $(OBJS_$(d))
d := $(dirstack_$(sp))
sp := $(basename $(sp))
include $(HARDWARE_PATH)/massstorage/rules.mk

View File

@ -4,9 +4,7 @@
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary or binary with bootloader
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduCopter/f4light_Revolution_SD_bl.bin 0x08000000 && \
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduCopter/f4light_Revolution_SD.bin 0x08010000 && \
/usr/local/stlink/st-util -m

View File

@ -4,9 +4,7 @@
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduPlane/f4light_Revolution_SD_bl.bin 0x08000000
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000
/usr/local/stlink/st-flash --reset write ../../../../../ArduPlane/f4light_Revolution_SD.bin 0x08010000
/usr/local/stlink/st-util -m

View File

@ -0,0 +1,12 @@
#!/bin/sh
# production binary without bootloader
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary or binary with bootloader
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../../ArduCopter/f4light_Revolution_SD_bl.bin 0x08000000 && \
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000 && \
/usr/local/stlink/st-util -m

View File

@ -0,0 +1,12 @@
#!/bin/sh
# production binary with bootloader
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../../ArduPlane/f4light_Revolution_SD_bl.bin 0x08000000
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000
/usr/local/stlink/st-util -m

View File

@ -178,10 +178,14 @@ void boardInit(void) {
#endif
#ifdef BOARD_MPU6000_DRDY_PIN
// Init MPU6000 DRDY pin - but it not used by driver
gpio_set_mode(PIN_MAP[BOARD_MPU6000_DRDY_PIN].gpio_device, PIN_MAP[BOARD_MPU6000_DRDY_PIN].gpio_bit, GPIO_INPUT_PU);
#endif
#ifdef BOARD_BUZZER_PIN
gpio_set_mode(PIN_MAP[BOARD_BUZZER_PIN].gpio_device, PIN_MAP[BOARD_BUZZER_PIN].gpio_bit, GPIO_OUTPUT_PP);
gpio_write_bit(PIN_MAP[BOARD_BUZZER_PIN].gpio_device, PIN_MAP[BOARD_BUZZER_PIN].gpio_bit, HAL_BUZZER_OFF);
#endif
#ifdef BOARD_SBUS_INVERTER
// it is not necessary because of 10K resistor to ground
gpio_set_mode( PIN_MAP[BOARD_SBUS_INVERTER].gpio_device, PIN_MAP[BOARD_SBUS_INVERTER].gpio_bit, GPIO_OUTPUT_PP);

View File

@ -61,8 +61,6 @@
#define BOARD_USB_SENSE 11 // PC5
@ -76,7 +74,7 @@
# define BOARD_BLUE_LED_PIN 36 // BLUE
# define BOARD_GREEN_LED_PIN 6 // NC - PC0 pin 8
# define BOARD_GREEN_LED_PIN 105 // NC - PC0 pin 8
# define HAL_GPIO_A_LED_PIN BOARD_BLUE_LED_PIN
# define HAL_GPIO_B_LED_PIN BOARD_GREEN_LED_PIN
@ -84,7 +82,6 @@
# define HAL_GPIO_LED_ON LOW
# define HAL_GPIO_LED_OFF HIGH
#define BOARD_NR_GPIO_PINS 109
//TODO add #define BOARD_HAS_UART3 ?
@ -119,15 +116,11 @@
#define BOARD_INS_DEFAULT HAL_INS_MPU60XX_SPI
#define BOARD_INS_ROTATION ROTATION_NONE
#define BOARD_INS_MPU60x0_NAME "mpu6000"
#define BOARD_MPU6000_CS_PIN 51 // PA4
#define BOARD_MPU6000_DRDY_PIN 10 // PC4
#define BOARD_STORAGE_SIZE 8192 // 4096 // EEPROM size
#define BOARD_SDCARD_NAME "sdcard"
#define BOARD_SDCARD_CS_PIN 2 // PB12
//#define BOARD_SDCARD_DET_PIN 38 // PB7
@ -172,13 +165,8 @@
#define SERVO_PIN_5 105 // PB4 - buzzer
//#define SERVO_PIN_6 22 // PA8
#if 1
#define HAL_CONSOLE USB_Driver // console on USB
#define HAL_CONSOLE_PORT 0
#else
#define HAL_CONSOLE uart1Driver // console on radio
#define HAL_CONSOLE_PORT 1
#endif
/*
// @Param: USB_STORAGE

View File

@ -4,9 +4,7 @@
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduCopter/f4light_cl_racing_bl.bin 0x08000000 && \
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduCopter/f4light_cl_racing.bin 0x08010000 && \
/usr/local/stlink/st-util -m

View File

@ -4,9 +4,7 @@
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduPlane/f4light_cl_racing_bl.bin 0x08000000 && \
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduPlane/f4light_cl_racing.bin 0x08010000 && \
/usr/local/stlink/st-util -m

View File

@ -0,0 +1,12 @@
#!/bin/sh
#production binary for bootloader
#dfu-util -a 0 --dfuse-address 0x08010000 -D /tmp/ArduCopter.build/f4light_AirbotV2.bin
# bare metal binary
#dfu-util -a 0 --dfuse-address 0x08000000:unprotect:force -D /tmp/ArduCopter.build/f4light_Revolution.bin
#dfu-util -a 0 --dfuse-address 0x08000000:leave -D ../../../../../ArduCopter/f4light_Revolution.bin -R
dfu-util -a 0 --dfuse-address 0x08010000:leave -D ../../../../../ArduCopter/f4light_cl_racing.bin -R

View File

@ -0,0 +1,12 @@
#!/bin/sh
# production binary with bootloader
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduCopter/f4light_cl_racing_bl.bin 0x08000000 && \
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000 && \
/usr/local/stlink/st-util -m

View File

@ -0,0 +1,12 @@
#!/bin/sh
# production binary with bootloader
#/usr/local/stlink/st-flash --reset write /tmp/ArduCopter.build/f4light_Revolution.bin 0x08010000
#bare metal binary
/usr/local/stlink/st-flash --reset read eeprom.bin 0x08004000 0xc000 && \
/usr/local/stlink/st-flash --reset write ../../../../../ArduPlane/f4light_cl_racing_bl.bin 0x08000000 && \
/usr/local/stlink/st-flash --reset write eeprom.bin 0x08004000 && \
/usr/local/stlink/st-util -m

View File

@ -0,0 +1,3 @@
#!/bin/sh
dfu-util -a 0 --dfuse-address 0x08004000:leave -Z 0xc000 -U $1.bin -R

View File

@ -1,4 +1,4 @@
#!/bin/sh
/usr/local/stlink/st-flash --reset write $1.bin 0x08004000
/usr/local/stlink/st-flash --reset write $1 0x08004000

View File

@ -1,3 +1,3 @@
#!/bin/sh
dfu-util -a 0 --dfuse-address 0x08004000:leave -D $1.bin -R
dfu-util -a 0 --dfuse-address 0x08004000:leave -D $1 -R

View File

@ -86,12 +86,10 @@ mkdir -p $ROOT/Release/Plane
cp $ROOT/ArduPlane/f4light_cl_racing_bl.bin $ROOT/Release/Plane
cp $ROOT/ArduPlane/f4light_cl_racing_bl.dfu $ROOT/Release/Plane
make f4light-clean
)
) && ( # AirBotF4 board
cd $ROOT/ArduCopter
# make f4light-clean
make f4light-clean
make f4light VERBOSE=1 BOARD=f4light_AirbotV2 && (
cp $ROOT/ArduCopter/f4light_AirbotV2.bin $ROOT/Release/Copter

View File

@ -3,6 +3,6 @@ git pull --rebase git://github.com/ArduPilot/ardupilot.git master
# Step 2: Merge the changes and update on GitHub.
git checkout RevoMini
git rebase master && git push origin RevoMini
git checkout Revo
git rebase master && git push origin Revo

View File

@ -7,8 +7,6 @@ git checkout -f master
git fetch origin
git reset --hard origin/master
popd
# git diff # this should show a change to git hash of OSD
git add minimosd-extra
git commit -m 'HAL_F4Light: updated OSD submodule'