From dd38ced7c47487545b30ad2aac977183124f9291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Mi=C5=A1i=C4=87?= Date: Wed, 15 Dec 2021 23:43:45 +0100 Subject: [PATCH] fmu-v5x: use mtd to get hw info from base EEPROM --- boards/px4/fmu-v5x/src/init.cpp | 3 +++ boards/px4/fmu-v5x/src/mtd.cpp | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/boards/px4/fmu-v5x/src/init.cpp b/boards/px4/fmu-v5x/src/init.cpp index 1632e5891e..d1eacf4d02 100644 --- a/boards/px4/fmu-v5x/src/init.cpp +++ b/boards/px4/fmu-v5x/src/init.cpp @@ -72,6 +72,7 @@ extern "C" { #include #include #include +#include #include #include #include @@ -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(), diff --git a/boards/px4/fmu-v5x/src/mtd.cpp b/boards/px4/fmu-v5x/src/mtd.cpp index 4e9548c275..498a89fb6e 100644 --- a/boards/px4/fmu-v5x/src/mtd.cpp +++ b/boards/px4/fmu-v5x/src/mtd.cpp @@ -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; +}