No Connection - Serial Moitor

I have reaf many posts about this problem! I purchased (2) Minima's early and have just recently attamed to use them with a basic Blink but added Serial.print()

Very basic -
Serial.begin(9600); in setup
Serial.println("Blink";

upon compile, The following error
In file included from C:\Users\pirat\AppData\Local\Temp\arduino\sketches\A656214F8025213C516B6D560118B5C7\sketch\Blink_copy_20230822041815.ino.cpp:1:0:
C:\Users\pirat\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.1.0\cores\arduino/Arduino.h:106:17: error: 'SerialUSB' does not name a type
#define Serial SerialUSB
^
D:\Arduino Stuff\My Uno R4\Blink_copy_20230822041815\Blink_copy_20230822041815.ino:25:1: note: in expansion of macro 'Serial'
Serial.begin(9600);
^~~~~~

I didn't say SerialUSB You did!! ???

I am using IDE 2.3.2

I have Removed 1.1.0 and then Reinstalled.

Same error and in Board & Port Selection it say
UNO R4 MINIMA No Ports Discovered

Looked at drivers ??? Says Santiago is up to date

I have 2 brand new boards that are mostly useless???

Preston

Hi @PiratePointBrewer. Please post your full sketch.

I'll provide instructions you can follow to do that:

  1. Select Tools > Auto Format from the Arduino IDE menus.
    This is done to make the code easier for us to read.
  2. Select Edit > Copy for Forum (Markdown) from the Arduino IDE menus.
  3. In a forum reply here, click on the post composer field.
  4. Press the Ctrl+V keyboard shortcut.
    This will paste the sketch to the post composer.
  5. Move the cursor outside of the code block markup before you add any additional text to your reply.
  6. Repeat the above process if your sketch has multiple tabs.
  7. Click the "Reply" button to post your reply.

When your code requires a library that's not included with the Arduino IDE please post a link to where you downloaded that library from, or if you installed it using Library Manager (Sketch > Include Library > Manage Libraries... in Arduino IDE) then say so and state the full name of the library.

/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
  the correct LED pin independent of which board is used.
  If you want to know what pin the on-board LED is connected to on your Arduino
  model, check the Technical Specs of your board at:
  https://www.arduino.cc/en/Main/Products

  modified 8 May 2014
  by Scott Fitzgerald
  modified 2 Sep 2016
  by Arturo Guadalupi
  modified 8 Sep 2016
  by Colby Newman

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/Blink
*/
#define ledpin 13
Serial.begin(9600);
//the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(ledpin, OUTPUT);
  pinMode(13, OUTPUT);  // init pin 6 as an output
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(ledpin, HIGH);  // turn the LED on (HIGH is the voltage level)
  Serial.println("High!");
  delay(2000);                // wait for a second
  digitalWrite(0, HIGH);      //light green led at pin 6
  delay(00);                  //delay .5 sec
  digitalWrite(0, LOW);       // turn led at pin 6 off
  delay(00);                  // delay .5 sec
  digitalWrite(ledpin, LOW);  // turn the LED off by making the voltage LOW
  Serial.println("Low");
  delay(1000);  // wait for a second
}

I have many libraries loaded butt all loaded from Library Manager.
None used used for this simple Tutorial Sketch. I added the Serial use to check as the Board & Port Selection it says
UNO R4 MINIMA No Ports Discovered

You are reporting two separate problems here:

The compilation error:

And a problem with the port of your UNO R4 Minima board:

It is essential for you to understand that these two problems are completely unrelated.

Compilation Error

The cause of the compilation error is that this function call is not inside of a function body:

That is not allowed. Move that line inside the setup function and then compile the sketch again. This time it should compile without any errors.

No Port

Please try this experiment and then report back with the results:

  1. Connect your Arduino board to your computer with the USB cable.
  2. Press and release the reset button on your Arduino board quickly twice.
  3. If it is already open, close the Tools > Port menu in Arduino IDE.
  4. Open the Tools > Port menu in Arduino IDE.

Now please reply here on the forum thread with the answers to the following questions:

  • Do you now see the LED on the board pulsing?
  • Do you see a port for the board in the Tools > Port menu?

Several Events:

Sorry you were correct. Serial.begin was outside setup. Moving it corrected the Compile error!

After several tries to get the timing correct. In the Select Boards & Port menu ;

Port Indicated as "1-4 USB DFU"

Opening the IDE Tools Menu;

Board - Arduino UNO R4 MINIMA
Port - 1-4 Clicking the arrow
dfu ports1-4 (Arduino UNO R4 Minima
When I recompile the sketch, to upload
I now get an error: No monitor available for the port protocol dfu
Could not connect to the port

If I open the Tools menu, Port indication is a faded 1-4. But the selection arrow is deactivated.

Very odd because now the program will not upload. Double clicking the rest button will restore the Tools Menu Port to the Dark 1-4 But give the No monitor available for the port protocol dfu
Could not connect to the port

When I first compiled the sketch, it was upload as the LED_BUILTIN did blink.
I added the Serial instructions, yes with "Serial.begin" in the wrong location BUT
The program would upload. But got the original message about no port.

Now that I have double clicked and I guess this DFU drive loaded I can do nothing

Sorry, I did forget to mention that I have tried shutting down the IDE and reloading 3 times while testing with the same results. Since the DFU driver has loaded I am really stuck.

Third thought, II grabbed a Nano avr and tried the same program with a correct result

Great! One problem fixed, one to go.

This is expected. The Serial Monitor can only be used with serial ports. You have selected a "DFU" port so Serial Monitor can't connect to it.

Once you have successfully uploaded the sketch, the board should start producing a serial port. If you select that serial port from the Tools > Port menu, Serial Monitor will be able to connect to the port without any problem.

I have done some further investigating.
Looking at Windows 11 device manager, I find that when I double clicked the reset button a device driver "DFU-RT Port" was loaded under USB devices.
It shows that the "Santiago" driver is UpToDate!!

That was no help BUT....
If I disable that driver in the device manager, Now I can compile and upload programs to The R4 as before! I can control the LED_BUILTIN blink rate but NO Serial Monitor. I am getting the Not Connected. Select a board and port to connect automatically message.

But now I can at least blink a $20.00 LED! Actually $40 because I bought two.

Other result of disabling the DFU-RT Port with device manager, when I look at the IDE Tools Menu, It shows Port 4 dimmed. But that was the port used when I connected the Nano.

I have developed a nice beer brewing system control that started with an R3, but the extensive use of arrays for data, EEprom files, and display information quickly ran out of ram. Moved to a mega 2560 as the 5 volt, 3 level interface wire-wrapped boards would plug right in.

I was able to use the SDK for a SAM21D on a RedBoard Turbo, but all of the interface board hardware was 5 volt and would have been a major job to rewire for the 3.3 volt processor. If I was going to rebuild and re wire-wrap, I was going to use an rp2040 on a PICO on a single level board. But the R4 came along and would use the existing 5 volt I/O and fit the board. So instead of using a very capable $4.00 Pico, I am trying to use a $20.00 R4 but have no way to debug as I can not communicate with the monitor.

Any advice is welcome

No success. As I had indicated, when I open the IDE Tools menu and click on "Port:" it shows 1-4.
The side arrow shows a heading "dfu ports" under that it says "1-4 (Arduino UNO R4 Minima)".
There is a check mark to indicate this is the selection. Clicking on the only closes the Tools Menu.
Opening it again and selecting Port: it remains 1-4 and the side arrow says "1-4 (Arduino UNO R4 Minima)".
I have two boards, both react the same.

You have suggested:

"This is expected. The Serial Monitor can only be used with serial ports. You have selected a "DFU" port so Serial Monitor can't connect to it.

Once you have successfully uploaded the sketch, the board should start producing a serial port. If you select that serial port from the Tools > Port menu, Serial Monitor will be able to connect to the port without any problem."

I have not "selected" DFU. That is all that is provided.
After uploading a sketch. I can not select a port using the IDE Tools menu because it is faded to grey, and still shows Port: 1-4. There is no side arrow with which to make a selection. Clicking on the Port: has no effect, it remains grey.

Double clicking the R4's Reset button returns the Port: 1-4 to solid black with a side arrow which
shows a heading "dfu ports" under that it says "1-4 (Arduino UNO R4 Minima)".
There is a check mark to indicate this is the selection. Clicking on the only closes the Tools Menu.
Opening it again and selecting Port: it remains 1-4 and the side arrow says "1-4 (Arduino UNO R4 Minima)".

This is exactly what I have previously said. Is there a firmware update? I am using the lates IDE 2.3.2. If this is not an issue for others can you replace these with a corrected version. I have two that have now practical use!

Answers to all in the thread.

The sketch does load and I may make changes to the delay values to verify that the sketch does compile and load!

Yes I see the Tools Menu in the IDE and I see the "Port" item. In the thread I have extensively described all results !!!

My frustration is..........

I DO NOT select DFU, there was no SANTIAGO devise in my USB Devices until the IDE or the R4 board package was loaded.
To be Clear.... Tools - Ports: now always shows "1-4" in one of 2 ways;

  1. IF the Serial Monitor is NOT requested, the font for Port: "1-4" is a faded grey, there is no selection arrow.
  2. double clicking the R$ Rest button, T00ls - Port: "1-4" font now dark with a selection arrow.
    just placing the cursor on the Tools-Port: "!-4" greys the bar and opens the selection arrow.
    This says on its top line "dfu ports". second line is a check mark followed by 1-4(Arduino UNO R4 Minima)
    *** IMPORTANT POINT ***
    I did NOTHING to select dfu anything. It comes up selected in the IDE!!
    Clicking on the selection in the Tool-Port: after the arrow DOES NOTHING to change the selection! It closes the IDE Tools menu.
    Selecting the Serial Monitor OR uploading the sketch only give the error of No Monitor available for DFU protocol.
    In addition, either loading a sketch or selecting the monitor returns the IDE Tools-Port: "1-4" the faded grey with no selection.

You have asked me to select a port rater then DFU How? I have found now way to change the selection.

Please advise! ( I really don't want to redesign and wire-wrap 3 interface boards to work with 3.3volts for the SAMD21 or the Pico! :grin:)

Preston

The question of whether you selected the port or it was somehow automagically selected for you is completely irrelevant. Obsessing over this is counterproductive. The relevant fact is that a DFU port is selected, regardless of how that selection happened to occur.

Agree! I am unable to change the selection!
How is this accomplished!!

Preston

I have uninstalled the R4 board package and then the entire IDE. I used the Device manager to uninstall the device driver.
I then reinstalled the IDE 2.3.2. Reinstalled the R4 board package.
I am asked to Select a Board and Port. I select Arduino UNO R4, and am told No Ports Selected.

I compile and upload the program. The following output is displayed:

Sketch uses 60268 bytes (22%) of program storage space. Maximum is 262144 bytes.
Global variables use 4568 bytes (13%) of dynamic memory, leaving 28200 bytes for local variables. Maximum is 32768 bytes.
dfu-util 0.11-arduino4

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
Device ID 2341:0069
Run-Time device DFU version 0101
Claiming USB DFU (Run-Time) Interface...
Setting Alternate Interface zero...
Determining device status...
DFU state(0) = appIDLE, status(0) = No error condition is present
Device really in Run-Time Mode, send DFU detach request...
Device will detach and reattach...
Opening DFU USB Device...
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 0101
Device returned transfer size 64
Copying data from PC to DFU device

Download [ ] 0% 0 bytes
Download [= ] 4% 2432 bytes
Download [== ] 8% 4864 bytes
Download [== ] 8% 5120 bytes
Download [=== ] 12% 7296 bytes
Download [==== ] 16% 9664 bytes
Download [===== ] 20% 12096 bytes
Download [====== ] 24% 14528 bytes
Download [======= ] 28% 16896 bytes
Download [======== ] 32% 19328 bytes
Download [========= ] 36% 21760 bytes
Download [========== ] 40% 24192 bytes
Download [=========== ] 44% 26560 bytes
Download [============ ] 48% 28992 bytes
Download [============= ] 52% 31424 bytes
Download [============== ] 56% 33792 bytes
Download [=============== ] 60% 36224 bytes
Download [================ ] 64% 38656 bytes
Download [================= ] 68% 41088 bytes
Download [================== ] 72% 43456 bytes
Download [=================== ] 76% 45888 bytes
Download [==================== ] 80% 48320 bytes
Download [===================== ] 84% 50688 bytes
Download [====================== ] 88% 53120 bytes
Download [======================= ] 92% 55552 bytes
Download [======================= ] 92% 55872 bytes
Download [======================== ] 96% 57984 bytes
Download [=========================] 100% 60276 bytes
Download done.
DFU state(7) = dfuMANIFEST, status(0) = No error condition is present
DFU state(2) = dfuIDLE, status(0) = No error condition is present
Done!

The sketch does not run. Opening the IDE - Tools Menu:
Ports: "1-1" The text is faded grey, n****o further selection allowed.

I then double click the R$ Reset Button, the sketch begins with the change parameters to confirm it is the sketch just loaded.
I again open the IDE - Tools Menu:

Ports: "1-1" This text id black and a single selection is possible. it reads:
A selection is allowed. It reads:

dfu ports

√ 1-4 (Arduino UNO R4 Minima)

There are no additional selections present. No way to change is selection. Any additional click only close the IDE - Tools Menu
Opening the Serial Monitor give two indications
In a red bar under the the Serial Monitor On/Off box;

No monitor available for the port protocol dfu. Could not connect to 1-4 dfu port

This statement was repeated in the output status box at the bottom right of the output window.

Additional information.

If I attempt to get Board Info - I receive: Non serial port, can't obtain info. This appears at the bottom of the output window.

You have twice indicated that I must select another port as if additional selections are available.
I have found no additional ports available to be selected. And know of no other methods to change this

I have experienced some human frustration for which I apologize.

What you interpret as "Obsession" is my attempt to clearly demonstrate in detail what I am seeing and my cations taken.

For your additional information, I have tries several USB A to C cables in both USB 2 and USB 3 ports available on the computer.
Additionally the computer has one USB C to C port. This has been tried wit 3 C to C cable used to connect the phones to the computer.

I am truly at a loss and need much appreciated help!!

Preston

The UNO R4 Minima has two different modes:

Boot Mode

The board can be manually put persistently (until another reset or power cycle) into this mode by resetting the board twice quickly. Arduino IDE also puts the sketch temporarily into this mode during the upload process.

While the board is in this mode, the "L" LED pulses and the board produces a "DFU" port.

The sketch program does not run while the board is in this mode.

Application Mode

This is the mode where the board runs the sketch program.

While in this mode, the board typically produces a serial port.

Since the sketch program is running on the same R7FA4M1AB3C microcontroller that produces the serial port, it is possible for the sketch code to disable or break the code that produces the USB CDC serial port. This is a significant difference from the UNO R3, which has a dedicated USB to serial bridge chip that produces the serial port and can not be affected by the sketch code.


I have been operating on the assumption that you are uploading the blink sketch you shared in post #3 (with the bug fixed). That sketch should not affect the board's ability to produce a serial port. Are you uploading that sketch to the board? Or are you uploading some other sketch? If you are uploading a different sketch, please try again with the blink sketch and let me know if the problem still occurs.

In the case where the board does not produce a serial port while in "application mode", you must use the double reset technique to put the board into the "boot mode" before uploading a sketch. After the upload finishes, the board should return to "application mode" (as indicated by the "L" LED no longer pulsing).

Please only use the double reset technique to put the board into "boot mode" when you are preparing to perform an upload. It is important to avoid frivolously putting the board into "boot mode" at other times because, while in this mode, the sketch program won't be running and a serial port won't be produced. In case you have unnecessarily put the board into "boot mode" when you didn't intend to perform an upload, you can put it back into "application mode" by pressing and releasing the reset button a single time.

Thank you for the response!
I have done everything as you have said! There is a change based on additional actions that I took. Not a solution but maybe something that will help you find and answer.

I uninstalled all of my Arduino IDE software from the desktop excluding my sketch files, library file and the local app Arduino15. I then re-installed IDE 2.3.2.
I verified by using several other processors to ensue the IDE connected, compiled and loaded.

Upon receipt of you email, I did exactly as you suggested without success. There was one change that I noticed since re-installing the IDE;
When first connected, it was in the application mode, "L" not pulsing. I compiled and uploaded the sketch. The processor did go into Boot Mode as the "L" is pulsing.
After the upload, I assume the processor is in Application mode as the "L" is Not blinking. BUT now the sketch does not start or run.
Now upon opening the IDE Tools - Ports: menu, It shows "Port 4" in the faded grey font. The selectin arrow is also grey and inactive.
Before re-installing the IDE the Tools-Ports: would say "1-4"
If I double click the board Reset, the board does return to Boot Mode. But the IDE Tools - Ports; menu shows the same "Port 4".
But now it is dark black and the selection arrow shows :
dfu ports
1-4 (Arduino UNO R4 Minima"
This is the same as before the IDE was removed and re-installed

I can recompile and upload from Boot Mode with the same result.

The sketch compiles and runs with UNO Re3, NANO, Mega 2560, Clone Mega 2560 using the USB C cable, Red Board Turbo (SAM21D), Teensy 4.1, and an RP- Pico.
I can note that as the MINIMA goes into Application Mode, The IDE Tools - Ports Menu will show the last USB port used for another board in the faded grey.

I have tried the Tools - Firmware Updater but it shows "No supported board connected regardless if the board is in Boot or Application Mode.

Here is the Markdown copy of the simple sketch.

/*
Blink

Turns an LED on for one second, then off for one second, repeatedly.

Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
[https://www.arduino.cc/en/Main/Products](https://www.arduino.cc/en/Main/Products)

modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman

This example code is in the public domain.

[http://www.arduino.cc/en/Tutorial/Blink](http://www.arduino.cc/en/Tutorial/Blink)
*/
#define ledpin LED_BUILTIN
//Serial.begin(9600);
//the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
Serial.begin(9600);
while(!Serial){}
pinMode(ledpin, OUTPUT);
//pinMode(13, OUTPUT); // init pin 6 as an output
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(ledpin, HIGH); // turn the LED on (HIGH is the voltage level)
Serial.println("High!");
delay(1000); // wait for a second

digitalWrite(ledpin, LOW); // turn the LED off by making the voltage LOW
Serial.println("Low");
delay(500); // wait for a second
}

Just out of curiosity, did you ever find a solution?

I have since picked up a r4 minima, and found a similar issue.

No,and the Arduino people stopped responding.

So if the don't give a sh*t,
I no longer do either!

I had two Official R4's and two Chinese clones.

So after Arduino refused to help,
all four went to the trash where they belonged!!

Currently being very successful with RP 2040's!!

https://community.element14.com/products/arduino/b/blog/posts/arduino-uno-r4-minima-troubleshooting-unknown-usb-device#:~:text=Reflash%20the%20Bootloader,-In%20case%20you&text=Step%205%20To%20flash%20the,on%20the%20UNO%20R4%20Minima.[possible solution]

Sorry to hear that, I did find a solution... its quite silly and probably is worth posting an bug for since the patch requires you to deviate from a normal Arduino start up routine for the serial.

Otherwise, the board seems ok.

I found a similar solution from another forum, however could not get it to work in the setup function. Instead I have to run this piece of code in the loop function to get around this issue.

void ardSerialInitPatch( void )
{ 
    static blt do_once = TRUE;

    if( do_once )
    {
        do_once = FALSE;

        uint32_t start_time = millis();

        //Setup the baud rate
        Serial.begin( 115200 );

        while( !Serial && (millis() - start_time) < 5000 )
        {
            ; // wait for serial port to connect. Needed for native USB
        }

        Serial.println(F("!"));
    }
}

For whatever reason, the !Serial will just sit there forever in the setup function.

Out of curiosity, how has your experience been with the RPs?