Hi,
I am working with a S32K144 using Simulink & the new toolbox (R2018), I can send messages on the bus, however I am having difficulty reading from the bus. I have tried the CAN example model, but the light seems to blink even if I don't send the CAN message so it hasn't been very helpful for troubleshooting. On my project I implemented the same receive format and I am using FreeMASTER to check the variables, but the messages aren't being received. I have attached my model below, it just receives messages from a joystick and sends out one steering command. Please let me know if you guys have any suggestions.
Thank you in advance.
Thank you for your reply, I have done this before and have been able to send out CAN messages with extended ID without a problem. It is just receiving the messages that doesn't work. I have it setup the same way as the example, when is the ISR suppose to run? From using FreeMASTER it looks like the routine runs once when I first start the code then no other CAN messages are read.
Thank you,
Fernando
Hola fernando.barrios@uwaterloo.ca,
I think the problem you may be seeing is because you have to include the receive blocks inside the CANReceive\RX_Complete block also.
These blocks are the same you're using on the init block (the one that runs only once on startup with the init_flag), this block setup your initial CAN Receive messages and then you have to include your receive blocks every time a CAN message has been received. So, when the FCAN_Rx_Complete_Isr calls your Rx_Complete block you are able to receive the subsequent CAN messages.
Regards,
Gustavo
Hello fernando.barrios@uwaterloo.ca,
It seems that gramirezv has spot this other issue before I did. Thank you for that Gustavo! He is right - you have to call the CAN Receive blocks inside the ISR calls, so you can continue receiving other CAN messages.
Kind regards,
Razvan.
Hi constantinrazvan.chivu and gramirezv,
I would like to use Rx FIFO, then at the beginning of my program check if there is any new messages in the mailbox and use the updated value for that cycle of calculations. In this case would I still have to use the ISR block? I don't see any other way of retrieving the data.
Thank you,
Fernando
I ran into the exact same issue while testing my CAN interface, that's why the description of the problem sounded very similar to me.
gramirezv are you using extended CAN as well?
Hi fernando.barrios@uwaterloo.ca,
Yes I'm using extended CAN as well, I'm working with J1939.
I would recommend you start from a single message and go from there. Since you have your CAN interface working and you are able to transmit messages you know your physical layer is working. I haven't gone deep using the CAN interface as I was doing only testing for evaluating the s32k144, but I would suggest you to do the following:
Best regards,
Gustavo
Hi fernando.barrios@uwaterloo.ca,
I'm attaching the model I used to test rx and tx of extended ID messages over CAN. This example transmits a 0x18FF0000 message and receives a 0x18FF0100 message.
Regards,
Gustavo
Hola gramirezv,
This is great, I really appreciate your help. I will test it out on the weekend!
Thank you,
Fernando
Hi constantinrazvan.chivu and gramirezv,
I appreciate your suggestions I have added all three of the FCAN receive blocks into the CANReceive\RX_Complete block and also into each case block. However, I am still not able to see any content being received by the NXP, but I can see it with a Vector CAN tool. Do you guys have any other suggestions that may not be allowing me to see anything? I have simplified the model a bit for testing purposes with no luck.
Thank you,
Fernando
Hello fernando.barrios@uwaterloo.ca,
I think you are facing some issues because you are using extended ID. We fixed this in a previous thread, but just now created a page dedicated to S32K14x 2018.R1 hotfixes - you can find it here.
Please follow the steps for hotfix 1 - this should fix your problems. Please let us know if you are having other issues.
Kind regards,
Razvan.