OP-277 Update all files to use a BOARD_TYPE and BOARD_REVISION scheme through the whole codebase.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2458 ebee16cc-31ac-478f-84a7-5cbb03baadba
@ -1063,7 +1063,7 @@ void firmwareiapobj_callback(AhrsObjHandle obj)
|
|||||||
if(firmwareIAPObj.ArmReset==1)
|
if(firmwareIAPObj.ArmReset==1)
|
||||||
{
|
{
|
||||||
|
|
||||||
if((firmwareIAPObj.Target==FUNC_ID) || (firmwareIAPObj.Target==0xFF))
|
if((firmwareIAPObj.BoardType==BOARD_TYPE) || (firmwareIAPObj.BoardType==0xFF))
|
||||||
{
|
{
|
||||||
|
|
||||||
++reset_count;
|
++reset_count;
|
||||||
@ -1075,11 +1075,11 @@ void firmwareiapobj_callback(AhrsObjHandle obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(firmwareIAPObj.Target==FUNC_ID && firmwareIAPObj.crc!=iap_calc_crc())
|
else if(firmwareIAPObj.BoardType==BOARD_TYPE && firmwareIAPObj.crc!=iap_calc_crc())
|
||||||
{
|
{
|
||||||
read_description(firmwareIAPObj.Description);
|
read_description(firmwareIAPObj.Description);
|
||||||
firmwareIAPObj.crc=iap_calc_crc();
|
firmwareIAPObj.crc=iap_calc_crc();
|
||||||
firmwareIAPObj.HWVersion=HW_VERSION;
|
firmwareIAPObj.BoardRevision=BOARD_REVISION;
|
||||||
FirmwareIAPObjSet(&firmwareIAPObj);
|
FirmwareIAPObjSet(&firmwareIAPObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ void process_spi_request(void) {
|
|||||||
//PIOS_LED_On(LED1);
|
//PIOS_LED_On(LED1);
|
||||||
opahrs_msg_v0_init_user_tx(&user_tx_v0, OPAHRS_MSG_V0_RSP_VERSIONS);
|
opahrs_msg_v0_init_user_tx(&user_tx_v0, OPAHRS_MSG_V0_RSP_VERSIONS);
|
||||||
user_tx_v0.payload.user.v.rsp.versions.bl_version = BOOTLOADER_VERSION;
|
user_tx_v0.payload.user.v.rsp.versions.bl_version = BOOTLOADER_VERSION;
|
||||||
user_tx_v0.payload.user.v.rsp.versions.hw_version = HW_VERSION;
|
user_tx_v0.payload.user.v.rsp.versions.hw_version = (BOARD_TYPE << 8) | BOARD_REVISION;
|
||||||
user_tx_v0.payload.user.v.rsp.versions.fw_crc = Fw_crc;
|
user_tx_v0.payload.user.v.rsp.versions.fw_crc = Fw_crc;
|
||||||
lfsm_user_set_tx_v0(&user_tx_v0);
|
lfsm_user_set_tx_v0(&user_tx_v0);
|
||||||
break;
|
break;
|
||||||
|
@ -481,7 +481,7 @@ void OPDfuIni(uint8_t discover) {
|
|||||||
dev.sizeOfDescription = SIZE_OF_DESCRIPTION;
|
dev.sizeOfDescription = SIZE_OF_DESCRIPTION;
|
||||||
dev.BL_Version = BOOTLOADER_VERSION;
|
dev.BL_Version = BOOTLOADER_VERSION;
|
||||||
dev.FW_Crc = CalcFirmCRC();
|
dev.FW_Crc = CalcFirmCRC();
|
||||||
dev.devID = HW_VERSION;
|
dev.devID = (BOARD_TYPE << 8) | BOARD_REVISION;
|
||||||
dev.devType = HW_TYPE;
|
dev.devType = HW_TYPE;
|
||||||
numberOfDevices = 1;
|
numberOfDevices = 1;
|
||||||
devicesTable[0] = dev;
|
devicesTable[0] = dev;
|
||||||
|
@ -422,7 +422,7 @@ void OPDfuIni(uint8_t discover) {
|
|||||||
dev.sizeOfDescription = SIZE_OF_DESCRIPTION;
|
dev.sizeOfDescription = SIZE_OF_DESCRIPTION;
|
||||||
dev.BL_Version = BOOTLOADER_VERSION;
|
dev.BL_Version = BOOTLOADER_VERSION;
|
||||||
dev.FW_Crc = CalcFirmCRC();
|
dev.FW_Crc = CalcFirmCRC();
|
||||||
dev.devID = HW_VERSION;
|
dev.devID = (BOARD_TYPE << 8) | BOARD_REVISION;
|
||||||
dev.devType = HW_TYPE;
|
dev.devType = HW_TYPE;
|
||||||
numberOfDevices = 1;
|
numberOfDevices = 1;
|
||||||
devicesTable[0] = dev;
|
devicesTable[0] = dev;
|
||||||
|
@ -100,9 +100,9 @@ static void resetTask(void *parameters);
|
|||||||
|
|
||||||
int32_t FirmwareIAPInitialize()
|
int32_t FirmwareIAPInitialize()
|
||||||
{
|
{
|
||||||
data.Target=FUNC_ID;
|
data.BoardType= BOARD_TYPE;
|
||||||
read_description(data.Description);
|
read_description(data.Description);
|
||||||
data.HWVersion=HW_VERSION;
|
data.BoardRevision= BOARD_REVISION;
|
||||||
data.ArmReset=0;
|
data.ArmReset=0;
|
||||||
data.crc = 0;
|
data.crc = 0;
|
||||||
FirmwareIAPObjSet( &data );
|
FirmwareIAPObjSet( &data );
|
||||||
@ -131,10 +131,10 @@ static void FirmwareIAPCallback(UAVObjEvent* ev)
|
|||||||
this_time = get_time();
|
this_time = get_time();
|
||||||
delta = this_time - last_time;
|
delta = this_time - last_time;
|
||||||
last_time = this_time;
|
last_time = this_time;
|
||||||
if((data.Target==FUNC_ID)&&(data.crc != iap_calc_crc()))
|
if((data.BoardType==BOARD_TYPE)&&(data.crc != iap_calc_crc()))
|
||||||
{
|
{
|
||||||
read_description(data.Description);
|
read_description(data.Description);
|
||||||
data.HWVersion=HW_VERSION;
|
data.BoardRevision=BOARD_REVISION;
|
||||||
data.crc = iap_calc_crc();
|
data.crc = iap_calc_crc();
|
||||||
FirmwareIAPObjSet( &data );
|
FirmwareIAPObjSet( &data );
|
||||||
}
|
}
|
||||||
@ -246,7 +246,7 @@ static void resetTask(void *parameters)
|
|||||||
// Main task loop
|
// Main task loop
|
||||||
lastSysTime = xTaskGetTickCount();
|
lastSysTime = xTaskGetTickCount();
|
||||||
while (1) {
|
while (1) {
|
||||||
data.Target=0xFF;
|
data.BoardType=0xFF;
|
||||||
data.ArmReset=1;
|
data.ArmReset=1;
|
||||||
data.crc=count;
|
data.crc=count;
|
||||||
FirmwareIAPObjSet(&data);
|
FirmwareIAPObjSet(&data);
|
||||||
|
@ -64,9 +64,14 @@ TIM8 | | | |
|
|||||||
//------------------------
|
//------------------------
|
||||||
// BOOTLOADER_SETTINGS
|
// BOOTLOADER_SETTINGS
|
||||||
//------------------------
|
//------------------------
|
||||||
#define FUNC_ID 2
|
//#define FUNC_ID 2
|
||||||
#define HW_VERSION 69
|
//#define HW_VERSION 69
|
||||||
|
|
||||||
#define BOOTLOADER_VERSION 0
|
#define BOOTLOADER_VERSION 0
|
||||||
|
#define BOARD_TYPE 0x02
|
||||||
|
#define BOARD_REVISION 0x01
|
||||||
|
//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION
|
||||||
|
|
||||||
#define MEM_SIZE 0x20000 //128K
|
#define MEM_SIZE 0x20000 //128K
|
||||||
#define SIZE_OF_DESCRIPTION 100
|
#define SIZE_OF_DESCRIPTION 100
|
||||||
#define START_OF_USER_CODE (uint32_t)0x08002000
|
#define START_OF_USER_CODE (uint32_t)0x08002000
|
||||||
|
@ -60,9 +60,14 @@ TIM4 | RC In 1 | Servo 3 | Servo 2 | Servo 1
|
|||||||
//------------------------
|
//------------------------
|
||||||
// BOOTLOADER_SETTINGS
|
// BOOTLOADER_SETTINGS
|
||||||
//------------------------
|
//------------------------
|
||||||
#define FUNC_ID 2
|
//#define FUNC_ID 2
|
||||||
#define HW_VERSION 69
|
//#define HW_VERSION 69
|
||||||
|
|
||||||
#define BOOTLOADER_VERSION 0
|
#define BOOTLOADER_VERSION 0
|
||||||
|
#define BOARD_TYPE 0x04
|
||||||
|
#define BOARD_REVISION 0x01
|
||||||
|
//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION
|
||||||
|
|
||||||
#define MEM_SIZE 0x20000 //128K
|
#define MEM_SIZE 0x20000 //128K
|
||||||
#define SIZE_OF_DESCRIPTION 100
|
#define SIZE_OF_DESCRIPTION 100
|
||||||
#define START_OF_USER_CODE (uint32_t)0x08002000
|
#define START_OF_USER_CODE (uint32_t)0x08002000
|
||||||
|
@ -62,9 +62,9 @@ TIM8 | | | |
|
|||||||
//------------------------
|
//------------------------
|
||||||
// BOOTLOADER_SETTINGS
|
// BOOTLOADER_SETTINGS
|
||||||
//------------------------
|
//------------------------
|
||||||
#define FUNC_ID 3
|
|
||||||
#define HW_VERSION 21
|
|
||||||
#define BOOTLOADER_VERSION 0
|
#define BOOTLOADER_VERSION 0
|
||||||
|
#define BOARD_TYPE 0x03
|
||||||
|
#define BOARD_REVISION 0x01
|
||||||
#define MEM_SIZE ((uint32_t)(*((volatile uint16_t *)(0x1FFFF7E0))) * 1024 - 1024) //128K
|
#define MEM_SIZE ((uint32_t)(*((volatile uint16_t *)(0x1FFFF7E0))) * 1024 - 1024) //128K
|
||||||
#define SIZE_OF_DESCRIPTION 100
|
#define SIZE_OF_DESCRIPTION 100
|
||||||
#define START_OF_USER_CODE (uint32_t)0x08003000
|
#define START_OF_USER_CODE (uint32_t)0x08003000
|
||||||
|
@ -69,9 +69,14 @@ TIM8 | Servo 5 | Servo 6 | Servo 7 | Servo 8
|
|||||||
// BOOTLOADER_SETTINGS
|
// BOOTLOADER_SETTINGS
|
||||||
//------------------------
|
//------------------------
|
||||||
|
|
||||||
#define FUNC_ID 1
|
//#define FUNC_ID 1
|
||||||
#define HW_VERSION 01
|
//#define HW_VERSION 01
|
||||||
|
|
||||||
#define BOOTLOADER_VERSION 0
|
#define BOOTLOADER_VERSION 0
|
||||||
|
#define BOARD_TYPE 0x01 // OpenPilot board
|
||||||
|
#define BOARD_REVISION 0x01 // Beta version
|
||||||
|
//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION
|
||||||
|
|
||||||
#define MEM_SIZE 524288 //512K
|
#define MEM_SIZE 524288 //512K
|
||||||
#define SIZE_OF_DESCRIPTION (uint8_t) 100
|
#define SIZE_OF_DESCRIPTION (uint8_t) 100
|
||||||
#define START_OF_USER_CODE (uint32_t)0x08005000//REMEMBER SET ALSO IN link_stm32f10x_HD_BL.ld
|
#define START_OF_USER_CODE (uint32_t)0x08005000//REMEMBER SET ALSO IN link_stm32f10x_HD_BL.ld
|
||||||
|
@ -88,17 +88,17 @@ void deviceWidget::populate()
|
|||||||
devicePic->setSharedRenderer(new QSvgRenderer());
|
devicePic->setSharedRenderer(new QSvgRenderer());
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case 1:
|
case 0x0101:
|
||||||
devicePic->renderer()->load(QString(":/uploader/images/deviceID-1.svg"));
|
devicePic->renderer()->load(QString(":/uploader/images/deviceID-0101.svg"));
|
||||||
break;
|
break;
|
||||||
case 21:
|
case 0x0301:
|
||||||
devicePic->renderer()->load(QString(":/uploader/images/deviceID-21.svg"));
|
devicePic->renderer()->load(QString(":/uploader/images/deviceID-0301.svg"));
|
||||||
break;
|
break;
|
||||||
case 42:
|
case 0x0401:
|
||||||
devicePic->renderer()->load(QString(":/uploader/images/deviceID-42.svg"));
|
devicePic->renderer()->load(QString(":/uploader/images/deviceID-0401.svg"));
|
||||||
break;
|
break;
|
||||||
case 69:
|
case 0x0201:
|
||||||
devicePic->renderer()->load(QString(":/uploader/images/deviceID-69.svg"));
|
devicePic->renderer()->load(QString(":/uploader/images/deviceID-0201.svg"));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 239 KiB After Width: | Height: | Size: 239 KiB |
Before Width: | Height: | Size: 552 KiB After Width: | Height: | Size: 552 KiB |
@ -1,13 +1,13 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/uploader">
|
<qresource prefix="/uploader">
|
||||||
<file>images/deviceID-1.svg</file>
|
|
||||||
<file>images/deviceID-69.svg</file>
|
|
||||||
<file>images/view-refresh.svg</file>
|
<file>images/view-refresh.svg</file>
|
||||||
<file>images/system-run.svg</file>
|
<file>images/system-run.svg</file>
|
||||||
<file>images/process-stop.svg</file>
|
<file>images/process-stop.svg</file>
|
||||||
<file>images/dialog-apply.svg</file>
|
<file>images/dialog-apply.svg</file>
|
||||||
<file>images/gtk-info.svg</file>
|
<file>images/gtk-info.svg</file>
|
||||||
<file>images/deviceID-42.svg</file>
|
<file>images/deviceID-0401.svg</file>
|
||||||
<file>images/deviceID-21.svg</file>
|
<file>images/deviceID-0301.svg</file>
|
||||||
|
<file>images/deviceID-0201.svg</file>
|
||||||
|
<file>images/deviceID-0101.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
<description>Firmware IAP</description>
|
<description>Firmware IAP</description>
|
||||||
<field name="Command" units="" type="uint16" elements="1"/>
|
<field name="Command" units="" type="uint16" elements="1"/>
|
||||||
<field name="Description" units="" type="uint8" elements="100"/>
|
<field name="Description" units="" type="uint8" elements="100"/>
|
||||||
<field name="HWVersion" units="" type="uint16" elements="1"/>
|
<field name="BoardRevision" units="" type="uint16" elements="1"/>
|
||||||
<field name="Target" units="" type="uint8" elements="1"/>
|
<field name="BoardType" units="" type="uint8" elements="1"/>
|
||||||
<field name="ArmReset" units="" type="uint8" elements="1"/>
|
<field name="ArmReset" units="" type="uint8" elements="1"/>
|
||||||
<field name="crc" units="" type="uint32" elements="1"/>
|
<field name="crc" units="" type="uint32" elements="1"/>
|
||||||
<access gcs="readwrite" flight="readwrite"/>
|
<access gcs="readwrite" flight="readwrite"/>
|
||||||
|