forked from Archive/PX4-Autopilot
omnibus: switch to flash-based params
Not all boards have an SD card. This is a *breaking* change and requires a bootloader change.
This commit is contained in:
parent
95b472277c
commit
2698625be9
|
@ -44,12 +44,13 @@
|
|||
* where the code expects to begin execution by jumping to the entry point in
|
||||
* the 0x0800:0000 address range.
|
||||
*
|
||||
* The first 0x4000 of flash is reserved for the bootloader.
|
||||
* The first 16 KiB of flash is reserved for the bootloader.
|
||||
* Paramater storage will use the next 16KiB Sector.
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash (rx) : ORIGIN = 0x08004000, LENGTH = 1008K
|
||||
flash (rx) : ORIGIN = 0x08008000, LENGTH = 992K
|
||||
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
|
||||
ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
|
||||
}
|
||||
|
|
|
@ -61,6 +61,8 @@
|
|||
|
||||
#define BOARD_OVERLOAD_LED LED_BLUE
|
||||
|
||||
#define FLASH_BASED_PARAMS
|
||||
|
||||
/*
|
||||
* ADC channels
|
||||
*
|
||||
|
|
|
@ -78,6 +78,10 @@
|
|||
|
||||
#include <parameters/param.h>
|
||||
|
||||
# if defined(FLASH_BASED_PARAMS)
|
||||
# include <parameters/flashparams/flashfs.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
|
@ -373,5 +377,23 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||
SPI_SELECT(spi3, PX4_SPIDEV_BARO, false);
|
||||
up_udelay(20);
|
||||
|
||||
#if defined(FLASH_BASED_PARAMS)
|
||||
static sector_descriptor_t params_sector_map[] = {
|
||||
{1, 16 * 1024, 0x08004000},
|
||||
{0, 0, 0},
|
||||
};
|
||||
|
||||
/* Initialize the flashfs layer to use heap allocated memory */
|
||||
result = parameter_flashfs_init(params_sector_map, NULL, 0);
|
||||
|
||||
if (result != OK) {
|
||||
message("[boot] FAILED to init params in FLASH %d\n", result);
|
||||
led_on(LED_AMBER);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue