Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when trying to Upload a XSVF #9

Open
Snocksman opened this issue Jul 21, 2022 · 6 comments
Open

Problem when trying to Upload a XSVF #9

Snocksman opened this issue Jul 21, 2022 · 6 comments
Assignees

Comments

@Snocksman
Copy link

Snocksman commented Jul 21, 2022

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...?

@mrjimenez
Copy link
Owner

Hi Snocksman,

I suspect this error is due to using Python 3 instead of Python 2, can you confirm my suspicion?

@mrjimenez
Copy link
Owner

Also, try to run idcode_simpler.xsvf first. This should return the ID of your device and should work in any device supporting an ID code.

@Snocksman
Copy link
Author

Snocksman commented Jul 21, 2022

Hi !
When trying to use python2.7 I get the following error message regardless what I am trying to Upload:

Traceback (most recent call last):
  File "xsvf", line 8, in <module>
    import Uploader
  File "/home/snocksman/jtag/JTAG/extras/python/Uploader.py", line 113
    (bytes_written, self._file_size - bytes_written), end='')
                                                         ^
SyntaxError: invalid syntax

When trying to upload something with python 3.x, the arduino LEDs are blinking before the error message, with this new error when using Python 2.7 the LEDs stay off.

I get the same message, when i simply prompt: python xsvf

@Snocksman
Copy link
Author

Snocksman commented Jul 21, 2022

Hey, I got it running !!!

I have to use Python 2.7 and cut a little part of the code in Line 113 of the file Uploader.py:
(bytes_written, self._file_size - bytes_written), end='') Here I had to remove the ,end=''

After that I was able to Upload the idcode_simpler.xsvf and it returned the Chip ID.

One Problem is left: When I try to Upload my code to the Chip I get the following error:

('IMPORTANT:', 'DR check failed!')
('IMPORTANT:', '*****************************')
('IMPORTANT:', 'Failure at instruction # 2865')
('IMPORTANT:', '*****************************')
('IMPORTANT:', 'Last TDO: 3F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF/166 bits')
('IMPORTANT:', 'Processed 2865 instructions.')
('IMPORTANT:', 'Checksum:  0x85/24070.')
('IMPORTANT:', 'Sum: 0x000DEC7B/24070.')
Quit: DR check failed (-101).
  Expected checksum:  0x7B/46948.
  Expected sum: 0x000DFF85/46948.
Elapsed time: 10.00 seconds.

@mrjimenez
Copy link
Owner

It is strange that it has processed so many instructions and has produced an error .

There is a debug mode, which you can activate by setting DEBUG to 1 in SerialComm.h. The output should get very verbose, but you might get a clue of what is failing. I have tried to comply as much as possible to the Xilinx specification, but sometimes the xsvf compilier might generate code that the arduino xsvf player can't handle.

@Snocksman
Copy link
Author

It´s a problem with the xsvf file. The SVF-File seems to be ok, but the converted XSVF-File is buggy. (P.S.: I wrote you an E-Mail to your sourceforge account)

@mrjimenez mrjimenez self-assigned this Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants