celeron55 wrote: ↑Tue Jun 27, 2023 8:29 pm
Oh, sorry, I think I haven't thought that though yet as I haven't needed extended frames for anything in my projects so far.
The library that's used to support the mcp2515 can controllers in this case is
https://github.com/collin80/mcp_can
Keep me updated how stuck you get, I'll look into it later.
Did some more testing and checking through the libraries. Using Savvycan I've checked sending standard and extended CAN frames both to and from the ipdm. Adding the 'frame.extended' parameter below compiles but regardless of 0 or 1, it seems to default to standard CAN (code snippet shown below). Savvycan gets id 0x220
Code: Select all
EVERY_N_MILLISECONDS(500) {
CAN_FRAME frame;
frame.id = 0x17E49220;
frame.length = 8;
frame.extended = 1; // Standard = 0? Extended = 1?
frame.data.bytes[0] = 0x00;
frame.data.bytes[1] = 0x00;
I've not figured out yet how ipdm CAN interacts with the CAN libraries but wondering if 'ipdm_can' section below could be part of it. More testing to do

CAN data appears to be ok, just the id's to be figured out
In can_common:
Code: Select all
typedef struct
{
uint32_t id = 0; // EID if ide set, SID otherwise
uint32_t fid = 0; // family ID
uint8_t rtr = 0; // Remote Transmission Request
uint8_t priority = 0; // Priority but only important for TX frames and then only for special uses.
uint8_t extended = 0; // Extended ID flag
uint16_t time = 0; // CAN timer value when mailbox message was received.
uint8_t length = 0; // Number of data bytes
BytesUnion data; // 64 bits - lots of ways to access it.
} CAN_FRAME;
In ipdm_can:
Code: Select all
struct CanParameters
{
uint8_t speed = CAN_500KBPS;
// These correspond to the MCP2515 filters
bool filter1_extended_id = false;
uint32_t filter1_mask = 0x000;
uint32_t filter1_ids[2] = {0xfff, 0xfff};
bool filter2_extended_id = false;
uint32_t filter2_mask = 0x000;
uint32_t filter2_ids[4] = {0xfff, 0xfff, 0xfff, 0xfff};
};