[Solved] A modified version of VidorDrawLogo won't run.

Hello to all,
I modified the WidorDrawLogo a little to test it on my Vidor board connected to my TV.
I can flash the program without problem, but it won't run. I see nothing to the TV.
If I double-tap quickly the reset on the board the Arduino Logo start OK.

I had follow the "FPGA boot loader recovery" procedure too, and the procedure was completed without problem. But again, after I flashed the program I see nothing on the TV and trought the serial port too. I use a 5V/2.5A power supply and a powered USB hub. My VidorDrawLogo program has very little modification: I only replaced "Arduino" with my name!

Someone can help me? Where am'I wrong?

Thanks

Clemente

N.B.
I attached all the log file.

VIDOR_LOG.txt (53.9 KB)

Please post your full sketch. If possible you should always post code directly in the forum thread as text using code tags (</> button on the toolbar). This will make it easy for anyone to look at it, which will increase the likelihood of you getting help. If the sketch is longer than the forum will allow then it's OK to add it as an attachment. Don't put your code in some external file service like dropbox, etc.

Hello Pert, thanks for your post.
As I said, but I know my english is very bad, my program is the original WidorDrawLogo program where I modify the "Arduino" string to "Clemente".

But I attached the program to this post too.

Thanks for your time.
Clemente

VidorDrawLogo.ino (1.34 KB)

It's not quite accurate to say you "only replaced "Arduino" with my name" but I don't see any obvious problems. On the other hand, I don't have any experience with the Vidor.

What happens if you upload the original VidorDrawLogo sketch to the Vidor?

Thanks again Pert,

What happens if you upload the original VidorDrawLogo sketch to the Vidor?
is the same thing, no image on the TV and no serial output. And I think the flash procedure ends correctly:

[==============================] 100% (10466/10466 pages)
done in 2.313 seconds

Verify 669764 bytes of flash with checksum.
Verify successful
done in 32.624 seconds
CPU reset.

regards
Clemente

Have you selected the correct baud rate? By default the IDE uses 9600 but the program uses 115200.

Hello FrederickZh, thanks for your replay,
yes the baud rate is 115200.

Just an update. I tried a very simple program:

#include "VidorGraphics.h"
#include "Vidor_GFX.h"

Vidor_GFX  vdgfx;

void setup() {
  Serial.begin(115200);
  while (!Serial){}

  Serial.println("Serial OK!");

  delay(1000);
}

void loop()
{
  Serial.println("Am'I a loop?");
}

and it worked as expected. May be a FPGA problem?

Thanks
Regards
Clemente

Hey everybody, I got the same problem with my MKR4000.

I just changed the color of the background in the example script, uploaded successfully and still can't see anything. When starting in bootloader mode (double click) the "normal" Arduino logo on a white background appears.

// Fill the screen with a yellowbackground
vdgfx.fillRect(0,0,640,480,vdgfx.Yellow(),1);

I also tried to use different phone chargers, different USB cables and used the FPGA boot loader recovery, but unfortunately nothing worked out.
If I add some print statements in the loop method I can see them in the console, but still no "new" image on screen.
Did anyone managed to run it correctly?

Same problem.

#include "VidorGraphics.h"
#include "Vidor_GFX.h"

Vidor_GFX  vdgfx;

void setup() {
  Serial.begin(115200);
  while (!Serial){}

  // Initialize the FPGA
  if (!FPGA.begin()) {
    Serial.println("Initialization failed!");
    while (1) {}
  }

  delay(4000);
}

void loop()
{ char S[12];
  /**
  *  Draw an Arduino logo
  */
  sprintf(S, "[%08d] Start screen draw...", millis());
  Serial.println(S);

  // Fill the screen with a white background
  vdgfx.fillRect(0,0,640,480,vdgfx.White(),1);

  sprintf(S, "[%08d] ...filled...", millis());
  Serial.println(S);

  /**
  *  The library allows drawing some basic elements to the view, like circles, rectangles, lines
  */  

  vdgfx.fillCircle(225,225,100 ,vdgfx.lightBlue(),1);
  sprintf(S, "[%08d] ...Circle1...", millis());
  Serial.println(S);
  vdgfx.fillCircle(415,225,100 ,vdgfx.lightBlue(),1);
  sprintf(S, "[%08d] ...Circle2...", millis());
  Serial.println(S);
  vdgfx.fillCircle(225,225,90 ,vdgfx.White(),1);
  sprintf(S, "[%08d] ...circle3...", millis());
  Serial.println(S);
  vdgfx.fillCircle(415,225,90 ,vdgfx.White(),1);
  sprintf(S, "[%08d] ...Circle4...", millis());
  Serial.println(S);
  vdgfx.fillRect(175,220,100,10 ,vdgfx.lightBlue(),1);
  sprintf(S, "[%08d] ...Rect1...", millis());
  Serial.println(S);
  vdgfx.fillRect(365,220,100,10 ,vdgfx.lightBlue(),1);
  sprintf(S, "[%08d] ...Rect2...", millis());
  Serial.println(S);
  vdgfx.fillRect(410,175,10,100 ,vdgfx.lightBlue(),1);
  sprintf(S, "[%08d] ...Rect3...", millis());
  Serial.println(S);

  /**
  *  To draw a text we can use the classic functions like write() and print()
  *  Text size, color and position can be changed using the .text subclass
  */
  vdgfx.text.setCursor(150,375);
  vdgfx.text.setAlpha(1);
  vdgfx.text.setSize(3);
  vdgfx.text.setColor(vdgfx.lightBlue());
  vdgfx.println("TEST");
  sprintf(S, "[%08d] ---printed TEST...", millis());
  Serial.println(S);
  vdgfx.text.setCursor(480,145);
  vdgfx.text.setSize(1);
  vdgfx.println("TM");
  sprintf(S, "[%08d] ...printed TM...", millis());
  Serial.println(S);

  sprintf(S, "[%08d] ...STOP!", millis());
  Serial.println(S);

  while (1) {
  }
}

The program is loaded correctly but then the usual logo remains instead of the modified one.

Welcome to minicom 2.7.1

OPTIONS: I18n 
Compiled on Aug 13 2017, 15:25:34.
Port /dev/ttyACM0, 18:01:05

Press CTRL-A Z for help on special keys

[00017511] Start screen draw...
[00022512] ...filled...
[00027513] ...Circle1...
[00032514] ...Circle2...
[00037515] ...circle3...
[00042516] ...Circle4...
[00047517] ...Rect1...
[00052518] ...Rect2...
[00057519] ...Rect3...
[00077523] ---printed TEST...
[00087525] ...printed TM...
[00087525] ...STOP!

By printing the milliseconds, each call to the graphics library lasts exactly 5001ms ... very strange.

After several hours spent trying to understand how the bootloader and JTAG bridge work.
My conclusion is that applicative software is never load in FPGA.

aka :

     uint32_t ptr[1];
     ptr[0] = 0 | 3;
     xmbCmdSend(ptr, 1); // (or xmbEveSend(ptr, 1) .. because I tried both)

just do nothing.

I finally put a scope probe on Flash CLK pin.

Factory software is load by the FPGA during power on (and only in this case not reset nor double reset).
The download duration is approximatly 64ms.

After that the FLASH component is neither more access unless R/W via JTAG interface

So FPGA is kept in factory software.
It's still able to answer some read flash request like

jtagFlashReadBlock(0x080000/*LAST_FLASH_PAGE*/, sizeof(buffer), (uint8_t*)buffer);

and basic commands (even the version command don't always return the same result).

So my next step will be to directly program the FPGA using an USBBlaster, but for now I have to rebuild a basic configuration with at least FLASH and JTAG bridge access.

riccardo_giacomazzi:
By printing the milliseconds, each call to the graphics library lasts exactly 5001ms ... very strange.

MB Timeout is 5000ms. All calls to graphics functions end with a timeout. The request is sent to the MB but there is no response from the FPGA side.

Hello Riccardo,
using your program I have the same result:

[00019011] Start screen draw...
[00024012] ...filled...
[00029013] ...Circle1...
[00034014] ...Circle2...
[00039015] ...circle3...
[00044016] ...Circle4...
[00049017] ...Rect1...
[00054018] ...Rect2...
[00059019] ...Rect3...
[00079023] ---printed TEST...
[00089025] ...printed TM...
[00089025] ...STOP!

I get a similar response.

[00006611] Start screen draw...
[00016613] ...filled...
[00021614] ...Circle1...
[00026615] ...Circle2...
[00031616] ...circle3...
[00036617] ...Circle4...
[00041618] ...Rect1...
[00046619] ...Rect2...
[00051620] ...Rect3...
[00071624] ---printed TEST...
[00081626] ...printed TM...
[00081626] ...STOP!

I also get a strange amount of pixels put onto the screen with a small green rectangle at the top right. (image attached)

I tried the VidorTestSketch example of the VidorPeripherals library and it seems to work correctly.
So I took the piece of code that reads the version of the FPGA and inserted it into the VidorDrawLogo example of the VidorGraphics library:

  // Let's discover which version we are running
  int version = FPGA.version();
  Serial.print("Vidor bitstream version: ");
  Serial.println(version, HEX);

  // Let's also ask which IPs are included in this bitstream
  FPGA.printConfig();

Unfortunately I get the FFFFFFFF value as a version:

Welcome to minicom 2.7.1

OPTIONS: I18n 
Compiled on Aug 13 2017, 15:25:34.
Port /dev/ttyACM0, 09:42:56

Press CTRL-A Z for help on special keys

Vidor bitstream version: FFFFFFFF
number of devices 0
[00017103] Start screen draw...
[00022105] ...filled...
[00027106] ...Circle1...
[00032107] ...Circle2...
[00037108] ...circle3...
[00042109] ...Circle4...
[00047110] ...Rect1...
[00052111] ...Rect2...
[00057112] ...Rect3...
[00077116] ---printed TEST...
[00087118] ...printed TM...
[00087118] ...STOP!

Perhaps it is, as philippe_at_sysemb says, that the file is not loaded into the FPGA, or the file in the library is corrupted.

Same result for me...

FPGA init done
Vidor bitstream version: FFFFFFFF
number of devices 0

Maybe we should rename the thread into a more general problem (if possible)?

Same here. But its also the original 'VidorDrawLogo' program that doesn't work for me. It starts and takes about 85 seconds to complete with no visual result.

tomtom2770:
Maybe we should rename the thread into a more general problem (if possible)?

Yep

I don't get any HDMI output from any of these sketches, including the boot screen after double tap.

Well... It seems that there are actually different issues going on here.

Scenario 1:

  • Double-click reset, no Arduino logo shows up in bootloader mode
  • Program uploading sometimes/always breaks

mphillips53:
I don't get any HDMI output from any of these sketches, including the boot screen after double tap.

Suggestion: Potentially corrupted bootloader. Try following the instructions in [Solved] FPGA boot loader recovery - MKRVIDOR4000 - Arduino Forum to fix it. If it still doesn't work, try getting a better power supply, e.g. phone charger.

Scenario 2:

  • Double-click reset, Arduino logo shows up normally
  • Program uploads normally
  • Completely no output to the display when running the sketch

cdicaprio:
I can flash the program without problem, but it won't run. I see nothing to the TV.
If I double-tap quickly the reset on the board the Arduino Logo start OK.

It seems that OP is the only one who's experiencing this issue... No idea why...

Scenario 3:

  • Double-click reset, Arduino logo shows up normally
  • Program uploads normally
  • Only the bootloader logo shows up when running the VidorDrawLogo sketch

tomtom2770:
I just changed the color of the background in the example script, uploaded successfully and still can't see anything. When starting in bootloader mode (double click) the "normal" Arduino logo on a white background appears.

riccardo_giacomazzi:
The program is loaded correctly but then the usual logo remains instead of the modified one.

...and many.

This is also the issue that I'm currently experiencing.
FPGA.begin() returns normally in this case but FPGA.version() just returns 0xFFFFFFFF, which causes FPGA.ready() to fail as well.

Hello to all,
is there anyone who tried to uninstall the arduino program? I will do a test tonight, as the last test.
I dn't know what to do. I don't have much hope of seeing the board working.

I've already asked the store how to send the board back. But for now I have not received answers.

Regards
Clemente