Flash ROM fixes for STM32F10X_HD
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
2010-11-30 NIIBE Yutaka <gniibe@fsij.org>
|
2010-11-30 NIIBE Yutaka <gniibe@fsij.org>
|
||||||
|
|
||||||
|
Flash ROM fixes for STM32F10X_HD.
|
||||||
|
* src/gnuk.ld.in (.gnuk_flash): Use FLASH_PAGE_SIZE.
|
||||||
|
* src/configure (FLASH_PAGE_SIZE): Defined for gnuk.ld.
|
||||||
|
* src/flash.c (FLASH_PAGE_SIZE): New define.
|
||||||
|
(FLASH_DATA_POOL_SIZE): Use FLASH_PAGE_SIZE.
|
||||||
|
|
||||||
Import changes of ChibiOS_2.0.8.
|
Import changes of ChibiOS_2.0.8.
|
||||||
* ChibiOS_2.0.8/os/hal/include/pwm.h
|
* ChibiOS_2.0.8/os/hal/include/pwm.h
|
||||||
* ChibiOS_2.0.8/os/hal/platforms/STM32/pwm_lld.c
|
* ChibiOS_2.0.8/os/hal/platforms/STM32/pwm_lld.c
|
||||||
|
|||||||
6
src/configure
vendored
6
src/configure
vendored
@@ -139,6 +139,11 @@ if test "$with_dfu" = "yes"; then
|
|||||||
else
|
else
|
||||||
echo "Configured for bare system (no-DFU)"
|
echo "Configured for bare system (no-DFU)"
|
||||||
ORIGIN=0x08000000
|
ORIGIN=0x08000000
|
||||||
|
if test "$target" = "STM32_PRIMER2"; then
|
||||||
|
FLASH_PAGE_SIZE=2048
|
||||||
|
else
|
||||||
|
FLASH_PAGE_SIZE=1024
|
||||||
|
fi
|
||||||
if test "$target" = "STM8S_DISCOVERY"; then
|
if test "$target" = "STM8S_DISCOVERY"; then
|
||||||
FLASH_SIZE=64k
|
FLASH_SIZE=64k
|
||||||
else
|
else
|
||||||
@@ -151,6 +156,7 @@ sed -e "s%@BOARD_MAKEFILE@%$BOARD_MAKEFILE%" \
|
|||||||
-e "s%@DEBUG_MAKE_OPTION@%$DEBUG_MAKE_OPTION%" \
|
-e "s%@DEBUG_MAKE_OPTION@%$DEBUG_MAKE_OPTION%" \
|
||||||
< Makefile.in > Makefile
|
< Makefile.in > Makefile
|
||||||
sed -e "s/@ORIGIN@/$ORIGIN/" -e "s/@FLASH_SIZE@/$FLASH_SIZE/" \
|
sed -e "s/@ORIGIN@/$ORIGIN/" -e "s/@FLASH_SIZE@/$FLASH_SIZE/" \
|
||||||
|
-e "s/@FLASH_PAGE_SIZE@/$FLASH_PAGE_SIZE/" \
|
||||||
< gnuk.ld.in > gnuk.ld
|
< gnuk.ld.in > gnuk.ld
|
||||||
sed -e "s/@DEBUG_DEFINE@/$DEBUG_DEFINE/" \
|
sed -e "s/@DEBUG_DEFINE@/$DEBUG_DEFINE/" \
|
||||||
-e "s/@DFU_DEFINE@/$DFU_DEFINE/" \
|
-e "s/@DFU_DEFINE@/$DFU_DEFINE/" \
|
||||||
|
|||||||
10
src/flash.c
10
src/flash.c
@@ -146,15 +146,19 @@ flash_erase_page (uint32_t addr)
|
|||||||
* ...
|
* ...
|
||||||
* _etext + (_edata - _data)
|
* _etext + (_edata - _data)
|
||||||
*
|
*
|
||||||
* 1-KiB align padding
|
* flash-page-size align padding
|
||||||
*
|
*
|
||||||
* 1-KiB data pool * 2
|
* flash-page-size data pool * 2
|
||||||
*
|
*
|
||||||
* 3-KiB Key store (512-byte (p, q and N) key-store * 6)
|
* 3-KiB Key store (512-byte (p, q and N) key-store * 6)
|
||||||
*/
|
*/
|
||||||
#define FLASH_DATA_POOL_HEADER_SIZE 2
|
#define FLASH_DATA_POOL_HEADER_SIZE 2
|
||||||
#define FLASH_DATA_POOL_SIZE (1024*2)
|
#if defined(STM32F10X_HD)
|
||||||
|
#define FLASH_PAGE_SIZE 2048
|
||||||
|
#else
|
||||||
#define FLASH_PAGE_SIZE 1024
|
#define FLASH_PAGE_SIZE 1024
|
||||||
|
#endif
|
||||||
|
#define FLASH_DATA_POOL_SIZE (FLASH_PAGE_SIZE*2)
|
||||||
|
|
||||||
static const uint8_t *data_pool;
|
static const uint8_t *data_pool;
|
||||||
static const uint8_t *keystore_pool;
|
static const uint8_t *keystore_pool;
|
||||||
|
|||||||
@@ -116,17 +116,17 @@ SECTIONS
|
|||||||
|
|
||||||
.gnuk_random :
|
.gnuk_random :
|
||||||
{
|
{
|
||||||
. = ALIGN (1024);
|
. = ALIGN (@FLASH_PAGE_SIZE@);
|
||||||
*(.gnuk_random)
|
*(.gnuk_random)
|
||||||
} > flash =0xffffffff
|
} > flash =0xffffffff
|
||||||
|
|
||||||
.gnuk_flash : ALIGN (1024)
|
.gnuk_flash : ALIGN (@FLASH_PAGE_SIZE@)
|
||||||
{
|
{
|
||||||
_data_pool = .;
|
_data_pool = .;
|
||||||
KEEP(*(.gnuk_data))
|
KEEP(*(.gnuk_data))
|
||||||
FILL(0xffffffff);
|
FILL(0xffffffff);
|
||||||
. = ALIGN(1024);
|
. = ALIGN(@FLASH_PAGE_SIZE@);
|
||||||
. += 1024;
|
. += @FLASH_PAGE_SIZE@;
|
||||||
_keystore_pool = .;
|
_keystore_pool = .;
|
||||||
FILL(0xffffffff);
|
FILL(0xffffffff);
|
||||||
. += 1024*3;
|
. += 1024*3;
|
||||||
|
|||||||
Reference in New Issue
Block a user