Can I access internal flash memory using Embedded Coder?

I am working on a project where I use Embedded Coder to deploy to a microcontroller. 
I would like to store data in the microcontroller’s internal flash memory, so that the data is retained even after a power cycle.
I would like to know:
  1. Is this feasible?
  2. If so, how can I do it?

 Respuesta aceptada

MathWorks Support Team
MathWorks Support Team hace alrededor de 16 horas
We do not support any block that directly allows users to write/read to/from the internal flash memory.
To do this, you must use the IO Device Builder app workflow to create your own system object, or the C-Caller block.
Attached is an example model and IOC with you based on the C-Caller implementation. You can use CubeIDE to verify that data is written to the last sector of the flash memory (0x080E0000). Please note that this is just a simple example to demonstrate the use of HAL APIs with C Caller and is not a full-fledged example; you may customize it accordingly.

Más respuestas (0)

Productos

Versión

R2024b

Preguntada:

el 17 de Mzo. de 2026 a las 0:00

Respondida:

el 17 de Mzo. de 2026 a las 15:30

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by