Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Visual Micro & Arduino mega 2560 & LAN Shield (Read 996 times)
Petr_B
Newbies
*
Offline


Posts: 3
Joined: Jan 24th, 2022
Visual Micro & Arduino mega 2560 & LAN Shield
Jan 24th, 2022 at 5:41pm
Print Post  
Hi all,
I have some project using Arduino Mega 2560, LAN shield with SD Card (not use) and some sensors (BMP28 and DHT11). Application is a small web server showing data from installed sensors.
In first step i develop this app using Arduino Uno only. When my code grow up I move to Mega.
My working process is 1) make some changes in program 2)install it into Arduino 3) test it and back to one.
It was working fine with Uno. After moving to Mega the process was the same only for a couple of rounds. After it the uploading is like lottery. Sometimes is successful, sometimes not with some error. The workaround (not 100% working) is 1) to disconnect LAN, 2) reset Arduino 3)wait a moment 4) start uploading over USB 5) program is working.
But I got the error message "write error" sometimes too and I have to close Visual Studio, disconnect Arduino from power (USB), wait a moment, connect Arduino back (without LAN), start Visual Studio, upload program and its working.
Its not nice to use this process. Do you have some advice?
Thank you
Petr 
Here is text from compiler:
Compiling 'Barometr' for 'ATmega2560 (Mega 2560) (Arduino Mega)'
Program size: 39 632 bytes (used 16% of a 253 952 byte maximum) (1,57 secs)
Minimum Memory Usage: 3679 bytes (45% of a 8192 byte maximum)
 

AVR Memory Usage
----------------
Device: atmega2560

Program:   39632 bytes (15.1% Full)
(.text + .data + .bootloader)

Data:       3679 bytes (44.9% Full)
(.data + .bss + .noinit)

text         data          bss          dec          hex      
      0        39632            0        39632         9ad0

Uploading 'Barometr' to 'ATmega2560 (Mega 2560) (Arduino Mega)' using 'COM4 '
Uploader started for board ATmega2560 (Mega 2560) (Arduino Mega)
Upload method will be: bootloader
Uploading via Bootloader 
ino17\bin\avrdude rduino17/etc/avrdude.conf" -v -V -patmega2560 -cwiring "-PCOM4 " -b115200 -D rometr.ino.hex:i"
avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch
         System wide configuration file is uino17/etc/avrdude.conf"
         Using Port                    : COM4 
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
         Programmer Type : Wiring
         Description     : Wiring
         Programmer Model: AVRISP
         Hardware Version: 15
         Firmware Version Master : 2.10
         Vtarget         : 0.0 V
         SCK period      : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as FF
avrdude: reading input file .hex"
avrdude: writing flash (39632 bytes):
Writing | ################avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2167
Joined: Feb 13th, 2019
Re: Visual Micro & Arduino mega 2560 & LAN Shield
Reply #1 - Jan 24th, 2022 at 5:49pm
Print Post  
Thanks for the report.

Your process to upload shouldn't require Visual Studio to be restarted, which would save some of the pain.

There seems to be a long discussion on this on the below thread on the Arduino forum, with the simplest solution listed being to prevent the Reset pin on the Ethernet shield from connecting to your board.
https://forum.arduino.cc/t/arduino-code-wont-upload-with-ethernet-shield-attache...

It will depend on the model of Ethernet shield in use of course, but sounds very similar from your description.

  
Back to top
 
IP Logged
 
Petr_B
Newbies
*
Offline


Posts: 3
Joined: Jan 24th, 2022
Re: Visual Micro & Arduino mega 2560 & LAN Shield
Reply #2 - Jan 24th, 2022 at 9:47pm
Print Post  
Hello, it seems to be close to solution. This is my "clean connection" :
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2167
Joined: Feb 13th, 2019
Re: Visual Micro & Arduino mega 2560 & LAN Shield
Reply #3 - Jan 25th, 2022 at 11:01am
Print Post  
Thanks for the image, it doesn't appear to be shorted from what I can see on that.

Can you confirm which Ethernet shield this is?

The thread suggests not connecting the shields reset line may help (and could be tried using jumper wires with the reset one missing if you don't want to modify the shield yet).

If that doesn't work there common solution seems to be to remove one of the capacitors on the ethernet shield.
  
Back to top
 
IP Logged
 
Petr_B
Newbies
*
Offline


Posts: 3
Joined: Jan 24th, 2022
Re: Visual Micro & Arduino mega 2560 & LAN Shield
Reply #4 - Jan 25th, 2022 at 4:46pm
Print Post  
The Shield is  HAN RUN HR911105A 17/02.
I did clean up the pins and replace USB cable too. It was better yesterday. I will see during next usage.
Thank you.

P.S. I did found some "solution" - press reset button right before uploading starts.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint