Skip to main content
Giu S
Associate II
June 12, 2017
Solved

STM32F0 CAN FIFO1

  • June 12, 2017
  • 5 replies
  • 1332 views
Posted on June 12, 2017 at 17:08

Hello to all,

I'm new in STM32. I have to use the CAN peripheral on the STM32F091VCTx microcontroller.

I'm able to send messages and receive messages in the FIFO0, but if I try to use the FIFO1 the software go down and go in an 'infinite loop' that I don't know what does it means. I have the last version of CubeMx and I use AC6 IDE.

Could someone explain to me what is the problem with FIFO1? How I can use it?

Thank you very much. 

    This topic has been closed for replies.
    Best answer by Giu S
    Posted on June 14, 2017 at 16:59

    Ok, I have the solution!

    I write only this:

    hcan.pTxMsg = &TxM;

    hcan.pRxMsg = &RxM;

    and I forgot this:

    hcan.pRx1Msg = &RxM1;

    Now it works.

    5 replies

    Tesla DeLorean
    Guru
    June 12, 2017
    Posted on June 12, 2017 at 17:20

    >>

    go in an 'infinite loop'

    Stopped in a debugger this where exactly? Hard Fault Handler, Default Handler?

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Giu S
    Giu SAuthor
    Associate II
    June 12, 2017
    Posted on June 12, 2017 at 18:12

    after this instruction (but only for FIFO1, because for FIFO0 it works good):

    pRxMsg->IDE = CAN_RI0R_IDE & hcan->Instance->sFIFOMailBox[FIFONumber].RIR;

    It goes here:

        .section .text.Default_Handler,'ax',%progbits

    Default_Handler:

    Infinite_Loop:

    b Infinite_Loop

    .size Default_Handler, .-Default_Handler

    Thank you for your reply.

    Tesla DeLorean
    Guru
    June 12, 2017
    Posted on June 12, 2017 at 22:39

    Check FIFONumber is in range.

    Have an effective Hard Fault Handler routine

    Make sure all IRQHandlers you need are correctly named and present

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..