EmbDev.net

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


von Robin (Guest)


Rate this post
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

von Martin T. (mthomas) (Moderator)


Rate this post
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

von Robin (Guest)


Rate this post
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

von Martin T. (mthomas) (Moderator)


Rate this post
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.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.