1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

REVONANO - Add support for eeprom and objlist fs

This commit is contained in:
Alessio Morale 2014-10-29 18:55:22 +01:00
parent 8b11861c63
commit 5c13551a1a
9 changed files with 55 additions and 35 deletions

View File

@ -132,11 +132,10 @@ int32_t PIOS_Flash_EEPROM_ReadSinglePage(struct flash_eeprom_dev *flash_dev, uin
if (address > 0xFFFF) {
return -2;
}
uint16_t address16 = address & 0xFFFF;
uint8_t mem_address[] = {
(address16 & 0xff00) >> 8, // MSB
(address16 & 0xFF) // LSB
(address & 0xFF00) >> 8, // MSB
(address & 0xFF) // LSB
};
const struct pios_i2c_txn txn_list[] = {

View File

@ -2,8 +2,8 @@ MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x008000 - 0x000080
BD_INFO (r) : ORIGIN = 0x08008000 - 0x80, LENGTH = 0x000080
RSVD (rx) : ORIGIN = 0x08008000, LENGTH = 0x020000 - 0x008000
FW (rx) : ORIGIN = 0x08010000, LENGTH = 0x060000
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x018000
RSVD (rx) : ORIGIN = 0x08008000, LENGTH = 0x010000 - 0x008000
FW (rx) : ORIGIN = 0x08010000, LENGTH = 0x030000
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x010000
}
REGION_ALIAS("CCSRAM", SRAM);

View File

@ -1,8 +1,9 @@
MEMORY
{
BL (rx) : ORIGIN = 0x08000000, LENGTH = 0x008000 - 0x000080
BD_INFO (r) : ORIGIN = 0x08008000 - 0x80, LENGTH = 0x000080
RSVD (rx) : ORIGIN = 0x08008000, LENGTH = 0x020000 - 0x008000
FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 0x060000
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x018000
RSVD (rx) : ORIGIN = 0x08008000, LENGTH = 0x010000 - 0x008000
FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 0x030000
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x010000
}
REGION_ALIAS("CCSRAM", SRAM);

View File

@ -1312,3 +1312,25 @@ void PIOS_WS2811_irq_handler(void)
PIOS_WS2811_DMA_irq_handler();
}
#endif // PIOS_INCLUDE_WS2811
#ifdef PIOS_INCLUDE_FLASH_OBJLIST
#include <pios_flashfs_objlist.h>
struct flashfs_cfg flash_main_fs_cfg = {
.table_magic = 0x01020304,
.obj_magic = 0x19293949,
.obj_table_start = 0,
.obj_table_end = 0xC000, // spaces for 192 UAVOs
.sector_size = 0xFF,
.chip_size = 0x10000
};
#endif /* PIOS_INCLUDE_FLASH_OBJLIST */
#ifdef PIOS_INCLUDE_FLASH_EEPROM
#include <pios_flash_eeprom.h>
struct pios_flash_eeprom_cfg flash_main_chip_cfg = {
.page_len = 128,
.total_size = 0x10000,
};
// .i2c_address = 0x50,
#endif /* PIOS_INCLUDE_FLASH_EEPROM */

View File

@ -38,8 +38,8 @@ MODULES += Receiver
MODULES += Actuator
MODULES += GPS
MODULES += TxPID
MODULES += CameraStab
MODULES += Battery
#MODULES += CameraStab
#MODULES += Battery
MODULES += FirmwareIAP
#MODULES += PathPlanner
#MODULES += PathFollower
@ -72,7 +72,10 @@ ifndef TESTAPP
SRC += $(FLIGHTLIB)/instrumentation.c
SRC += $(OPUAVTALK)/uavtalk.c
SRC += $(OPUAVOBJ)/uavobjectmanager.c
SRC += $(OPUAVOBJ)/uavobjectpersistence.c
SRC += $(OPUAVOBJ)/eventdispatcher.c
SRC += $(PIOSCOMMON)/pios_flash_eeprom.c
SRC += $(PIOSCOMMON)/pios_flashfs_objlist.c
#ifeq ($(DEBUG), YES)
SRC += $(OPSYSTEM)/dcc_stdio.c

View File

@ -26,7 +26,7 @@
#define configTICK_RATE_HZ ((portTickType)1000)
#define configMAX_PRIORITIES ((unsigned portBASE_TYPE)5)
#define configMINIMAL_STACK_SIZE ((unsigned short)512)
#define configTOTAL_HEAP_SIZE ((size_t)(70 * 1024)) // this is minimum, not total
#define configTOTAL_HEAP_SIZE ((size_t)(50 * 1024)) // this is minimum, not total
#define configMAX_TASK_NAME_LEN (16)
#define configUSE_PREEMPTION 1

View File

@ -119,9 +119,11 @@
/* #define PIOS_OVERO_SPI */
/* #define PIOS_INCLUDE_SDCARD */
/* #define LOG_FILENAME "startup.log" */
// #define PIOS_INCLUDE_FLASH
#define PIOS_INCLUDE_FLASH
// #define PIOS_INCLUDE_FLASH_INTERNAL
// #define PIOS_INCLUDE_FLASH_LOGFS_SETTINGS
#define PIOS_INCLUDE_FLASH_OBJLIST
#define PIOS_INCLUDE_FLASH_EEPROM
#define FLASH_FREERTOS
/* #define PIOS_INCLUDE_FLASH_EEPROM */

View File

@ -102,7 +102,6 @@ static const struct pios_ms5611_cfg pios_ms5611_cfg = {
};
#endif /* PIOS_INCLUDE_MS5611 */
/**
* Configuration for the MPU6000 chip
*/
@ -318,25 +317,24 @@ void PIOS_Board_Init(void)
PIOS_DEBUG_Assert(0);
}
#endif
#if defined(PIOS_INCLUDE_FLASH)
/* Connect flash to the appropriate interface and configure it */
#if 0
uintptr_t flash_id = 0;
// Initialize the external USER flash
if (PIOS_Flash_Jedec_Init(&flash_id, pios_spi_telem_flash_id, 1)) {
PIOS_DEBUG_Assert(0);
}
if (PIOS_FLASHFS_Logfs_Init(&pios_uavo_settings_fs_id, &flashfs_external_system_cfg, &pios_jedec_flash_driver, flash_id)) {
PIOS_DEBUG_Assert(0);
}
if (PIOS_FLASHFS_Logfs_Init(&pios_user_fs_id, &flashfs_external_user_cfg, &pios_jedec_flash_driver, flash_id)) {
#ifdef PIOS_INCLUDE_I2C
if (PIOS_I2C_Init(&pios_i2c_pressure_adapter_id, &pios_i2c_pressure_adapter_cfg)) {
PIOS_DEBUG_Assert(0);
}
#endif
#if defined(PIOS_INCLUDE_FLASH)
/* Connect flash to the appropriate interface and configure it */
uintptr_t flash_id = 0;
// Initialize the external USER flash
if (PIOS_Flash_EEPROM_Init(&flash_id, &flash_main_chip_cfg, pios_i2c_pressure_adapter_id, 0x50)) {
PIOS_DEBUG_Assert(0);
}
if (PIOS_FLASHFS_Init(&pios_uavo_settings_fs_id, &flash_main_fs_cfg, &pios_EEPROM_flash_driver, flash_id)) {
PIOS_DEBUG_Assert(0);
}
#endif /* if defined(PIOS_INCLUDE_FLASH) */
@ -729,10 +727,6 @@ void PIOS_Board_Init(void)
};
GPIO_Init(GPIOA, &gpioA8);
if (PIOS_I2C_Init(&pios_i2c_pressure_adapter_id, &pios_i2c_pressure_adapter_cfg)) {
PIOS_DEBUG_Assert(0);
}
PIOS_DELAY_WaitmS(50);
#if defined(PIOS_INCLUDE_ADC)

View File

@ -77,7 +77,6 @@ ifndef TESTAPP
SRC += $(OPUAVOBJ)/eventdispatcher.c
SRC += $(PIOSCOMMON)/pios_flashfs_logfs.c
SRC += $(PIOSCOMMON)/pios_flash_jedec.c
#ifeq ($(DEBUG), YES)
SRC += $(OPSYSTEM)/dcc_stdio.c