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?

 Réponse acceptée

MathWorks Support Team
MathWorks Support Team il y a environ 16 heures
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.

Plus de réponses (0)

Produits

Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by