cancel
Showing results for 
Search instead for 
Did you mean: 

Initialization with JTAG after mass Flash erase

vender007
Associate II
Posted on January 19, 2011 at 17:10

Hi all,

In the Factory setting of STM32VLDISCOVERY ,i was able to blink the two LEDs manually by setting the GPIO_CRH and GPIO_ODR registers through JTAG debugger. but after i have done a mass ERASE on FLASH, i am not able to do that. Do i have to do some initialization before setting the GPIO registers, Which the factory burned software was doing it for me. If yes what is the minimal initialization needs to be done on register level, i guess in RCC component. Is the same as in systemInit() function in stdlibrary for STM32.

Also, does a mass erase means that it has also wiped off the ''system memory'' part and option bytes also.Which i don't think so, since they are write protected. Is it possible to erase ''system memory'' part and put my own boot loader.

Thanks

--Vinit

3 REPLIES 3
Posted on January 20, 2011 at 06:14

I'll base line at 8 MHz, turn on the GPIO(C) clock, setup the GPIO (PC.8 & PC.9), and bang away.

Want it to go faster, pay attention to the PLL, AHB, APB1 and APB2 clocks.

The fw library package has some fairly minimal code examples, including the default application.

No you can't erase the system memory or replace the boot loader. It might be flash, but ST doesn't provide any method to change it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
vender007
Associate II
Posted on January 20, 2011 at 11:07

Hi,

thanks for the answer, I have one more question regarding flash.

What i am doing is writing individual address location using JTAG debugger , After i have done a mass erase using JTAG, I am not able to write anything on the Flash PAGEs, its all 0xffffffff all the way. I have checked everything, its not write protected, the Flash Status Register are also not showing BSY bit set, after the write. but when i read the same PAGE its the same. i don't know why it should happen. have anyone faced similar problem.

thanks

--Vinit

Posted on January 20, 2011 at 14:30

We could idly guess why it is not working, or you could provide a code fragment.

I seem to remember a requirement about the clocking speed, but can't locate a cite off-hand. ST runs at 24 MHz on the classic STM32 boot loader. There are a couple of app notes floating around too, like PM0042 Flash Programming Manual.

You have to make sure you have unlocked the flash controller. Program 16-bit words, on word boundaries. It is possible to program large chunks of flash without toggling the PG bit for each.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..