DSP Uart Application
-
Hello,
Platform: VOXL2 running PX4
I have a custom application running on the DSP in the form of a PX4 driver. It is talking over the RC UART port on the VOXL2 to a micro-controller. When I begin increasing the amount of data I am sending into the DSP (from the micro), information starts getting lost on the DSP RX side. I believe it is single bytes getting dropped but I can't rule out multiple bytes also. This happens at 460800, 921600 and 2000000 baud (slower rates are not viable for this application) and I tried varying how frequently I read data from the file handle which doesn't appear to affect anything. The data rate that I've observed issues happening can be as low as 5 KB/s and gets worse with higher rates.
In back-tracing this issue, I've come up with some questions I'd like some help with:
- Which of the DSPs is PX4 running on?
- I'm assuming the Sensor Hexagon DSP or is it running across multiple DSPs?
- The entire voxl-px4 stack is running on the QRT1 RTOS isn't it?
- When are the uart function pointers mapped and is the source for these available (I'm assuming no)?
- What is the underlying configuration of the UART that the DSP is talking to on the RC Port?
- Is there a library or config file where I can inspect the config / setup?
- For the low-level IO, is there a DMA in place and what is the buffer size?
- Could this be an issue?
- Is there documentation or architecture diagrams covering these details?
- Unfortunately I could not find the necessary information in the forums or on the docs site
Best Regards,
Shaun. - Which of the DSPs is PX4 running on?
-
@scosgrove PX4 runs on the Sensors Hexagon DSP (AKA SLPI, AKA SDSP). Most of PX4 runs on that DSP but there is some part of PX4 that runs on the Linux applications processor (e.g. Mavlink, logging, data manager, etc.). The applications processor portion communicates with the DSP portion via the muorb (multiprocessor uorb) module in PX4. Unfortunately, all of the details of the UART HW and drivers (including the API) are Qualcomm proprietary so we are not able to share details of that. There isn't much configuration going on though, just port number and baudrate. There is no DMA. Can you move your driver to the applications processor? If you have an add-on board with an application processor mapped UART then you could run on the applications processor.
-
@Eric-Katzfey Thanks for your response, I appreciate you taking some time to think about this.
Apologies, when I said voxl-px4, I think of this as the binary that runs on the DSP, but I guess it is both the Apps and the DSP split application.
Shifting to the Apps processor isn't an option for this particular use-case but I appreciate that I may have more control / insight doing this from Linux.
Can you point me to any datasheets that I can try to access from Qualcomm which may shed some light on both the capabilities of the Sensor Hexagon DSP and the hardware access? I have a Qualcomm account to access their provided documentation and I've unfortunately not found anything useful with the underlying RTOS and practically nothing on the drivers for the UART or even how they are connected apart from the mapping in the QUP. Thanks!
-
@scosgrove Unfortunately, there isn't a whole lot of useful documentation about that. You kind of have to look through the Qualcomm source code to get an idea of what it is doing. One idea is to use the Qualcomm
mini-dm
debug tool. It is included with the Hexagon SDK. If you are connected to the USB port (i.e. you can use adb) then you can use mini-dm. This will output more information from the DSP as it is running and you may see some error messages coming out when you are seeing issues with data loss. -
@scosgrove , I just wanted to mention that our ESC driver for PX4 is also using UART running at 2Mbit. The Flight Control loop sends out commands at 800Hz and each control packet is 15 bytes long. Also one ESC channel (out of four) sends feedback to the DSP for every command. The feedback packet size is 16 bytes (at 800hz), that would be 12800 bytes/s. We almost never see missed RX data. I have also experimented with larger feedback packets (~42 bytes at 800hz = 33600 bytes/s received by DSP).
Can you please clarify how the data is batched when the byte loss happens - how many bytes are sent without a break?
Alex