Skip to main content
Visitor II
April 26, 2026
Question

How to save runtime-learned knowledge with NanoEdge AI library?

  • April 26, 2026
  • 2 replies
  • 171 views

Hello ST Community,

I am using the NanoEdge AI Studio to generate an anomaly detection library for an STM32L4 device (fixed installation, vibration monitoring). The library works fine, but I need to persist the knowledge learned during runtime so that after a power cycle or reboot, the device does not have to learn again from scratch.

I followed the official documentation and community advice (including the solution marked as accepted in [this thread](https://community.st.com/t5/edge-ai/is-there-any-way-to-save-or-export-knowledge-which/td-p/123456)):
- Added the `.neai` section in my linker script with `KEEP(*(.neai))`
- Declared `extern char _sneai_knowledge[];` and `extern char _eneai_knowledge[];`
- Computed `NEAI_KNOWLEDGE_SIZE = (uint32_t)_eneai_knowledge - (uint32_t)_sneai_knowledge;`
- Implemented functions to save this RAM section to internal Flash and restore it on boot.

However, `NEAI_KNOWLEDGE_SIZE` is **0** and the `.map` file shows that the `.neai` section is empty:

```
.neai 0x20008218 0x0 load address 0x0801ee5c
0x20008218 . = ALIGN (0x4)
0x20008218 _sneai_knowledge = .
*(.neai)
0x20008218 _eneai_knowledge = .
0x20008218 . = ALIGN (0x4)
```

I also checked the library summary provided by NanoEdge AI Studio:

- Library ID: 97
- Model: ICM
- RAM: 2.9 KB
- Flash: 2.3 KB
- Minimum learning iterations: 22

No `.neai` content is present in the generated library.

**My understanding:**
The `.neai` section will only contain data if the library was generated with the **"Embedded Knowledge"** option enabled. However, I cannot find this option anywhere in the Deployment step of my NanoEdge AI Studio. (See attached screenshot of my Deployment interface – no "Embedded Knowledge" checkbox visible.)

**My questions are:**

1. Where exactly is the "Embedded Knowledge" option located in the current version of NanoEdge AI Studio?
2. Is it still required to enable this option to have a non-zero `.neai` section?
3. If that option is not available (or even if it is), what is the recommended way to preserve runtime-learned knowledge for my ICM model? Are there any official APIs like `neai_export_knowledge()` / `neai_import_knowledge()` that I should use instead?
4. Where is the runtime knowledge actually stored for an ICM model (preprocessing_ctx, icm_ctx)? And is it safe to manually back up those structures to Flash?

Any guidance from ST engineers or experienced users would be highly appreciated. I have already spent a lot of time trying to make the `.neai` approach work, but it seems my library does not use that section at all.

Thank you in advance!

Best regards,
Cooli

 

2 replies

Julian E.
ST Technical Moderator
April 28, 2026

Hi @cooli,

 

This functionality is indeed not available in the current version of NanoEdge.

I am discussing with the development team to see if they plan to put it back.

 

I will let you know when I have an update.

It will probably be added back in the next version.

 

Have a good day,

Julian

​In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Visitor II
June 18, 2026

Nice to meet you,

Is there any update regarding knowledge storage in the new version of NanoEdge?

I have also tried to follow the guidelines to store my ML model (defining a memory section in the linker script, declaring the required variables, and implementing functions to store/retrieve the model from Flash). In fact, I need to access the knowledge in order to update it during the learning stages.

Could you please clarify how to access the model hyperparameter memory section?

Thank you for your support.

Best regards,
Pietro