Compile code for gcc_ntoarmle processor and execute on targe

I am facing specific problem in the code which is compiled for armle.

I have attached two files.

  1. sample_resource.c is resource manager and creates “sample” resource manager.
  2. write_data.c opens resource manager and writes one structure into resource manager.
  3. sample_resource.c reads structure and prints value of structure.

These code works perfectly if compiled for gcc_ntox86 processor and execute on PC.
But if we compile these code for gcc_ntoarmle processor and
execute on target, “sample” resource manager crashes at line number 209 of
sample_resource.c --printf(“data[0]= %d\n”,data[0]);

Could anyone please help me in finding the root cause of this problem?

Thanks
Vani

Pretty easy, you are casting a char into an int when you don’t know if that char is aligned or not. You can’t do that on most CPUs besides the x86. Don’t alias the char data withat pointer and you will be okay.

Hi Vani,
Could you please help me?
I saw your 2 files for resource managanig,but i dont know
How can i communicate with hardware?
Best Regards:
Alireza