Problems with uploading the sketch from the cloud on arduino nano iot 33

Hello everyone.
I have a problem with an arduino nano iot 33 I can't upload sketches from the cloud to the board.
I want to specify that, the last time I tried to restart it, it worked, but it hasn't worked for a few days.
If anyone can help me?
Thank you .



#include "thingProperties.h"

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(1500); 

  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  // Your code here 
  
  
}


Done Verifying Untitled_may28a

/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .bss by 4 bytes
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .bss by 4 bytes
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .bss by 4 bytes
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .bss by 4 bytes
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .bss by 4 bytes

1 Like

Hi @Ionut. I apologize for the inconvenience that is caused by this bug. This has been reported to the Arduino Cloud developers. They have already prepared a fix, and even deployed the fix to the version of Cloud Editor that is used with non-IoT sketches. However, the version of Cloud Editor used with Arduino Cloud IoT Thing sketches still has the bug. So a fix is definitely coming, but unfortunately it is not quite here yet. I'll post an update here if I receive any news from them about a resolution.

The bug only affects uploads via the USB port. If you have an "Entry" Arduino Cloud plan, or higher then you can also upload sketches to IoT Devices "over-the-air" (OTA), and these uploads should work fine.

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

  1. Select the over-the-air port from the Cloud Editor toolbar:
  2. Click the upload button.

In case you are interested in understanding the conditions under which the bug occurs, as well as potential workarounds, I'll provide the boring details below. If you aren't curious then you are welcome to skip reading the rest of this post.

The bug occurs when the compilation produces output on the "standard error" stream (AKA "stderr").

So first we must consider what conditions can produce that type of output, and if that is relevant, what could be done to avoid those conditions:

Compilation Errors

The most common source of such stderr output is error messages.

This source of stderr output is irrelevant to the bug because the upload could not be performed anyway because you can only upload if the compilation was successful.

Compilation Warnings

We could also get stderr output from compiler warnings about non-fatal possible problems with the code.

However, Cloud Editor configures the compiler to not produce any warnings so this is not a factor.

#pragma message

Another source of stderr output is #pragma message directives. These are used to print informational messages in the compiler output. We can reproduce the bug with a simple sketch like this:

#pragma message "Hello, world!"
void setup() {}
void loop() {}

In the case where the upload is skipped due to the output from a #pragma message directive, the workaround would be to comment out those directives in the code. This is straightforward if the #pragma message directive is in your sketch. It is a bit more complicated if the #pragma message directive is in a library, but not too difficult once you know how to do it. If you do run into such a situation, I'd be happy to provide instructions for modifying the library source code.

Linker Warnings

Another source of stderr output is warnings that come from other pieces of the compilation toolchain, such as the GNU linker ld. Unfortunately ld produces some warnings during some compilations for the Nano 33 IoT board:

/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .bss by 4 bytes
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .bss by 4 bytes
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .bss by 4 bytes
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .bss by 4 bytes
/home/builder/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .bss by 4 bytes

If the compilation produces these warnings then the bug causes Cloud Editor to skip the upload operation.

I don't know what specific conditions cause these warnings to be produced. Unfortunately they do seem to be produced by the combination of the "ArduinoIoTCloud" and "Arduino_ConnectionHandler" libraries used by Arduino Cloud IoT Thing sketches (even though the Cloud Editor stderr handling bug is not specific to Thing sketches).

My understanding is that the warnings don't indicate any real problem, so you don't need to be concerned about the warning itself, as explained here:

https://forums.adafruit.com/viewtopic.php?t=189483#p917530

As for a workaround, I'm not sure what could be done to prevent ld from producing these warnings. Since they don't occur for all Arduino sketch compilations, perhaps it could be accomplished by adding some innocuous code to the sketch, or making a simple modification to a library. Maybe one of the other forum helpers will have an idea about that.

Thank you very much for your help

Hello again @Ionut. The bug that caused uploads to USB ports to be skipped when the compilation produced stderr output has now been fixed for IoT Thing sketches.

So you should now be able to upload IoT sketches as well as non-IoT sketches without encountering that problem.

Please give it a try and let us know if you still have any problems.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.