Difference between revisions of "KONNEKTING Protocol Specification 0x01"
Konnekting (talk | contribs) |
Konnekting (talk | contribs) |
||
Line 13: | Line 13: | ||
After ProgMode has been achived, it's time to do the actual device programming. | After ProgMode has been achived, it's time to do the actual device programming. | ||
− | For getting an answer for "... changed?", a comparison between the "DeviceMemory" section (see: https://gitlab.com/konnekting/KonnektingXmlSchema/blob/develop/src/main/xsd/KonnektingDeviceV0.xsd) of .kconfig.xml with the data the application wants to write. If there are any differences, data has to be written. Either complete, or only the blocks with changes (will speed up programming a lot, especially for small changes). | + | For getting an answer for the "... changed?" decision-blocks, a comparison between the "DeviceMemory" section (see: https://gitlab.com/konnekting/KonnektingXmlSchema/blob/develop/src/main/xsd/KonnektingDeviceV0.xsd) of .kconfig.xml with the data the application wants to write. If there are any differences, data has to be written. Either complete, or only the blocks with changes (will speed up programming a lot, especially for small changes). |
{{#drawio:Protocol0x01WorkflowTables}} | {{#drawio:Protocol0x01WorkflowTables}} |
Revision as of 13:06, 15 November 2019
Workflow
The following describes the workflow for programming a KONNEKTING device. The diagrams show the required actions the programming device (f.i. KONNEKTING Suite) needs to do in order to program a KONNEKTING device.
Start Programming Mode
Before the programming can start, the KONNEKTING device needs to be in "programming mode" (short: ProgMode). The following diagram describes the two possible ways to achive ProgMode.
Do Programming
After ProgMode has been achived, it's time to do the actual device programming. For getting an answer for the "... changed?" decision-blocks, a comparison between the "DeviceMemory" section (see: https://gitlab.com/konnekting/KonnektingXmlSchema/blob/develop/src/main/xsd/KonnektingDeviceV0.xsd) of .kconfig.xml with the data the application wants to write. If there are any differences, data has to be written. Either complete, or only the blocks with changes (will speed up programming a lot, especially for small changes).
The parts for "Program CommObjects" and "Program Parameters" are optional an depend on what the user want to program. So you can skip or include them, as you like.
Working with files
This is about working with files, means transfering files to the device, including firmware upgrade
todo ...
Device Memory Layout
The device's memory is divided in multiple sections:
Hints:
- The AddressTable is sorted by the GroupAdress ascending by its integer value.
- The AssociationTable is sorted by the GroupAddress ID ascending by its integer value.
System Table
- Total table size in bytes: 32 bytes, first 16 bytes: fixed, read only; next 16 bytes: variable, readable/writeable
Access Mode | Table Byte Index | Description |
---|---|---|
R | 0 | version byte HI |
R | 1 | version byte LO |
R | 2 | #Device Flags |
R | 3 | #GroupAddress Table address HI |
R | 4 | GroupAddress Table address LO |
R | 5 | #Association Table address HI |
R | 6 | Association Table address LO |
R | 7 | #CommObject Table address HI |
R | 8 | CommObject Table address LO |
R | 9 | #Parameter Table address HI |
R | 10 | Parameter Table address LO |
R | 11..15 | 0xFF, unused |
R/W | 16 | IndividualAddress HI |
R/W | 17 | IndividualAddress LO |
R/W | 18..31 | 0xFF, unused |
Device Flags
b7 ist the left most bit, b0 is the right most bit.
bit | hex mask | Description |
---|---|---|
b7 | 0x80 | Factory Flag:
|
b6 | IA set | |
b5 | CO set | |
b4 | Params set | |
b3 | data storage in use | |
b2..b0 | n/a | unused |
GroupAddress Table
- Total table size in bytes: 1+(n*2) bytes, where n = GroupAddress limit, see #System_Type
Table Byte Index | Description |
---|---|
0 | number of filled entries in table |
1 | GroupAddress 0 HI |
2 | GroupAddress 0 LO |
3 | GroupAddress 1 HI |
4 | GroupAddress 1 LO |
5 | GroupAddress 2 HI |
6 | GroupAddress 2 LO |
... | ... |
Association Table
- Total table size in bytes: 1+(n*2) bytes, where n = GA-CommObj relation limit, see #System_Type
Table Byte Index | Description |
---|---|
0 | number of filled entries in GA<->CommObj relations table |
1 | GroupAddress ID Nr.1 |
2 | CommObj ID Nr.1 |
3 | GroupAddress ID Nr.2 |
4 | CommObj ID Nr.2 |
5 | GroupAddress ID Nr.3 |
6 | CommObj ID Nr.3 |
... | ... |
CommObject Table
- Total table size in bytes: 1+(n) bytes, where n = CommObjects limit, see #System_Type
Table Byte Index | Description |
---|---|
0 | number of existing CommObjects |
1 | config byte (see below) of CommObject ID 0 |
2 | config byte of CommObject ID 1 |
3 | config byte of CommObject ID 2 |
... | ... |
CommObject config byte
b7 ist the left most bit, b0 is the right most bit.
bit | hex mask | Description |
---|---|---|
b7 | 0x80 | unused, 0x00 |
b6 | unused, 0x00 | |
b5 | C: the Communication flag | |
b4 | R: the Read flag | |
b3 | T: the Transmit flag | |
b2 | W: the Write flag | |
b1 | U: the Update flag | |
b0 | I: the Initialization flag |
Parameter Table
- Total table size in bytes: depends on actual by device provided parameters
Table Byte Index | Description |
---|---|
0 | ... |
1 | ... |
2 | ... |
3 | ... |
... | ... |
User Space
This is the space where user data can be stored. The KONNEKTING Device Library provides an API to query the start address for this user space in memory.
Property Pages
Property pages are blocks information with up to 12 bytes of length. Property pages are read-only and do not directly belong to the device's memory (f.i. EEPROM or Flash). The information is mostly stored in the device firmware.
0x00 Device Info
- Property Page Number: 0 dec / 0x00 hex
- Property Page Name: Device Information
Byte no# | Description |
---|---|
2 | Manufacturer-ID HI |
3 | Manufacturer-ID LO |
4 | Device-ID |
5 | RevisionID |
6 | Device Flags, see below |
7 | System Type, see below |
8..13 | 0xFF, unused |
Device Flags
b7 ist the left most bit, b0 is the right most bit.
bit | hex mask | Description |
---|---|---|
b7 | 0x80 | Factory Flag:
|
b6..b0 | n/a | unused |
System Type
hex | Name | Description |
---|---|---|
0x00 | System 0 Simple |
Up to:
|
0x01 | System 1 Default |
Up to:
|
0x02 | System 2 Extended DRAFT |
Up to:
|
GAs = Unique GroupAddresses
GA-ComObj relations = Assignments of GAs to ComObjects
ComObjects = Number of ComObjects
Parameters = Number of Parameters
Message Types for Protocol-Version 0x01
These are the messages KONNEKTING uses to communicate between the programming device and the KONNEKTING device.
0x00 Acknowledge
- Message Name: Acknowledge
- Message-Type-ID: 0 dec / 0x00 hex
- Direction: Device -> Suite
- Expected Response: n/a
- Description: Sent by device as answer to most WRITE messages
- Requires Programming Mode: n/a
Byte no# | Description |
---|---|
2 | Acknowledge Type |
3 | Error Code |
4..13 | 0xFF, unused |
Acknowledge Type
hex | Description |
---|---|
0x00 | ACK |
0xFF | NACK |
Error Code
hex | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0x00 | ERR_CODE_OK | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0x01 | ERR_CODE_NOT_SUPPORTED | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0x02 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0x03 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0x04 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0x05 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0x06 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0x07 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0x08 | }
0x01 PropertyPageRead
0x02 PropertyPageResponse
0x08 Unload
0x09 Restart
0x0A ProgrammingModeWrite
0x0B ProgrammingModeRead
0x0C ProgrammingModeResponse
0x1E MemoryWrite
0x1F MemoryRead
Memory TablesWith help of #0x1F MemoryRead and #0x1E MemoryWrite one can access the device's memory (EEPROM, flash, ...). The memory stores different tables for different usage. As both messages access memory by memory address, one has to know at which address which table starts. To get the start addresses of all tables, see #0x01 PropertyPageRead and #0x01 Table Addresses. 0x20 MemoryResponse
0x28 DataWritePrepare
Data Type
0x29 DataWrite
Notes:
0x2A DataWriteFinish
Notes:
0x2B DataRead
0x2C DataReadResponse
0x2D DataReadData
0x2E DataRemove
Notes:
|