serial

Hi Sir/Madam,

I have created an photon application, where data can be recieved. the procedure is 6 bytes of hex data is writen to serial port and immediately the serial port acts as reciever. the data recieved is show as a tabler format in this reciever GUI application. This application is working fine on x86 but the program is not working when built for ppc core ml403 board and is giving error. The program is running on ppc but when it is trying to read from serial port it is giving error and terminating

Below is the part of the reciever program and the error it is givin.

fd = open("/dev/ser1", O_RDWR | O_NOCTTY | O_NDELAY);//we are opening the serial port as above
write(fd,&value,len);// writing buffer to serial port
read(fd, sResult, n); // reading from the serial port to buffer

The error coming for ppc core board is:

Process 114705 (receive) terminated SIGS EGV code= 2fltno=11
ip= fe35833c mapaddr= 0005833c .ref=48040000…

Memory fault…

Please help us to resolve this error.

Thanks and regards
Swetha

i do not know O_NDELAY within my documentation this may be new (we have 6.3.2). Does O_NDELAY make you not anymore require to flush streams? Oh wait, we have a file ^^

with the SIG SEGV information you could just open your executable in your debugger and check what is running @ that address. if really the corresponding part you posted is running there also may be invalid values.

For example is sResult of type “char * sResult”? And is there also space allocated? Otherwise you just wrote anywhere :stuck_out_tongue_winking_eye:

Your code is doing something illegal, post complete source.