Go Down

Topic: Uploading to Vidor not working (Read 2049 times) previous topic - next topic

JayWizard

Hey guys,

i finally got my MKR Vidor 4000 today. :D

I've already tried to upload some code, but the process always get stuck.

Code: [Select]
Sketch uses 10608 bytes (4%) of program storage space. Maximum is 262144 bytes.

Restarting in bootloader mode

Get port list before reset

[COM7]

Touching port COM7 at 1200bps

Set DTR off

Flashing with command:C:/Users/*****/.arduino-create/arduino/bossac/1.7.0-arduino3/bossac.exe --port=COM7 -I -U true -i -e -w -v C:/Users/*****/AppData/Local/Temp/arduino-create-agent575574427/sketch_jul23a.bin -R


I've tried it multiple times - online / offline, but it doesn't work.
The editor recognizes the device correctly.

Any ideas?

DarioPennisi

Hi Jay,
sorry to hear you're having trouble. i am not the best person to answer this but it seems to me you're using create and my impression is that you have an older version of the plugin installed as we had to modify bossac to handle FPGA flashing. i just checked and it looks like the right plugin has not yet been updated so if you want to use create you may need to wait a bit. on the other hand if you download the latest java IDE you should be fine.

let me know if this gets you up and running... looks like courier has been faster than us...

smellai

Hi,
the plugin you can download from GitHub should work with Vidor. Today or on monday we'll update the web editor to require the latest version of the plugin automatically

JayWizard

#3
Jul 27, 2018, 03:20 pm Last Edit: Jul 27, 2018, 03:24 pm by JayWizard
Thanks for the answer,

i've reinstalled the latest java IDE, but it's still not working:

Code: [Select]

Linking everything together...
"C:\Users\Johan\Documents\ArduinoData\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++"  "-LC:\Users\Johan\AppData\Local\Temp\arduino_build_180717" -Os -Wl,--gc-sections -save-temps  "-TC:\Users\Johan\Documents\ArduinoData\packages\arduino\hardware\samd_beta\1.6.22\variants\mkrvidor/linker_scripts/gcc/flash_with_bootloader.ld" "-Wl,-Map,C:\Users\Johan\AppData\Local\Temp\arduino_build_180717/Blink.ino.map" --specs=nano.specs --specs=nosys.specs -mcpu=cortex-m0plus -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -o "C:\Users\Johan\AppData\Local\Temp\arduino_build_180717/Blink.ino.elf" "C:\Users\Johan\AppData\Local\Temp\arduino_build_180717\sketch\Blink.ino.cpp.o" "C:\Users\Johan\AppData\Local\Temp\arduino_build_180717\core\clockout.c.o" "C:\Users\Johan\AppData\Local\Temp\arduino_build_180717\core\variant.cpp.o" -Wl,--start-group "-LC:\Users\Johan\Documents\ArduinoData\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Lib/GCC/" -larm_cortexM0l_math -lm "C:\Users\Johan\AppData\Local\Temp\arduino_build_180717/..\arduino_cache_359670\core\core_arduino_samd_beta_mkrvidor_5b8b6a452050d7fb4f142b0c9b159c84.a" -Wl,--end-group
"C:\Users\Johan\Documents\ArduinoData\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-objcopy" -O binary  "C:\Users\Johan\AppData\Local\Temp\arduino_build_180717/Blink.ino.elf" "C:\Users\Johan\AppData\Local\Temp\arduino_build_180717/Blink.ino.bin"
"C:\Users\Johan\Documents\ArduinoData\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom  "C:\Users\Johan\AppData\Local\Temp\arduino_build_180717/Blink.ino.elf" "C:\Users\Johan\AppData\Local\Temp\arduino_build_180717/Blink.ino.hex"
Der Sketch verwendet 10740 Bytes (4%) des Programmspeicherplatzes. Das Maximum sind 262144 Bytes.
Erzwinge Reset durch öffnen/schließen mit 1200 bps auf dem Port COM7
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
PORTS {COM7, } / {COM7, } => {}
Uploading using selected port: COM7
C:\Users\Johan\Documents\ArduinoData\packages\arduino\tools\bossac\1.7.0-arduino3/bossac.exe -i -d --port=COM7 -I -U true -i -e -w -v C:\Users\Johan\AppData\Local\Temp\arduino_build_180717/Blink.ino.bin -R
Beim Hochladen des Sketches ist ein Fehler aufgetreten


EDIT:
it also does not work with the latest version of the plugin, it may be a hardware problem.

DarioPennisi

Hi Jay,
looks like you may have uplaoded an arduino sketch at some point and that is preventing new sketches to be uploaded.
please try putting the board in bootloader mode by quickly doubletapping the button on the board. if you do that right the LED should start pulsing gently.
in that condition check again the serial port to which you need to load (it should change with respect to the one in application mode) and try uploading the sketch again.

i don't think there's any hw problem as you would not even see an USB uart otherwise. also if you connect the micro hdmi connector you should see the arduino logo.

let me know if you still have issues.
thanks,

Dario

v_chinnici

Hello,

If you still are experiencing issues, we kindly ask you to contact our online support at support@arduino.cc

Best,
Valentina Chinnici
Arduino
Product Marketing Manager (Education)

a2retro

I am having the same issue and output as Jay using the IDE 1.8.5  and it is just uploading the first blink sketch. I have done nothing else to the board. After some time it times out.

I did a reset and tried again this is the output. It seems odd that it flips temporarily to COM7 when the board is one COM6

Sketch uses 10740 bytes (4%) of program storage space. Maximum is 262144 bytes.
Forcing reset using 1200bps open/close on port COM6
PORTS {COM6, } / {COM6, } => {}
PORTS {COM6, } / {} => {}
PORTS {} / {COM7, } => {COM7, }
Found upload port: COM7
C:\Users\Glenn\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0-arduino3/bossac.exe -i -d --port=COM7 -I -U true -i -e -w -v C:\Users\Glenn\AppData\Local\Temp\arduino_build_217228/Blink.ino.bin -R
Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Jun 20 2018 16:38:19
chipId=0x10010005
Connected at 921600 baud
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Atmel SMART device 0x10010005 found
write(addr=0x20004000,size=0x34)
writeWord(addr=0x20004030,value=0x10)
writeWord(addr=0x20004020,value=0x20008000)
Device       : ATSAMD21G18A
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Chip ID      : 10010005
version()=v2.0 [Arduino:XYZ] Jun 20 2018 16:38:19
Version      : v2.0 [Arduino:XYZ] Jun 20 2018 16:38:19
Address      : 8192
Pages        : -129
Page Size    : 64 bytes
Total Size   : 4194295KB
Planes       : 1
Lock Regions : 16
Locked       : readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
none
readWord(addr=0x41004018)=0
Security     : false
Boot Flash   : true
readWord(addr=0x40000834)=0
BOD          : false
readWord(addr=0x40000834)=0
BOR          : false
Arduino      : FAST_CHIP_ERASE
Arduino      : FAST_MULTI_PAGE_WRITE
Arduino      : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
chipErase(addr=0x2000)
done in 0.843 seconds

Write 10884 bytes to flash (171 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x2000, size=0x1000)

SAM-BA operation failed
An error occurred while uploading the sketch

[===========                   ] 37% (64/171 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0x1000)

[======================        ] 74% (128/171 pages)write(addr=0x20005000,size=0xac0)
writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0xac0)

[==============================] 100% (171/171 pages)
done in 0.077 seconds

Verify 10884 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = d618
checksumBuffer(start_addr=0x3000, size=0x1000) = dc9e
checksumBuffer(start_addr=0x4000, size=0xa84) = 56b4
Verify successful
done in 0.013 seconds
CPU reset.
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
writeWord(addr=0xe000ed0c,value=0x5fa0004)

a2retro

I unplugged the board and tried again - it hangs on the upload - then eventually times out :(

a2retro

Hi Dario,

So here is where it stands. I modified the sketch to print to the serial port so I could see if the sketch was getting uploaded.

Your tip about double tapping worked as it switches to com7 and tries to upload. Now even though it says it fails with a

SAM-BA operation failed
An error occurred while uploading the sketch

[===========                   ] 36% (64/173 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0x1000)

[======================        ] 73% (128/173 pages)write(addr=0x20005000,size=0xb40)
writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0xb40)

[==============================] 100% (173/173 pages)
done in 0.076 seconds

The fact is the new sketch is written and is working as I now see the text I added to the sketch

On
Off
On
Off
On
Off
On
Off


So this will be pretty confusing for most people. I did not realize that the standard serial out was actually on a different port (and default) vs the sketch upload port.

Glenn

DarioPennisi

Hi Glenn,
The serial port you see via console is SerialUSB. This is standard on mkr boards so if you're new to them it may be a bit confusing. We're likely going to add some tutorial for that.
Regarding sketch upload error please note that as opposed to standard boards the binary being uploaded is made of two parts: the Sam program and the fpga firmware. If fpga firmware upload fails you'll still have Sam sketch correctly uploaded but it won't have fpga firmware updated.
I'm trying to figure out what's wrong but my hypothesis is that Vidor is being plugged on low current USB ports (eg on hubs) and this may cause overcurrent which in turn makes the upload process fail. I would recommend to use a USB 3 port that has generally provision for more current.

a2retro

Hi Dario,

Hi Glenn,
The serial port you see via console is SerialUSB. This is standard on mkr boards so if you're new to them it may be a bit confusing. We're likely going to add some tutorial for that.
Yes this is my first MKR board


Quote
Regarding sketch upload error please note that as opposed to standard boards the binary being uploaded is made of two parts: the Sam program and the fpga firmware. If fpga firmware upload fails you'll still have Sam sketch correctly uploaded but it won't have fpga firmware updated.
I'm trying to figure out what's wrong but my hypothesis is that Vidor is being plugged on low current USB ports (eg on hubs) and this may cause overcurrent which in turn makes the upload process fail. I would recommend to use a USB 3 port that has generally provision for more current.
I have tried the upload in both USB 3.0 and 2.0 ports with similar results. I am confident that my front side 3.0 ports are wired directly to my motherboard and do not pass through any kind of hub. My motherboard is a MSI Z170A XPOWER GAMING TITANIUM EDITION and I am running Win7 Pro.

If there is anything I can do to help please let me know.

Glenn

a2retro

#11
Jul 28, 2018, 05:14 pm Last Edit: Jul 28, 2018, 05:17 pm by a2retro
I am trying the VidorTestSketch now. Still getting SAM-BA operation failed but the upload does appear to be successful.

Code: [Select]
Vidor bitstream version: 1020107
number of devices 9
1 01000000 MB_DEV_SF
1 02000000 MB_DEV_GPIO
4 04000000 MB_DEV_I2C
6 05000000 MB_DEV_SPI
8 06000000 MB_DEV_UART
1 08000000 MB_DEV_SDRAM
4 09000000 MB_DEV_NP
11 0A000000 MB_DEV_ENC
0 0B000000 MB_DEV_REG
Pin A0 is HIGH
Pin A0 is LOW


Note I do not see the output from this code in the sketch

  SerialFPGA1.println("test");

JayWizard

Hi Jay,
looks like you may have uplaoded an arduino sketch at some point and that is preventing new sketches to be uploaded.
please try putting the board in bootloader mode by quickly doubletapping the button on the board. if you do that right the LED should start pulsing gently.
in that condition check again the serial port to which you need to load (it should change with respect to the one in application mode) and try uploading the sketch again.

i don't think there's any hw problem as you would not even see an USB uart otherwise. also if you connect the micro hdmi connector you should see the arduino logo.

let me know if you still have issues.
thanks,

Dario
Hi Dario,

thank you very much,
putting the board into the bootloader mode was the right solution for me! :D

I am looking forward to write some code :D
Jay

Wd0ug

The double-click the blue button worked for me, too.  I see that it changed the serial port from 4 to 5, so the Tools - Port needs attention after the double-click.  I see that after the upload, the serial port reverts back to 4, so to do another upload, you must do the Tools - Port thing.
Thanks for the solution!

narit

#14
Aug 05, 2018, 09:10 am Last Edit: Aug 05, 2018, 09:11 am by narit
I have some issue in uploading to Vidor.
However, after some digging I found some problem.

1. the Bossac.exe in Arduino IDE 1.8.5 is corrupted. It is not a win32 application.
2. I have replace Bossac.exe from the older folder, There is a second problem.

The uploading command have option -I which isn't recognized by ether Bossac.exe (1.8 and 1.6).

3. The different between Bossac.exe 1.8 and 1.6 are the -U parameter which is "1" and "true", with no and with space consequently.

Therefore I have changed the Platform.txt in C:\Users\***\arduino\hardware\samd_beta\1.6.22\
Line 156 from

tools.bossacI.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -I -U {upload.native_usb} -i -e -w -v "{build.path}/{build.project_name}.bin" -R

into (Bossac 1.8)

tools.bossacI.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U1 -e -w -v "{build.path}/{build.project_name}.bin" -R


and into (Bossac 1.6)

tools.bossacI.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U true -e -w -v "{build.path}/{build.project_name}.bin" -R

4. and removing the duplicated option -i.


I have succeed uploading Blink.ino a simple example. However, for Vidor's example it failed.

File operation exceeds flash size

The output is..

Code: [Select]
C:\**\arduino\tools\bossac\1.7.0-arduino3/bossac.exe -i -d --port=COM9 -U1 -e -w -v C:\**/VidorEncoder.ino.bin -R

Set binary mode
File operation exceeds flash size
version()=v2.0 [Arduino:XYZ] Jun 20 2018 16:38:19
Connected at 921600 baud
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
write(addr=0x20004000,size=0x34)
writeWord(addr=0x20004030,value=0x10)
writeWord(addr=0x20004020,value=0x20008000)
version()=v2.0 [Arduino:XYZ] Jun 20 2018 16:38:19
readWord(addr=0x41004018)=0
readWord(addr=0x40000834)=0
readWord(addr=0x40000834)=0
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
An error occurred while uploading the sketch
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
Device       : ATSAMD21x18
Version      : v2.0 [Arduino:XYZ] Jun 20 2018 16:38:19
Address      : 0x2000
Pages        : 3968
Page Size    : 64 bytes
Total Size   : 248KB
Planes       : 1
Lock Regions : 16
Locked       : none
Security     : false
Boot Flash   : true
BOD          : false
BOR          : false
Chip Erase   : true
Fast Write   : true
Fast Verify  : true
Erase flash
chipErase(addr=0x2000)

Done in 0.749 seconds


Anyone could help?
I am still confusing for the arduino => FPGA toolchain.

Go Up