I can't write on the board

My Magic 1.1 board (RAMPS 14 EFB) repeatedly crashes. After successful upload, the board will restart and everything is as before the upload. The board communicates seamlessly with the display and controls. It can also be read via USB. Restarts after inserting USB

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 "C:\Users\D4str\Desktop\TH3DUF_R2\Windows Arduino\portable\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

Using Port : COM3
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: reading input file "C:\Users\D4str\AppData\Local\Temp\arduino_build_47358/sketch_mar22a.ino.hex"
avrdude: writing flash (656 bytes):

Writing | ################################################## | 100% 0.09s

avrdude: 656 bytes of flash written

avrdude done. Thank you.

If I understand you correctly, inserting USB causes the board to reset?

Or do you also open e.g. serial monitor or other application to communicate with the board?

Please provide a link to the board.

If you are inserting USB during a 3d / cnc program running it WILL reset the board.

Almost all Arduinos WILL reset when plugged into USB and are designed to do so !

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

ballscrewbob:
Almost all Arduinos WILL reset when plugged into USB and are designed to do so !

I'm not behind a PC, but I wonder if that's correct. Just connecting does not open the serial port and hence I suspect that there will be no reset

Serial port and USB port are two different things AFAIK.
How else would device manager etc. know something was plugged in ?

Restart is ok…
And what about the problem that after uploading, nothing really uploaded?
the reboot will also occur when inserting usb during the working process
serial monitor works

start
echo:Marlin bugfix-2.0.x

echo: Last Updated: 2020-02-29 | Author: (D4str, JGAurora Magic)
echo:Compiled: Mar 20 2020
echo: Free Memory: 2608 PlannerBufferBytes: 1520
echo:SD init fail
echo:V76 stored settings retrieved (623 bytes; crc 9081)
echo: G21 ; Units in mm (mm)
echo: M149 C ; Units in Celsius

echo:; Filament settings: Disabled
echo: M200 D1.75
echo: M200 D0
echo:; Steps per unit:
echo: M92 X80.00 Y80.00 Z800.00 E88.00
echo:; Maximum feedrates (units/s):
echo: M203 X300.00 Y300.00 Z5.00 E25.00
echo:; Maximum Acceleration (units/s2):
echo: M201 X300.00 Y300.00 Z100.00 E400.00
echo:; Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>
echo: M204 P300.00 R400.00 T300.00
echo:; Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate> J<junc_dev>
echo: M205 B20000.00 S0.00 T0.00 J0.01
echo:; Home offset:
echo: M206 X0.00 Y0.00 Z0.00
echo:; Auto Bed Leveling:
echo: M420 S0
echo:; Material heatup parameters:
echo: M145 S0 H200 B60 F0
echo: M145 S1 H240 B110 F0
echo:; PID settings:
echo: M301 P22.20 I1.08 D114.00
echo:; Power-Loss Recovery:
echo: M413 S1
echo:; Z-Probe Offset (mm):
echo: M851 X-25.00 Y10.00 Z0.00
echo:; Filament load/unload lengths:
echo: M603 L460.00 U600.00
echo:; Filament runout sensor:
echo: M412 S0
echo:SD init fail

Those look like MARLIN errors.
NOT board errors.

If you wish I will move you to another section but marlin may be better dealt with on a forum specialising in marlin not arduino.

Arduino is on one board with Marlin.
Marlin works. I can “print”. However, I cannot reinstall. That’s the problem. In Visual Studio, it writes me this.

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: Atmel AVR 2.0.0 > Arduino Mega or Mega 2560 ATmega2560 (Mega 2560)
HARDWARE: ATMEGA2560 16MHz, 8KB RAM, 248KB Flash
PACKAGES:

  • framework-arduino-avr 5.0.0
  • tool-avrdude 1.60300.190424 (6.3.0)
  • toolchain-atmelavr 1.50400.190710 (5.4.0)
    Converting Marlin.ino
    LDF: Library Dependency Finder → http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 16 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- 1.5.0
    | |-- 1.0
    |-- 0.6.2
    | |-- 1.0
    | |-- 1.0
    |-- 1.3.5
    |-- 0.4.1
    | |-- 1.0
    | |-- 1.0
    |-- 1.0.3
    | |-- 1.0
    |--
    | |-- 1.0
    |-- 0.8.0
    |--
    |-- <SailfishRGB_LED>
    | |-- 1.0
    |--
    |--
    | |-- 1.0
    |-- 1.0
    |-- 1.0
    Building in release mode
    Checking size .pio\build\mega2560\firmware.elf
    Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
    RAM: [=== ] 29.5% (used 2418 bytes from 8192 bytes)
    Flash: [== ] 21.3% (used 53982 bytes from 253952 bytes)
    Configuring upload protocol…
    AVAILABLE: wiring
    CURRENT: upload_protocol = wiring
    Looking for upload port…
    Auto-detected: COM3
    Uploading .pio\build\mega2560\firmware.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: reading input file “.pio\build\mega2560\firmware.hex”
avrdude: writing flash (53982 bytes):

Writing | ################################################## | 100% 6.54s

avrdude: 53982 bytes of flash written
avrdude: verifying flash memory against .pio\build\mega2560\firmware.hex:
avrdude: load data flash data from input file .pio\build\mega2560\firmware.hex:
avrdude: input file .pio\build\mega2560\firmware.hex contains 53982 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 6.37s

avrdude: verifying …
avrdude: verification error, first mismatch at byte 0x0000
0x14 != 0x0c
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK (E:FD, H:D8, L:FF)

avrdude done. Thank you.

*** [upload] Error 1

ballscrewbob:
How else would device manager etc. know something was plugged in ?

I have no idea how USB works.

A)
Setup:
Mega (original as far as I know, it identifies itself as Mega); external power and usb connected
RealTerm V2.0.0.70; DTR line cleared, port not open

B)
I loaded the following code in a Mega

int counter;

void setup()
{
  Serial.begin(57600);
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop()
{
  Serial.println(counter++);
  digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
  delay(1000);
}

C)
1)
Serial port not opened in realTerm
TX led flashing, L led blinking at 1 Hz
2)
Disconnect USB
TX no longer flashing, L led blinking at 1 Hz
3)
Immediately after reconnecting USB
TX led still not flashing, L led blinking at 1 Hz
4)
Open port in RealTerm
TX led flashing, L led blinking at 1 Hz
RealTerm showed 75 as first value

To me this proves that the board did not reset after connecting the USB.

Yet if I disconnect my GRBL based machine mid stream all hell breaks loose.
Or even if just disconnected and were IDLE then my sending program balks at a lost connection.
One machine has seperate power for the UNO and will do the same.

Marlin is a subset of GRBL and they both make extensive use of serial and eeprom and memory manipulations.
Most versions tend to run at 115200 baud (at least here they do)
They also quite often employ a handshake capability.

EDIT
The handshake tends more to the buffer to keep the data flow from over running but can also be used for grbl command status as well so it can be a complex serial stream.

if I turn off the printer and have the cable connected, I can continue to work in the menu. So the whole board (arduino / marlin) is powered from usb.

Then it is NOT the board but some setting you may have forgotten.
Did you write down all the previous parameters first before changing anything ?

usually the Marlin board has its own power supply and normally that would be independent of the mega below it unless it is a combined board/controller and not a shield ?

I only changed the marlin settings and allowed the use of signal inputs for z_endstop
EDIT: it's a combined board
Unfortunately for her, there is no datasheet
The heart of this board is the mega 2560 and I think it serves both arduino and marlin.

Chip listens to commands from both the control display and the PC. all you can do is burn bootloader and upload firmware to the board

I presume you burnt the correct fuses for the bootloader first ?

I am not an expert on this particular matter but combined boards usually have a specific method to upgrade what would be loosely termed the "firmware" in the case of Marlin.

You would need to check the suppliers GITHUB for the methods and firmware.
It usually involved an ICSP programmer IIRC.

I recorded the bootloader sometime half a year ago. And I've been upgrading the firmware many times on this Board. I'll try to get a second arduino and hack it through it: D .As there a hardware format for the mega 2560 chipset? I think it's a cyclical mistake.