Flash ROM fixes for STM32F10X_HD

This commit is contained in:
NIIBE Yutaka
2010-11-30 14:32:56 +09:00
parent 87b0ca84b1
commit d49c33ec96
4 changed files with 23 additions and 7 deletions

View File

@@ -1,5 +1,11 @@
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.
* ChibiOS_2.0.8/os/hal/include/pwm.h
* ChibiOS_2.0.8/os/hal/platforms/STM32/pwm_lld.c

6
src/configure vendored
View File

@@ -139,6 +139,11 @@ if test "$with_dfu" = "yes"; then
else
echo "Configured for bare system (no-DFU)"
ORIGIN=0x08000000
if test "$target" = "STM32_PRIMER2"; then
FLASH_PAGE_SIZE=2048
else
FLASH_PAGE_SIZE=1024
fi
if test "$target" = "STM8S_DISCOVERY"; then
FLASH_SIZE=64k
else
@@ -151,6 +156,7 @@ sed -e "s%@BOARD_MAKEFILE@%$BOARD_MAKEFILE%" \
-e "s%@DEBUG_MAKE_OPTION@%$DEBUG_MAKE_OPTION%" \
< Makefile.in > Makefile
sed -e "s/@ORIGIN@/$ORIGIN/" -e "s/@FLASH_SIZE@/$FLASH_SIZE/" \
-e "s/@FLASH_PAGE_SIZE@/$FLASH_PAGE_SIZE/" \
< gnuk.ld.in > gnuk.ld
sed -e "s/@DEBUG_DEFINE@/$DEBUG_DEFINE/" \
-e "s/@DFU_DEFINE@/$DFU_DEFINE/" \

View File

@@ -146,15 +146,19 @@ flash_erase_page (uint32_t addr)
* ...
* _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)
*/
#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
#endif
#define FLASH_DATA_POOL_SIZE (FLASH_PAGE_SIZE*2)
static const uint8_t *data_pool;
static const uint8_t *keystore_pool;

View File

@@ -116,17 +116,17 @@ SECTIONS
.gnuk_random :
{
. = ALIGN (1024);
. = ALIGN (@FLASH_PAGE_SIZE@);
*(.gnuk_random)
} > flash =0xffffffff
.gnuk_flash : ALIGN (1024)
.gnuk_flash : ALIGN (@FLASH_PAGE_SIZE@)
{
_data_pool = .;
KEEP(*(.gnuk_data))
FILL(0xffffffff);
. = ALIGN(1024);
. += 1024;
. = ALIGN(@FLASH_PAGE_SIZE@);
. += @FLASH_PAGE_SIZE@;
_keystore_pool = .;
FILL(0xffffffff);
. += 1024*3;