Controllino Mini (Uno) - suddenly can't upload.

So, while using board called Controllino Mini - uploading worked fine, until it suddenly stopped working. The controller itself is still running, I can access it through serial monitor through USB cable and send commands - controller is working fine. Just cant upload new program. Tried many different usb ports, com ports, baud rates etc. The same program runs fine on regular Arduino Uno.

So it hangs after the line
Description : Arduino
and then gives wrong data after
Hardware Version:

Please help me asap, as it is used in an industrial machine. Already ordered new one, but would still like to know how I bricked it and how to reset it.

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\...\arduino-1.8.6\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         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    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 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 : Arduino
         Description     : Arduino
avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00
         Hardware Version: 4744608
         Firmware Version: 0.4611299

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00
         Vtarget         : 420030.5 V
         Varef           : 197193068.8 V
         Oscillator      : 0.531 Hz
         SCK period      : 17599574.7 us


avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x00
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

the selected serial port 
 does not exist or your board is not connected
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x00

avrdude done.  Thank you.

Does the problem still occur if you upload to just the Controllino Mini board alone, with nothing connected to it?

It also occurs when nothing is connected to it.

Got it working now, here is the tutorial how to reset it: atmega328 - Did I Brick my Controllino? - Arduino Stack Exchange

But I think there is some issue with this product ,I did not touch the RTC stuff - it just happened randomly.

I just received an answer from the official team which should work, I'll leave it here for further reference:

Open the device and disconnect (remove) connection board for approx. 30 seconds from the control board – RTC is disconnected from power (gold cap disconnected) and because of that there is reset of all RTC registers.
Plug the connection board back in to the control board. Now we need to rewrite the SW inside the Controllino which caused wrong RTC setting.
Open the Controllino example RTC sketch in Arduino IDE and prepare it to upload (function Controllino_RTC_init(0); shall reset all registers inside the RTC).
Pres and hold reset button on the Controllino device.
Connect the USB Cable (still hold the reset button, SW inside the Controllino doesn’t start)
Click for upload the sketch in Aruduino IDE and wait for „uploading“ message on debug line, than immediately release the reset button and uploading shall be finished (=> hold the reset button during the compiling phase)
If not successful, repeat the procedure

Interesting - if those instructions work, it sounds do me like they don't autoreset the board when serial port is opened.

DrAzzy:
Interesting - if those instructions work, it sounds do me like they don't autoreset the board when serial port is opened.

Got more appropriate answer:

"
We have observed similar behaviour too, but up to now it is not clear what is the reason. The most probable explanation is, that once you program a corrupted sketch (corruption happens during the upload) the device is then skipping the bootloader and always jumps directly to the sketch after a reset. Then the avrdude is not talking with the bootloader, but with the sketch.

Please see our FAQ No.10 here https://github.com/CONTROLLINO-PLC/CONT ... ibrary#faq
"