EmbDev.net

Forum: ARM programming with GCC/GNU tools Flash writing on Str710


Author: Robin (Guest)
Posted on:

Rate this post
0 useful
not useful
hello friends

i hv some problem in flash writing basically in typecast plz any body
give me any example to write in flash i am using some code like this
/**************************************************/
 char  ch='a';

        u32 temp=0;
        u32  a=0;

   temp=0;
     *(vu32*)(0x400c0000+a) = (u32)(ch++);

          temp = (*(vu32*)0x400c0000+a);

     temp=(temp&0x000000ff);
     DebugSerial1((u8)temp);
     a+=4;
/*****************************************/

but this is giving error
robin

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Robin wrote:
>...
>      *(vu32*)(0x400c0000+a) = (u32)(ch++);
>...

You can not simply write the flash like this. Special operations are
needed to write values into the flash memeory. STMicro provides
application notes which explain the needed operations. There is also a
"UART-bootloader" example available from www.st.com which demonstrates
"write to flash". I offer a port of the ST bootloader for the GNU
toolchain on www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects.

Martin Thomas

Author: Robin (Guest)
Posted on:

Rate this post
0 useful
not useful
Martin Thomas wrote:
> Robin wrote:
>>...
>>      *(vu32*)(0x400c0000+a) = (u32)(ch++);
>>...
>
> You can not simply write the flash like this. Special operations are
> needed to write values into the flash memeory. STMicro provides
> application notes which explain the needed operations. There is also a
> "UART-bootloader" example available from www.st.com which demonstrates
> "write to flash". I offer a port of the ST bootloader for the GNU
> toolchain on www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects.
>
> Martin Thomas

Martin i hv config Dataflash means initilize of data flash already .
plz tell me for reading and writing is it needed to call Flash read and
write function given by ST ?
is there any option by using pointer like we can directly readwrite ?

Regards

robin

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Robin wrote:
> Martin Thomas wrote:
>> Robin wrote:
>>>...
>>>      *(vu32*)(0x400c0000+a) = (u32)(ch++);
>>>...
>>
>> You can not simply write the flash like this. Special operations are
>> needed to write values into the flash memeory. STMicro provides
>> application notes which explain the needed operations. There is also a
>> "UART-bootloader" example available from www.st.com which demonstrates
>> "write to flash". I offer a port of the ST bootloader for the GNU
>> toolchain on www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects.
>>
>> Martin Thomas
>
> Martin i hv config Dataflash means initilize of data flash already .
> plz tell me for reading and writing is it needed to call Flash read and
> write function given by ST ?

Dataflash is a trademark from Atmel for external flash-memories. Most of
them get connected by SPI some offer a memory-bus. Writing to Atmel
Dataflash and to the internal Flash of STR71x are compelty different
tasks. The hint I have given in the previous post are for the internal
flash since this is how I understood your question (and the memory
target address indicated this). For Dataflash see the application note
"using dataflash" from atmel.com and the datasheet. (when using
Dataflash with SPI take care of the SPI-mode)

> is there any option by using pointer like we can directly readwrite ?

I don't think so.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.