Hardware

Chest board link

The USB device, its start-up, the three-step exchange every cycle, the frame format, the message types, the preferences, the motor board handshake and the chest board tools.

The chest board is the only USB device nao-rs talks to for the body. It is the hub for everything below the neck. This page describes the link as recorded from the robot and as nao-rs implements it. Parts marked (inferred) are read from the traffic and not yet confirmed otherwise.

The device

PropertyValue
USB idffff:0006 ("Arm9 v3.3" chest board; ffff:0005 is the older one, also recognized by the tools)
Interface0
Endpoints usedEP1 bulk OUT and IN, 64-byte packets
Endpoints not usedEP2 isochronous (OUT 400 B, IN 300 B)
Linux accessusbfs directly, no libusb; udev names it /dev/chestboard on HULKs-OS

Start-up

StepRequest
1Open the device, select configuration 1
2Vendor OUT request 0x13, no data (inferred: start of the protocol)
3Claim interface 0
4Vendor IN request 0x02, answer 4 bytes, 00 02 00 29 on our robot (inferred: chest board version)

The exchange

Every exchange has three steps:

  1. Bulk OUT on EP1: one frame, 20 ms timeout.
  2. Vendor IN request 0x14, 5 bytes: 2a followed by the CRC of the frame just sent. The chest board acknowledges the frame.
  3. Bulk IN on EP1, up to 512 bytes, 20 ms timeout: the answer frame. When nothing is ready the read times out, and vendor IN request 0x15 (2 bytes) asks for the chest board's status (inferred).

A bulk read takes about 0.7 ms.

Frames

DirectionLayout
To the chest board[CRC-32, big endian][messages][length table, last message first]
From the chest board[messages][length table, last message first][CRC-32, big endian]

The CRC is the standard CRC-32 (the one zlib computes). A frame holds up to 255 messages and at most 4 KB. A frame whose length table doesn't add up decodes to no messages. HAL's decoder writes past 255 entries without a bound check; nao-rs stops at 255.

Messages

Every message starts with three bytes: kind, bus, address.

Byte 0Kind (inferred from the traffic)
00Request
01Command (once per board after its configuration)
02Data from a board
03Request to the chest board itself
04Acknowledge from a board (header and one status byte)
Byte 1Bus
00Upper body motor boards
01Leg motor boards and foot boards
02Devices behind the chest board: inertial unit (09), battery (0b), sonar (42), and 50, 51 (not yet named)
03The chest board: preferences (06), chest button (05), id strings (08), 2a

Byte 2 is the board address (see Boards) or a register.

Preferences

The chest board stores a 4,635-byte preference block, read in 32-byte pieces and checked with a CRC. It holds typed key-value pairs, among them:

  • the body id and body version;
  • the stored serial number of every board;
  • the joint zero positions;
  • the foot pressure sensors' gains and offsets;
  • the inertial unit's offsets.

naoctl prefs prints all of them. nao-rs reads all 76 values HAL logs, and every one is identical to HAL's.

The motor board handshake

  1. nao-rs sends a 4-byte request, 00 <bus> <board> 20, to each board.
  2. The board answers with 32 bytes: 16 bytes of status, then 16 bytes of configuration: its serial number (equal to its stored serial number in the preferences; the foot boards send 0), the configuration version, the hardware revision, the board type and the fields used at run time.
  3. The version is checked against the accepted list. A rejected board is asked again, three times in all, and then left uninitialized.
  4. An accepted board gets one command afterwards: 01 <bus> <board> 07 for joint boards, 01 <bus> <board> 08 for hand and foot boards (inferred: start).

HAL does not send a configuration table to the boards; it only reads theirs. Every board of a NAO6 updated by NAOqi 2.8.7 reports version 11 (0b). HAL 2.8.5 accepts only 10, which is why the motors of such a robot don't start under HULKs-OS. The bytes HAL takes from the configuration after the check have the same meaning in versions 10 and 11. nao-rs accepts [10] by default, like HAL; accepting 11 is the motor session's step (planned).

The chest board tools

Aldebaran's three chest board tools are ported onto the same link. They need the chest board free: stop hulk (or HAL) first.

ToolWhat it doesSafe on a running robot?
chest-version [0-3]Reads a 20-character id string per slot (slot 3 is the body id)Yes, read-only; HAL sends the same requests at every start-up
chest-mode or chest-mode -bAsks whether the chest board is in its boot loaderYes, read-only
chest-mode -s, -t, -f, -u, -mSets the chest LED state: start, stop, firmware update, unusable, manualChanges state
chest-mode -rResets the LED watchdog timerChanges state
chest-mode -oSwitches the motors off and onNo
chest-mode -pSwitches the head computer off and onNo
chest-harakiri [-r]Powers the robot off, or with -r resets itNo

None of the tools puts the chest board into its boot loader. They are not in the robot bundle yet; build them from the drivers repository.

On this page