CANopen Slave Protocol Stack 
Version 7.04.00
Loading...
Searching...
No Matches
STM32437I-EVAL board

The CANopen FD Slave protocol stack for the STM32437I-EVAL runs on a bit-rate of 500 kBit/s on interface CAN2. Please make sure that:

  • the CAN cable is connected to CN10
  • jumper JP3 and JP10 are configured for CAN2

For display of the CANopen network state the example uses the LEDs LD1 (green) and LD3 (red), the symbol COS_LED_SUPPORT is configured to 1.

Board STM32437I-EVAL

Prerequisites

The example project can be built if the following programs are installed:

Please make sure that the value of WIN_TOOLCHAIN_PATH (for Windows) or UNIX_TOOLCHAIN_PATH (for macOS / Linux) inside the cmake/toolchain-gcc-<version>.cmake file is equal to the install path of the GNU Arm Embedded Toolchain.

cmake
#-----------------------------------------------------------------------------------------------------------------------
# set paths to the desired toolchains of corresponding OS
#
set(WIN_TOOLCHAIN_PATH "D:/devtools/GNU_ARM/13.2 Rel1" CACHE PATH "Windows toolchain for GNU ARM")
set(UNIX_TOOLCHAIN_PATH "/Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi" CACHE PATH "Unix toolchain for GNU ARM")

How to build

Create a local build directory and start the build process within this directory. Make sure to pass the correct toolchain (i.e. GNU Arm Embedded Toolchain) to the CMake process via the parameter -DCMAKE_TOOLCHAIN_FILE. The following examples assume a GNU Arm Embedded Toolchain version 13.2.1.

Debug build

mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../../../../../../cmake/module/toolchain-gcc-13.2.1.cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .

Under Windows, you may have to add the parameter -G"Unix Makefiles" to the CMake configuration:

cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./../../../../../cmake/module/toolchain-gcc-13.2.1.cmake -DCMAKE_BUILD_TYPE=Debug ..

Release build

mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../../../../../../cmake/module/toolchain-gcc-13.2.1.cmake ..
cmake --build .

Under Windows, you may have to add the parameter -G"Unix Makefiles" to the CMake configuration:

cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./../../../../../cmake/module/toolchain-gcc-13.2.1.cmake ..

Resource requirements

The amount of Flash and RAM is given under the following conditions:

  • Use dynamic PDO mapping with 4 TPDOs and 4 RPDOs
  • Use network variables)
Protocol Memory size Flash Memory Size RAM
Classic CANopen 21104 13412

Testing with a CAN monitor tool

Upon reset, the example will transmit a boot-up message using the identifier 70Bh, representing the configured node-ID 11d.

Time-stamp ID Format DLC Data Comment
----------- ---- ------ --- ------------------------ ----------------------------
95151.24441 70B CBFF 1 00 Boot-up, node-ID 11

Writing a value of 100 ms to the heartbeat producer object (1017:00h) shall result in a cycle heartbeat transmission of the device.

Time-stamp ID Format DLC Data Comment
----------- ---- ------ --- ------------------------ ----------------------------
95155.73732 60B CBFF 8 22 17 10 00 64 00 00 00 Set 1017:00h (heartbeat) to 100 ms
95155.74072 58B CBFF 8 60 17 10 00 00 00 00 00 SDO response: OK
95155.84134 70B CBFF 1 7F heartbeat, node-ID 11, pre-operational
95155.94341 70B CBFF 1 7F heartbeat, node-ID 11, pre-operational
95156.04559 70B CBFF 1 7F heartbeat, node-ID 11, pre-operational