Uno R4 Minima Programmer Issues Ubuntu

Hi all!

I have a minima that I was setting up for the arduino-cli, but after my first flash using the arduino-cli my board does not recognize it as a USB device.

I have two programmers that are on the list in the IDE for the minima, jlink (edu) and a stm stlink (v2).

When I try to burn the bootloader I get this error:

Property 'bootloader.tool.serial' is undefined

When I try to burn a sketch directly I get this error:

Failed programming: recipe not found 'program.pattern'

I get the same error regardless of which programmer I use, so my thoughts are that it's an issue with the board's configurations within the IDE or its packages.

I was hoping to use the built-in functionality the Arduino IDE has so I would not have to figure out the controller configurations myself using each one's flash utilities. Still, there seems to be an issue that either no one has run into, or one I have specifically created lol.

I am using Arduino IDE 2.3.2, and even tried the nightly build: 2.3.3, same issue.

I have another minima board, but I am afraid of flashing another arduino-cli build until I know I can recover the first minima.

Once I can recover it, I can look into the build issue without further monetary loss.

So two questions, if it doesn't recognize as USB is it forever bricked? And if not, then what recommendations would you give to try to resolve the programmer issue described above?

As I get time I will look into using the utilities directly, but thought I would present the questions while I wait for time to look into it outside the confounds of the IDE in case it is an already documented issue. I did look through the forums but did not see any specific to this chip, if I missed one please forward it to my attention.

I also did some initial Google investigation, but most of what I found had to do with access to the udev stuff, which I have worked out with my working board.

For what it's worth, I do get the same errors when the good board is connected. The dfu upload works as normal for the good board. I can also debug the good board with the jlink (edu), so I have some confidence at least one programmer is working, to some extent.

Thanks in advance!

Have you tried doing the double tap reset and see if it shows up like that?

The errors you report make it sound like the wrong board is selected or something has gone wrong in the boards file. Maybe someone with more experience with the CLI tools can comment on that.

Double tap has no effect. At this point I am not too worried about the cli stuff, but more about whether or not its recoverable and getting the programmer to work with the IDE.

As mentioned further in my post, I get the programmer errors regardless of the "health" of a minima board as a working one exhibits the same issue. And as mentioned I can debug with that same working board using the jlink (edu). Only the programmer seems to have the issue.

Typically when I run into issues I get a command line snippet of the failed command that was last run to trouble shoot against, but this appears to be internal to the IDE, within the configuration for the IDE itself, which I probably can't look into as easily.

Would maybe building the IDE locally and running it through in debug help give more details? Or is there some type of log I can share that might help reveal the issues?

Oh. This sounds like an issue on the Ubuntu side. You said you've done all the udev rules stuff right? And you're a member of dialout. Have you killed the screen-reader thing? I know that causes issues.

Not sure where to go, just listing all the known Ubuntu issue I know about.

OK, I setup Arduino IDE in Windows.

I get a similar issue trying to burn the bootloader:

Property 'bootloader.tool.dfu' is undefined

Burn sketch directly:

Failed programming: recipe not found 'program.pattern'

Swapped back to Ubuntu, now magically a new dfu port is listed in Ubuntu as well.

I get the same errors above when connected to the "dfu" port.

Not sure why its showing up any differently, but results are the same on both Windows and Ubuntu when the dfu port is selected.

I am pretty sure prior to the Windows driver install the minima never registered as a dfu port, however, it did not seem to affect operation.

Windows I.D.E also version 2.3.2.

The issue seems to be in the board configuration, maybe I will dig into the documentation in setting them up to see if I can glean anything.

I am not familiar with your unit but for the ones I use with the IDE I have to be a member of the dialout group. Try this:
Type 'groups', is 'dialout' there ?
sudo usermod -a -G tty yourUserName - sudo usermod -a -G tty gil
sudo usermod -a -G dialout yourUserName
Log off and log on again for the changes to take effect.
The last step is most important!

I don't think I have a permission issue, I can use the jlink (edu) debugger and flash normally fine. I am trying to use the programmer flashing feature, but on both Windows and Ubuntu I get the same errors.

FYI, you don't need a board or a programmer to get the error. For instance, if I set to Uno and try to burn bootloader I get:

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 "/home/$USER/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/home/$USER/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : stk500v2
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)

avrdude done.  Thank you.

Failed chip erase: uploading error: exit status 1

This is not an IDE failure, it is a failure from the command that was run to try and flash the device.

Do the same deal with the minima:

Property 'bootloader.tool.dfu' is undefined

Don't even get to the part where the command is run, fails internally. Can someone else verify this?

Oh, you're trying to use the IDE to burn the bootloader. That won't work. To burn the bootloader you have to use the Renesas Flash Programmer. It's a different program.

Burning bootloader has been supported in the past for the R3 model, and other Atmel chips. Interesting that they would not support programming for a programming IDE lol. You'd think they'd at least grey out the option rather than sending me on a wild goose chase. Definitely seems like a step back in support from previous boards if this is the case.

Can we confirm that the programming feature is not supported for the Uno R4?

I think there are problems with the Renesas Software License Agreement ... to download the software (Renesas Flash Programmer) you have to register and log in to their site.

I don't know, but ... I think redistribution is forbidden. :thinking:

Guglielmo

I have a Segger jlink (edu), which works great for debugging.

It can also program in the JFlashLite app (one of Segger's utils), but I haven't taken the time yet to figure out how to use it for this specific chip.

I put in an issue for this, expecting that this is not suppose to be supported. Its something I have to figure out anyway, so if I find a solution I plan on sharing it with the community.

I think in Segger's device the license is managed on the hardware itself, because I get errors when trying access non-edu utilities, which their site is a little misleading in which can and can't be used... but the app will tell you when you are wrong lol.

I also have a ST-Link, which the IDE lists as a programmer that can be used. But I haven't tinkered with it yet.

Seems like a weird decision to choose a chip for open software to only be pay-walled by the hardware groups. But, such is the way of the world I suppose.

Some boards come with their own debuggers, or built in tools, ESP32 and STM comes to mind. They almost seem more inviting by giving you tools up front, rather than having to pay for more stuff that you should have as a developer for that platform anyway. Definitely seems like a wiser choice for hobbyist like myself lol.

Had there been a disclaimer that the Uno R4 did not support programming in the IDE, I would have probably steered clear of it.

It supports programming in the IDE. You just can't burn the bootloader section.

Here are the instructions I copied from one of the github pages.

OK, I think I have defective hardware.

Get this, I finally checked out the segger jflashlite, which was super easy to use btw. Just select the chip, select the file, and flash!

I tried flashing the bootloader hex that I found for the Uno R4, flash is successful, but the board still behaves the same.

I went ahead and tried my second working board, which had my software that just turned on the led 13 pin and nothing else. I flashed the bootloader, and low and behold it did work. Arduino IDE recognizes it. I can flash it with the IDE, all the things.

So I wonder if the board was just DOA all along and I did not know it, I had never flashed anything to tell the difference before this, although at some point it was discoverable as a usb device. I haven't hooked anything up to it other than the usb cable and debugger, so I don't think I compromised it.

The dfu flash and arduino-cli build is fine, I confirmed after taking the risk on the second board. I have a dead board lol!

1 Like

Hi @mithrandirmatt.

These "programmers" are defined for the board so that you can use them as debug probes with the Arduino IDE 2.x integrated sketch debugger (and arduino-cli debug).

When the Arduino CLI and Arduino IDE developers implemented the capability for the user to be able to configure which debug probe to use via the standard UI of the Arduino development tools, the designers decided to use the existing "Programmers" UI instead of adding a separate UI component for selecting the debug probe. This makes sense in many cases because a debug probe typically can be used as a programmer in addition to a debug probe and some boards platforms do support that. However, as was already explained, the "Burn Bootloader" and "Upload Using Programmer" capabilities have not been implemented by the developers of the Minima's "Arduino UNO R4 Boards" platform. So in this particular case the "programmers" only serve as debug probes for use with the sketch debugger.