Application Restarting

Hi to al,

      I got a problem in handling of datas.Actually i am trying to get a string  through UART1,writing  in flash and reading  back the stored string when it is required.....

In data hdlr i did this…

bool Data_Hdlr(u16 Datalen,u8 *Data)
    wm_strncpy(Wdata,(ascii *)Data,Datalen);
    return TRUE;

This is how i am writing the string…

adl_flhWrite(HANDLE,(u16)ID,(u16)wm_strlen(Wdata),(u8 *)Wdata)

And reading the string from the flash…

adl_flhRead(HANDLE,(u16)ID,(u16)adl_flhExist((ascii*)HANDLE,ID),(u8 *)Flhmem)

I declared Wdata as
ascii *Wdata;

My code gets restarted in this case… :frowning:
I tried in many ways, finally i solved the issue also :slight_smile:
my application is not restaring once i declared Wdata as
ascii Wdata[10];

Even though i solved this issue i need to know the cause :question:


You need to look carefully in your ‘C’ textbook, and consider the difference between a pointer definition such as

ascii *Wdata;

and an arraay definition such as

ascii Wdata[10];

You might also like to spend some time at

This is basic ‘C’ stuff - nothing specifically to do with Open-AT.

The link is very usefull…
Thanks Awneil.