Usage; Example Project; System Bootloader; Bootloader Mode - MACH SYSTEMS CANFD-LIN-GW User Manual

Table of Contents

Advertisement

5 Usage

The device's firmware can be fully developed by the user, and the user has a full control over
the device's peripherals.
The device can be used as CAN FD to CAN bridge, CAN to LIN gateway, CAN/LIN to RS-232, data
logger, ECU simulator, communication simulator or for remote monitoring inputs and remote control
of outputs.
The user can make use of the system bootloader which allows for firmware programming over
USB and RS-232. For flashing over CAN bus, please refer to [1].

5.1 Example Project

Example STM32CubeIDE project in C language is available free-of-charge. Please refer to [2].
The corresponding .ioc file for STM32CubeMx is also available from there.
This example project enters the system bootloader when this CAN message is received over
either CAN channel (see 5.2.1 ):
Baud Rate = 500K
CAN Id = 0x1FFFFFFF (Ext. Id)
DLC=4
Data Bytes = 0x00 0x01 0x02 0x03
It is also strongly suggested to keep similar logic to enter the system bootloader
programmatically.

5.2 System Bootloader

The STM32G4 MCU contains a system bootloader which is pre-programmed in ROM during
manufacture. The system bootloader supports USB and RS-232, it does not support flashing over CAN
bus. If the possibility to upload a firmware over CAN bus is needed, the OpenBLT bootloader described
in [3] can be used.
It should be noted that when the device enters the system bootloader whilst USB is connected, the
device can then be flashed over USB only. If the user wants to flash the device over RS-232, he has to
either power the device over external power pins (see Option 1 in 4.2) or he has to make sure USB
data lines are not connected. This is the limitation of the system bootloader.

5.2.1 Bootloader Mode

There are two ways to enter the system bootloader:
A. Programmatically from application
The user can call jumpToBootloader() function whenever he wants to enter the
system bootloader. Do not to call the function directly from an interrupt routine.
It is suggested to enable at least one way to programmatically enter the system
bootloader.
An example how to call from CAN RX interrupt (taken from source code example in
Chapter 5.1):
/* It is strongly suggested to keep the possibility to
jump to System Booloader from application */
MACH SYSTEMS s.r.o.
CAN FD LIN Gateway - User Manual
www.machsystems.cz
info@machsystems.cz
Page 10 of 18

Advertisement

Table of Contents
loading

Table of Contents