RetroBSD
http://retrobsd.org/

How can I get 1-10MB/s of debugging data to and from a dev b
http://retrobsd.org/viewtopic.php?f=12&t=38278
Page 1 of 1

Author:  gundan [ Tue Nov 14, 2017 9:14 am ]
Post subject:  How can I get 1-10MB/s of debugging data to and from a dev b

I want to say here's the fundamental problem : I'm looking at a dev board for, say, a TI/AD/Microchip microprocessor or DSP. This is long before a full product design; we're talking proof-of-concept work here. I want to send data from a PC to be processed by my firmware, or have my firmware send data to my PC. And I want the rate to be of the order of 1-10MB/s.

15+ years ago, 1-10MB/s would have been quite niche. kB/s would have been more usual, and the dev board would have had a DB9 connector on it. I could have just plugged a serial cable between the dev board and my PC, perhaps with a USB-to-serial converter, and read and write to COMX or /dev/ttySX.

However, this scheme has a number of limitations that are now starting to show up:

I want MB/s, not kB/s.
The absolute max UART rate a 100MHz device could manage is still only 0.7 MB/s. SPI on the other hand allows up to 3-4 MB/s.
It's incredibly rare for PCs to come with serial ports now, so specialised adaptors are needed to interface with a PC eg. USB to serial cable.
But I'm stumped for what I could use to replace the old serial scheme. The main context for this question is sending serialised debugging data between vendor dev boards and a PC before design is finalised, so anything requiring secondary devices eg. Bluetooth isn't super useful. The µPs I typically work with are in the realm of TI's MSP430, Microchip's PIC32M*, and low power DSPs like the TI C55x or C674. Their dev boards might typically come with headers connected to SPI/I2C/UART peripherals.

Ethernet would require full implementation of a networking stack, which isn't really practical on the constrained DSPs or µPs I often work with. Furthermore most PCs only have one ethernet port, if at all, so you wouldn't be able to use it for wired networking.

Ground-up USB requires getting a vendor ID from a 3rd party, and reinventing all sorts of wheels at the driver and software level just to get data from one device to another.

Ideally I'd like to just be able to dump bytes in a peripheral register on my µP and drain it using Python on the PC or vice versa, using a cable most IT departments would have lying around, and get 1-10 MB/s. A bonus would be not having to poll every available port of whatever kind to find the device on a PC. Is this possible?
All guys has any suggestions that welcome.
Thanks all

Author:  majenko [ Tue Nov 14, 2017 10:19 am ]
Post subject:  Re: How can I get 1-10MB/s of debugging data to and from a d

A direct USB connection can get that kind of speeds. A High-Speed connection is 480Mbps overall or about 60MBps. Of course, that's shared by everything on the bus, and the kind of USB connection (Bulk, Interrupt, Isochronous, etc) defines the latency and smoothness of the transaction, but it's certainly possible to get high speeds like that.

I am working on a new USB stack for chipKIT which includes HS support for the MZ chips. It's not optimized yet for ultra high speed, but it works. It's all in my USB branch of the chipKIT-core:

  • https://github.com/majenkotech/chipKIT-Core/tree/usb

I can't remember the speeds I was getting in testing, but it's certainly a helluva lot faster than serial. And you have the choice of protocols - CDC/ACM, Raw HID, etc. (audio coming one day too, along with Mass Storage Device).

Author:  Pito [ Tue Nov 14, 2017 7:08 pm ]
Post subject:  Re: How can I get 1-10MB/s of debugging data to and from a d

Few days back I got a $7 FT232H board from ebay.
https://www.ebay.com/itm/CJMCU-FT232H-H ... SwsXFZHAiM
It is an FTDI chip, high speed 480Mbps at the PC side, fully supported by Win and Linux, at the MCU side it offers:
Quote:
Single channel USB to serial / parallel ports with a variety of configurations.
Entire USB protocol handled on the chip. No USB specific firmware programming required.
USB 2.0 Hi-Speed (480Mbits/Second) and Full Speed (12Mbits/Second) compatible.
Multi-Protocol Synchronous Serial Engine (MPSSE) to simplify synchronous serial protocol (USB to JTAG, I2C, SPI or bit-bang) design.
UART transfer data rate up to 12Mbaud. (RS232 Data Rate limited by external level shifter).
USB to asynchronous 245 FIFO mode for transfer data rate up to 8 MByte/Sec.
USB to synchronous 245 parallel FIFO mode for transfers up to 40 Mbytes/Sec

So the best scenario for you would be the FT232H connected to your MCU via SPI or JTAG...
The pic32mx/mz can do 20/50Mbit/sec via SPI (2.5/6MB/sec).

Adafruit sells the identical board ($15) and perhaps there is python support as well
https://learn.adafruit.com/adafruit-ft2 ... t/overview
Python for the FT232H:
https://learn.adafruit.com/adafruit-ft2 ... psse-setup
https://pypi.python.org/pypi/pyftdi
http://eblot.github.io/pyftdi/

With USB on the pic32mx/mz you may get ~0.5MByte/sec rd/wr FS reliably when lucky.

Author:  wiz [ Wed Nov 15, 2017 12:58 am ]
Post subject:  Re: How can I get 1-10MB/s of debugging data to and from a d

Gundan,

Doesn't seem that hard unless you want to use stuff in the 'normal' way. i.e.- gotta do http. instead of just send the data.

The big advantage of USB2 was the receive buffering so the processor could be doing something else while waiting for data to come in. Most so called high speed data consists of ping-pong buffers. But if you don't have to do that much processing with the received data you can just dedicate your micro to mostly receiving or sending data.

In a lot of cases your really have bursts of data at the high rate followed by display or analysis. In this case your problem is not that hard. Conventional Oscilloscopes for example display at a high rate but only in bursts.

Interesting question.

Wiz

Author:  majenko [ Wed Nov 15, 2017 10:10 am ]
Post subject:  Re: How can I get 1-10MB/s of debugging data to and from a d

The next stage of the new USB stack is to implement DMA so as to free up the CPU a little more while reception/transmission is going on. That's going to be fun...

Especially on the MZ chips that have their own dedicated USB DMA channels...

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/