HI All,
I compile the DFU example from ST using Keil MDK and try to download it into Bank 1. I always get a error: Flash Download failed -- ARM966E-S(I am using STR912FAW44). The following is what I do:
I setup the uVISION IDE the same as the thread http://www.keil.com/support/docs/3347.htm
Setup FMI in str91x.s
FMI_SETUP EQU 1 FMI_CR_Val EQU 0x00000018 FMI_BBSR_Val EQU 0x00000000 FMI_BBADR_Val EQU 0x00000000 FMI_NBBSR_Val EQU 0x00000006 FMI_NBBADR_Val EQU 0x00400000 FLASH_CFG_Val EQU 0x00000000
Setup STR91xCFG.s
CFG EQU 1 CFG_W0 EQU 0x00000000 CFG_W1 EQU 0x00010000
What am I missing in my project setting?
Thanks
Lillian
Hi All,
I use the sample 3347.zip from http://www.keil.com/support/docs/3347.htm and download it into MCBSTR9 evaluation board. However, I go the same issue above. The error message is below,
Load "\\STR912\\3347\\Blinky-B0B1\\Bank0\\Blinky-B0.AXF" Erase Done. Programming Failed!
Please help me. Thank you for any information.
Lillian,
I had to change the FLASH programming options for programming bank 1 on our STR9 systems.
You change these by opening a Keil project under Keil\ARM\Flash\STR91X
You then have to select the target STR9 derivative, bank and programming type from the project options
Then in the file FlashDev.c you will see one of these for each STR9 derivative, bank and programming type, this is for STR91xFxx7, Bank 1 and ICP programming
#ifdef STR91xFxx7 struct FlashDevice const FlashDevice = { FLASH_DRV_VERS, // Driver Version, do not modify! "STR91xFxx7 Flash Bank1 ICP", // Device Name ONCHIP, // Device Type 0x00400000, // Device Start Address 0x00020000, // Device Size in Bytes (128kB) 0x00004000, // Programming Page Size 1, // Reserved, must be 1 0xFF, // Initial Content of Erased Memory 6000, // Program Page Timeout 6000 mSec 3000, // Erase Sector Timeout 3000 mSec // Specify Size and Address of Sectors 0x004000, 0x000000, // Sector Size 16kB (8 Sectors) SECTOR_END }; #endif
I increased the time-outs for bank 1 to these (I think I just copied the Bank 0 options)
6000, // Program Page Timeout 6000 mSec 3000, // Erase Sector Timeout 3000 mSec
from these values
100, // Program Page Timeout 100 mSec 1000, // Erase Sector Timeout 1000 mSec
You then rebuild the project, and try programming bank 1 again in the normal way.
Hope this helps.
Stuart.
Hi Stuart,
Thank you very much for your help. I try to change the timeout value for STR912FAW44. It can 2 times successfully download in 10 times try. I wonder if you can 100% download successfully.
Thanks again for your help.
I use a STR9FAZ47 and we can program ours 100% of the time.
I use the ICP method for programming, as I also programming the STR9 configuration registers.
Stuart
When I compile the STR91x flash file using keil MDK, i got the three warning message.
Build target 'STR91xFxx4 Bank1 ICP' compiling FlashDev.c... linking... STR91xFxx4B1.axf: Warning: L6305W: Image does not have an entry point. (Not specified or not set due to multiple choices.) .\TargetX.lin(12): warning: L6314W: No section matches pattern *(RW). .\TargetX.lin(12): warning: L6314W: No section matches pattern *(ZI). Program Size: Code=0 RO-data=4256 RW-data=0 ZI-data=0 User command #1: cmd.exe /C copy STR91xFxx4B1.axf ..\STR91xFxx4B1_.FLX 1 file(s) copied. "STR91xFxx4B1.axf" - 0 Error(s), 3 Warning(s).
I wonder if the warning message affect the downloading.
I made the changes and just tried compiling this here using MDK 4.14. I didn't get any warnings see below.
Build target 'STR91xFxx4 Bank1 ICP' compiling FlashDev.c... linking... Program Size: Code=0 RO-data=4256 RW-data=4 ZI-data=0 User command #1: cmd.exe /C copy STR91xFxx4B1.axf ..\STR91xFxx4B1_.FLX 1 file(s) copied. "STR91xFxx4B1.axf" - 0 Error(s), 0 Warning(s).
I have uploaded the file for you at
www.filedropper.com/str91xfxx4b1
So you can try this one if you want
Regards,
Thank you for your kind help. I try your file and still get the programming failed. I check the chip version in my MCBSTR9 board is G. Also, could you please do me a favour to take a look at my STR91x flash file and see why i get the warning message. I find it cannot attatch file here. Could you please sene me the email lillian201151@hotmail.com so I can send you my design file?
Thanks a lot
Hi,
I find the reason to fail program. Go to Options for Target -> Debug -> Ulink ARM Debugger Settings -> MAX JTAG Clock
Change MAX JTAG Clock from 1M to 500K.
Then flash program will be successful.
Best Regards,