Simplify configuration of the CC13xx/CC26xx ROM bootloader

Currently board.h does all the work, but it does not really need to. This commit moves most of the ccfg defines to ccxxware-conf.h and now board.h only needs to specify the bootloader enable pin and corresponding level.
This commit is contained in:
George Oikonomou 2018-08-16 22:01:48 +01:00
parent 917333dbeb
commit 06bbb65bdb
14 changed files with 90 additions and 99 deletions

View File

@ -199,8 +199,14 @@
* the chip to enter bootloader mode. * the chip to enter bootloader mode.
* @{ * @{
*/ */
#ifndef ROM_BOOTLOADER_ENABLE
#define ROM_BOOTLOADER_ENABLE 1 /* Backward compatibility */
#ifdef ROM_BOOTLOADER_ENABLE
#define CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE ROM_BOOTLOADER_ENABLE
#endif
#ifndef CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE
#define CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE 1
#endif #endif
/** @} */ /** @} */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/

View File

@ -68,6 +68,26 @@
#define SET_CCFG_CCFG_TAP_DAP_1_WUC_TAP_ENABLE 0x00 #define SET_CCFG_CCFG_TAP_DAP_1_WUC_TAP_ENABLE 0x00
#endif #endif
/** @} */ /** @} */
/*---------------------------------------------------------------------------*/
/**
* \brief ROM bootloader configuration
*
* Those values are not meant to be modified by the user
* @{
*/
#if CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5
#define SET_CCFG_BL_CONFIG_BL_LEVEL CCXXWARE_CONF_BL_LEVEL
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER CCXXWARE_CONF_BL_PIN_NUMBER
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
#else
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0x00
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x01
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER IOID_UNUSED
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xFF
#endif
/** @} */
/*---------------------------------------------------------------------------*/
#endif /* CCXXWARE_CONF_H_ */ #endif /* CCXXWARE_CONF_H_ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**

View File

@ -141,23 +141,14 @@
/** /**
* \brief ROM bootloader configuration * \brief ROM bootloader configuration
* *
* Change SET_CCFG_BL_CONFIG_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select * Change CCXXWARE_CONF_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select which
* which button triggers the bootloader on reset. * button triggers the bootloader on reset. Use CCXXWARE_CONF_BL_LEVEL to
* * control the pin level that enables the bootloader (0: low, 1: high). It is
* The remaining values are not meant to be modified by the user * also possible to use any other externally-controlled DIO.
* @{ * @{
*/ */
#if ROM_BOOTLOADER_ENABLE #define CCXXWARE_CONF_BL_PIN_NUMBER BOARD_IOID_KEY_LEFT
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5 #define CCXXWARE_CONF_BL_LEVEL 0
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x00
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER BOARD_IOID_KEY_LEFT
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
#else
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0x00
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x01
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0xFF
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xFF
#endif
/** @} */ /** @} */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**

View File

@ -158,23 +158,14 @@
/** /**
* \brief ROM bootloader configuration * \brief ROM bootloader configuration
* *
* Change SET_CCFG_BL_CONFIG_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select * Change CCXXWARE_CONF_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select which
* which button triggers the bootloader on reset. * button triggers the bootloader on reset. Use CCXXWARE_CONF_BL_LEVEL to
* * control the pin level that enables the bootloader (0: low, 1: high). It is
* The remaining values are not meant to be modified by the user * also possible to use any other externally-controlled DIO.
* @{ * @{
*/ */
#if ROM_BOOTLOADER_ENABLE #define CCXXWARE_CONF_BL_PIN_NUMBER BOARD_IOID_KEY_LEFT
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5 #define CCXXWARE_CONF_BL_LEVEL 0
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x00
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER BOARD_IOID_KEY_LEFT
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
#else
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0x00
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x01
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0xFF
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xFF
#endif
/** @} */ /** @} */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**

View File

@ -141,23 +141,14 @@
/** /**
* \brief ROM bootloader configuration * \brief ROM bootloader configuration
* *
* Change SET_CCFG_BL_CONFIG_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select * Change CCXXWARE_CONF_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select which
* which button triggers the bootloader on reset. * button triggers the bootloader on reset. Use CCXXWARE_CONF_BL_LEVEL to
* * control the pin level that enables the bootloader (0: low, 1: high). It is
* The remaining values are not meant to be modified by the user * also possible to use any other externally-controlled DIO.
* @{ * @{
*/ */
#if ROM_BOOTLOADER_ENABLE #define CCXXWARE_CONF_BL_PIN_NUMBER BOARD_IOID_KEY_LEFT
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5 #define CCXXWARE_CONF_BL_LEVEL 0
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x00
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER BOARD_IOID_KEY_LEFT
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
#else
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0x00
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x01
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0xFF
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xFF
#endif
/** @} */ /** @} */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**

View File

@ -141,23 +141,14 @@
/** /**
* \brief ROM bootloader configuration * \brief ROM bootloader configuration
* *
* Change SET_CCFG_BL_CONFIG_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select * Change CCXXWARE_CONF_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select which
* which button triggers the bootloader on reset. * button triggers the bootloader on reset. Use CCXXWARE_CONF_BL_LEVEL to
* * control the pin level that enables the bootloader (0: low, 1: high). It is
* The remaining values are not meant to be modified by the user * also possible to use any other externally-controlled DIO.
* @{ * @{
*/ */
#if ROM_BOOTLOADER_ENABLE #define CCXXWARE_CONF_BL_PIN_NUMBER BOARD_IOID_KEY_LEFT
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5 #define CCXXWARE_CONF_BL_LEVEL 0
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x00
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER BOARD_IOID_KEY_LEFT
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
#else
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0x00
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x01
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0xFF
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xFF
#endif
/** @} */ /** @} */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**

View File

@ -253,6 +253,16 @@
#define BOARD_BUTTON_HAL_INDEX_REED_RELAY 0xFF #define BOARD_BUTTON_HAL_INDEX_REED_RELAY 0xFF
/** @} */ /** @} */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/**
* \brief ROM bootloader configuration
*
* Sensortags do not support the bootloader
* @{
*/
#define CCXXWARE_CONF_BL_PIN_NUMBER IOID_UNUSED
#define CCXXWARE_CONF_BL_LEVEL 0
/** @} */
/*---------------------------------------------------------------------------*/
/** /**
* \name Device string used on startup * \name Device string used on startup
* @{ * @{

View File

@ -234,6 +234,16 @@
#define BOARD_BUTTON_HAL_INDEX_REED_RELAY 0xFF #define BOARD_BUTTON_HAL_INDEX_REED_RELAY 0xFF
/** @} */ /** @} */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/**
* \brief ROM bootloader configuration
*
* Sensortags do not support the bootloader
* @{
*/
#define CCXXWARE_CONF_BL_PIN_NUMBER IOID_UNUSED
#define CCXXWARE_CONF_BL_LEVEL 0
/** @} */
/*---------------------------------------------------------------------------*/
/** /**
* \name Device string used on startup * \name Device string used on startup
* @{ * @{

View File

@ -213,23 +213,14 @@
/** /**
* \brief ROM bootloader configuration * \brief ROM bootloader configuration
* *
* Change SET_CCFG_BL_CONFIG_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select * Change CCXXWARE_CONF_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select which
* which button triggers the bootloader on reset. * button triggers the bootloader on reset. Use CCXXWARE_CONF_BL_LEVEL to
* * control the pin level that enables the bootloader (0: low, 1: high). It is
* The remaining values are not meant to be modified by the user * also possible to use any other externally-controlled DIO.
* @{ * @{
*/ */
#if ROM_BOOTLOADER_ENABLE #define CCXXWARE_CONF_BL_PIN_NUMBER BOARD_IOID_KEY_SELECT
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5 #define CCXXWARE_CONF_BL_LEVEL 0
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x00
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER BOARD_IOID_KEY_SELECT
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
#else
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0x00
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x01
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0xFF
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xFF
#endif
/** @} */ /** @} */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**

View File

@ -213,23 +213,14 @@
/** /**
* \brief ROM bootloader configuration * \brief ROM bootloader configuration
* *
* Change SET_CCFG_BL_CONFIG_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select * Change CCXXWARE_CONF_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select which
* which button triggers the bootloader on reset. * button triggers the bootloader on reset. Use CCXXWARE_CONF_BL_LEVEL to
* * control the pin level that enables the bootloader (0: low, 1: high). It is
* The remaining values are not meant to be modified by the user * also possible to use any other externally-controlled DIO.
* @{ * @{
*/ */
#if ROM_BOOTLOADER_ENABLE #define CCXXWARE_CONF_BL_PIN_NUMBER BOARD_IOID_KEY_SELECT
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5 #define CCXXWARE_CONF_BL_LEVEL 0
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x00
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER BOARD_IOID_KEY_SELECT
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
#else
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0x00
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x01
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0xFF
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xFF
#endif
/** @} */ /** @} */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**

View File

@ -64,7 +64,7 @@
#define SENSORTAG_CC2650_REV_1_2_0 0 #define SENSORTAG_CC2650_REV_1_2_0 0
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Enable the ROM bootloader */ /* Enable the ROM bootloader */
#define ROM_BOOTLOADER_ENABLE 1 #define CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE 1
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* Shrink the size of the uIP buffer, routing table and ND cache. * Shrink the size of the uIP buffer, routing table and ND cache.

View File

@ -32,7 +32,7 @@
#define PROJECT_CONF_H_ #define PROJECT_CONF_H_
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Enable the ROM bootloader */ /* Enable the ROM bootloader */
#define ROM_BOOTLOADER_ENABLE 1 #define CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE 1
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Change to match your configuration */ /* Change to match your configuration */
#define IEEE802154_CONF_PANID 0xABCD #define IEEE802154_CONF_PANID 0xABCD

View File

@ -35,9 +35,8 @@
#define IEEE802154_CONF_PANID 0xABCD #define IEEE802154_CONF_PANID 0xABCD
#define IEEE802154_CONF_DEFAULT_CHANNEL 25 #define IEEE802154_CONF_DEFAULT_CHANNEL 25
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Enable the ROM bootloader */ /* Enable the ROM bootloader */
#define ROM_BOOTLOADER_ENABLE 1 #define CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE 1
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* For very sleepy operation */ /* For very sleepy operation */
#define RF_BLE_CONF_ENABLED 0 #define RF_BLE_CONF_ENABLED 0

View File

@ -32,9 +32,9 @@
#ifndef TARGET_CONF_H_ #ifndef TARGET_CONF_H_
#define TARGET_CONF_H_ #define TARGET_CONF_H_
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#define CC26XX_UART_CONF_BAUD_RATE 460800 #define CC26XX_UART_CONF_BAUD_RATE 460800
#define RF_BLE_CONF_ENABLED 0 #define RF_BLE_CONF_ENABLED 0
#define ROM_BOOTLOADER_ENABLE 1 #define CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE 1
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#define SENSNIFF_IO_DRIVER_H "pool/cc13xx-cc26xx-io.h" #define SENSNIFF_IO_DRIVER_H "pool/cc13xx-cc26xx-io.h"
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/