mirror of https://github.com/FOME-Tech/openblt.git
- added bootloader version macros to boot.h.
- added new hook functions to the NVM module to allow an application specific override for user program verification/checksum handling. git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@54 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
parent
284cfcae80
commit
5bdefa6487
|
@ -130,12 +130,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (256)
|
#define BOOT_NVM_SIZE_KB (256)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -168,6 +168,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -130,12 +130,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (256)
|
#define BOOT_NVM_SIZE_KB (256)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -168,6 +168,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -103,12 +103,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (128)
|
#define BOOT_NVM_SIZE_KB (128)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -154,6 +154,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -103,12 +103,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (128)
|
#define BOOT_NVM_SIZE_KB (128)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -154,6 +154,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -105,12 +105,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (128)
|
#define BOOT_NVM_SIZE_KB (128)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -154,6 +154,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -139,12 +139,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (256)
|
#define BOOT_NVM_SIZE_KB (256)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -159,6 +159,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -139,12 +139,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (256)
|
#define BOOT_NVM_SIZE_KB (256)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -159,6 +159,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -141,12 +141,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (256)
|
#define BOOT_NVM_SIZE_KB (256)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -159,6 +159,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -130,12 +130,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (256)
|
#define BOOT_NVM_SIZE_KB (256)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -154,6 +154,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -130,12 +130,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (256)
|
#define BOOT_NVM_SIZE_KB (256)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -154,6 +154,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -132,12 +132,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (256)
|
#define BOOT_NVM_SIZE_KB (256)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -154,6 +154,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -143,12 +143,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (128)
|
#define BOOT_NVM_SIZE_KB (128)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -239,6 +239,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -143,12 +143,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (128)
|
#define BOOT_NVM_SIZE_KB (128)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -239,6 +239,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -145,12 +145,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (128)
|
#define BOOT_NVM_SIZE_KB (128)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -239,6 +239,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -166,12 +166,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (128)
|
#define BOOT_NVM_SIZE_KB (128)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -158,6 +158,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -166,12 +166,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (128)
|
#define BOOT_NVM_SIZE_KB (128)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -158,6 +158,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -168,12 +168,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (128)
|
#define BOOT_NVM_SIZE_KB (128)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -158,6 +158,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -139,12 +139,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (1024)
|
#define BOOT_NVM_SIZE_KB (1024)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
* \endinternal
|
* \endinternal
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
* Include files
|
||||||
|
****************************************************************************************/
|
||||||
#include "boot.h" /* bootloader generic header */
|
#include "boot.h" /* bootloader generic header */
|
||||||
#if (BOOT_FILE_LOGGING_ENABLE > 0)
|
#if (BOOT_FILE_LOGGING_ENABLE > 0)
|
||||||
#include "stm32f4xx.h" /* STM32 registers */
|
#include "stm32f4xx.h" /* STM32 registers */
|
||||||
|
@ -155,6 +158,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -139,12 +139,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (1024)
|
#define BOOT_NVM_SIZE_KB (1024)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
* \endinternal
|
* \endinternal
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
* Include files
|
||||||
|
****************************************************************************************/
|
||||||
#include "boot.h" /* bootloader generic header */
|
#include "boot.h" /* bootloader generic header */
|
||||||
#if (BOOT_FILE_LOGGING_ENABLE > 0)
|
#if (BOOT_FILE_LOGGING_ENABLE > 0)
|
||||||
#include "stm32f4xx.h" /* STM32 registers */
|
#include "stm32f4xx.h" /* STM32 registers */
|
||||||
|
@ -155,6 +158,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -141,12 +141,16 @@
|
||||||
* present on the microcontroller. Through these hook functions the NVM driver can be
|
* present on the microcontroller. Through these hook functions the NVM driver can be
|
||||||
* extended to support additional memory types such as external flash memory and serial
|
* extended to support additional memory types such as external flash memory and serial
|
||||||
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
* eeproms. The size of the internal memory in kilobytes is specified with configurable
|
||||||
* BOOT_NVM_SIZE_KB.
|
* BOOT_NVM_SIZE_KB. If desired the internal checksum writing and verification method can
|
||||||
|
* be overridden with a application specific method by enabling configuration switch
|
||||||
|
* BOOT_NVM_CHECKSUM_HOOKS_ENABLE.
|
||||||
*/
|
*/
|
||||||
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
/** \brief Enable/disable the NVM hook function for supporting additional memory devices. */
|
||||||
#define BOOT_NVM_HOOKS_ENABLE (0)
|
#define BOOT_NVM_HOOKS_ENABLE (0)
|
||||||
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
/** \brief Configure the size of the default memory device (typically flash EEPROM). */
|
||||||
#define BOOT_NVM_SIZE_KB (1024)
|
#define BOOT_NVM_SIZE_KB (1024)
|
||||||
|
/** \brief Enable/disable hooks functions to override the user program checksum handling. */
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
* \endinternal
|
* \endinternal
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
* Include files
|
||||||
|
****************************************************************************************/
|
||||||
#include "boot.h" /* bootloader generic header */
|
#include "boot.h" /* bootloader generic header */
|
||||||
#if (BOOT_FILE_LOGGING_ENABLE > 0)
|
#if (BOOT_FILE_LOGGING_ENABLE > 0)
|
||||||
#include "stm32f4xx.h" /* STM32 registers */
|
#include "stm32f4xx.h" /* STM32 registers */
|
||||||
|
@ -155,6 +158,34 @@ blt_bool NvmDoneHook(void)
|
||||||
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
#endif /* BOOT_NVM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Verifies the checksum, which indicates that a valid user program is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmVerifyChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************//**
|
||||||
|
** \brief Writes a checksum of the user program to non-volatile memory. This is
|
||||||
|
** performed once the entire user program has been programmed. Through
|
||||||
|
** the checksum, the bootloader can check if a valid user programming is
|
||||||
|
** present and can be started.
|
||||||
|
** \return BLT_TRUE if successful, BLT_FALSE otherwise.
|
||||||
|
**
|
||||||
|
****************************************************************************************/
|
||||||
|
blt_bool NvmWriteChecksumHook(void)
|
||||||
|
{
|
||||||
|
return BLT_TRUE;
|
||||||
|
}
|
||||||
|
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -47,6 +47,12 @@ extern blt_int8u NvmEraseHook(blt_addr addr, blt_int32u len);
|
||||||
extern blt_bool NvmDoneHook(void);
|
extern blt_bool NvmDoneHook(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
extern blt_bool NvmWriteChecksumHook(void);
|
||||||
|
extern blt_bool NvmVerifyChecksumHook(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************************//**
|
/************************************************************************************//**
|
||||||
** \brief Initializes the NVM driver.
|
** \brief Initializes the NVM driver.
|
||||||
|
@ -158,8 +164,13 @@ blt_bool NvmErase(blt_addr addr, blt_int32u len)
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
blt_bool NvmVerifyChecksum(void)
|
blt_bool NvmVerifyChecksum(void)
|
||||||
{
|
{
|
||||||
/* check checksum */
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/* check checksum using the application specific method. */
|
||||||
|
return NvmVerifyChecksumHook();
|
||||||
|
#else
|
||||||
|
/* check checksum using the interally supported method. */
|
||||||
return FlashVerifyChecksum();
|
return FlashVerifyChecksum();
|
||||||
|
#endif
|
||||||
} /*** end of NvmVerifyChecksum ***/
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
@ -182,11 +193,21 @@ blt_bool NvmDone(void)
|
||||||
return BLT_FALSE;
|
return BLT_FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* compute and write checksum, which is programmed by the internal driver */
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/* compute and write checksum, using the application specific method. */
|
||||||
|
if (NvmWriteChecksumHook() == BLT_FALSE)
|
||||||
|
{
|
||||||
|
return BLT_FALSE;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/* compute and write checksum, which is programmed by the internal driver. */
|
||||||
if (FlashWriteChecksum() == BLT_FALSE)
|
if (FlashWriteChecksum() == BLT_FALSE)
|
||||||
{
|
{
|
||||||
return BLT_FALSE;
|
return BLT_FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* finish up internal driver operations */
|
/* finish up internal driver operations */
|
||||||
return FlashDone();
|
return FlashDone();
|
||||||
} /*** end of NvmDone ***/
|
} /*** end of NvmDone ***/
|
||||||
|
|
|
@ -47,6 +47,12 @@ extern blt_int8u NvmEraseHook(blt_addr addr, blt_int32u len);
|
||||||
extern blt_bool NvmDoneHook(void);
|
extern blt_bool NvmDoneHook(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
extern blt_bool NvmWriteChecksumHook(void);
|
||||||
|
extern blt_bool NvmVerifyChecksumHook(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************************//**
|
/************************************************************************************//**
|
||||||
** \brief Initializes the NVM driver.
|
** \brief Initializes the NVM driver.
|
||||||
|
@ -158,8 +164,13 @@ blt_bool NvmErase(blt_addr addr, blt_int32u len)
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
blt_bool NvmVerifyChecksum(void)
|
blt_bool NvmVerifyChecksum(void)
|
||||||
{
|
{
|
||||||
/* check checksum */
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/* check checksum using the application specific method. */
|
||||||
|
return NvmVerifyChecksumHook();
|
||||||
|
#else
|
||||||
|
/* check checksum using the interally supported method. */
|
||||||
return FlashVerifyChecksum();
|
return FlashVerifyChecksum();
|
||||||
|
#endif
|
||||||
} /*** end of NvmVerifyChecksum ***/
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
@ -182,11 +193,21 @@ blt_bool NvmDone(void)
|
||||||
return BLT_FALSE;
|
return BLT_FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* compute and write checksum, which is programmed by the internal driver */
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/* compute and write checksum, using the application specific method. */
|
||||||
|
if (NvmWriteChecksumHook() == BLT_FALSE)
|
||||||
|
{
|
||||||
|
return BLT_FALSE;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/* compute and write checksum, which is programmed by the internal driver. */
|
||||||
if (FlashWriteChecksum() == BLT_FALSE)
|
if (FlashWriteChecksum() == BLT_FALSE)
|
||||||
{
|
{
|
||||||
return BLT_FALSE;
|
return BLT_FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* finish up internal driver operations */
|
/* finish up internal driver operations */
|
||||||
return FlashDone();
|
return FlashDone();
|
||||||
} /*** end of NvmDone ***/
|
} /*** end of NvmDone ***/
|
||||||
|
|
|
@ -47,6 +47,12 @@ extern blt_int8u NvmEraseHook(blt_addr addr, blt_int32u len);
|
||||||
extern blt_bool NvmDoneHook(void);
|
extern blt_bool NvmDoneHook(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
extern blt_bool NvmWriteChecksumHook(void);
|
||||||
|
extern blt_bool NvmVerifyChecksumHook(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************************//**
|
/************************************************************************************//**
|
||||||
** \brief Initializes the NVM driver.
|
** \brief Initializes the NVM driver.
|
||||||
|
@ -158,8 +164,13 @@ blt_bool NvmErase(blt_addr addr, blt_int32u len)
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
blt_bool NvmVerifyChecksum(void)
|
blt_bool NvmVerifyChecksum(void)
|
||||||
{
|
{
|
||||||
/* check checksum */
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/* check checksum using the application specific method. */
|
||||||
|
return NvmVerifyChecksumHook();
|
||||||
|
#else
|
||||||
|
/* check checksum using the interally supported method. */
|
||||||
return FlashVerifyChecksum();
|
return FlashVerifyChecksum();
|
||||||
|
#endif
|
||||||
} /*** end of NvmVerifyChecksum ***/
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
@ -182,11 +193,21 @@ blt_bool NvmDone(void)
|
||||||
return BLT_FALSE;
|
return BLT_FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* compute and write checksum, which is programmed by the internal driver */
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/* compute and write checksum, using the application specific method. */
|
||||||
|
if (NvmWriteChecksumHook() == BLT_FALSE)
|
||||||
|
{
|
||||||
|
return BLT_FALSE;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/* compute and write checksum, which is programmed by the internal driver. */
|
||||||
if (FlashWriteChecksum() == BLT_FALSE)
|
if (FlashWriteChecksum() == BLT_FALSE)
|
||||||
{
|
{
|
||||||
return BLT_FALSE;
|
return BLT_FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* finish up internal driver operations */
|
/* finish up internal driver operations */
|
||||||
return FlashDone();
|
return FlashDone();
|
||||||
} /*** end of NvmDone ***/
|
} /*** end of NvmDone ***/
|
||||||
|
|
|
@ -47,6 +47,12 @@ extern blt_int8u NvmEraseHook(blt_addr addr, blt_int32u len);
|
||||||
extern blt_bool NvmDoneHook(void);
|
extern blt_bool NvmDoneHook(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
extern blt_bool NvmWriteChecksumHook(void);
|
||||||
|
extern blt_bool NvmVerifyChecksumHook(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************************//**
|
/************************************************************************************//**
|
||||||
** \brief Initializes the NVM driver.
|
** \brief Initializes the NVM driver.
|
||||||
|
@ -158,8 +164,13 @@ blt_bool NvmErase(blt_addr addr, blt_int32u len)
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
blt_bool NvmVerifyChecksum(void)
|
blt_bool NvmVerifyChecksum(void)
|
||||||
{
|
{
|
||||||
/* check checksum */
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/* check checksum using the application specific method. */
|
||||||
|
return NvmVerifyChecksumHook();
|
||||||
|
#else
|
||||||
|
/* check checksum using the interally supported method. */
|
||||||
return FlashVerifyChecksum();
|
return FlashVerifyChecksum();
|
||||||
|
#endif
|
||||||
} /*** end of NvmVerifyChecksum ***/
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
@ -182,11 +193,21 @@ blt_bool NvmDone(void)
|
||||||
return BLT_FALSE;
|
return BLT_FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* compute and write checksum, which is programmed by the internal driver */
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/* compute and write checksum, using the application specific method. */
|
||||||
|
if (NvmWriteChecksumHook() == BLT_FALSE)
|
||||||
|
{
|
||||||
|
return BLT_FALSE;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/* compute and write checksum, which is programmed by the internal driver. */
|
||||||
if (FlashWriteChecksum() == BLT_FALSE)
|
if (FlashWriteChecksum() == BLT_FALSE)
|
||||||
{
|
{
|
||||||
return BLT_FALSE;
|
return BLT_FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* finish up internal driver operations */
|
/* finish up internal driver operations */
|
||||||
return FlashDone();
|
return FlashDone();
|
||||||
} /*** end of NvmDone ***/
|
} /*** end of NvmDone ***/
|
||||||
|
|
|
@ -47,6 +47,12 @@ extern blt_int8u NvmEraseHook(blt_addr addr, blt_int32u len);
|
||||||
extern blt_bool NvmDoneHook(void);
|
extern blt_bool NvmDoneHook(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
extern blt_bool NvmWriteChecksumHook(void);
|
||||||
|
extern blt_bool NvmVerifyChecksumHook(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************************//**
|
/************************************************************************************//**
|
||||||
** \brief Initializes the NVM driver.
|
** \brief Initializes the NVM driver.
|
||||||
|
@ -158,8 +164,13 @@ blt_bool NvmErase(blt_addr addr, blt_int32u len)
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
blt_bool NvmVerifyChecksum(void)
|
blt_bool NvmVerifyChecksum(void)
|
||||||
{
|
{
|
||||||
/* check checksum */
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/* check checksum using the application specific method. */
|
||||||
|
return NvmVerifyChecksumHook();
|
||||||
|
#else
|
||||||
|
/* check checksum using the interally supported method. */
|
||||||
return FlashVerifyChecksum();
|
return FlashVerifyChecksum();
|
||||||
|
#endif
|
||||||
} /*** end of NvmVerifyChecksum ***/
|
} /*** end of NvmVerifyChecksum ***/
|
||||||
|
|
||||||
|
|
||||||
|
@ -182,11 +193,21 @@ blt_bool NvmDone(void)
|
||||||
return BLT_FALSE;
|
return BLT_FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* compute and write checksum, which is programmed by the internal driver */
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||||
|
/* compute and write checksum, using the application specific method. */
|
||||||
|
if (NvmWriteChecksumHook() == BLT_FALSE)
|
||||||
|
{
|
||||||
|
return BLT_FALSE;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/* compute and write checksum, which is programmed by the internal driver. */
|
||||||
if (FlashWriteChecksum() == BLT_FALSE)
|
if (FlashWriteChecksum() == BLT_FALSE)
|
||||||
{
|
{
|
||||||
return BLT_FALSE;
|
return BLT_FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* finish up internal driver operations */
|
/* finish up internal driver operations */
|
||||||
return FlashDone();
|
return FlashDone();
|
||||||
} /*** end of NvmDone ***/
|
} /*** end of NvmDone ***/
|
||||||
|
|
|
@ -50,6 +50,17 @@
|
||||||
#include "xcp.h" /* xcp communication layer */
|
#include "xcp.h" /* xcp communication layer */
|
||||||
|
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
* Defines
|
||||||
|
****************************************************************************************/
|
||||||
|
/** \brief Main version of the bootloader core. */
|
||||||
|
#define BOOT_VERSION_CORE_MAIN (0u)
|
||||||
|
/** \brief Minor version of the bootloader core. */
|
||||||
|
#define BOOT_VERSION_CORE_MINOR (96u)
|
||||||
|
/** \brief Bufgix version of the bootloader core. */
|
||||||
|
#define BOOT_VERSION_CORE_BUGFIX (0u)
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* Function prototypes
|
* Function prototypes
|
||||||
****************************************************************************************/
|
****************************************************************************************/
|
||||||
|
|
|
@ -292,6 +292,14 @@
|
||||||
#error "BOOT_NVM_SIZE_KB must be > 0"
|
#error "BOOT_NVM_SIZE_KB must be > 0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef BOOT_NVM_CHECKSUM_HOOKS_ENABLE
|
||||||
|
#define BOOT_NVM_CHECKSUM_HOOKS_ENABLE (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE < 0) || (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 1)
|
||||||
|
#error "BOOT_NVM_CHECKSUM_HOOKS_ENABLE must be 0 or 1"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* W A T C H D O G D R I V E R C O N F I G U R A T I O N C H E C K
|
* W A T C H D O G D R I V E R C O N F I G U R A T I O N C H E C K
|
||||||
|
|
Loading…
Reference in New Issue