Browse Source

holybro_can-gps-v1:Add Flash Based Parameters

release/1.12
David Sidrane 4 years ago committed by Daniel Agar
parent
commit
9e834d26f8
  1. 2
      boards/holybro/can-gps-v1/src/board_config.h
  2. 23
      boards/holybro/can-gps-v1/src/init.c

2
boards/holybro/can-gps-v1/src/board_config.h

@ -98,6 +98,8 @@ @@ -98,6 +98,8 @@
#define HW_INFO_INIT_VER 6
#define HW_INFO_INIT_REV 7
#define FLASH_BASED_PARAMS
/* CAN Silence
*
* Silent mode control

23
boards/holybro/can-gps-v1/src/init.c

@ -74,6 +74,9 @@ @@ -74,6 +74,9 @@
#include <px4_platform/gpio.h>
#include <px4_platform/board_determine_hw_info.h>
#include <px4_platform/board_dma_alloc.h>
# if defined(FLASH_BASED_PARAMS)
# include <parameters/flashparams/flashfs.h>
#endif
/*
* Ideally we'd be able to get these from arm_internal.h,
@ -158,6 +161,23 @@ __EXPORT int board_app_initialize(uintptr_t arg) @@ -158,6 +161,23 @@ __EXPORT int board_app_initialize(uintptr_t arg)
stm32_spiinitialize();
#if defined(FLASH_BASED_PARAMS)
static sector_descriptor_t params_sector_map[] = {
{2, 16 * 1024, 0x08008000},
{0, 0, 0},
};
/* Initialize the flashfs layer to use heap allocated memory */
int result = parameter_flashfs_init(params_sector_map, NULL, 0);
if (result != OK) {
syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result);
return -ENODEV;
}
#endif // FLASH_BASED_PARAMS
#if defined(SERIAL_HAVE_RXDMA)
/* set up the serial DMA polling */
static struct hrt_call serial_dma_call;
@ -183,8 +203,5 @@ __EXPORT int board_app_initialize(uintptr_t arg) @@ -183,8 +203,5 @@ __EXPORT int board_app_initialize(uintptr_t arg)
led_on(LED_GREEN); // Indicate Power.
led_off(LED_BLUE);
/* Configure the HW based on the manifest */
px4_platform_configure();
return OK;
}

Loading…
Cancel
Save