I'm trying to use Freemaster 2.0 over CAN, however the configuration method isn't exactly clear.
I got Freemaster to work over UART (and it's excellent), but when I instead go to freemaster_cfg.h and make the following changes:
#define FMSTR_USE_FLEXCAN 1
/* Select RX and TX FlexCAN Message buffers */
#define FMSTR_FLEXCAN_TXMB 4
#define FMSTR_FLEXCAN_RXMB 5 //MB0-3 are used by application
There doesn't appear to be any activity from Freemaster. What's not clear is:
-How do I set the actual TX and RX ID's for Freemaster to use? I see private functions, however it's not clear how I'm "supposed" to manipulate those commands
-Do I need to put FMSTR_ISR(); in the existing CAN interrupt handler?
Is there a setup guide to help with the CAN configuration? It was relatively straightforward with UART, however I haven't seen much for using CAN.
Thank you,
Andrew
已解决! 转到解答。
Came back with some fresh eyes and got this figured out. I'll go over the "obvious" stuff, especially if you have used Freemaster over UART, and then get into the non-obvious.
Obvious configuration things - as found in examples, documentation, etc.:
Even if you have Freemaster included in your S32DS project, you still need:
What's *not* obvious:
Came back with some fresh eyes and got this figured out. I'll go over the "obvious" stuff, especially if you have used Freemaster over UART, and then get into the non-obvious.
Obvious configuration things - as found in examples, documentation, etc.:
Even if you have Freemaster included in your S32DS project, you still need:
What's *not* obvious:
Hi Andrew,
you only need to enable FlexCAN communication by
#define FMSTR_USE_FLEXCAN 1
and disable UART.
In FreeMaster communication driver you can find examples for multiple MCUs. Anyway - which MCU are you using? S32K144?
Jiri
Thanks Jiri,
Yes, I'm using the S32K144 FRDM board
I understand that's how the documentation says it's "supposed" to work.. but that's exactly what I've done in freemaster_cfg.h, and it doesn't work.
My application communicates on FlexCAN MB 0,1,2, and 3 just fine, however when I use the Freemaster CAN communication wizard, communication times out because the FMSTR code won't respond on 0x7AA.
I looked at the example for the S32 in the driver package, however it wasn't useful since the example is for SCI, not CAN. I may be looking in the wrong example, of course - if you could be more specific on which one works with CAN it would be very helpful.
Again - 0x7AA TX/ RX is the default communication setting in the PC application - but where am I supposed to set this in the S32's configuration? If I instead want to set the ID to 0x7FF it's not clear on how I need to do that - the only thing that I can tell is setting "1" for "FMSTR_USE_FLEXCAN" which seems insufficient.