mirror of https://github.com/rusefi/openblt.git
Refs #140.
- Checksum location is now configurable for Cortex Mx targets, due to possible different size in vector tables. git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@157 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
parent
33599da5d2
commit
dea8e21945
|
@ -51,8 +51,24 @@
|
|||
/** \brief Number of bytes to erase per erase operation. */
|
||||
#define FLASH_ERASE_BLOCK_SIZE (0x400)
|
||||
#endif
|
||||
/** \brief Offset into the user program's vector table where the checksum is located. */
|
||||
/** \brief Offset into the user program's vector table where the checksum is located.
|
||||
* For this target it is set to the end of the vector table. Note that the
|
||||
* value can be overriden in blt_conf.h, because the size of the vector table
|
||||
* could vary. When changing this value, don't forget to update the location
|
||||
* of the checksum in the user program accordingly. Otherwise the checksum
|
||||
* verification will always fail.
|
||||
*/
|
||||
#ifndef FLASH_VECTOR_TABLE_CS_OFFSET
|
||||
#define FLASH_VECTOR_TABLE_CS_OFFSET (0xC0)
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* Plausibility checks
|
||||
****************************************************************************************/
|
||||
#if (FLASH_VECTOR_TABLE_CS_OFFSET > FLASH_WRITE_BLOCK_SIZE)
|
||||
#error "FLASH_VECTOR_TABLE_CS_OFFSET is set too high. It must be located in the first writable block."
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
|
|
|
@ -44,8 +44,24 @@
|
|||
#define FLASH_WRITE_BLOCK_SIZE (512)
|
||||
/** \brief Total numbers of sectors in array flashLayout[]. */
|
||||
#define FLASH_TOTAL_SECTORS (sizeof(flashLayout)/sizeof(flashLayout[0]))
|
||||
/** \brief Offset into the user program's vector table where the checksum is located. */
|
||||
/** \brief Offset into the user program's vector table where the checksum is located.
|
||||
* For this target it is set to the end of the vector table. Note that the
|
||||
* value can be overriden in blt_conf.h, because the size of the vector table
|
||||
* could vary. When changing this value, don't forget to update the location
|
||||
* of the checksum in the user program accordingly. Otherwise the checksum
|
||||
* verification will always fail.
|
||||
*/
|
||||
#ifndef FLASH_VECTOR_TABLE_CS_OFFSET
|
||||
#define FLASH_VECTOR_TABLE_CS_OFFSET (0x0B8)
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* Plausibility checks
|
||||
****************************************************************************************/
|
||||
#if (FLASH_VECTOR_TABLE_CS_OFFSET > FLASH_WRITE_BLOCK_SIZE)
|
||||
#error "FLASH_VECTOR_TABLE_CS_OFFSET is set too high. It must be located in the first writable block."
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
|
|
|
@ -48,8 +48,24 @@
|
|||
#define FLASH_TOTAL_SECTORS (sizeof(flashLayout)/sizeof(flashLayout[0]))
|
||||
/** \brief Number of bytes to erase per erase operation. */
|
||||
#define FLASH_ERASE_BLOCK_SIZE (0x400)
|
||||
/** \brief Offset into the user program's vector table where the checksum is located. */
|
||||
/** \brief Offset into the user program's vector table where the checksum is located.
|
||||
* For this target it is set to the end of the vector table. Note that the
|
||||
* value can be overriden in blt_conf.h, because the size of the vector table
|
||||
* could vary. When changing this value, don't forget to update the location
|
||||
* of the checksum in the user program accordingly. Otherwise the checksum
|
||||
* verification will always fail.
|
||||
*/
|
||||
#ifndef FLASH_VECTOR_TABLE_CS_OFFSET
|
||||
#define FLASH_VECTOR_TABLE_CS_OFFSET (0xF0)
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* Plausibility checks
|
||||
****************************************************************************************/
|
||||
#if (FLASH_VECTOR_TABLE_CS_OFFSET > FLASH_WRITE_BLOCK_SIZE)
|
||||
#error "FLASH_VECTOR_TABLE_CS_OFFSET is set too high. It must be located in the first writable block."
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
|
|
|
@ -52,8 +52,17 @@
|
|||
#endif
|
||||
/** \brief Macro for accessing the flash control registers. */
|
||||
#define FLASH ((tFlashRegs *) (blt_int32u)0x40022000)
|
||||
/** \brief Offset into the user program's vector table where the checksum is located. */
|
||||
/** \brief Offset into the user program's vector table where the checksum is located.
|
||||
* For this target it is set to the end of the vector table. Note that the
|
||||
* value can be overriden in blt_conf.h, because the size of the vector table
|
||||
* could vary. When changing this value, don't forget to update the location
|
||||
* of the checksum in the user program accordingly. Otherwise the checksum
|
||||
* verification will always fail.
|
||||
*/
|
||||
#ifndef FLASH_VECTOR_TABLE_CS_OFFSET
|
||||
#define FLASH_VECTOR_TABLE_CS_OFFSET (0x150)
|
||||
#endif
|
||||
|
||||
#define FLASH_KEY1 ((blt_int32u)0x45670123)
|
||||
#define FLASH_KEY2 ((blt_int32u)0xCDEF89AB)
|
||||
#define FLASH_LOCK_BIT ((blt_int32u)0x00000080)
|
||||
|
@ -66,6 +75,14 @@
|
|||
#define FLASH_PG_BIT ((blt_int32u)0x00000001)
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* Plausibility checks
|
||||
****************************************************************************************/
|
||||
#if (FLASH_VECTOR_TABLE_CS_OFFSET > FLASH_WRITE_BLOCK_SIZE)
|
||||
#error "FLASH_VECTOR_TABLE_CS_OFFSET is set too high. It must be located in the first writable block."
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* Type definitions
|
||||
****************************************************************************************/
|
||||
|
|
|
@ -44,8 +44,24 @@
|
|||
#define FLASH_WRITE_BLOCK_SIZE (512)
|
||||
/** \brief Total numbers of sectors in array flashLayout[]. */
|
||||
#define FLASH_TOTAL_SECTORS (sizeof(flashLayout)/sizeof(flashLayout[0]))
|
||||
/** \brief Offset into the user program's vector table where the checksum is located. */
|
||||
/** \brief Offset into the user program's vector table where the checksum is located.
|
||||
* For this target it is set to the end of the vector table. Note that the
|
||||
* value can be overriden in blt_conf.h, because the size of the vector table
|
||||
* could vary. When changing this value, don't forget to update the location
|
||||
* of the checksum in the user program accordingly. Otherwise the checksum
|
||||
* verification will always fail.
|
||||
*/
|
||||
#ifndef FLASH_VECTOR_TABLE_CS_OFFSET
|
||||
#define FLASH_VECTOR_TABLE_CS_OFFSET (0x184)
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* Plausibility checks
|
||||
****************************************************************************************/
|
||||
#if (FLASH_VECTOR_TABLE_CS_OFFSET > FLASH_WRITE_BLOCK_SIZE)
|
||||
#error "FLASH_VECTOR_TABLE_CS_OFFSET is set too high. It must be located in the first writable block."
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
|
|
|
@ -45,8 +45,24 @@
|
|||
#define FLASH_WRITE_BLOCK_SIZE (512)
|
||||
/** \brief Total numbers of sectors in array flashLayout[]. */
|
||||
#define FLASH_TOTAL_SECTORS (sizeof(flashLayout)/sizeof(flashLayout[0]))
|
||||
/** \brief Offset into the user program's vector table where the checksum is located. */
|
||||
/** \brief Offset into the user program's vector table where the checksum is located.
|
||||
* For this target it is set to the end of the vector table. Note that the
|
||||
* value can be overriden in blt_conf.h, because the size of the vector table
|
||||
* could vary. When changing this value, don't forget to update the location
|
||||
* of the checksum in the user program accordingly. Otherwise the checksum
|
||||
* verification will always fail.
|
||||
*/
|
||||
#ifndef FLASH_VECTOR_TABLE_CS_OFFSET
|
||||
#define FLASH_VECTOR_TABLE_CS_OFFSET (0x188)
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* Plausibility checks
|
||||
****************************************************************************************/
|
||||
#if (FLASH_VECTOR_TABLE_CS_OFFSET > FLASH_WRITE_BLOCK_SIZE)
|
||||
#error "FLASH_VECTOR_TABLE_CS_OFFSET is set too high. It must be located in the first writable block."
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
|
|
|
@ -50,8 +50,24 @@
|
|||
#define FLASH_TOTAL_SECTORS (sizeof(flashLayout)/sizeof(flashLayout[0]))
|
||||
/** \brief Number of bytes to erase per erase operation. */
|
||||
#define FLASH_ERASE_BLOCK_SIZE (0x400)
|
||||
/** \brief Offset into the user program's vector table where the checksum is located. */
|
||||
/** \brief Offset into the user program's vector table where the checksum is located.
|
||||
* For this target it is set to the end of the vector table. Note that the
|
||||
* value can be overriden in blt_conf.h, because the size of the vector table
|
||||
* could vary. When changing this value, don't forget to update the location
|
||||
* of the checksum in the user program accordingly. Otherwise the checksum
|
||||
* verification will always fail.
|
||||
*/
|
||||
#ifndef FLASH_VECTOR_TABLE_CS_OFFSET
|
||||
#define FLASH_VECTOR_TABLE_CS_OFFSET (0x26C)
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* Plausibility checks
|
||||
****************************************************************************************/
|
||||
#if (FLASH_VECTOR_TABLE_CS_OFFSET > FLASH_WRITE_BLOCK_SIZE)
|
||||
#error "FLASH_VECTOR_TABLE_CS_OFFSET is set too high. It must be located in the first writable block."
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
|
|
Loading…
Reference in New Issue