This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

making a CAN acknowledger using CMSIS

Hi,

I am making some test code and I want to program one of my CAN channels to respond to all frames on the CAN bus with an ACK.

It does one time but ignores everything afterword.

I have initialized the driver and have the event and object callbacks. I do not do anything in the callbacks since I don't care about the data. I can put a break in the receive case and it does see the first frame. No more messages to the either call backs after that.

I tried setting the callback addresses to NULL in the initialize function ( the CMSIS documentation said you could if you dont need to process them ). This made a HW fault. Tracked that down to CMSIS code that was calling the NULL callback. So I guess you cant use NULLS.

I am not doing the OSSignalWait() / OSSignalSet thing. I am going to try that next.

So my question is... is there anything that needs to be done on each message reception to enable receiving the next?

Thanks,
Tony

Parents
  • I set up an additional device on my CAN bus and have it sending frames every 250ms. My CMSIS device is acking just fine.

    So some of the detail that I left out of my original post probably matters... although it has not dawned on me yet why.

    Additional detail:
    Originally I was using the same hardware device to send and to ack... just different CAN channels. Channel 0 sends, channel 1 acks.

    The drivers for channel 0 and channel 1 are setup in the same RTOS thread. The thread is seup to run every 250ms and send on ch 0. Channel 1 is ignored by my code. Maybe something is dawning on me while writing this... will the OSDelay( 250 ) make the callback not work if a message comes in while delayed? Hmmm

    Maybe channel 1 needs its own thread?

    Thanks,
    Tony

Reply
  • I set up an additional device on my CAN bus and have it sending frames every 250ms. My CMSIS device is acking just fine.

    So some of the detail that I left out of my original post probably matters... although it has not dawned on me yet why.

    Additional detail:
    Originally I was using the same hardware device to send and to ack... just different CAN channels. Channel 0 sends, channel 1 acks.

    The drivers for channel 0 and channel 1 are setup in the same RTOS thread. The thread is seup to run every 250ms and send on ch 0. Channel 1 is ignored by my code. Maybe something is dawning on me while writing this... will the OSDelay( 250 ) make the callback not work if a message comes in while delayed? Hmmm

    Maybe channel 1 needs its own thread?

    Thanks,
    Tony

Children