MCUXpresso SDK Documentation

co_manager_basic

co_manager_basic#

Overview#

The co_manager_basic example shows CANopen manager basic feature on the CANopenNode stack.

CANopen manager setup TPDO1(0x1800), RPDO1(0x1400) and RPDO2(0x1401).
Press A, manager send NMT command to switch device to Operational mode.
Press B, manager SDO update device heartbeat producer time to 500ms (0x1017). Default heartbeat producer time is 100ms.
Press C, manager TPDO1 update device RPDO1 mapping parameter.
Press D, read manager RPDO1 mapping parameter which is updated by device TPDO1 cyclic transmission.
Press E, read manager RPDO2 mapping parameter which is updated by device TPDO2 acyclic transmission.

Manager node ID is 0x03.

Running the demo#

== CANopenNode manager basic EXAMPLE ==
 - Press A Enter Device Operational mode
 - Press B Update Device Heartbeat producer time to 500ms (0x1017)
 - Press C Update Device RPDO (0x1400) mapping parameter (0x2000)
 - Press D Read Manager RPDO (0x1400) mapping parameter (0x2001)
 - Press E Read Manager RPDO (0x1401) mapping parameter (0x2002)

Press any key to start CANopen and Manager should start first

Allocated 4896 bytes for CANopen objects
CANopenNode - Reset communication...
CANopenNode - Running...

Press A
Device NMT state Operational
Press B
Read back Heartbeat producer time (0x1017) by SDO
SDO Data 0xf4 0x1
Press C
Read back Device RPDO (0x1400) mapping parameter (0x2000) by SDO
SDO Data 0x1 0x0
Press C
Read back Device RPDO (0x1400) mapping parameter (0x2000) by SDO
SDO Data 0x2 0x0
Press C
Read back Device RPDO (0x1400) mapping parameter (0x2000) by SDO
SDO Data 0x3 0x0
Press D
RPDO (0x1400) mapping parameter (0x2001) 0xff
Press E
RPDO (0x1401) mapping parameter (0x2002) 0x1

Supported Boards#

FRDM-MCXA156
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA156 Board

  • Personal Computer

Board settings

The example requires 2 sets of boards, each of them is mounted with the base board. To make example work, connections needed to be as follows on each base board:

Board to board connections needed to be as follows:

        Node A           connect to      Node B
Pin Name   Board Location         Pin Name    Board Location
CANH       J22-2                  CANH        J22-2
CANL       J22-4                  CANL        J22-4
GND        J22-3                  GND         J22-3
Prepare the Demo
  1. Connect the type-C USB cable between the PC host and the USB ports on the board.

  2. Open a serial terminal on PC for the serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

FRDM-MCXE247
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXE247 Board

  • Personal Computer

Board settings

The example requires 2 boards.

Board to board connections needed to be as follows:

        Node A           connect to      Node B
Pin Name   Board Location         Pin Name    Board Location
CANH       J17-1                  CANH        J17-1
CANL       J17-2                  CANL        J17-2
GND        J17-4                  GND         J17-4
Prepare the Demo
  1. Connect the type-C USB cable between the PC host and the USB ports on the board.

  2. Open a serial terminal on PC for the serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

FRDM-MCXE31B
Hardware requirements
  • Micro USB cable

  • FRDM-MCXE31B Board

  • Personal Computer

Board settings

The example requires 2 sets of boards, each of them is mounted with the base board. To make example work, connections needed to be as follows on each base board:

Board to board connections needed to be as follows:

        Node A           connect to      Node B
Pin Name   Board Location         Pin Name    Board Location
CANH       J17-1                  CANH        J17-1
CANL       J17-2                  CANL        J17-2
GND        J17-4                  GND         J17-4
Prepare the Demo
  1. Connect a type-c USB cable between the host PC and the MCU-Link USB port (J13) on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

MIMXRT1060-EVKB
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT1060-EVKB board

  • Personal Computer

Board settings

The example requires 2 sets of boards, each of them are mounted with the base board. Using a male to male CAN cable to connect the CAN2 instance (J42) between the 2 base boards.

Prepare the Demo
  1. Connect a USB cable between the PC host and the OpenSDA USB on the board.

  2. Open a serial terminal on PC for OpenSDA serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.