Skip to main content
jurij
Associate II
July 30, 2012
Question

STM32F4Discovery: Receiving CAN message?

  • July 30, 2012
  • 7 replies
  • 2187 views
Posted on July 30, 2012 at 19:43

The original post was too long to process during our migration. Please click on the attachment to read the original post.
    This topic has been closed for replies.

    7 replies

    waleedaslam89
    Associate II
    July 31, 2012
    Posted on July 31, 2012 at 07:09

    The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6jS&d=%2Fa%2F0X0000000buB%2FLQIKpbpVU9hzOOo.sx7_.6LpLkjUla3hkY.G.KKKoJI&asPdf=false
    jurij
    jurijAuthor
    Associate II
    August 1, 2012
    Posted on August 01, 2012 at 12:59

    Put to Normal mode and then check what CAN_init returns ... in my case, if I put Normal mode and disconnect the CAN transceiver, I get Init_Failed.

    jurij
    jurijAuthor
    Associate II
    August 1, 2012
    Posted on August 01, 2012 at 19:40

    I have a question for you ... in manual (and CAN library), it says CAN Filter Number has to be between 0 and 13 ... you use 14. I found out that if I use a number between 0 and 13, I don't receive any message at all, but if I set it to 14, it accept them (all). Why so?

    Tesla DeLorean
    Guru
    August 1, 2012
    Posted on August 01, 2012 at 20:04

    I have a question for you ... in manual (and CAN library), it says CAN Filter Number has to be between 0 and 13 ... you use 14. I found out that if I use a number between 0 and 13, I don't receive any message at all, but if I set it to 14, it accept them (all). Why so?

    Cause you're using CAN2, a slaving device, and the default setting of CAN_FMR is that the filter base for the slave is 14. Use CAN_SlaveStartBank() if you want it set to something else.

    The CAN on the STM32F40x has 28 filters, the defaults assume 14 for each CAN1 and CAN2
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    waleedaslam89
    Associate II
    August 2, 2012
    Posted on August 02, 2012 at 06:48

    The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6lS&d=%2Fa%2F0X0000000bur%2FuL1qd5LtaD32kDG3IGpE46jl.r0RFANQxUUkVLl457c&asPdf=false
    waleedaslam89
    Associate II
    August 2, 2012
    Posted on August 02, 2012 at 06:56

    I still don't understanding the configuration of CAN Filtering . I have manage to understand the CAN list mode filtering but having a problem with Mask mode. 

    Suppose I want to filter Identifiers from (100 to 150). Can any one tell me the Mask filter settings and Values for both Extended identifier configuration and Standard Identifier configuration. 

    Thanks.

    bjoern2
    Visitor II
    August 2, 2012
    Posted on August 02, 2012 at 13:04

    You can find more if you search this forum for:

    CAN Baud rate

    Try this:

     // CAN Bitrate

      CAN_InitStructure.CAN_SJW=CAN_SJW_1tq;    // SJW (1 bis 4 möglich)

     

      CAN_InitStructure.CAN_BS1=CAN_BS1_14tq;   // Samplepoint 72%

     

      CAN_InitStructure.CAN_BS2=CAN_BS2_6tq;    // Samplepoint 72%