Error while compiling the flexray code

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

Error while compiling the flexray code

1,672 Views
amogh_negalur
Contributor II


error while implementing flexray using mpc5748g

i am using this code:

/* Flexray Channel A TX */
SIUL2.MSCR[PC5].B.SSS=1 ;
SIUL2.MSCR[PC5].B.OBE =1 ;
SIUL2.MSCR[PC5].B.SRC =3 ;
/* Flexray Channel A TX_EN */
SIUL2.MSCR[PE2].B.SSS=1 ;
SIUL2.MSCR[PE2].B.OBE =1 ;
SIUL2.MSCR[PE2].B.SRC =3 ;
/* Flexray Channel A RX */
SIUL2.MSCR[PE3].B.IBE =1 ;

SIUL2.IMCR[224].B.SSS = 1;
SIUL2.IMCR[510].B.SSS =2 ;

and i am getting this error:

2019-04-08.png

Can anyone  please help me debug these errors?? i am new to s32ds

7 Replies

1,491 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

first issue is, you do not have declared symbols PC5, PE2 etc. Because this is array index, it must be defined as a number somewhere in you code.

About second issue, could you please share your code directly in IDE? Have you correctly included MPC5748G.h header file in the .c file, where you use register names?

Regards,

Martin

1,491 Views
amogh_negalur
Contributor II

thank you sir,

   I had not included the MPC5748G.h. Now, i tried including the "MPC5748G_601.h" and got the following error.ss.png

The following is the link to my project. Please help me out

https://drive.google.com/open?id=1guM3leN250VZ1JQdNcA73S2MXW98ZNRv 

0 Kudos
Reply

1,491 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

I did not know you use SDK based project. Unfortunately, this project use different header file and it is not recommended to use your own header file. Please delete your header file and please use following way, how to access registers:

/*Set SRC = 3, OBE = 1 and SSS = 1 */

 SIUL2->MSCR[37] = 0x32000001;

or you can use included macros. The same result as the code above:
 SIUL2->MSCR[37] = SIUL2_MSCR_SSS(1)| SIUL2_MSCR_OBE(1) | SIUL2_MSCR_SRC(3);

Regards,

Martin

1,491 Views
amogh_negalur
Contributor II

thank you sir,

That worked for me now i have no errors. Can you please tell me how to send a single bit from one ecu to another using Flexray protocol? If you have any code it will be very helpful sir. Or if you can explain the steps involved, that would be great.

0 Kudos
Reply

1,491 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

unfortunately, NXP does not provide any example code for Flexray peripheral, because of complexity of this peripheral and complexity of the protocol. If you want to work with Flexray, I recommend you to use prepared driver. 

But remember, all available drivers are under license (NXP MCAL driver or driver from Vector).

Regards,

Martin

1,491 Views
amogh_negalur
Contributor II

thank you sir, 

instead can i have any simple codes regarding LIN protocol using the same devkit? Simple C codes. In example codes, i see vectors. I want some simple c codes. Where can i find them?

0 Kudos
Reply

1,491 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

unfortunately, there is no SDK based example for LinFlex available, but you check bare-board project created by colleague of mine for LinFlex.

https://community.nxp.com/docs/DOC-341822 

Example is created in GreenHills IDE, but you can manually move source code into S32DS.

Regards,

Martin

0 Kudos
Reply