Tech Support > Computer Hardware > Microprocessors > ST10 Flash Memory Erasing (or not)
ST10 Flash Memory Erasing (or not)
Posted by adamroper on April 14th, 2006


I'm writing a software BSL for an ST10F269 to talk to the ST10 Flasher
supplied by ST because I will have no physical access to the board to
put the chip into onboard BSL mode. The idea is that I handle the start
of the world and then hand over to the ST10 Flasher's (from st.com)
monitor program for the rest of normal operation before booting into
Flash.

Everything is ok in that the ST10 Flasher tool starts up fine and loads
its monitor program, but then if I attempt to erase flash memory (any
bank) the processor never acknowledges the request and everything just
hangs. Now because the ST10 Flasher Tool loads and its monitor takes
over, in theory I'm out of the equation at this point. So I think that
this means I must have neglected to set a register to the correct value
or missed something similar out of the magical incantation so that the
rest of the world is fooled into believing that we are in true BSL
mode.

I've set CP, SP, S0CON, S0BG, SYSCON, STKUN, STKOV, not BUSCON but I
don't think that is the problem. Any ideas?

Thanks

Posted by Jim McGinnis on April 18th, 2006


On 14 Apr 2006 02:51:17 -0700, "adamroper" <adam.roper@bem.fki-et.com>
wrote:

I'm not sure that what you're trying to do is possible. My impression
is that the BSL can only be invoked at reset by pulling down POL.4. It
sounds like your software handles a normal reset and then tries to
pass control to the BSL.


--
Jim McGinnis

Posted by adamroper on April 20th, 2006


Not quite Jim,

The idea is that I have written a small program that pretends to be the
onboard BSL in that it does everything that is done by pulling P0L.4
low, i.e. setting registers etc. It lives in flash so the first thing
that it does is copy itself into RAM and sets its execution address
using the SROM_PS macros supplied by Keil.

In detail it basically sets up the UART, then waits for a null
character on serial from the ST10 Flasher tool to which it replies with
a D5 identification byte. It then grabs the next 32 bytes (the
flasher's 1BL) that come down the serial line and loads them into the
relevant location in RAM (0xFA40). It then sets the necessary
registers, clears the Rx serial line, and jumps to the address in RAM
where I just loaded those 32 bytes of primary BL. From this point on
it is all out of my hands.

This is all working fine except for one thing, which is that I can't
erase any flash. The ST10 Flasher program starts fine, and serial
communications between it and the processor are exactly as they should
be, but I must be missing something where I set the registers before
handing over control to the flasher tool.

Adam

Posted by adamroper on April 20th, 2006


OK, I've found the problem, and as this has crept to the #1 slot in
Google's page rank for the search term "st10 flash erase" I feel I have
a duty to report the 'solution'.

The problem of course is nothing to do with the processor or anything
physical, it is something in the ST10 Flasher tool from
STMicroElectronics that is waiting for a boolean condition, presumably
on some register, to be met before it will carry out its in-built flash
erase STEAK routine. I tested this by downloading another flasher
tool, this time from the good people at HiTex UK, and the whole thing
works without a problem.

I am in the process of (hopefully) obtaining the exact boolean that is
not being met from ST support, but the product is not supported and is
closed source, despite it being freely available >:$ If I get a final
answer from them then I will of course post it asap.


Similar Posts