platform-ststm32 icon indicating copy to clipboard operation
platform-ststm32 copied to clipboard

Arduino Opta M4 core doesn't run

Open vmsh0 opened this issue 9 months ago • 0 comments

Hi,

I'm trying to run a minimal example on the M4 Core of the Arduino Opta (very similar to the Portenta) but the code doesn't run.

[env:opta_m4]
platform = ststm32
board = opta_m4
framework = arduino
#include <Arduino.h>

void setup() {
  pinMode(LED_D3, OUTPUT);
  digitalWrite(LED_D3, HIGH);
}

void loop() {}

The above minimal example makes LED 4 light up when compiled with the Arduino IDE, but doesn't when compiled with PlatformIO. In both cases, compilation succeeds and upload succeeds as well. The linker scripts are verified to be identical. The binary produced by the Arduino IDE works perfectly when uploaded with PlatformIO's bundled dfu-util, so this is definitely not an upload problem. I am guessing that whatever PlatformIO compiles crashes before turning the LED on.

This archive contains the binary files as they come out from the Arduino IDE and from PlatformIO; perhaps someone smarter than me can have a look: binaries.zip

The compile logs for both Arduino IDE (sorry - I'm not sure how to force a clean build) and PIO (verbose clean build):

arduino-logs.txt

pio-logs.txt

Please let me know if I can provide anything else.

Please note that, for reproduction, this needs a minimal sketch running on the other (main) core, so that it will start the M4 core, e.g.:

#include <Arduino.h>
#include <RPC.h>

void setup() {
  pinMode(LED_D1, OUTPUT);
  pinMode(LED_D0, OUTPUT);

  digitalWrite(LED_D1, HIGH);
  digitalWrite(LED_D0, HIGH);

  if (!RPC.begin())
    digitalWrite(LED_D1, LOW);
}

void loop() {}

vmsh0 avatar Mar 01 '25 18:03 vmsh0