As far as I can see, nrf52840 sense only has: RAM: 256 KB and Clock speed: 64Mhz while esp32 DOIT devkit v1 has up to: Clock speed: 240Mhz, RAM: 520 KB. But esp32 cannot run tensorflow lite and nrf52840 sense can. Can you explain it to me?
Hi there,
The neural network model size is limited by the ESP32’s standard 8MB FLASH, and tensor allocation by its default 512KB sRAM.
Not sure if that’s your issue, but worth mentioning.
GL PJ
1 Like
But the nRF has even less Flash?
Memory 256 KB RAM 1MB Flash 2MB onboard Flash
Hi there,
SO Great question! The difference lies mainly in hardware architecture and available resources. Here’s why:
Xiao nRF52840 Sense (Nordic Semiconductor nRF52840 SoC):
- Floating Point Unit (FPU):
- The nRF52840 has a Cortex-M4 processor with a single-precision FPU (Floating Point Unit), which is essential for handling calculations required by machine learning models, especially neural networks.
- Better Compatibility with TensorFlow Lite:
- TensorFlow Lite for Microcontrollers is optimized for Cortex-M cores with FPUs. It can run models more efficiently and accurately on this hardware.
- Low Power Consumption:
- The nRF52840 is designed for low-power applications, making it suitable for running ML models on battery-operated devices.
- Memory Resources:
- The nRF52840 has 256KB RAM and 1MB Flash, which is sufficient to load smaller machine learning models for inference (but not training).
ESP32 (Xtensa LX6 or LX7, depending on model):
- No Hardware FPU:
- The standard ESP32 (Xtensa LX6) does NOT have an FPU. While it does support fixed-point operations and software floating-point emulation, this is slow and inefficient for ML tasks.
- The ESP32-S3 (Xtensa LX7) does have some vector instructions for faster processing, but still lacks a dedicated FPU.
- TensorFlow Lite Compatibility:
- It can run TensorFlow Lite models, but with significantly reduced performance because of the lack of hardware FPU. The ESP-DSP library tries to optimize performance, but it’s still limited.
- Memory Constraints:
- The ESP32 typically has 520KB SRAM (divided into several blocks) and up to 4MB Flash (external). While this sounds like a lot, running complex models is challenging due to fragmented memory and limited RAM.
HTH
GLPJ
1 Like