I'm working on an AWE Core integration on a Cortex-M4 processor using the AWE Core Integration Guide. I'm trying to understand how tuning responses are supposed to work in UART mode. I assume that when a response is available, the data in the packet buffer is encoded as described in Section 3.5 of the integration guide?
If that's the case, how do I know how many bytes of response I need to send? Do I need to decode the protocol to extract the length field from the first word?
5:11pm
Hi,
We recommend implementing UART on baremetal systems by writing a byte-by-byte interrupt handler. With this approach the BSP author does not need to keep track of the number of bytes sent back to the host. On each transmit holding register empty interrupt, call awe_fwTuningTxByte, and if the return value is not bComplete insert the byte into the transmit holding register. The ADSP_21489 BSP on our website (www.dspconcepts.com/downloads) uses this method for UART tuning.
If this is not practical (perhaps because an RTOS is being used) create an additional buffer to hold the encoded bytes. This buffer must be large enough to hold the maximum encoded byte payload which, for a 264 word packet buffer, would be (264 * 5) + 3 = 1323 bytes long. Then call awe_fwTuningTxByte in a loop placing each encoded byte into the send buffer until the method returns bComplete = TRUE. Then use an RTOS call to send the encoded reply bytes to the host.
Thanks
-Axel
5:14pm
This all sounds incredibly inefficient. Is there a way to configure the server to not do the encoding and just send normal tuning packets over the serial link?
11:24am
The encoding exists to provide the robustness necessary for an RS-232 based tuning interface. There is currently no way to turn off this encoding on the Server side so it is required to use the methods described above to decode on the target side.
11:28am
Where is the awe_fwTuningTxByte() API documented?
10:32am
This function is listed in the TuningHandler.h file with a short description. This file can be found under Lib\AWEInclude in your STM BSP package.
We are currently working on improving our API and documentation with a focus on usability, so your feedback on these items is useful to us to that end.
Thanks
Axel