Forum Discussion
Altera_Forum
Honored Contributor
14 years agoJTAG UART slowness
Hi All,
I am trying to write a file from the PC into SDRAM through the JTAG UART, and have found that it is quite slow. I only see about 1KB/s, and need to transfer files that are about 10-20MB. At first I was using system console to write directly into SDRAM using the "master_write_32" commands. I thought maybe system-console is slow because it needs to control the nios processor in some way. I then tried using the nios2-terminal with the command "cat file | nios2-terminal", and simple software to continually read the UART, but didn't find any improvement. Next I tried using code included with the high speed image to transfer data (specifically to send data from the PC), but unfortunately didn't fix the problem. I see that when I download the elf file speeds of 60KB/s are reported. Assuming that's true, then I don't think its my byte-blaster or cable etc. Has anyone experienced something similar to this? Any help/suggestions would be greatly appreciated. Thanks!6 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- I am trying to write a file from the PC into SDRAM through the JTAG UART, and have found that it is quite slow. I only see about 1KB/s, and need to transfer files that are about 10-20MB. At first I was using system console to write directly into SDRAM using the "master_write_32" commands. I thought maybe system-console is slow because it needs to control the nios processor in some way. --- Quote End --- The fastest method is master_write_memory using the JTAG-to-Avalon-MM bridge. http://www.ovro.caltech.edu/~dwh/correlator/pdf/altera_jtag_to_avalon_analysis.pdf Cheers, Dave - Altera_Forum
Honored Contributor
--- Quote Start --- I see that when I download the elf file speeds of 60KB/s are reported. Assuming that's true, then I don't think its my byte-blaster or cable etc. --- Quote End --- All benchmarks have been most likely made with an USB Blaster. Byte Blaster is considerably slower due to the bit-banging method of generating JTAG signals. - Altera_Forum
Honored Contributor
And why not to use simple UART? There's SOPC/QSys UART component, but I'd offer to write Your own and use USB-to-UART converter, which is capable of a few Mbit/s.
- Altera_Forum
Honored Contributor
Thanks for the information it was very helpful. I mis-spoke in my earlier message. I'm actually using the USB Blaster. An old habit of calling it the byte blaster. I took dwh's suggestion and used the JTAG to Avalon MM Bridge instead of the NIOS, and used the write_master_memory command which speeded things up significantly. I now see ~100KB/sec which is good enough for my purposes. Thanks again.
- Altera_Forum
Honored Contributor
--- Quote Start --- I took dwh's suggestion and used the JTAG to Avalon MM Bridge instead of the NIOS, and used the write_master_memory command which speeded things up significantly. I now see ~100KB/sec which is good enough for my purposes. --- Quote End --- Great! Cheers, Dave - Altera_Forum
Honored Contributor
Hmmm.... If you expose the nios soft reset pins to an avalon slave you should be able to use the JTAG -> Avalon master interface to download software.
This would significantly reduce the resource usage - especially if you don't need the I-cache for anything else. Technically the JTAG uart could still be present - but I suspect that is only included as part of the debugger.