Flash writing on Str710

Guest #1172539
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
Moderator #1172540
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
Guest #1172541
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
Moderator #1172542
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

A question of your own? This thread is over 19 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.