0

I'm using NUCLEO-F103RB Board and SN65HVD230 CAN transceiver. and CAN mode is CAN_MODE_LOOPBACK. workspace is keil uvision(IDE), STM32 ST-LINK(debugger?).

I have a sample code what my teacher gives me. it's STMICRO'S sample code. but i really don't know how to use..

first, I know how to set stdId, DLC, DATA[0]~[7] it is like this.

tx_msg.StdId = 0x701;
tx_msg.DLC = 8;
tx_msg.Data[0] = 0x11;
tx_msg.Data[1] = 0x22;
tx_msg.Data[2] = 0x33;
tx_msg.Data[3] = 0x44;
tx_msg.Data[4] = 0x55;
tx_msg.Data[5] = 0x66;
tx_msg.Data[6] = 0x77;
tx_msg.Data[7] = 0x88;

as I know, next step is making transmission code. but how to make trasmission code?

  1. using can_tx(argument...) like this?
  2. setting register about CAN protocol (but my teacher said there is no changing register or interrupt.)

also, I think this is transmit function, maybe....

can_tx(uint32_t CanTxMsgTypeDef *tx_msg),uint32_t timeout)

internal argument->()

Mike
  • 4,041
  • 6
  • 20
  • 37
arwire
  • 1
  • 1

0 Answers0