HI
I am able to cross compile my code made in x86 architecture for p2020 rdb.
While executing the code it works fine to a certain level and doesn't show any output after that, when it has to check a certain system file ie /var /log /boot.
I have given Read access to boot file as well.
Kindly suggest the troubleshooting approach!!!.
HI Yiping
I am able to access the system files now.
Kindly confirm is there any challenge in cross compiling the thread in the application using cross compiling tool chain.
Kindly vet the command
$ CC test.c -lpthread.
regds
Hitu
Hello Hitu Sharma,
Please try to whether the program could run after "chmod 777 /var/log/boot".
Would you please share the related part of your code?
Have a great day,
Yiping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Yiping Wang
I have already given the access to file ie "chmod 777 /var/log/boot".
plz find below the relevant part of the code:
fs = fopen("/var/log/boot.log","r");
printf("Performing Self Test..... \n");
sleep(5);
S2[8]= ++S2[8];
fflush(stdout);
//Try opening serial port
/*serial_fl = open(SERIAL_PATH,O_RDWR|O_NOCTTY);
if(serial_fl == -1) { //Checks the availability of the Serial Port
printf("Failed.\n");
fflush(stdout);
return 0;
} else {
//printf("Success.\n");
fflush(stdout);
//Get serial port settings
tcgetattr(serial_fl, &serial_settings); //Get Current Settings of the Port
cfsetispeed(&serial_settings,BAUDRATE); //Set Input Baudrate
cfsetospeed(&serial_settings,BAUDRATE); //Set Output Baudrate
serial_settings.c_cflag &= ~PARENB; //Mask Parity Bit as No Parity
serial_settings.c_cflag &= ~CSTOPB; //Set Stop Bits as 1 or else it will be 2
serial_settings.c_cflag &= ~CSIZE; //Clear the current no. of data bit setting
serial_settings.c_cflag |= CS8; //Set no. of data bits as 8 Bits
}
serial_write_ret = write(serial_fl,serial_buffer_send,strlen(serial_buffer_send));*/
printf("SELF TEST PASSED\n");