2007-04-27 10:09 AM
2007-04-23 05:24 AM
2007-04-23 12:03 PM
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 ]2007-04-23 08:52 PM
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 ]2007-04-23 09:19 PM
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.2007-04-23 09:23 PM
I only tried to disable the write protection.
I checked the registers and it's still disabled2007-04-23 10:49 PM
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); }2007-04-24 09:12 PM
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.2007-04-25 01:45 AM
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=falsehitex_str7_ram.ld : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1NI&d=%2Fa%2F0X0000000bm8%2FRFg4iiKnRygp938mE6vQ5UfnTwrmuqoDnmqx0qljsfs&asPdf=false2007-04-26 10:40 AM
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!!!