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?

 採用された回答

MathWorks Support Team
MathWorks Support Team 2026 年 3 月 17 日

0 投票

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.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Simulink Coder についてさらに検索

製品

リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by