2015-04-18 09:59 PM
Hi,
I'm trying AN2557 FW3.30 from ST's website. i run it and I fill it succesfully when download first application at 0x8003000-0x8004209. but for second time, the downloading is failed. then i go to check flash contain, and i saw the address 0x8003000-0x80037FF = still fill with data (i'm not sure is this from last application or new) 0x8003800-0x8003BFF = Blank (0xFF) 0x8003C00-0x8003FFF = Data Contained 0x804000 - .... = Blank (0xFF) what is the mistake? Thanks in advance.2015-04-19 12:41 AM
2015-04-19 07:47 AM
Who knows what part, specifically, you're using?
If I had to guess I'd say you have the erase block (sector) size wrong for the part you're using, say 0x400 vs 0x8002015-04-20 05:51 AM
sorry, i forgot to explain. i'm using STM32F100C8 and KEIL. at the app note, i read, we should uncomment corresponding line in stm32_eval.h. then i do uncomment #define USE_STM32100B_EVAL but it doesn't work. and although i have tried recomment and uncomment another possible line.
2015-04-20 09:25 AM
Sorry, limited internet access here.
You need to focus on the chip the toolset is configured to use, and which it's passing in via any defines. This sounds very much like the code thinks the flash block size is bigger than it is, and isn't erasing with a tight enough step. Review the code with that mindset.2015-04-21 12:51 AM
yes, after i try add more delay at erasing timeout but still doesn't work, i think the board has not been configured correctly since people do it successfully with this code. as your suggestion, i think there are still wrong page size or i do wrong with my compiler. i will check and trace deeper especially at line of page size calculation.
thank you, clive1.2015-04-21 06:09 AM
But it's not about timing, it's about physical size, and a coherency between what the hardware actually is, and what the software thinks it is.
STM32F10x_AN2557_FW_V3.3.0\Project\IAP\inc\common.h#if defined (STM32F10X_MD) || defined (STM32F10X_MD_VL)
#define PAGE_SIZE (0x400) /* 1 Kbyte */
#define FLASH_SIZE (0x20000) /* 128 KBytes */
#elif defined STM32F10X_CL
#define PAGE_SIZE (0x800) /* 2 Kbytes */
#define FLASH_SIZE (0x40000) /* 256 KBytes */
#elif defined STM32F10X_HD || defined (STM32F10X_HD_VL)
#define PAGE_SIZE (0x800) /* 2 Kbytes */
#define FLASH_SIZE (0x80000) /* 512 KBytes */
#elif defined STM32F10X_XL
#define PAGE_SIZE (0x800) /* 2 Kbytes */
#define FLASH_SIZE (0x100000) /* 1 MByte */
#else
#error ''Please select first the STM32 device to be used (in stm32f10x.h)''
#endif
Select the correct target, and insure the defines passed to the compiler are
USE_STM32100B_EVAL, STM32F10X_MD_VL, USE_STDPERIPH_DRIVER
2015-04-21 06:13 AM
There should be a Keil Project with a ''STM32100B-EVAL'' specifically called out as a Target. Make sure to select that build selection, and you won't have to edit any files.
2015-04-25 11:31 PM
Sorry, late reply. just have to finish another project.
yes clive1, after i change the option for target, also at C/C++ tab wtih USE_STM32100B_EVAL, STM32F10X_MD_VL, USE_STDPERIPH_DRIVER it works perfectly. working with almost 100% makes me forget to configure keil itself. thank you very much, clive1.