Home ·

# SerialConnection QML Type

SerialConnection represents a serial connection to a programmable device, either via RS232 or USB. More...

Import Statement: | import SAMBA.Connection.Serial 3.2
Inherits: | Connection

- List of all members, including inherited members

## Properties

- baudRate : int
- maxChunkSize : var
- port : string

## Methods

- close()
- go(address)
- open()
- read(address, length, timeout)
- readu8(address, timeout)
- readu16(address, timeout)
- readu32(address, timeout)
- waitForMonitor(timeout)
- write(address, data)
- writeu8(address, data)
- writeu16(address, data)
- writeu32(address, data)

## Detailed Description

SerialConnection can be used to connect to the SAM-BA Monitor included in the ROM Code of most Atmel MPUs and MCUs.

The device must be waiting for commands in SAM-BA Monitor mode. This is usually done by either erasing the device (for devices that have an internal flash and a dedicated ERASE pin), or by disabling the chip-select of the external memories. Please see the datasheets and manuals of the device and board for more details.

This SAMBA::Connection implementation supports both direct USB connection to the SAM-BA Monitor and access through the console UART. The console UART is device-specific (for example DBGU for SAMA5D4) and may be configurable (on SAMA5D2, the console can be changed using the boot config word and/or fuses). Please see the datasheet of the device for more details.

## Property Documentation

baudRate : int

The serial baud rate to use for the connection.

If the requested baudrate is not supported, the closest supported one will be used. When connected directly to the AT91 CDC ACM USB port, the baudrate is ignored.

maxChunkSize : var

The maximum size of the data chunks when reading from the device

Some platforms have limitations on the maximum amount of data that can be transferred in a single chunk on the serial device. This property allows some control on the way the read transfers are split.

The default value should be suitable for most cases.

port : string

The port to use for the connection

For Windows, port have the form "COMxx" where xx is the number assigned to the port, for example "COM2" or "COM84".

For Linux, use the device name without its "/dev/" prefix, i.e. for "/dev/ttyACM0", use "ttyACM0".

## Method Documentation

close()

See also Connection::close().

go(address)

See also Connection::go().

open()

See also Connection::open().

read(address, length, timeout)

See also Connection::read().

readu8(address, timeout)

See also Connection::readu8().

readu16(address, timeout)

See also Connection::readu16().

readu32(address, timeout)

See also Connection::readu32().

waitForMonitor(timeout)

See also Connection::waitForMonitor().

write(address, data)

See also Connection::write().

writeu8(address, data)

See also Connection::writeu8().

writeu16(address, data)

See also Connection::writeu16().

writeu32(address, data)

See also Connection::writeu32().