cancel
Showing results for 
Search instead for 
Did you mean: 

STR750 flash problem

140801
Associate II
Posted on April 27, 2007 at 19:09

STR750 flash problem

10 REPLIES 10
140801
Associate II
Posted on April 23, 2007 at 14:24

I had problems with normal flash writing using OpenOCD so I tried this:

I tried to program the flash from my code in RAM, but when I execute the first flash command all the flash registers go to: 0xe6000010 (that's what suppose to happen) and then they stay that way untill reset (that's my problem). The same thing happens when I write to the NV flash protection registers.

I'm using YAGARTO toolchain, OpenOCD, LPT Wiggler JTAG and a STR751FR1 ARM.

The functions that I use come from ST and in debug everything seems OK (except of course the ''0xe6000010' moment).

All RAM debugging (using peripherals etc.) works fine too.

Did anyone have a similar problem? Because I try and I try to program the flash but everything fails so far.

I would be very grateful for any help

mohamed23
Associate II
Posted on April 23, 2007 at 21:03

Hi Welpa,

This is dueto the first write operation to flash which should be exceuted from RAM and consume more time than the subsequent other operationd about 2ms as described in the STR7 Flash reference Manual.

The ST code should work fine , but you have to port it to your toolchain

YAGARTO / OpenOCD and to have special care how to excecute some functions from RAM using your linker/tool

By the way, I have never heard about this Toochain :o , could you please give

more details, is it a free one using gcc compiler ? Thanks in advance.

BR,

Rave

[ This message was edited by: Rave on 24-04-2007 00:34 ]

140801
Associate II
Posted on April 24, 2007 at 05:52

Yagarto is a free toolchain based on Eclipse and gcc. Just type it's name on google. Maybe it's not 100% working (sometimes the debugging doesn't start) but it's quite nice to work with, especialy for beginers.

I have ported the code to my toolchain but as I mentioned, everything gets stuck and never get's out from the WaitForLastOperation(). I disabled the debuger and wait several minutes but nothing changes, the 0xe6000010 is still there.

I even tried to manualy change the flash with the debugger like this:

mww 0x20100000 0x20000000 (word program flag)

mww 0x20100010 0x00000100 (address)

mww 0x20100008 0xAAAAAAAA (data)

mww 0x20100000 0xA0000000 (start programming)

resume

and after a while i typed:

halt

then when I probe the registers:

mdw 0x20100000 10

I get the 0xe6000010 0xe6000010 0xe6000010 ...

[ This message was edited by: Welpa on 24-04-2007 09:51 ]

najoua
Associate II
Posted on April 24, 2007 at 06:19

Hello Welpa,

You said that you 'write to the NV flash protection registers'. So, it is possible that the locations you are trying to program belong to write protected sectors.

Could you please verify the Flash Write protection status by reading the Flash non volatile write protection register (FLASH_NVWPAR)( or using directly the library routine FLASH_GetWriteProtectionStatus()).

Waiting for your feedback,

Best regards,

Najoua.

140801
Associate II
Posted on April 24, 2007 at 06:23

I only tried to disable the write protection.

I checked the registers and it's still disabled

140801
Associate II
Posted on April 24, 2007 at 07:49

Here's my code:

Quote:

#define __MAIN_C__

#include ''7xx_flash.h''

#include ''typedefs.h''

#include ''75x_lib.h''

int main (void)

{

#ifdef DEBUG

debug();

#endif

/* MRCC system reset(for debug purpose) */

MRCC_DeInit();

/* Wait for OSC4M start-up */

OSC4MStartUpStatus = MRCC_WaitForOSC4MStartUp();

if(OSC4MStartUpStatus == SUCCESS)

{

/* Set HCLK to 30 MHz */

MRCC_HCLKConfig(MRCC_CKSYS_Div2);

/* Set CKTIM to 15 MHz */

MRCC_CKTIMConfig(MRCC_HCLK_Div2);

/* Set PCLK to 15 MHz */

MRCC_PCLKConfig(MRCC_CKTIM_Div1);

/* Set CKSYS to 60 MHz */

MRCC_CKSYSConfig(MRCC_CKSYS_OSC4MPLL, MRCC_PLL_Mul_15);

}

FLASH_DeInit();

FLASH_WaitForLastOperation();

FLASH_EraseSector(FLASH_BANK0_SECTOR1);

FLASH_WaitForLastOperation();

FLASH_WriteWord(0x03000,0x11aa11aa);

FLASH_WaitForLastOperation();

while (1);

return(0);

}

najoua
Associate II
Posted on April 25, 2007 at 06:12

Hi Welpa,

There is no issue in the code.

Now, is it possible to have a look to your startup and linker files?

Regards,

Najoua.

140801
Associate II
Posted on April 25, 2007 at 10:45

I have attached the files

The code is a little messy because it has been ported from STR710 - sorry for that.

Could you tell me is it possible to program flash only by writing to the necessary registers with the debugger (like I showed before)? Or is it possible only through code? And if so, can we execute this code during a debug process (with breakpoints, steps etc.)?

________________

Attachments :

crt.s : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1NN&d=%2Fa%2F0X0000000bmA%2FRP5K6X_jacVpCayczPx9HthGU18RxsJpOcGsZwHqaDo&asPdf=false

hitex_str7_ram.ld : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1NI&d=%2Fa%2F0X0000000bm8%2FRFg4iiKnRygp938mE6vQ5UfnTwrmuqoDnmqx0qljsfs&asPdf=false
140801
Associate II
Posted on April 26, 2007 at 19:40

Could someone tell me what are the requirements for flash programming?

Because I have set up the clock properly (in a few different configurations), disabled all the interrupts, I am running the code from RAM and all the protections in the registers are disabled. I have no idea what to look for next!

I also think that the OpenOCD programming problems, which give me an 'error:0xe6000010', could be connected with the flash being stuck in programming.

If nothing helps maybe I'll try to change the MCU on my board, but that is a final option.

HELP!!!