fmu-v5x: use mtd to get hw info from base EEPROM

This commit is contained in:
Igor Mišić 2021-12-15 23:43:45 +01:00 committed by Beat Küng
parent cc63c49a51
commit dd38ced7c4
2 changed files with 16 additions and 1 deletions

View File

@ -72,6 +72,7 @@ extern "C" {
#include <systemlib/px4_macros.h>
#include <px4_arch/io_timer.h>
#include <px4_platform_common/init.h>
#include <px4_platform_common/px4_manifest.h>
#include <px4_platform/gpio.h>
#include <px4_platform/board_determine_hw_info.h>
#include <px4_platform/board_dma_alloc.h>
@ -221,6 +222,8 @@ __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());
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(),

View File

@ -102,13 +102,20 @@ static const px4_mtd_entry_t imu_eeprom = {
};
static const px4_mtd_manifest_t board_mtd_config = {
.nconfigs = 3,
.nconfigs = 2,
.entries = {
&fmum_fram,
&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,
@ -125,3 +132,8 @@ 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;
}