Cross compiling the code developed in x86 architecture for P2020rdb

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cross compiling the code developed in x86 architecture for P2020rdb

826 Views
hitusharma
Contributor II

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!!!.

0 Kudos
3 Replies

729 Views
hitusharma
Contributor II

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

0 Kudos

729 Views
yipingwang
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

729 Views
hitusharma
Contributor II

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");

0 Kudos