How to configure by PE to use CAN and Freemaster at the same time?

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

How to configure by PE to use CAN and Freemaster at the same time?

41,917 Views
kiddyang
Contributor I

Freemaster is communicated via CAN bus and also I want to use CAN to transmit/receive at the same time. Professional expert system doesn't allow me to use these two modules at the same time.

Labels (1)
Tags (3)
0 Kudos
Reply
6 Replies

41,305 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Kidd,

Which chip do you used ? Does it have two CAN module ?

For k60 example , it have CAN0 and CAN1, so it can use at the same time :

pastedImage_0.png


Have a great day,
Alice Yang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

41,305 Views
kiddyang
Contributor I

But when I use MC56F8346 without configuring by PE, I could do this by adding freemaster's driver manually. I wonder if this driver is useful for 56F84789 too?

I have tried to do that and there come out another problem. After I configured CAN module by PE successfully, then added freemaster's driver(for 56800E), and compiled, there would be error like this.

pastedImage_0.png

Compared with code generated by PE, the code which had errors in picture above was totally same. But there was no error in the PE code.

WHY? Is this a BUG of code warrior 10.6 or PE system???

HELP! I have been delayed here for long time.How to configure by PE to use CAN and Freemaster at the same time?

0 Kudos
Reply

41,305 Views
Bohrfutter
Contributor III

Hi Kidd Yang

We just had the same problem and modified the freemaster code not using CAN hardware but passing the CAN messages directly from our CAN handler to the freemaster code. If you like I can send you an example... We did this for MSCAN on a KEAZ but it is the same for FlexCan

Cheers

Sebastian

0 Kudos
Reply

41,305 Views
TICS_Fiona
NXP Employee
NXP Employee

Hello Kidd

The code of your Freemaster's driver implements the same functionality with the code generated by PE Freemaster component.  You can only choose one of them. 

The link error on your screenshot shows that the section ‘fardata’ is not defined.  It should be defined with the code like #pragma define_section fardata ".fardata.data" RW

Best Regards

Fiona Kuang

Technical Information & Commercial Support

0 Kudos
Reply

41,305 Views
kiddyang
Contributor I

It is MC56F84789 with only one CAN module. But when I used MC56F8346, I can do these two things with only one CAN module.(haven't configure by PE but wrote the underlying code directly)

Is there any solution to this problem by PE? THANK YOU!

Your sincerely,

Kidd Yang

0 Kudos
Reply

41,305 Views
TICS_Fiona
NXP Employee
NXP Employee

Hello Kidd

When add both FreeMaster (with FlexCAN) and Init_CAN component in the same project, Processor Expert will prompt error message like "Peripheral is already used by the component …"

This is not special for FlexCAN, it is same for any other peripheral in PE for DSC including ADC, SCI… User can only choose one of them in his project for the same peripheral module.

Peripheral Initialization Component ( with name "Init_**") only provides a low-level hardware approach to initialize registers of the peripheral module.   For advanced functions, please choose the other component.

As a workaround, you can first add FreeMaster component into a 56F84789 project, and after generating code with it, copy the source file into your application project, and add FreescaleCAN component, or vice versa.

Best Regards

Fiona Kuang

Technical Information & Commercial Support

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply