Read standar and extended messages through same CAN port. (S32k39)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Read standar and extended messages through same CAN port. (S32k39)

ソリューションへジャンプ
1,064件の閲覧回数
MaMM
Contributor III

Hello.

I'm trying to read can messages in a port. I can read extended, but I cannot read any standard message. I have configured port as "mixed", but still I cannot read,. How can I configure it?

Do I need to generate pdu_ID per can message or can I read all of them and filter inside tha simulink code by comparing the ID with the expected ID?

Any example of reading standard/extended messages through the same port will be apprecited.

Miguel.

0 件の賞賛
返信
1 解決策
1,053件の閲覧回数
Adrian_Gherca
NXP Employee
NXP Employee

Hello,

In order to receive CAN messages with standard ID,  in your configuration project (S32 Configuration Tool or EB tresos), you need to explicitly set the Can ID Message Type field (under Can_43_FLEXCAN\CanConfigSet\CanHardwareObject) to STANDARD:

Adrian_Gherca_0-1737455182854.png


For more information and a comprehensive example please have a look at this article: Communicating over the CAN Bus

 

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
1,054件の閲覧回数
Adrian_Gherca
NXP Employee
NXP Employee

Hello,

In order to receive CAN messages with standard ID,  in your configuration project (S32 Configuration Tool or EB tresos), you need to explicitly set the Can ID Message Type field (under Can_43_FLEXCAN\CanConfigSet\CanHardwareObject) to STANDARD:

Adrian_Gherca_0-1737455182854.png


For more information and a comprehensive example please have a look at this article: Communicating over the CAN Bus

 

0 件の賞賛
返信
1,045件の閲覧回数
MaMM
Contributor III

Hi Adrian.

Thanks a lot. It works now. The link you've given is related to MCUExpress utility. Do you have examples using EB Tresos?

Miguel.

1,025件の閲覧回数
Adrian_Gherca
NXP Employee
NXP Employee

In NXP’s Model-Based Design Toolbox for S32K3xx Series you can find many examples related to CAN and many other topics.
The CAN examples are located in these folders: NXP_MBDToolbox_S32K3xx\S32K3_Examples\can  and  NXP_MBDToolbox_S32K3xx\S32K3_Examples\MR-CANHUBK344

All the settings from the S32 Configuration Tool can be traced to the ones in EB tresos.
Nevertheless, the toolbox includes examples for EB tresos as well as examples for S32 Configuration Tool.

P.S.  S32 Configuration Tool is NXP's proprietary tool for configuring S32K3xx MCUs. MCUXpresso is for IMXRT, DSC, LPC.

0 件の賞賛
返信
1,017件の閲覧回数
MaMM
Contributor III

Hi Adrian.

Thanks for the response. I know where are located the examples. The problem here is that there is no an example combining standard, extended messages TX and RX. So, this is why I asked for a more complete example.

Good to know that the drivers configuration are exchangables between Tresos and NXP tool. 

BR.

Miguel.

990件の閲覧回数
Adrian_Gherca
NXP Employee
NXP Employee

Hello,

In Can_Write (Tx) blocks, switching between the standard and extended ID formats can be done by choosing the appropriate Hardware Object that was previously configured (or created if necessary) with the desired Can ID Message Type setting in the configuration project in CanHardwareObject tab.

If, in the configuration project, the TRANSMIT CanHardwareObject was configured as MIXED (in Can ID Message Type), then the ID type can be changed directly from the Simulink model by applying the bitwise OR operation to the Message ID input of the Can_write block:
0x80000000 | desired_ID.
Example:

Adrian_Gherca_2-1737533548845.png

On the Rx side, a CanHardwareObject must be configured for each type of ID that you want to receive. Then the Object_ID output of the CanIf_RxIndication block can be checked to find out which CanHardwareObject has received the message. This gives you the information of the message ID type.

Adrian_Gherca_0-1737531424191.png
Adrian_Gherca_1-1737531555052.png


 

0 件の賞賛
返信