The following steps describe the procedure to draw an A2B schematic in SigmaStudioPlus.
With sub-node-to-sub-node communication possible with AD242x/3x parts, the way upstream and downstream slots are computed in the A2B schematic varies depending on the A2B transceiver type used. This section describes the slot configuration for AD242x & AD243x types.
In A242x, with the ability for a sub-node to directly receive/transmit data from/to other sub-nodes without having to move the data all the way up to the main, the Rx and Tx channels configured for the peripherals does not directly translate to the Upstream and Downstream slots.
One can configure slots for AD242x sub-nodes using
Slots Received at Port B: Number of slots received at Port B. Calculated as Maximum of ‘UPMaskmax ‘ and ‘Passed up slots from Port B’.
Slots Passed Up from Port B: Number of received slots to be passed up from Port B.
Slots Contributed: Number of slots being contributed to upstream.
Receive Offset: Number of slots which are skipped before transmission.
Slots Transmitted at Port A: Number of slots transmitted at Port A. This is the sum of ‘Slots Passed Up from Port B’ + ‘Slots Contributed’.
Slots received at Port A: Number of slots received at Port A. Calculated as Maximum of ‘DNMaskmax’ and ‘Passed down slots from Port A’.
Slots Passed Down from Port A: Number of received slots to be passed down from Port A
Slots Contributed: Number of slots being contributed to downstream.
Slots Consumed: Number of slots being consumed from downstream when the masks are not used.
Receive Offset: Number of slots which are skipped before transmission.
Slots Transmitted at Port B: This is the sum of ‘Passed down slots from Port A’’ + ‘Slots Contributed’.
Broadcast Downstream Slots: This is active only when the Select slots to consume is disabled.
Figure: Slot Config – Sub-node Properties Window
Like AD242x, AD243x can be either configured via ‘stream configuration’ or manual slot configuration in General/Register view. Additionally, stream-based auto-slot calculation is extended to SPI Data tunnels along with audio streams.
Alternative to the approach of configuring slots in an A2B network using General View/Register view tabs, one could use the Stream based network design approach wherein SigmaStudioPlus does all required A2B slots register settings.
This feature enables auto configuration of A2B slots based on the network wide stream specification. It also facilitates mechanism to store, communicate and import of network wide stream information.
Open Stream configuration window by right clicking Target processor.
This window allows the user to define streams along with properties like sampling rate, number of channels per stream etc. Separate option is provided to edit a selected stream properties. User may remove as well as re-order a selected stream using the respective options.
Figure: Stream Definition Window
All the defined streams are available for assignment. For each stream, user needs to select the source and destination. Each stream can have a single source and one or more destination. The option “Auto Slot Calculate” ensures that slot configuration registers are programmed according to the assignment during schematic Link/download. Optionally, user may trigger slot calculation based on the current assignment by using the button “Calculate Now”.
Figure: Stream Assignment
Like audio, Data tunnels can be defined with the properties like name, tunnel down slots & tunnel up slots. Further, data tunnel can be configured by selecting the participating nodes. Configuration window ensures that user cannot create overlapping data tunnels. ‘Auto Slot Calculate’ option ensures that the data tunnel offsets are calculated implicitly while adhering to the constraints.
Figure: Data Tunnel Configuration
The ‘Stream View’ tab of ‘Device Properties’ window as shown in the below Figure, captures the node level information based on the stream assignment. User can view all the streams associated with the current node. Usage of the streams, direction and corresponding bus slots are captured in the in this view. Note that ‘Stream View’ will be populated only when “Auto Slot Calculate” option is enabled during Stream Assignment. ‘Stream View’ also captures the bandwidth used by the current node.
Figure: Stream View
A Custom Node Identifier allows A2B software stack to determine, at run-time, whether the nodes are physically connected in the expected order so that right configuration is applied to the node. This enables system integrators to uniquely identify and authenticate a Node in an A2B network.
User can set unique ID for a node in an attached I2C enabled Memory device such as an EEPROM attached or by setting unique combination of A2B Transceiver GPIO pin(s) and levels (low/high) or even store in an attached processor memory. The Custom ID information (as set in the hardware) shall be provided in SigmaStudioPlus so that it is used for A2B node validation during discovery process.
Custom Node Identifier can be set from the Node’s ‘Device Properties→General View→ID’ tab.
Use the ‘I2C Device’ option as shown in the below Figure when the Custom ID for the node is stored in a Memory device attached to it.
Specify the Custom ID (either as an ASCII string or as a Hexadecimal number) – Max 50 characters, device address, address width and the memory location in the device where the ID is stored.
Figure: Custom Node ID using I2C
It is possible to write Custom Node ID into an I2C enabled memory device from SigmaStudioPlus using the ‘peripheral properties’ window as shown in Figure 24. The data in the XML file represents comma separated ASCII values of Custom Node ID.
Use ‘GPIO Pins’ option as shown in Figure 24 when A2B Transceiver GPIO pins are used for Custom Node Identification. Specify transceiver GPIO Pins and their level (high/low) to be matched on the actual hardware during A2B discovery process. A GPIO pin not used for Node Identification shall be set to ‘IGNORE’.
As most GPIO pins are multiplexed with other functionality, user shall select pin(s) that are free for Node ID. Note that a GPIO pin will assume a multiplexed functionality only after the A2B Transceiver is discovered and configured. So, with additional on-board circuitry (pull-up/pull-downs) one should be able to use A2B GPIO pins (including multiplexed GPIO) for Custom Node ID. If multiple nodes in a network use GPIO pins for Identification, then each node shall have unique GPIO pin/level settings.
Figure: Custom Node ID using GPIO pins
Use ‘Mailbox’ option as shown in the below Figure when Custom Node Identifier for the sub-node is to be requested from a connected processor.
Figure: Custom Node ID using A2B mailbox
When a schematic is downloaded with this option set, SigmaStudioPlus sends Custom Node Identifier request message to the sub-node over A2B Mailbox, using A2B Stack’s Communication channel module. The sub-node processor, running the Communication channel instance, is expected to handle the request message and respond with its Custom ID as set in SigmaStudioPlus before the ‘TimeOut’ period. The ‘TimeOut’ field specifies the time in milliseconds before which the sub-node must respond with its custom Node ID. If the sub-node fails to respond after ‘number of Retries’ or responds with an invalid ID, then SigmaStudioPlus aborts discovery and a discovery fail message is provided to the user. For more details on communication channel to be run on sub-node and application integration details to refer in 19.10.x release.
During A2B discovery process, the Software stack will read the Custom Identifier value from the remote memory device via I2C at the specified address or will read levels on the specified GPIO lines and validate it against the assigned value. In case of mailbox authentication, the Software stack will request for the ID via the communication channel over A2B mailbox. The sub-node controller is expected to the run the communication channel and the sub-node application is required to handle the request message and respond with the custom node ID as set in SigmaStudioPlus. In all cases if there is a match then the node will be successfully configured otherwise the discovery will be aborted. Additionally, user may register a call back after custom node authentication check, where authentication status can be overridden.
Note that a node may not have a Custom ID set, in which case the stack discovery and initialization process will not perform any Custom ID authentication and hence simply applies the configuration available for that node position
In the Auto configuration scheme, a host processor can automatically configure a A2B sub-node and its peripherals or a complete A2B network without prior knowledge of the topology. Typically, a non-volatile memory device like EEPROM is used to store the configuration information. Following sections describe the Auto configuration options in detail.
A complete A2B network can be configured using the information stored in a memory device that is directly connected to the Host processor via I2C. Such memory device shall use device address 0x50 (7-bit) and accessible directly to the Host processor over I2C. Upon boot, the host processor can read this information to automatically configure the complete A2B network i.e., main and sub-node A2B Transceivers, network and sub-node peripheral devices without any prior knowledge of the network.
In SigmaStudioPlus, one can store the network configuration information into a memory device by saving the Schematic into an EEPROM connected to ECU. This can be done by right clicking the master node. It also can be access from the project window.
Figure: Saving Schematic to EEPROM
Also, there is a provision to export the information into an XML/ Dat file as shown in Figure:A2B Network Stream Information Schematic for EEPROM/DAT File. These files can be input to custom EEPROM programming utilities, specifically .dat file can be converted to hex/.s37 format for ease of flashing.
Figure: Schematic Dump as XML
To specify A2B stack running on the Target processor can load the network wide configuration from EEPROM ensure to define the macro ‘A2B_FEATURE_EEPROM_OR_FILE_PROCESSING ’ and ‘A2B_BCF_FROM_SOC_EEPROM’ and undefined ‘ADI_SIGMASTUDIO_BCF’ in .\Target\examples\demo\a2b-xx\a2bstack-pal\platform\a2b\features.h.
Alternatively, network wide configuration can be sourced to target software from .dat file via the local file system. Refer adi_a2b_busconfig.dat section for more details. (.dat file from EEPROM window and adi_a2b_busconfig.dat file is essentially same)
The Stream information of A2B network is exported to binary file/EEPROM if ‘Include Stream info to dat file’ checkbox is enabled. Stream Information of A2B network is stored in the EEPROM/binary file as shown below.
Figure: A2B Network Stream Information Schematic for EEPROM/DAT File
In EEPROM/Binary file 6th byte (EEPROM Byte Address is 0x05) indicates that the Stream information is exported if the value is 0x01. Addresses mentioned in the Stream Information figure are just for representation and they are not the actual address. Stream information address would be defined by the value at 0x18 (MSB) and 0x19 (LSB) in EEPROM/Binary (DAT) File.
For optimized discovery flow, configure the A2B stack to program the peripherals in multiple jobs instead of serial peripheral processing. This can be done by setting the macro ‘A2B_CONSECUTIVE_PERIPHERAL_CFGBLOCKS’ to a non-zero value in case of EEPROM usage.