Skip to content

CAN: Remote frame is not working for H743ZI2 #12788

@micropk

Description

@micropk

Description of defect

I am trying to send the remote type CAN message using the CAN API, the write function returns 1 (success), however at the receiver side its not being reflected as "CANRemote" Type. Other parameters are working as expected only the type(CANRemote) is having the issue. I've observed only on NUCLEO_H743ZI2, I am not sure about other NUCLEO targets.

Target(s) affected by this defect ?

TARGET_NUCLEO_H743ZI2

Toolchain(s) (name and version) displaying this defect ?

GNU Arm Embedded Toolchain V7.2.1

What version of Mbed-os are you using (tag or sha) ?

mbed-os-5.14.1

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

NA

How is this defect reproduced ?

Observe only printf("Data: %d, Type:CANData\n", msg.data[0]); is being printed.

#include "mbed.h"

Ticker ticker;

DigitalOut led1(LED1);
DigitalOut led2(LED2);

CAN can1(MBED_CONF_APP_CAN1_RD, MBED_CONF_APP_CAN1_TD);
CAN can2(MBED_CONF_APP_CAN2_RD, MBED_CONF_APP_CAN2_TD);
char counter = 0;

void send() {
  CANMessage msg;
  msg.id = 123;
  msg.type = CANRemote;
  msg.format = CANStandard;
  msg.len = 1;
  msg.data[0] = counter;
  if (can1.write(msg)) {
    counter++;
    printf("Message sent: %d\n", counter);
  }
  led1 = !led1;
}

int main() {
  ticker.attach( & send, 1);
  CANMessage msg;
  while (1) {
    if (can2.read(msg)) {
      if (msg.type == CANRemote) {
        printf("Data: %d, Type:CANRemote\n", msg.data[0]);
      } else {
        printf("Data: %d, Type:CANData\n", msg.data[0]);
      }
      led2 = !led2;
    }
    wait(0.2);
  }
}

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