ArduinoCloud.update() causes memory fault and usage fault

I am using Uno R4 WiFi on Arduino Cloud. I am just starting to trying it out so I am using the default 'Get Started' project provided by the platform. I am able to connect and configure the device. However the following fault (error?) occurs in the serial monitor after the board connects to WiFi successfully:

ArduinoIoTCloudTCP::begin could not read device id.
***** Arduino IoT Cloud - configuration info *****
Device ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
MQTT Broker: iot.arduino.cc:8883
WiFi.status(): 0
Current WiFi Firmware: 0.4.1
Connected to ":)"


Firmware name: "/tmp/precompile-arduino-renesas_uno2715454279/sketches/DC418DEDB6BD760AA642B5F0C3E93193/empty_sketch.ino", compiled on: Dec  5 2024
Fault on interrupt or bare metal(no OS) environment
===== Thread stack information =====
  addr: 20007e20    data: 00000000
  addr: 20007e24    data: 00000000
  addr: 20007e28    data: 0000001e
  addr: 20007e2c    data: 0000000e
  addr: 20007e30    data: 0000001c
  addr: 20007e34    data: 0000000b
  addr: 20007e38    data: 0000007c
  addr: 20007e3c    data: 00000006
  addr: 20007e40    data: 00000000
  addr: 20007e44    data: 00000000
  addr: 20007e48    data: 20000e7c
  addr: 20007e4c    data: 67700b68
  addr: 20007e50    data: 20000cb0
  addr: 20007e54    data: 20002d58
  addr: 20007e58    data: 000022b3
  addr: 20007e5c    data: ffffffff
  addr: 20007e60    data: 20003064
  addr: 20007e64    data: 05000000
  addr: 20007e68    data: 0001e000
  addr: 20007e6c    data: 0000c06f
  addr: 20007e70    data: 0001df2c
  addr: 20007e74    data: 00000000
  addr: 20007e78    data: 00000000
  addr: 20007e7c    data: 00000000
  addr: 20007e80    data: 00000000
  addr: 20007e84    data: 00000000
  addr: 20007e88    data: 20000964
  addr: 20007e8c    data: 00004040
  addr: 20007e90    data: 20000cb0
  addr: 20007e94    data: 00005021
  addr: 20007e98    data: 0001ce2d
  addr: 20007e9c    data: 000085e7
  addr: 20007ea0    data: d0fd3818
  addr: 20007ea4    data: 67700b68
  addr: 20007ea8    data: 00040000
  addr: 20007eac    data: 20000964
  addr: 20007eb0    data: 00004040
  addr: 20007eb4    data: 0000a500
  addr: 20007eb8    data: ffffffff
  addr: 20007ebc    data: 000053a5
  addr: 20007ec0    data: 2000095c
  addr: 20007ec4    data: 0000433f
  addr: 20007ec8    data: 40040020
  addr: 20007ecc    data: 00000000
  addr: 20007ed0    data: 00004040
  addr: 20007ed4    data: 000144d1
  addr: 20007ed8    data: 0001e8e0
  addr: 20007edc    data: 40046f00
  addr: 20007ee0    data: 00000000
  addr: 20007ee4    data: 0001450f
  addr: 20007ee8    data: 0001e8e0
  addr: 20007eec    data: 0000c9b7
  addr: 20007ef0    data: 0001e8e0
  addr: 20007ef4    data: 00011703
  addr: 20007ef8    data: 000116f9
  addr: 20007efc    data: 00002599
====================================
=================== Registers information ====================
  R0 : 00000000  R1 : 20007e70  R2 : 20002d58  R3 : 4f4c535f
  R12: 00000006  LR : 0000be35  PC : 4f4c535e  PSR: 61000000
==============================================================
Memory management fault is caused by instruction access violation
Show more call stack info by run: addr2line -e "/tmp/precompile-arduino-renesas_uno2715454279/sketches/DC418DEDB6BD760AA642B5F0C3E93193/empty_sketch.ino".elf -a -f 4f4c535e 0000be34 0000c06e 00005020 000085e6 000053a4 0000433e 000144d0 0001450e 0000c9b6 00011702 000116f8

It also caused 'Usage fault' when I tried it out with a simpler sketch.
After testing the above error seems to occur with the ArduinoCloud.update() function, as it wont appear as long as I remove the functions.
I have totally no idea WTH is a 'Usage fault' and a 'Memory management fault' and there no clue as to how I could fix it.

/* 
  Sketch generated by the Arduino IoT Cloud Thing "Cloud Blink"
  
  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  int speed;
  bool led;
  bool mode;
  bool power;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#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();
  pinMode(LED_BUILTIN, OUTPUT);
}

int _lastToggleMillis = millis();

void loop() {
  ArduinoCloud.update();
  if (power) {
    if (mode) {
      if (millis() - _lastToggleMillis > speed) {
        led = !led;
        _lastToggleMillis = millis();
      }
    } else {
      led = true;
    }
  } else {
    led = false;
  }
  digitalWrite(LED_BUILTIN, led);
}

/*
  Since Led is READ_WRITE variable, onLedChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onLedChange()  {
  Serial.print("Led status changed:");
  Serial.println(led);
}

/*
  Since Power is READ_WRITE variable, onPowerChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onPowerChange()  {
  Serial.print("Power changed:");
  Serial.println(led);
}

/*
  Since Mode is READ_WRITE variable, onModeChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onModeChange()  {
  Serial.print("Mode changed:");
  Serial.println(mode);
}

/*
  Since Speed is READ_WRITE variable, onSpeedChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onSpeedChange()  {
  Serial.print("Speed changed:");
  Serial.println(speed);
}

[sterrethe edit]
code tags added around output]
[/sterretje end]

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