Skip to main content
Version: 5.0.x {stable}

Interface configuration

msgconf [-y] [interface] [cfg0] [cfg1] [cfg2] [cfg3]

Prints or sets configuration of communication interfaces.

Printing the configurations

Command msgconf [interface] prints the configuration of the given interface. Command msgconf prints all the interfaces and their configurations in a shorter format.

Setting the configurations

Command msgconf [interface] [cfg0] [cfg1] [cfg2] [cfg3] sets [interface] to given configurations [cfg0], [cfg1], [cfg2] and [cfg3]. If the [cfg1] - [cfg3] values are not entered, zeroes are configured (as defaults). If only [cfg0] is given, it is taken as a single 32-bit number. The special values for these numbers are: 0 - disable the current interface and ?1 - set the given interface to the release-specific default configuration.

  • [interface] is a 4-bit number that identifies the communication interface. The numbers assignment is listed in the table below.

  • [cfg0], [cfg1], [cfg2] and, [cfg3] are four 8-bit numbers in the range 0 - 255 that specify the setting of the communication interface. If these four numbers would be merged into one 32-bit number, [cfg0] would be the LSB, and [cfg3] would be the MSB.

  • Option -y will auto-confirm the changes (otherwise a (y/n) ? prompt will appear).

Interface IDs

[interface] numberInterface
0SWD
1UMSG/UARTCOM
2UMSG2/UARTEXT
3CAN
4CANEXT
5UMSG3
6UMSG4
7USB
8NRF24
9BLUETOOTH
10UDP
11LIN
11LIN2
13LIN3

Interface-specific configuration

This section covers only the most common interfaces and their typical use cases. For greater detail, please refer to siliXcon.

CANx

Description of how to read and set configuration for the CAN Interface ([interface] number 3 or 4).

  • [cfg0] - indirectly sets the speed of the interface. It is a prescaler of the maximum CAN speed - 2 Mbps. Possible values and their meaning is in the table below.
[cfg0] valueSpeed
12 Mbit/s
21 Mbit/s - default setting in most releases
4500 kbit/s
5400 kbit/s
8250 kbit/s
10200 kbit/s
16125 kbit/s
20100 kbit/s
  • [cfg1] - configures the CAN timing. The value 0 is default and other values are reserved for further definition.
  • [cfg2] - configures the (n) bits used for the transmitter address in the CAN ID for unicast and multicast messages. If this value is set to 0, a default value of n = 3 is used. Other values are reserved for further definition.
  • [cfg3] - reserved for further definition.

UARTx

  • [cfg0] - sets baud-rate of selected UART interface in the following way:
[cfg0] valueBaud rate
81200 bps
92400 bps
104800 bps
119600 bps
1219200 bps
1338400 bps
1457600 bps
15115200 bps
16230400 bps
17460800 bps
18921600 bps
  • [cfg1], [cfg2] and [cfg3] - configure the UART mode and timings. The default values are 0 which denotes the 8 bits, no parity, and 1 stop bit. Other values are reserved for further definition.

Return value

When called with arguments, returns the current or set value of that interface. When called without arguments returns 0.

Examples

CommandDescription
msgconf 3 8 0 4 6sets speed od first CAN interface to 250 kbit/s with default timing, uses 4 bits for transmitter address in CAN 2.0a and 6 bits for transmitter address in CAN 2.0b
msgconf 3 -1sets the first CAN interface to release-specific default configuration
msgconf 3 0disables the first CAN interface
msgconf 3 4sets the speed of the first CAN interface to 500 kbit/s (other configuration remains default)
msgconf 1 15 0 0 0sets UART COM to baud rate 115200 bps, 8 bits, no parity, and 1 stop bit (115200 kbps is the default setting in most releases). Zeroes at the end could be omitted, command msgconf 1 15 has the same effect

msginit <interface> <cfg0> [cfg1] [cfg2] [cfg3] [-y]

Works similarly to msgconf (for more info look above), but only for setting the configuration. The only difference is that msginit DOES NOT save the changes to flash memory. This means that the changes you make with msginit will be lost after reboot.


msghost [-e/-d] <dest> <interface>

Changes the host address to <dest> and specifies over what interface will the communication take place. In other words, redirects the communication with the host (for example SWTools) to the specified address over the specified interface.

  • <dest> - address of the target device. It is a number in range 0 - 255.
  • <interface> - number of the used interface. For more info on which number represents which interface, look at the Interface IDs table.

With options -e (short for enable) / -d (short for disable), you can disable/enable the stream output from the controller to the host. The controller will save the unsent data to a buffer (buffer has limited storage), and send it after the stream output is enabled again (with -e). When not specified the option stays as is.

Return value

Returns 0 if and only if the command was successfully executed.


protoconf [-y] [interface] [conf]

Command for viewing and changing service protocols for interfaces.

  • -y option, if present no confirmation prompt is displayed.
  • [interface] interface number according to Interface IDs table.
  • [conf] a number representing what services to enable and what to disable. A negative value means default configuration, otherwise, each bit in the number represents one service protocol, 1 for enable and 0 for disable. Look at the table below to see the bit assignment.

The command can be run with 0 arguments, 1 argument, and 2 arguments. When run without arguments, lists all interfaces along with their configurations. If run with only one argument, prints configuration for given [interface] or if the argument is -1 then sets all interfaces to the default configuration. If run with all arguments enables and disables service protocols for a given interface.

Protocols number assignment

Bit positionService protocol
0PWR (power) - controls device power state.
1FWR (forward) - forwards messages from one interface to another.
3ID (identification) - transfers device metadata (HWID, SWID, UUID ...).
4FS (filesystem) - filesystem transfer, used by emGUI.
5RPC (remote procedure call) - executing commands in the controller, used by emGUI.
6STREAM - default standard input/output streaming, used by Terminal emulator.

Return value

When called with arguments, returns the current/set value of the given service protocol.

Examples

AM-felix#>protoconf
<outputs 15 lines>

Prints configuration for each interface.

AM-felix#>protoconf -1
reset all protos to default (-1)
(y/n) ?
y
AM-felix#>

Sets all interfaces to default configurations.

AM-felix#>protoconf 3 0b11110111
configuring proto 3 as 247 (247)
(y/n) ?
y
AM-felix#>

Enables all service protocols except for ID service for interface number 3 (CAN).