#WioTerminal – @EdgeImpulse projects and the error: `FLASH’ overflowed by 42784 bytes
Tags: englishpost, edgeimpulse, platformio
Published: 2022-05-06 12:32:27

---
title: #WioTerminal – @EdgeImpulse projects and the error: `FLASH’ overflowed by 42784 bytes
published: true
date: 2022-05-05 21:01:46 UTC
tags: EnglishPost,EdgeImpulse,EnglishPost,PlatformIO
canonical_url: 
---

Hi !

Yesterday I hosted a session where I show how to train a Computer Vision model and run the model in a Wio Terminal.

[TinyML 🧠 and Azure IoT with Edge Impulse and Wio Terminal](https://youtu.be/JCirUbyY60s)

In this video I also explain how to connect and use an ArduCAM to take photos with the device.

The build process for this machine learning model takes some time, so I show a precorded set of videos where I show, what’s happens when we build a model, and this becomes to big for the device.

In example, let’s try to build a model with the next set of settings.

- Neural Network Architecture based on MobileNetV2
- Size: 96×96 
- Final layer: 16 neurons
- Dropout: 0.1
- Unoptimized (float32)
- RAM usage: 934.3K
- Latency: 465 ms
- Flash usage: 454.0K
- Accuracy: 90.91%

Once I added the exported library to the Platform IO project, the following log show this error.

![wio terminal cant build firmware](https://brunocapuano.files.wordpress.com/2022/05/wio-terminal-cant-build-firmware.jpg?w=1024)

```

Linking .pio\build\seeed_wio_terminal\firmware.elf
c:/users/bruno/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: .pio\build\seeed_wio_terminal\firmware.elf section `.text' will not fit in region `FLASH'
c:/users/bruno/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: region `FLASH' overflowed by 14256 bytes
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\seeed_wio_terminal\firmware.elf] Error 1
================================================================================================================================ [FAILED] Took 75.96 seconds ================================================================================================================================
The terminal process "C:\Users\bruno\.platformio\penv\Scripts\platformio.exe 'run', '--environment', 'seeed_wio_terminal'" terminated with exit code: 1.

```

So, the model configuration is too big.

This is when EON Tuner comes handy in order to help us fit the trained model.

> The EON Tuner helps you find and select the best embedded machine learning model for your application within the constraints of your target device. The EON Tuner analyzes your input data, potential signal processing blocks, and neural network architectures – and gives you an overview of possible model architectures that will fit your chosen device’s latency and memory requirements.
> 
> <cite><a href="https://docs.edgeimpulse.com/docs/edge-impulse-studio/eon-tuner" target="_blank" rel="noreferrer noopener">Edge Impulse – EON Tuner</a></cite>

Let’s try to build the same project with EON tuner enabled and the following configuration:

- Neural Network Architecture based on MobileNetV2
- Size: 96×96 
- Final layer: 16 neurons
- Dropout: 0.1
- Quantized (int8)
- RAM usage: 292.9K
- Latency: 126 ms
- Flash usage: 222.8K
- Accuracy: 90.91%

The output is a happy moment now ! The firmware will fit into the Wio Terminal device.

```

Linking .pio\build\seeed_wio_terminal\firmware.elf
Checking size .pio\build\seeed_wio_terminal\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [====] 40.0% (used 78576 bytes from 196608 bytes)
Flash: [======] 57.2% (used 290504 bytes from 507904 bytes)
Building .pio\build\seeed_wio_terminal\firmware.bin
======================================= [SUCCESS] Took 70.99 seconds =======================================

```

Happy coding!

Greetings

El Bruno

More posts in my blog [ElBruno.com](https://www.elbruno.com).

* * *