mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 20:28:37 +08:00
Merge PR #19575 (changes to pr-extendend_hw_ver_rev_format)
- 4096 of 3 hex digits each for rev and ver is enough.
#defines used in SPI versions do not be long format, use use the macro
- Board provides a prefix and the formatting is sized and built in
- No need for funky board_get_base_eeprom_mtd_manifest interface
Original mft is used where the abstraction is done with the MFT interface
Co-authored-by: David Sidrane <David.Sidrane@Nscdg.com>
This commit is contained in:
@@ -83,7 +83,9 @@
|
||||
#define GPIO_HW_VER_REV_DRIVE /* PB1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1)
|
||||
#define GPIO_HW_REV_SENSE /* PA0 */ ADC1_GPIO(0)
|
||||
#define GPIO_HW_VER_SENSE /* PA1 */ ADC1_GPIO(1)
|
||||
#define HW_INFO_INIT "CANGPS%04x%04x"
|
||||
#define HW_INFO_INIT_PREFIX "CANGPS"
|
||||
|
||||
#define CANGPS00 HW_VER_REV(0x0,0x0) // CANGPS
|
||||
|
||||
#define FLASH_BASED_PARAMS
|
||||
|
||||
|
||||
@@ -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
|
||||
{0x00000000, hw_mft_list_v0000, arraySize(hw_mft_list_v0000)},
|
||||
{CANGPS00, hw_mft_list_v0000, arraySize(hw_mft_list_v0000)},
|
||||
};
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
@@ -11,13 +11,13 @@ icm20689 -R 2 -s start
|
||||
bmi088 -A -R 2 -s start
|
||||
bmi088 -G -R 2 -s start
|
||||
|
||||
if ver hwtypecmp VD00
|
||||
if ver hwtypecmp VD000000
|
||||
then
|
||||
# Internal SPI BMI088
|
||||
bmi088 -A -R 2 -s start
|
||||
bmi088 -G -R 2 -s start
|
||||
fi
|
||||
if ver hwtypecmp VD01
|
||||
if ver hwtypecmp VD000001
|
||||
then
|
||||
# Internal SPI ICM-20602
|
||||
icm20602 -R 2 -s start
|
||||
|
||||
@@ -152,12 +152,12 @@
|
||||
#define GPIO_HW_REV_SENSE /* PC3 */ GPIO_ADC12_INP13
|
||||
#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 */ GPIO_ADC123_INP12
|
||||
#define HW_INFO_INIT "VD%04x%04x"
|
||||
#define HW_INFO_INIT_PREFIX "VD"
|
||||
|
||||
#define BOARD_NUM_SPI_CFG_HW_VERSIONS 2
|
||||
|
||||
#define VD00000000 HW_VER_REV(0x0,0x0) // Durandal, Ver 0 Rev 0
|
||||
#define VD00000001 HW_VER_REV(0x0,0x1) // Durandal, Ver 0 Rev 1
|
||||
#define VD00 HW_VER_REV(0x0,0x0) // Durandal, Ver 0 Rev 0
|
||||
#define VD01 HW_VER_REV(0x0,0x1) // Durandal, Ver 0 Rev 1
|
||||
|
||||
/* CAN Silence
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -83,8 +83,8 @@ static const px4_hw_mft_item_t hw_mft_list_durandal[] = {
|
||||
|
||||
static px4_hw_mft_list_entry_t mft_lists[] = {
|
||||
// ver_rev
|
||||
{VD00000000, hw_mft_list_durandal, arraySize(hw_mft_list_durandal)},
|
||||
{VD00000001, hw_mft_list_durandal, arraySize(hw_mft_list_durandal)},
|
||||
{VD00, hw_mft_list_durandal, arraySize(hw_mft_list_durandal)},
|
||||
{VD01, hw_mft_list_durandal, arraySize(hw_mft_list_durandal)},
|
||||
};
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
@@ -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 "V5%04x%04x"
|
||||
#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
|
||||
*
|
||||
|
||||
@@ -129,8 +129,8 @@ static const px4_hw_mft_item_t hw_mft_list_v0540[] = {
|
||||
};
|
||||
|
||||
static px4_hw_mft_list_entry_t mft_lists[] = {
|
||||
{0x00000000, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)},
|
||||
{0x00040000, 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
|
||||
};
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user