You are viewing a static version of the site. Enable JavaScript to benefit from the
full functionality of this site and enable such things as forum posting.
Which compiler do i need to properly get my sketch uploaded to a Leonardo board?
Michel:
I'm new to UECIDE, i needed a terminal that properly recognizes CR characters, so i switched from the Arduino IDE to UECIDE. On my UNO this works very well, but now i want to use a Leonardo board. The board is recognized on COM4 and in the Arduino IDE i can compile and upload to it, but on UECIDE the compilation fails:
avrdude: ser_open(): can't open device "\.\COM4": Het systeem kan het opgegeven bestand niet vinden. (translated: the system cannot find the file).
I selected the Leonardo board at COM4 (which was the only option available). I use Arduino 1.8.1 as core and GCC 7.3.0 AVR as compiler and Avrdude for Arduino boards as programmers. Now, this is fairly new to me but it seems the COM4 is recognized because on compiling and programming to the Leonardo there is activity on the board --> resetting the board --> orange led starts blinking
Any help greatly appreciated
matt:
I haven't used the Leonardo for some time. I know it needs to reboot using 1200 baud to switch to the bootloader mode, and that causes the UART to disappear and reappear again - maybe it's just a timing problem. I'm not a Windows user much so I haven't done a whole heap of testing. At the moment it allows 1.5 seconds after closing the port at 1200 baud before it tries to program. Maybe that time needs increasing.
Michel:
Ok??? and what do i need to do to reboot this Leonardo thing at 1200 baud? I can't use an UNO unfortunately for i have to use the keyboard library
matt:
It should be doing it for you. Can you try programming the board and watch what happens in the Device Manager in Windows to see how long it takes the port to disappear and reappear?
Michel:
Hi Matt, i used Putty to open a session at 1200 baud and i think it did a reset, but i'm not sure. What i find strange is that i can perfectly compile and upload to my Leonardo board in the "normal" Arduino IDE but uploading in UECIDE to my Leonardo simply doesn't work. I reinstalled the drivers, and it works flawlessly in the normal IDE. I tried different compilers in UECIDE but they gave all spooky messages. The other thing is: UECIDE let me select the COM port the Leonardo is on at that moment, so somehow there must be a connection.
And about that programming (i'm still new to this and somewhere in the past i worked with serial ports but that is long gone): am i correct that i need to open a 1200 baud connection to the COM port the Leonardo is on, wait for a while, close the connection and wait about 2 maybe 3 seconds and look what is happening in device manager?
Michel:
i did this puTTY session at 1200 baud and saw in device manager the Leonardo bootloader at COM9. After about 2 seconds it switched to the COM14 port. Tried to compile and upload again but no results. Same message
Michel:
It is getting weirder and weirder. I downloaded programino and successfully compiled and uploaded a sketch to my Leonardo. I did an uninstall of UECIDE and a reinstall. I selected the correct COM port, but did not upload a sketch using UECIDE. Instead i switched to the Serial Terminal in UECIDE and it showed the programino sketch still working on my Leonardo. Then i tried compiling and uploading again using UECIDE, but still the same message that the device cannot be found. This is really strange... It seems that the drivers are installed correctly, the COM port shows up and is even visible in the Terminal, why can't i upload to my Leonardo then??? Confused...
matt:
It may be UECIDE not being able to find the Leonardo on the new COM port (14). It's a failing of Windows that it gives it a completely different COM port number when in bootloader mode. UECIDE is supposed to hunt for it using the USB VID & PID but it may be failing. This is functionality that I haven't been able to fully test in Windows yet. I really need to set myself up a proper Windows test environment and see what it's doing...
matt:
Ah, I can see what this is. I never actually made a working programmer for the Leonardo. I can do though, so bear with me...
matt:
Ok, so if you go into the plugin manager and "refresh" then "upgrade all" you should get the new version of the avrdude-arduino programmer (version 1.0.9) which hopefully should work properly...