From 0c3e896101c3c5f878cd90020664bd0d975a4cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Mi=C5=A1i=C4=87?= Date: Mon, 24 Jan 2022 15:48:16 +0100 Subject: [PATCH] boards: update manifest.c to follow the new hw_ver_rev format --- boards/holybro/can-gps-v1/src/board_config.h | 2 ++ boards/holybro/can-gps-v1/src/manifest.c | 6 +++--- boards/holybro/durandal-v1/src/init.c | 16 +++++++------- boards/holybro/durandal-v1/src/manifest.c | 4 ++-- boards/holybro/pix32v5/src/board_config.h | 5 ++++- boards/holybro/pix32v5/src/manifest.c | 8 +++---- boards/modalai/fc-v1/src/board_config.h | 3 +++ boards/modalai/fc-v1/src/manifest.c | 8 +++---- boards/modalai/fc-v2/src/board_config.h | 1 + boards/modalai/fc-v2/src/manifest.c | 6 +++--- boards/nxp/fmurt1062-v1/src/board_config.h | 4 +++- boards/nxp/fmurt1062-v1/src/manifest.c | 4 ++-- boards/px4/fmu-v5/src/manifest.c | 4 ++-- boards/px4/fmu-v5x/src/board_config.h | 1 + boards/px4/fmu-v5x/src/init.cpp | 21 ++++++++++--------- boards/px4/fmu-v5x/src/manifest.c | 3 ++- boards/px4/fmu-v5x/src/mtd.cpp | 17 +++------------ boards/px4/fmu-v6u/src/board_config.h | 3 ++- boards/px4/fmu-v6u/src/manifest.c | 6 +++--- boards/px4/fmu-v6x/src/init.c | 18 ++++++++++------ boards/px4/fmu-v6x/src/manifest.c | 4 ++-- .../smartap-airlink/src/board_config.h | 4 ++-- .../sky-drones/smartap-airlink/src/manifest.c | 2 +- 23 files changed, 81 insertions(+), 69 deletions(-) diff --git a/boards/holybro/can-gps-v1/src/board_config.h b/boards/holybro/can-gps-v1/src/board_config.h index 2eb2fd7463..f9acbad506 100644 --- a/boards/holybro/can-gps-v1/src/board_config.h +++ b/boards/holybro/can-gps-v1/src/board_config.h @@ -85,6 +85,8 @@ #define GPIO_HW_VER_SENSE /* PA1 */ ADC1_GPIO(1) #define HW_INFO_INIT_PREFIX "CANGPS" +#define CANGPS00 HW_VER_REV(0x0,0x0) // CANGPS + #define FLASH_BASED_PARAMS /* CAN Silence diff --git a/boards/holybro/can-gps-v1/src/manifest.c b/boards/holybro/can-gps-v1/src/manifest.c index 1beb74589a..695cdcf108 100644 --- a/boards/holybro/can-gps-v1/src/manifest.c +++ b/boards/holybro/can-gps-v1/src/manifest.c @@ -104,7 +104,7 @@ static const px4_hw_mft_item_t hw_mft_list_v0000[] = { static px4_hw_mft_list_entry_t mft_lists[] = { // ver/rev - {0x0000, hw_mft_list_v0000, arraySize(hw_mft_list_v0000)}, + {CANGPS00, hw_mft_list_v0000, arraySize(hw_mft_list_v0000)}, }; /************************************************************************************ @@ -127,7 +127,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 8; + uint32_t ver_rev = board_get_hw_version() << 16; ver_rev |= board_get_hw_revision(); for (unsigned i = 0; i < arraySize(mft_lists); i++) { @@ -138,7 +138,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) } if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); + syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); } } diff --git a/boards/holybro/durandal-v1/src/init.c b/boards/holybro/durandal-v1/src/init.c index 527a8680ae..f8dc55d72f 100644 --- a/boards/holybro/durandal-v1/src/init.c +++ b/boards/holybro/durandal-v1/src/init.c @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2012-2019 PX4 Development Team. All rights reserved. + * Copyright (c) 2012-2019, 2022 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -206,7 +206,6 @@ stm32_boardinitialize(void) * ****************************************************************************/ - __EXPORT int board_app_initialize(uintptr_t arg) { /* Power on Interfaces */ @@ -219,6 +218,13 @@ __EXPORT int board_app_initialize(uintptr_t arg) px4_platform_init(); + // Use the default HW_VER_REV(0x0,0x0) for Ramtron + + stm32_spiinitialize(); + + /* Configure the HW based on the manifest */ + + px4_platform_configure(); if (OK == board_determine_hw_info()) { syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), @@ -228,7 +234,7 @@ __EXPORT int board_app_initialize(uintptr_t arg) syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); } - /* configure SPI interfaces (after we determined the HW version) */ + /* Configure the actual SPI interfaces (after we determined the HW version) */ stm32_spiinitialize(); @@ -268,9 +274,5 @@ __EXPORT int board_app_initialize(uintptr_t arg) #endif /* CONFIG_MMCSD */ - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - return OK; } diff --git a/boards/holybro/durandal-v1/src/manifest.c b/boards/holybro/durandal-v1/src/manifest.c index 54ab596f50..033bff2d7a 100644 --- a/boards/holybro/durandal-v1/src/manifest.c +++ b/boards/holybro/durandal-v1/src/manifest.c @@ -107,7 +107,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 8; + uint32_t ver_rev = board_get_hw_version() << 16; ver_rev |= board_get_hw_revision(); for (unsigned i = 0; i < arraySize(mft_lists); i++) { @@ -118,7 +118,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) } if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); + syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); } } diff --git a/boards/holybro/pix32v5/src/board_config.h b/boards/holybro/pix32v5/src/board_config.h index 23eb46bba9..0c17be2100 100644 --- a/boards/holybro/pix32v5/src/board_config.h +++ b/boards/holybro/pix32v5/src/board_config.h @@ -185,7 +185,10 @@ #define GPIO_HW_REV_SENSE /* PC3 */ ADC1_GPIO(13) #define GPIO_HW_VER_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0) #define GPIO_HW_VER_SENSE /* PC2 */ ADC1_GPIO(12) -#define HW_INFO_INIT_PREFIX "VPI32X5" +#define HW_INFO_INIT_PREFIX "VPIX32V5" + +#define VPIX32V500 HW_VER_REV(0x0,0x0) // PIX32V5 Rev 0 +#define VPIX32V540 HW_VER_REV(0x4,0x0) // HolyBro mini no can 2,3 /* CAN Silence * diff --git a/boards/holybro/pix32v5/src/manifest.c b/boards/holybro/pix32v5/src/manifest.c index 2c5375a3c7..c9d9541eee 100644 --- a/boards/holybro/pix32v5/src/manifest.c +++ b/boards/holybro/pix32v5/src/manifest.c @@ -129,8 +129,8 @@ static const px4_hw_mft_item_t hw_mft_list_v0540[] = { }; static px4_hw_mft_list_entry_t mft_lists[] = { - {0x0000, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, - {0x0400, hw_mft_list_v0540, arraySize(hw_mft_list_v0540)}, // HolyBro mini no can 2,3 + {VPIX32V500, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, + {VPIX32V540, hw_mft_list_v0540, arraySize(hw_mft_list_v0540)}, // HolyBro mini no can 2,3 }; /************************************************************************************ @@ -153,7 +153,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 8; + uint32_t ver_rev = board_get_hw_version() << 16; ver_rev |= board_get_hw_revision(); for (unsigned i = 0; i < arraySize(mft_lists); i++) { @@ -164,7 +164,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) } if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); + syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); } } diff --git a/boards/modalai/fc-v1/src/board_config.h b/boards/modalai/fc-v1/src/board_config.h index ecdd1d5d51..ed81347bdb 100644 --- a/boards/modalai/fc-v1/src/board_config.h +++ b/boards/modalai/fc-v1/src/board_config.h @@ -143,6 +143,9 @@ #define GPIO_HW_REV_SENSE /* PF5 */ ADC3_GPIO(15) #define GPIO_HW_VER_SENSE /* PF4 */ ADC3_GPIO(14) #define HW_INFO_INIT_PREFIX "V1" +#define V10006 HW_VER_REV(0x0,0x6) // V1006 Rev 6 +#define V10100 HW_VER_REV(0x1,0x0) // V1010 Rev 0 + /* PWM */ diff --git a/boards/modalai/fc-v1/src/manifest.c b/boards/modalai/fc-v1/src/manifest.c index 7b2266bd1f..d63b19f5eb 100644 --- a/boards/modalai/fc-v1/src/manifest.c +++ b/boards/modalai/fc-v1/src/manifest.c @@ -90,8 +90,8 @@ static const px4_hw_mft_item_t hw_mft_list_fc0100[] = { }; static px4_hw_mft_list_entry_t mft_lists[] = { - {0x0006, hw_mft_list_fc0006, arraySize(hw_mft_list_fc0006)}, - {0x0100, hw_mft_list_fc0100, arraySize(hw_mft_list_fc0100)} + {V10006, hw_mft_list_fc0006, arraySize(hw_mft_list_fc0006)}, + {V10100, hw_mft_list_fc0100, arraySize(hw_mft_list_fc0100)} }; /************************************************************************************ @@ -114,7 +114,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 8; + uint32_t ver_rev = board_get_hw_version() << 16; ver_rev |= board_get_hw_revision(); for (unsigned i = 0; i < arraySize(mft_lists); i++) { @@ -125,7 +125,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) } if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); + syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); } } diff --git a/boards/modalai/fc-v2/src/board_config.h b/boards/modalai/fc-v2/src/board_config.h index 5cac089719..b0868261a9 100644 --- a/boards/modalai/fc-v2/src/board_config.h +++ b/boards/modalai/fc-v2/src/board_config.h @@ -183,6 +183,7 @@ #define GPIO_HW_REV_SENSE /* PH4 */ GPIO_ADC3_INP15 #define GPIO_HW_VER_SENSE /* PH3 */ GPIO_ADC3_INP14 #define HW_INFO_INIT_PREFIX "V2" +#define V20300 HW_VER_REV(0x3,0x0) /* PE6 is nARMED --> FCv2 this goes to TP13 * The GPIO will be set as input while not armed HW will have external HW Pull UP. diff --git a/boards/modalai/fc-v2/src/manifest.c b/boards/modalai/fc-v2/src/manifest.c index 4f01dd360f..485e5edd63 100644 --- a/boards/modalai/fc-v2/src/manifest.c +++ b/boards/modalai/fc-v2/src/manifest.c @@ -83,7 +83,7 @@ static const px4_hw_mft_item_t hw_mft_list_fc0200[] = { }; static px4_hw_mft_list_entry_t mft_lists[] = { - {0x0300, hw_mft_list_fc0200, arraySize(hw_mft_list_fc0200)}, + {V20300, hw_mft_list_fc0200, arraySize(hw_mft_list_fc0200)}, }; /************************************************************************************ @@ -106,7 +106,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 8; + uint32_t ver_rev = board_get_hw_version() << 16; ver_rev |= board_get_hw_revision(); for (unsigned i = 0; i < arraySize(mft_lists); i++) { @@ -117,7 +117,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) } if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); + syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); } } diff --git a/boards/nxp/fmurt1062-v1/src/board_config.h b/boards/nxp/fmurt1062-v1/src/board_config.h index 8ea538f91b..9d14fb5da4 100644 --- a/boards/nxp/fmurt1062-v1/src/board_config.h +++ b/boards/nxp/fmurt1062-v1/src/board_config.h @@ -192,7 +192,9 @@ #define GPIO_HW_VER_REV_DRIVE /* GPIO_AD_B0_01 GPIO1_IO01 */ (GPIO_PORT1 | GPIO_PIN1 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | HW_IOMUX) #define GPIO_HW_REV_SENSE /* GPIO_AD_B1_08 GPIO1 Pin 24 */ ADC1_GPIO(13, 24) #define GPIO_HW_VER_SENSE /* GPIO_AD_B1_04 GPIO1 Pin 20 */ ADC1_GPIO(9, 20) -#define HW_INFO_INIT_PREFIX "V5" +#define HW_INFO_INIT_PREFIX "V5" +#define V500 HW_VER_REV(0x0,0x0) // FMUV5, Rev 0 +#define V540 HW_VER_REV(0x4,0x0) // mini no can 2,3, Rev 0 /* CAN Silence * diff --git a/boards/nxp/fmurt1062-v1/src/manifest.c b/boards/nxp/fmurt1062-v1/src/manifest.c index 8c18182949..63cd4eebed 100644 --- a/boards/nxp/fmurt1062-v1/src/manifest.c +++ b/boards/nxp/fmurt1062-v1/src/manifest.c @@ -88,8 +88,8 @@ static const px4_hw_mft_item_t hw_mft_list_v0540[] = { }; static px4_hw_mft_list_entry_t mft_lists[] = { - {0x0000, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, - {0x0400, hw_mft_list_v0540, arraySize(hw_mft_list_v0540)}, + {V500, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, + {V540, hw_mft_list_v0540, arraySize(hw_mft_list_v0540)}, }; /************************************************************************************ diff --git a/boards/px4/fmu-v5/src/manifest.c b/boards/px4/fmu-v5/src/manifest.c index 3e131f9ada..bab37eceff 100644 --- a/boards/px4/fmu-v5/src/manifest.c +++ b/boards/px4/fmu-v5/src/manifest.c @@ -186,7 +186,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 8; + uint32_t ver_rev = board_get_hw_version() << 16; ver_rev |= board_get_hw_revision(); for (unsigned i = 0; i < arraySize(mft_lists); i++) { @@ -197,7 +197,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) } if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); + syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); } } diff --git a/boards/px4/fmu-v5x/src/board_config.h b/boards/px4/fmu-v5x/src/board_config.h index d128af382f..c8b654627b 100644 --- a/boards/px4/fmu-v5x/src/board_config.h +++ b/boards/px4/fmu-v5x/src/board_config.h @@ -200,6 +200,7 @@ #define V5Xa0 HW_VER_REV(0xa,0x0) // NO USB (Q), Rev 0 #define V5Xa1 HW_VER_REV(0xa,0x1) // NO USB (Q) I2C2 BMP388, Rev 1 #define V5Xa2 HW_VER_REV(0xa,0x2) // NO USB (Q) I2C2 BMP388, Rev 2 +#define V5X101 HW_VER_REV(0x10,0x1) // NO USB (Q) I2C2 BMP388, Rev 1 /* HEATER * PWM in future diff --git a/boards/px4/fmu-v5x/src/init.cpp b/boards/px4/fmu-v5x/src/init.cpp index d1eacf4d02..a6606761db 100644 --- a/boards/px4/fmu-v5x/src/init.cpp +++ b/boards/px4/fmu-v5x/src/init.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2012-2020 PX4 Development Team. All rights reserved. + * Copyright (c) 2012-2022 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -54,9 +54,7 @@ #include #include -extern "C" { #include -} #include #include #include @@ -222,8 +220,13 @@ __EXPORT int board_app_initialize(uintptr_t arg) px4_platform_init(); - /* Enable base EEPROM MTD to read hardware information*/ - px4_mtd_config(board_get_base_eeprom_mtd_manifest()); + // Use the default HW_VER_REV(0x0,0x0) for Ramtron + + stm32_spiinitialize(); + + /* Configure the HW based on the manifest */ + + px4_platform_configure(); if (OK == board_determine_hw_info()) { syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), @@ -233,11 +236,13 @@ __EXPORT int board_app_initialize(uintptr_t arg) syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); } + /* Configure the Actual SPI interfaces (after we determined the HW version) */ + stm32_spiinitialize(); board_spi_reset(10, 0xffff); - /* configure the DMA allocator */ + /* Configure the DMA allocator */ if (board_dma_alloc_init() < 0) { syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); @@ -269,10 +274,6 @@ __EXPORT int board_app_initialize(uintptr_t arg) #endif /* CONFIG_MMCSD */ - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - int hw_version = board_get_hw_version(); if (hw_version == 0x9 || hw_version == 0xa) { diff --git a/boards/px4/fmu-v5x/src/manifest.c b/boards/px4/fmu-v5x/src/manifest.c index 4fe0458ddf..34051132f5 100644 --- a/boards/px4/fmu-v5x/src/manifest.c +++ b/boards/px4/fmu-v5x/src/manifest.c @@ -127,6 +127,7 @@ static px4_hw_mft_list_entry_t mft_lists[] = { {V5Xa0, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB (Q), Rev 0 {V5Xa1, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB (Q) I2C2 BMP388, Rev 1 {V5Xa2, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB (Q) I2C2 BMP388, Rev 2 + {V5X101, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB I2C2 BMP388, Rev 1 }; /************************************************************************************ @@ -160,7 +161,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) } if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); + syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); } } diff --git a/boards/px4/fmu-v5x/src/mtd.cpp b/boards/px4/fmu-v5x/src/mtd.cpp index 498a89fb6e..75d4cbd434 100644 --- a/boards/px4/fmu-v5x/src/mtd.cpp +++ b/boards/px4/fmu-v5x/src/mtd.cpp @@ -102,20 +102,14 @@ static const px4_mtd_entry_t imu_eeprom = { }; static const px4_mtd_manifest_t board_mtd_config = { - .nconfigs = 2, + .nconfigs = 3, .entries = { &fmum_fram, + &base_eeprom, &imu_eeprom } }; -static const px4_mtd_manifest_t board_mtd_base_eeprom_config = { - .nconfigs = 1, - .entries = { - &base_eeprom - } -}; - static const px4_mft_entry_s mtd_mft = { .type = MTD, .pmft = (void *) &board_mtd_config, @@ -131,9 +125,4 @@ static const px4_mft_s mft = { const px4_mft_s *board_get_manifest(void) { return &mft; -} - -const px4_mtd_manifest_t *board_get_base_eeprom_mtd_manifest(void) -{ - return &board_mtd_base_eeprom_config; -} +} \ No newline at end of file diff --git a/boards/px4/fmu-v6u/src/board_config.h b/boards/px4/fmu-v6u/src/board_config.h index abab3f75fd..7fbdc4d7ae 100644 --- a/boards/px4/fmu-v6u/src/board_config.h +++ b/boards/px4/fmu-v6u/src/board_config.h @@ -173,7 +173,8 @@ #define GPIO_HW_VER_REV_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0) #define GPIO_HW_REV_SENSE /* PH4 */ GPIO_ADC3_INP15 #define GPIO_HW_VER_SENSE /* PH3 */ GPIO_ADC3_INP14 -#define HW_INFO_INIT_PREFIX "V6U" +#define HW_INFO_INIT_PREFIX "V6U" +#define V6U00 HW_VER_REV(0x0,0x0) /* HEATER * PWM in future diff --git a/boards/px4/fmu-v6u/src/manifest.c b/boards/px4/fmu-v6u/src/manifest.c index 761b14efa2..f0cd4d4f12 100644 --- a/boards/px4/fmu-v6u/src/manifest.c +++ b/boards/px4/fmu-v6u/src/manifest.c @@ -82,7 +82,7 @@ static const px4_hw_mft_item_t hw_mft_list_v0600[] = { }; static px4_hw_mft_list_entry_t mft_lists[] = { - {0x0000, hw_mft_list_v0600, arraySize(hw_mft_list_v0600)}, + {V6U00, hw_mft_list_v0600, arraySize(hw_mft_list_v0600)}, }; /************************************************************************************ @@ -105,7 +105,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 8; + uint32_t ver_rev = board_get_hw_version() << 16; ver_rev |= board_get_hw_revision(); for (unsigned i = 0; i < arraySize(mft_lists); i++) { @@ -116,7 +116,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) } if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); + syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); } } diff --git a/boards/px4/fmu-v6x/src/init.c b/boards/px4/fmu-v6x/src/init.c index a96a406496..3dc9a10ee9 100644 --- a/boards/px4/fmu-v6x/src/init.c +++ b/boards/px4/fmu-v6x/src/init.c @@ -52,7 +52,6 @@ #include #include #include -#include #include #include @@ -71,6 +70,7 @@ #include #include #include +#include #include #include #include @@ -219,6 +219,13 @@ __EXPORT int board_app_initialize(uintptr_t arg) px4_platform_init(); + // Use the default HW_VER_REV(0x0,0x0) for Ramtron + + stm32_spiinitialize(); + + /* Configure the HW based on the manifest */ + + px4_platform_configure(); if (OK == board_determine_hw_info()) { syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), @@ -228,11 +235,13 @@ __EXPORT int board_app_initialize(uintptr_t arg) syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); } + /* Configure the Actual SPI interfaces (after we determined the HW version) */ + stm32_spiinitialize(); board_spi_reset(10, 0xffff); - /* configure the DMA allocator */ + /* Configure the DMA allocator */ if (board_dma_alloc_init() < 0) { syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); @@ -264,13 +273,10 @@ __EXPORT int board_app_initialize(uintptr_t arg) if (ret != OK) { led_on(LED_RED); + return ret; } #endif /* CONFIG_MMCSD */ - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - return OK; } diff --git a/boards/px4/fmu-v6x/src/manifest.c b/boards/px4/fmu-v6x/src/manifest.c index 3a4fc93bff..f3e00ff832 100644 --- a/boards/px4/fmu-v6x/src/manifest.c +++ b/boards/px4/fmu-v6x/src/manifest.c @@ -124,7 +124,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 8; + uint32_t ver_rev = board_get_hw_version() << 16; ver_rev |= board_get_hw_revision(); for (unsigned i = 0; i < arraySize(mft_lists); i++) { @@ -135,7 +135,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) } if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); + syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); } } diff --git a/boards/sky-drones/smartap-airlink/src/board_config.h b/boards/sky-drones/smartap-airlink/src/board_config.h index 93d158e54f..e03f0d08f1 100644 --- a/boards/sky-drones/smartap-airlink/src/board_config.h +++ b/boards/sky-drones/smartap-airlink/src/board_config.h @@ -173,8 +173,8 @@ #define GPIO_HW_VER_REV_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0) #define GPIO_HW_REV_SENSE /* PF5 */ ADC3_GPIO(15) #define GPIO_HW_VER_SENSE /* PF4 */ ADC3_GPIO(14) -#define HW_INFO_INIT_PREFIX "VSA" - +#define HW_INFO_INIT_PREFIX "SDSA" +#define SDSA0501 HW_VER_REV(0x05,0x01) /* HEATER * PWM in future */ diff --git a/boards/sky-drones/smartap-airlink/src/manifest.c b/boards/sky-drones/smartap-airlink/src/manifest.c index 2f7deac667..34a5583e78 100644 --- a/boards/sky-drones/smartap-airlink/src/manifest.c +++ b/boards/sky-drones/smartap-airlink/src/manifest.c @@ -88,7 +88,7 @@ static const px4_hw_mft_item_t hw_mft_list_v0501[] = { static px4_hw_mft_list_entry_t mft_lists[] = { - {0x0501, hw_mft_list_v0501, arraySize(hw_mft_list_v0501)}, + {SDSA0501, hw_mft_list_v0501, arraySize(hw_mft_list_v0501)}, };