IRNAS / KORUZA-driver-specification

Specification and later documentation for KORUZA open source open hardware driver
Other
0 stars 1 forks source link

CPU - MCU comunication #1

Closed VojislavM closed 8 years ago

VojislavM commented 8 years ago

Koruza driver will be part of the bigger Koruza system, and it will be responsible for driving low-level peripherals. This means there must be some kind of communication between main Koruza CPU and Koruza driver MCU. A majority of systems who have this kind of architecture are using UART communication between two processors. This way they can exchange data and commands. It is necessary to establish a good protocol between two processors, and then it would be more obvious what kind of communication is best.

Picture represents how this is done in LinkIt Smart 7688 Duo system

image1

kostko commented 8 years ago

I propose a protocol based on TLVs, which makes it extensible in a backwards-compatible way. Each protocol message looks like this:

[TLV#1] [TLV#2] ...

And each TLV looks like this:

[type: 1 byte] [length: 2 bytes] [value: length bytes]

All protocol values are in network byte order (big endian). The use of TLVs enables older protocol implementations to skip newer TLVs.

The following TLVs are currently defined:

We need to determine what kind of messages should be exchanged between the CPU and MCU and define the TLVs that we will need in the protocol.

I have prepared a message handling implementation for the above protocol:

VojislavM commented 8 years ago

I agree with your suggestion for the protocol. Soon I will send you a list of commands that we need to have, and we can then discuss it further.

In the mean time, I will implement the code you sent on the STM32 platform for Koruza driver.

VojislavM commented 8 years ago

All communication between MCU and CPU is done thru UART with TLV protocol.