Giter Site home page Giter Site logo

jtag's Introduction

jtag's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jtag's Issues

Error: Requested DR Size Too Small

Hello,

First off, thanks for creating and sharing this project, it's really neat.

I got it all up and running and can successfully program my Spartan 2 FPGA. I can't program the XCF02 EEPROM in the chain, however, as it seems the DR Size is too small. The error says the current size is 1032 bits while the EEPROM wants 4097 bits.

I traced the definition back through your code to the line:
static const uint32_t S_MAX_CHAIN_SIZE_BYTES = 129;
but increasing it to the large value I need seems to cause the upload script to hang.

Do you know what the issue could be?

Thanks in advance,
Chandler Snyder

ValueError: invalid literal for int() with base 10: 'oft WDT reset'

Hello,
I am trying to run the python loader and keep getting the following issue. Im not sure what is causing the problem. Thanks in advance for the help!

python xsvf test1.xsvf
Unrecognized line: r...l..r...#..n............p.<.....8.........p....nn...;.n........b.$.r..r..p.n..........l.........b..n..n.$......b...~.n.......l.....#.n...r....nr...;....?...;...r...n....b.......l..........r....n.b..
File: /home/ubuntu1604/Arduino/libraries/JTAG/extras/python/test1.xsvf
Ready to send 506578 bytes.
Sent: 255 bytes, 506323 remaining
Traceback (most recent call last):
File "xsvf", line 57, in
main()
File "xsvf", line 46, in main
u.upload_all_files(args.fileName)
File "/home/ubuntu1604/Arduino/libraries/JTAG/extras/python/Uploader.py", line 148, in upload_all_files
ok = self.upload_one_file(fd)
File "/home/ubuntu1604/Arduino/libraries/JTAG/extras/python/Uploader.py", line 103, in upload_one_file
num_bytes = int(argument)
ValueError: invalid literal for int() with base 10: 'oft WDT reset'

VREF does not work when INPUT_PULLUP is used?

I think the vref detection can't work properly on its own if the INPUT_PULLUP is used on the vref pin. When the JTAG cable is disconnected then the internal pull-up on the VREF pin will cause the vref detection to always read logical one - JTAG cable connected. I don't think there is a good solution for this, unless an external pull down resistor (about 2k) is used as well. Changing the INPUT_PULLUP to INPUT (without pull-up) helps a bit, but because the VREF pin is then left floating it might also trigger wrong vref detection depending on the electrical noise on the vref wire. Perhaps the best would be to add an option to ignore vref completely if a value of 0 (or -1) is specified as VREF pin when the player is constructed.

Error in Uploader.py

When I use it under Win 10 x64 (with both x86 and x64 Python 3.9.2 and 3.8.6), I get:

c:\Users\Riccardo\Documenti\Arduino\libraries\JTAG\extras\python>python xsvf -p COM4 D:\output.xsvf
Traceback (most recent call last):
File "xsvf", line 8, in
import Uploader
File "c:\Users\Riccardo\Documenti\Arduino\libraries\JTAG\extras\python\Uploader.py", line 16, in
class Uploader(object):
File "c:\Users\Riccardo\Documenti\Arduino\libraries\JTAG\extras\python\Uploader.py", line 23, in Uploader
[(chr(x) in _printable_chars) and chr(x) or '.' for x in range(256)])
File "c:\Users\Riccardo\Documenti\Arduino\libraries\JTAG\extras\python\Uploader.py", line 23, in
[(chr(x) in _printable_chars) and chr(x) or '.' for x in range(256)])
NameError: name '_printable_chars' is not defined

How can I fix? Is it there anything wrong with my files paths?

Error in extra/python/XSVFDisassembler.py

I used the suggested way to test the XSVFAssembler and Disasembler using the xsvf_example inside the XSVFParser. The result seems to be wrong.

The problem is that the assembler turns a byte into character using UTF-8 encoding. When Disassembler reads the file, it reads a byte at a time. However, UTF-8 encoding results 2 bytes for code points >128. So the disassembler reads the wrong character by only taking one byte at a time. I am not sure the same problem exist in the main XSVFDecoder inside the /src.

Uno R4 Minima

Hi,

I tried to Verify the example JTAGTest.ino on Uno R4 Minima and got this error:
r4

thanks.

Doesn't compile for SAMD21

Attempting to compile for SAMD21 produces the following debug output

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\ArduinoPin.cpp: In constructor 'ArduinoPin::ArduinoPin(uint8_t, uint8_t)':

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\ArduinoPin.cpp:12:31: error: invalid conversion from 'PortGroup*' to 'uint8_t {aka unsigned char}' [-fpermissive]

  setPort(digitalPinToPort(pin));

                               ^

In file included from C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\ArduinoPin.cpp:1:0:

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\ArduinoPin.h:13:7: error:   initializing argument 1 of 'void ArduinoPin::setPort(uint8_t)' [-fpermissive]

  void setPort(uint8_t n) { m_port = n; }

       ^

In file included from C:\Users\andrew.england\AppData\Local\Arduino15\packages\SparkFun\hardware\samd\1.6.1\cores\arduino/delay.h:23:0,

                 from C:\Users\andrew.england\AppData\Local\Arduino15\packages\SparkFun\hardware\samd\1.6.1\cores\arduino/Arduino.h:81,

                 from C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\ArduinoPin.cpp:3:

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\ArduinoPin.cpp: In constructor 'ArduinoInputPin::ArduinoInputPin(uint8_t)':

C:\Users\andrew.england\AppData\Local\Arduino15\packages\SparkFun\hardware\samd\1.6.1\variants\SparkFun_SAMD_Mini/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portInputRegister(port)    ( &(port->IN.reg) )

                                            ^

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\ArduinoPin.cpp:18:8: note: in expansion of macro 'portInputRegister'

 , m_in(portInputRegister(port()))

        ^

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\ArduinoPin.cpp: In constructor 'ArduinoOutputPin::ArduinoOutputPin(uint8_t)':

C:\Users\andrew.england\AppData\Local\Arduino15\packages\SparkFun\hardware\samd\1.6.1\variants\SparkFun_SAMD_Mini/variant.h:65:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->OUT.reg) )

                                            ^

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\ArduinoPin.cpp:24:9: note: in expansion of macro 'portOutputRegister'

 , m_out(portOutputRegister(port()))

         ^

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\SerialComm.cpp: In member function 'void SerialComm::Important(const __FlashStringHelper*, ...)':

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\SerialComm.cpp:60:2: error: 'va_list' was not declared in this scope

  va_list args;

  ^

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\SerialComm.cpp:60:10: error: expected ';' before 'args'

  va_list args;

          ^

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\SerialComm.cpp:61:11: error: 'args' was not declared in this scope

  va_start(args, ifsh);

           ^

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\SerialComm.cpp:61:21: error: 'va_start' was not declared in this scope

  va_start(args, ifsh);

                     ^

C:\Users\andrew.england\Documents\Arduino\libraries\JTAG\src\SerialComm.cpp:64:13: error: 'va_end' was not declared in this scope

  va_end(args);

             ^

Using library JTAG at version 1.0.15 in folder: C:\Users\andrew.england\Documents\Arduino\libraries\JTAG 
exit status 1
Error compiling for board SparkFun SAMD21 Mini Breakout.

Problem when trying to Upload a XSVF

Hi !

I have uploaded the sketch to my Arduino nano, connected it to an ATF1504AS and tried to Upload a XSVF File to it with the Python scripts.

I enter this Command to Upload the file:

python xsvf -p /dev/ttyUSB0 FE3Test.xsvf

And here is the Error Message, that I get when trying to Upload the XSVF File:

snocksman@raspberrypi:~/JTAG/extras/python $ python xsvf -p /dev/ttyUSB0 FE3Test.xsvf
Traceback (most recent call last):
  File "/home/snocksman/JTAG/extras/python/xsvf", line 57, in <module>
    main()
  File "/home/snocksman/JTAG/extras/python/xsvf", line 46, in main
    u.upload_all_files(args.fileName)
  File "/home/snocksman/JTAG/extras/python/Uploader.py", line 150, in upload_all_files
    ok = self.upload_one_file(fd)
  File "/home/snocksman/JTAG/extras/python/Uploader.py", line 144, in upload_one_file
    line.translate(Uploader._translate_str))
TypeError: a bytes-like object is required, not 'str'

What can I do to get it running...?

Problem with uploading XSVF and SVF

hi. first of all thanks for making this project. i tried to program xc9572xl with .xsvf and svf file but it gives me error. i attach the pic then you could see the problem . help to solve this problem. thanks in advance

xsvf
svf

Error in programming process

Hi,
I have trying to use this code/library to program a Lattice CPLD. But unfortunately, I'm not have success on that.
I also tried to program the Xilinx CoolRunner II, and I'm having the same problem.
This screenshot is the result of a erase.svf file.

Im not sure if I can use this code for Lattice CPLD or another Xilinx CPLD, as I'm trying to use.

image

Are these boards compatible easily?

I couldn't find a way to send "message via github"?
and I think it might be good info for people interested in the future.

I tried to find a jtag programmer locally but nothing... I'd have to order from china and wait a few weeks which I'd not really want to do. these are what I found locally and in Sweden that are "arduino compatible" and have 3.3v IO.

I'm unsure if the nodemcu is programmed with arduino IDE like normal?

NodeMCU ESP8266
https://www.kjell.com/se/produkter/el-verktyg/arduino/utvecklingskort/nodemcu-utvecklingskort-p87091

Arduino MKR Zero
https://www.kjell.com/se/produkter/el-verktyg/arduino/utvecklingskort/arduino-mkr-zero-utvecklingskort-p87190

Uploader speed-up tip.

Hi,
thank you for sharing your excellent library JTAG library. I'd like to share the following tip that can improve uploading speed.

I managed to get some significant upload speed-ups by sending the very first data chunk a little bit bigger than requested. As a result some extra bytes are probably held in OS buffers reducing reaction time to the new data request coming from the MCU.
The change in Uploader.py is as follows:

--- Uploader.py.orig	2024-03-31 10:15:34.578022226 +0100
+++ Uploader.py	2024-03-31 10:07:41.720332743 +0100
@@ -101,6 +101,10 @@
             argument = line[1:]
             if command == 'S':
                 num_bytes = int(argument)
+                if bytes_written == 0:
+                    num_bytes = num_bytes + 48
+                    if  num_bytes > self._file_size:
+                        num_bytes = self._file_size
                 xsvf_data = fd.read(num_bytes)
                 bytes_written += len(xsvf_data)
                 self.update_hashes(xsvf_data)

The value 48 was selected experimentally (when S63 is sent from Arduino UNO), higher values seem to cause upload issues, but even a size as small as 16 bytes can improve the upload speed. Here is an example of sending an erase .xsvf sequence of 23126 bytes to ATF1504ASL device (115200 baud rate):
Original code: 3.39 seconds
New code: 2.47 seconds

This was tested on Ubuntu 20.04 uploading to Arduino UNO. The player code looks like this:

PlayXSVFJTAGArduino p(Serial, SERIAL_RX_BUFFER_SIZE, 12, 2, 4, 3, 10, false);

I don't know whether the trick would work on Windows OS though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.