Merge pull request #1732 from bthebaudeau/cc2538-flash-conf-fw-coffee

cc2538: Add configuration for firmware location
This commit is contained in:
Antonio Lignan 2016-06-24 18:44:16 +02:00 committed by GitHub
commit f0b19a18a9
2 changed files with 19 additions and 2 deletions

View file

@ -35,8 +35,7 @@
*/
MEMORY
{
FLASH_FW (rx) : ORIGIN = COFFEE_START + COFFEE_SIZE,
LENGTH = FLASH_CCA_ADDR - (COFFEE_START + COFFEE_SIZE)
FLASH_FW (rx) : ORIGIN = FLASH_FW_ADDR, LENGTH = FLASH_FW_SIZE
FLASH_CCA (RX) : ORIGIN = FLASH_CCA_ADDR, LENGTH = FLASH_CCA_SIZE
/*

View file

@ -48,6 +48,7 @@
#define FLASH_H_
#include "dev/cc2538-dev.h"
#include "cfs-coffee-arch.h"
#include <stdint.h>
/*---------------------------------------------------------------------------*/
@ -90,6 +91,23 @@
#define FLASH_CCA_LOCK_DEBUG_BIT 7 /**< Debug lock bit position in the corresponding lock byte */
/** @} */
/*---------------------------------------------------------------------------*/
/** \name Firmware location in flash memory
* @{
*/
#ifdef FLASH_CONF_FW_ADDR
#define FLASH_FW_ADDR FLASH_CONF_FW_ADDR
#elif !defined(COFFEE_CONF_CUSTOM_PORT)
#define FLASH_FW_ADDR (COFFEE_START + COFFEE_SIZE)
#else
#define FLASH_FW_ADDR CC2538_DEV_FLASH_ADDR
#endif
#ifdef FLASH_CONF_FW_SIZE
#define FLASH_FW_SIZE FLASH_CONF_FW_SIZE
#else
#define FLASH_FW_SIZE (FLASH_CCA_ADDR - FLASH_FW_ADDR)
#endif
/** @} */
/*---------------------------------------------------------------------------*/
/** \name Flash lock bit page and CCA layout
* @{
*/