Skip to content

STM32 incoming CAN message wrong type and format #3792

Closed
@vargham

Description

@vargham

Reading CAN messages with STM32 targets results out of range format and type with extended format (4 instead of 1), and remote type (2 instead of 1). Tried with STM32F302 and STM32F429, same result. I tried also with LPC1768 and the result is OK (1 for extended and 1 for remote).
CANFormat and CANType enums are declared in can_helper.h

enum CANFormat {
    CANStandard = 0,
    CANExtended = 1,
    CANAny = 2
};
typedef enum CANFormat CANFormat;

enum CANType {
    CANData   = 0,
    CANRemote = 1
};
typedef enum CANType CANType;

Tried:
printf("CAN in Format=%d Type=%d\r\n",canMessage.format, canMessage.type);
Output is Format=0 for CAN standard and Format=4 for CAN extended. Output is Type=0 for data and Type=2 for remote. Extended format should be 1 and not 4, remote frame should be 1 not 2.

Description

  • Type: Bug
  • Priority: Major

Bug

Target
STM32 all

Toolchain:
Online IDE

Toolchain version:
Current Online IDE with mbed-lib rev 136.

Expected behavior
Extended format should be CANExtended (1), remote frame should be CANRemote (1).

Actual behavior
Extended format is 4, remote frame is 2.

Steps to reproduce
Receive CAN messages (Extended/Standard and Data/Remote) with any STM32 target.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions