Inquiry Regarding SQLite Integration with STM32G070KBT6 Microcontroll

Thread Starter

sreekuttan143

Joined May 20, 2025
5
Hello everyone,

I’m currently working on a project that involves integrating SQLite into the STM32G070KBT6 microcontroller, which features an Arm® Cortex®-M0+ core, 128 KB Flash, and 36 KB RAM. For development, I’m using STM32CubeMX along with the IAR Embedded Workbench IDE.

To begin the integration, I’ve added the sqlite3.h and sqlite3.c source files to the project directories (Core/Inc and Core/Src). Given the limited memory resources of the STM32G070KBT6, I’ve disabled several SQLite features to reduce the binary size. Specifically, I’ve defined the following preprocessor flags:

  • SQLITE_THREADSAFE=0
  • SQLITE_OMIT_FLOATING_POINT
  • SQLITE_OMIT_DISKIO
  • SQLITE_OMIT_WAL
  • SQLITE_OMIT_LOAD_EXTENSION
These changes were made after reviewing SQLite’s typical build size (300 KB to 700 KB) and identifying that many features are designed for Linux-based environments, which are not applicable to my use case.

I would like to know:

  1. Is SQLite integration feasible on the STM32G070KBT6, considering its memory constraints?
  2. Are there alternative STM32 microcontrollers or development boards that are better suited for running SQLite, preferably with higher RAM and Flash capacity while maintaining a compact form factor?
Any insights, suggestions, or shared experiences would be greatly appreciated!
 

Ya’akov

Joined Jan 27, 2019
10,226
Welcome to AAC.

In order to give meaningful advice context is required. What problem does the device being developed solve? What genuine constraints are in place?

The abstraction of "using SQLite on an STM32 MCU" is not the actual problem—though it could be forced into that role compromising the actual device's ability to be a stable solution to the actual problem.
 

Rf300

Joined Apr 18, 2025
76
The STM32G0xx series is definitely too small for working with such complex things like SQLite. It is intended as a small and cheap controller for simple embedded applications. You should look for a more powerful controller from the STM32F4xx, STM32F7xx or STM32H5xx series with sufficient memory (>= 1 MB flash, some 100 kB RAM). STM has about 1500 controllers of the STM32 series, so you will find a device matching your requirements.
 
Top