Skip to content

Conversation

@lucarin91
Copy link
Contributor

@lucarin91 lucarin91 commented Oct 21, 2025

Motivation

Arduino apps require that the micro is in sync with the orchestration handled by arduino-app-cli. In particular, at boot, we need the micro to wait for the arduino-app-cli, and start only to execute the sketch of the default app or some other app decided by the user.

For this reason, we need to use the flash on RAM feature of the zephyr platform, which allows. In this way, the micro loses the code at every boot, and the arduino-app-cli can reflash it with the correct app at boot.

Change description

Update the flash mode to RAM, and handle the case in which the micro was previously flashed from the IDE2 with an in-flash sketch.

As a general note, a sketch could be flashed in RAM only if the micro is waiting for a sketch, which means that if there is a sketch already running from the flash, it should be removed by flashing an empty one.

Change description

Additional Notes

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@per1234 per1234 added the enhancement New feature or request label Oct 21, 2025
@lucarin91 lucarin91 requested review from a team, cmaglie and dido18 and removed request for cmaglie October 23, 2025 08:12
@lucarin91 lucarin91 marked this pull request as ready for review October 30, 2025 14:53
@mirkoCrobu
Copy link
Contributor

As a general note, a sketch could be flashed in RAM only if the micro is waiting for a sketch, which means that if there is a sketch already running from the flash, it should be removed by flashing an empty one.

Is this something that should be notified to the user before the removal?

@lucarin91
Copy link
Contributor Author

How to test it

  1. Create an app with a sketch that includes something that start in the setup for instance light up the led matrix
#include <Arduino_LED_Matrix.h>

Arduino_LED_Matrix matrix;

void setup() {
  const uint32_t full[4] = {0xffffffff,0xffffffff,0xffffffff,0xffffffff};
  matrix.begin();
  matrix.loadFrame(full);
}

void loop() {
}
  1. start the app, the led matrix should be on
  2. restart the board by disconnecting and reconnecting it

expected result: the led matrix should be off till you start again the app

previus result: the les matrix will be on right after the animation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants