cancel
Showing results for 
Search instead for 
Did you mean: 

STR912FAW44 IAP programing fails after 8192 bytes

lloydepowell
Associate II
Posted on June 24, 2009 at 19:27

STR912FAW44 IAP programing fails after 8192 bytes

10 REPLIES 10
lloydepowell
Associate II
Posted on May 17, 2011 at 09:58

I am running the IAP programmer as detailed in AN2475 and PM0020 to load my app into Bank 0. Bank 1 is the boot. BBSR and NBBSR are set correctly for 512k bank 0 and 32k Bank 1. The programing is successful in the first 8192 bytes. But at address x82000, it fails to program. Any ideas?

This address is still in sector 0 of Bank 0, but is it just coincidence that it is the length of a sector of Bank 1?

woshilongsan
Associate II
Posted on May 17, 2011 at 09:58

I also encountered this problem,be resolved as soon as possible!

woshilongsan
Associate II
Posted on May 17, 2011 at 09:58

hi

I solved the problem!CSX-bit configuration.

woshilongsan
Associate II
Posted on May 17, 2011 at 09:58

hi!

lloydepowell

You can make reference to this website

http://www.st.com/mcu/forums-cat-6715-21.html

Now, my problem is that user programs can not run!

and I found that I can't use JTAG download the program for FLASH0.

lloydepowell
Associate II
Posted on May 17, 2011 at 09:58

Yes, that is the same problem. Now I am building a direct interface to JTAG FTD2xx.dll using Borland Cbuilder6. It is now reading and writing with boot from Bank 0. I am working to make it read the ISC_CONFIGURATION register.

lloydepowell
Associate II
Posted on May 17, 2011 at 09:58

Sure sounds like the CSX is not being set to boot bank 1. But there is no info in STMicro other than to use the CAPS or JLink tools. I am using OpenOCD. And I assumed the following cfg lines would do the CSX set.

flash bank str9x 0x00080000 0x00080000 0 0 das.cpu

flash bank str9x 0x00000000 0x00008000 0 0 das.cpu

lloydepowell
Associate II
Posted on May 17, 2011 at 09:59

After I figured out that I had the wrong bit for CSx and set the right one, I managed to program more than x2000 bytes of the sector 0, bank 0. But now I have a different problem. I am programing 16 half words at a time. In sector 1, the first set is successful. but as soon as I program the second 16, all of that sector reads as garbage. A power down is required to clear it.

1. I do know that my simple custom jtag interface works to read and set the ICS_CONFIGURATION.

2. Sometimes the flash status read after an IAP program command locks up. The solution seemed to be - insert a dummy SRAM read before the status read.

[ This message was edited by: lloydepowell on 24-06-2009 03:35 ]

woshilongsan
Associate II
Posted on May 17, 2011 at 09:59

hi

lloydepowell

Now!Your user program can run it?

I found my user program can write BANK0 is right(I read and compared),

but the user program can't run.I may be wrong configuration of the user program.The same configuration can be run in another user program.

:o

[ This message was edited by: woshilongsan on 24-06-2009 03:50 ]

lloydepowell
Associate II
Posted on May 17, 2011 at 09:59

After much tweaking, the programing is working. Now I am looking to see how far it gets after jumping to the application at 0x80000. I put an LED in the StartDelay loop so it is going that far. The three main requirements to stabilize the programing are:

1. Do not take data from the Ethernet while programing. It must be first downloaded to SRAM.

2. Place a dummy read SRAM before each read status.

3. Place the return to read mode command (0xFF) in a loop as it does not work the first few times. I use a loop of 0x100 times