cancel
Showing results for 
Search instead for 
Did you mean: 

Using CAN on SPC560B-DIS

srosen
Associate II
Posted on November 19, 2014 at 16:24

Hello,

I am trying to make a simple project that for a start can send a single CAN frame.

I am using the SPC560B-DIS evb without any CAN board (will connect later on my own converter).

I took a CAN sample  from other evb and merged it to my project but it doesn't work!

Is there any CAN sample that works that I can use?

Can I connect a scope to the TX pin and view the data without converter to CAN High and CAN Low?

In the example i did not see any initialization to the I/O (Tx and Rx) is that correct?

Can I use the external clock on my board for the CAN module?

Thanks

Shachar
11 REPLIES 11
Erwan YVIN
ST Employee
Posted on November 19, 2014 at 17:25

Hello Rosen ,

Do you succeed to take the hand by JTAG USB and PLS?

There is an application for motherboard & mini-module

SPC560Bxx OS-Less CAN Test Application

You can use like starting point these application (importing from Appwizard)

SPC560Bxx OS-Less Test Application for Discovery

Take the CAN configuration of SPC560Bxx OS-Less CAN Test Application

and use these configurations into SPC560Bxx OS-Less Test Application for Discovery

WARNING : the io settings are different and the clocks settings are completely different

otherwise you should not boot.

Anyway , we will update the application repositories in the following weeks especially for discovery boards.

yes , it is possible to connect to the TX pin and view the data

compare SPC560B6DIS I/O headers with your reference manual.

CAN peripheral is started by canStart.

for the CAN module , you can use an external clock by settings your low level drivers option.

Best regards

Erwan

________________

Attachments :

2014-11-19_172054.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006qW5u&d=%2Fa%2F0X0000000bo4%2FEnbKO0oN0Q2qgoSvrFzC5hpPT3WMg2w5C4w_Hl7EzPM&asPdf=false
srosen
Associate II
Posted on November 20, 2014 at 10:25

Hello Erwan,

Thanks for the quick response.

I did manage the JTAG USB and PLS, took me a while but it works now.

Regarding your suggestion,  that is exactly what I did yesterday but no luck with it.

question:

1. Why isn't there any CAN I/O defined in the example? Shouldn't it be configured in the configuration file just like the Leds and the Push button?

2. Is there an option to use C++ compiler during the evaluation period?

Thank you,

Shachar

Erwan YVIN
ST Employee
Posted on November 20, 2014 at 14:35

Hello Rosen ,

1) About CAN driver ,

    the 8 first mailbox id are dedicated for RX (canReceive) (Input)

    the 8 next mailbox id are dedicated for TX (canTransmit) (Output)

    the component GUI (on CAN) is used to enable , disable and configure your CAN Drivers.

    The test application is to send a CAN Message on a channel with EID 0x1234567

2) We are using a ''gcc powerpc vle'' provided by hightec.

     there is no option to use the C++ compiler.

     it is existing in our plugin :

     c:\SPC5Studio\eclipse\plugins\com.st.tools.spc5.tools.hightec_1.0.0.201306281422\hightec\bin\ppc-vle-g++.exe

     you have to create and update your platform component to provide the compilation on c++

 Best Regards

                       Erwan

Hello Erwan,

Thanks for the quick response.

I did manage the JTAG USB and PLS, took me a while but it works now.

Regarding your suggestion,  that is exactly what I did yesterday but no luck with it.

question:

1. Why isn't there any CAN I/O defined in the example? Shouldn't it be configured in the configuration file just like the Leds and the Push button?

2. Is there an option to use C++ compiler during the evaluation period?

Thank you,

Shachar

nooshin_1382
Associate II
Posted on January 07, 2015 at 14:10

Hello Rosen

I have the same problem i wrote the code and compile it successfully but no action on Tx CAN Pin

is your problem solved ?

if you know what is the problem please help me on this

thanks

Best Regards

vanima

Erwan YVIN
ST Employee
Posted on January 16, 2015 at 15:25

Hello Vanima ,

I have no problem :

About the current CAN driver , 

    the 8 first mailbox id are dedicated for RX (canReceive) (Input) (1,2,3,4,5,6,7,8)

    the 8 next mailbox id are dedicated for TX (canTransmit) (Output) (9,10 ....16)

    Tx Channel ID 1 means 9 (in lld part) ....and so on ..

Next Week, There is will be a improvement on CAN driver on the version 3.4.0

#281492 CAN Naming convention : Change the id number of Filter

#286966 The message buffers Tx/Rx Configuration in CAN module 

will be dynamic

  Best regards

        Erwan

souha
Associate II
Posted on April 02, 2015 at 13:27

Hello,

I'm trying to send a CAN message on SPC560 B discovery board  using chibi OS.

I configured the CAN1 Tx pin (PC10) and Rx pin (PC11) and connect it to an external CAN transceiver. I m using  ''cantransmit ''function available (canTransmit(&CAND2, 3, &txmsg, TIME_IMMEDIATE). I can't see any signal in CAN pins.

Have you any idea about the possible problem? Have you a sample code to test CAN using chibiOs on SPC560B-dis?

Erwan YVIN
ST Employee
Posted on April 07, 2015 at 17:22

Hello Souha ,

Did you try to adapt the configuration for ''SPC560Bxx OS-Less CAN Test Application'' ?

For this application , you have just to change the clock settings.

we have created a Change request for to pout in the Application Wizard some new applications for ''SPC560Bxx for discovery''.

   Best Regards

                 Erwan

souha
Associate II
Posted on April 09, 2015 at 12:48

Hello Erwan,

I m a little confused with clock settings(system clock or CAN clock). Which settings did you  put?

Thanks for help

Souha

Erwan YVIN
ST Employee
Posted on April 29, 2015 at 17:47

Hello Souha ,

The application ''SPC560Bxx OS-Less CAN Test Application for Discovery'' is in attachment.

it will be integrated in the next release.

best regards

Erwan

________________

Attachments :

SPC560Bxx_OS-Less_CAN_Test_Application_for_Discovery.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006qVYC&d=%2Fa%2F0X0000000bny%2F68hJTIcxfG4eyWwuchEup6CyKlbiZy37ccZ3wVa0.YI&asPdf=false