[ bootloader not responding after the first upload ]


Guest texane

Recommended Posts

Guest texane

Hi,

I programmed the 500k fpga using the bitstream provided on the zpuino website,

it seems to work. Then, using the toolchain I compiled a very simple program to

test. I uploaded it using the zpuiprogrammer, without the -U option. It worked, I

saw the correct communication with the bootloader.

I rebooted the card in between, and reprogrammed the FPGA with the bitstream.

But now I cannot send any program to the bootloader, and the zpuinoprogrammer

aborts saying it cannot find the programmer. I guess this is because I erase the

flash? Is there something to do to revert that?

I am running on Linux, if it can help...

Thanks very much for helping,

f.

Link to comment
Share on other sites

I programmed the 500k fpga using the bitstream provided on the zpuino website,

it seems to work. Then, using the toolchain I compiled a very simple program to

test. I uploaded it using the zpuiprogrammer, without the -U option. It worked, I

saw the correct communication with the bootloader.

Hi,

problem is you did not build the program using the IDE, so its relocations are wrong. It would never work like that. You need to use IDE to compile for now.

I rebooted the card in between, and reprogrammed the FPGA with the bitstream.

But now I cannot send any program to the bootloader, and the zpuinoprogrammer

aborts saying it cannot find the programmer. I guess this is because I erase the

flash? Is there something to do to revert that?

Since your program is "wrong", it might be overwriting the bootloader.

try one of these:

a) upload the bitstream to FPGA only (no flash) using butterflyprog, and then before one second elapses, issue the following command (make sure zpuinoprogrammer is in your path):

  zpuinoprogrammer -R -v -v -d /dev/ttyUSB1 -r

This should read the flash, and enter program mode (so the bootloader does not start your program). You then should upload a proper sketch using the IDE.

B) If you already programmed ZPUino bitfile on the flash (using butterflyprog) try disconnecting the USB, reconnecting, and before 1s elapses run the above command again.

I had to remove bootloader protection due to timing and performance issues.

Álvaro

Link to comment
Share on other sites

Guest texane

Hi,

Thanks very much for helping (wont reply by email since it may be

useful to other on the forum).

I tried the methods you suggested, and it worked ... once. IE. if

I am fast enough (I guess), I can make the bootloader enter the

programming mode an then use the IDE to upload programs.

But 2 uploads later, the IDE ended up with the same error:

Cannot get programmer version.

I tried on both a 500k and a 250k.

I will modify the bootloader source code to change the programming

mode waiting delay and synthetize a bitstream to see  if it comes from

here... but any other idea is welcome.

Thanks,

f.

Link to comment
Share on other sites

Something I forgot to ask you: 

are you using the same version of IDE and bitfile ? I'm asking this because there were some internal changes that require them to be in sync (I moved memreg[] array into lower memory so it could be shared by the bootloader and the sketch).

Álvaro

Link to comment
Share on other sites

Guest texane

HI,

I tried with the precompiled versions downloadable from your website,

but it does not work neither. I paste the content of my script intended

to make the bootloader enter the programming mode (if my understanding

is correct):

#/!usr/bin sh

sudo $PAPILIO_BINDIR/papilioloader -vvv -f /home/texane/tmp/papilio_one_routed.bit ;

sudo /home/texane/repo/zpuino/ZPUino.git/build/linux/dist/tools/zpuinoprogrammer -vvv -R -d /dev/ttyUSB1 -r;

where papilio_one_routed.bit is a synthetized version of your git, for the papilio 250k.

with the bootloader delay modified to 10seconds (instead of 1). I tried with the version

avail on your website, same thing. I just remind that it worked twice in the past, so I dont

think this is a problem related with the bit files... but who knows...

I run this script as soon as possible after connecting the device, here is the output:

texane@dell:~/repo/zpuino/examples$ ./write.sh

Using built-in device list

JTAG chainpos: 0 Device IDCODE = 0x11c1a093    Desc: XC3S250E

Uploading "/home/texane/tmp/papilio_one_routed.bit". Done.

Programming time 329.0 ms

USB transactions: Write 86 read 2 retries 4

Opened device '/dev/ttyUSB1'

Connecting...

Tx: 0x7e 0x01 0x1e 0x0e 0x7e

Tx: 0x7e 0x01 0x1e 0x0e 0x7e

Tx: 0x7e 0x01 0x1e 0x0e 0x7e

Connecting...

Tx: 0x7e 0x01 0x1e 0x0e 0x7e

Tx: 0x7e 0x01 0x1e 0x0e 0x7e

Rx: 0x00

Rx: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Rx: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Rx: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Tx: 0x7e 0x01 0x1e 0x0e 0x7e

Connecting...

Tx: 0x7e 0x01 0x1e 0x0e 0x7e

...

Cannot get programmer version, aborting

I think thereis a problem with the serial communication. I tested with 3 different cables. I tested

on a papilio500k too, with the correct bitfiles.

Without being able to put the bootloader in programming mode, there is no way to upload a program

with the IDE...

I am now trying to debug the bootloader, to see what can possibly go wrong.

Thanks for your help.

Link to comment
Share on other sites

Guest texane

To add something: I see a bunch of zero being received (cf the previous output), and I dont think this

is normal... could there be a problem with the serial conf (ie. baudrate) ?

Link to comment
Share on other sites

Guest texane

Yes, but I tried with 3 programmers:

. the binary one from the website

. the binary one from the git repository

. the repo one recompiled + some modifications + debug

Same result, but I will try again with the precompiled binary one

Link to comment
Share on other sites

Guest texane

Hi,

I finally managed to upload a simple program. I used the git version

of both the bitstream (resynthetized) and programmer (recompiled).

I then used the arduino IDE to upload the file. I do not really know

what makes it work now. But for the moment we wanted to check the

timer interrupts where ok, we had some doubt (works fine on the

papilio at least...) I plan to investigate more about the previous bootloader

issues, plus I want to use plain C, so I will check what is the required linker

map for the program to use at link time.

Thanks for your help,

f.

Link to comment
Share on other sites

Guest texane

Ok, it would be helpful. I was planning to do a similar Makefile once I found

the correct LD map to use... so if you dont have time for that, ask me (did

not have the time yesterday + at work by now).

Thanks for your help,

f.

Link to comment
Share on other sites

Guest texane

Hi, I will try tonight as I have no access to the board right now.

I tried something similar yesterday but it did not work... What

I do is to turn the elf into a binary (.bin) with objcopy, a thing

not mentioned in the above link.

Thanks for posting this link,

f.

Link to comment
Share on other sites

Guest texane

Hi,

I ended up using the whole build generated by the IDE in the /tmp/ directory

as a base for my standalone example. It is very near of what you previously

mentionned, and what I tried... I guess I missed a gcc option that made the

program invalid. BTW, everything works fine with this tarball:

http://88.191.59.7:8080/~texane/verytmp/alone.tar.gz

Still contains hardcoded path + configuration flags board dependant, but it

works.

Cheers,

f.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.