SQLite Forum

Porting Sqlite to freertos
Login

Porting Sqlite to freertos

(1) By Mushtakh (mushtakh) on 2020-10-28 07:35:10 [link] [source]

Hi, I want to port sqlite in freertos with STM32f4 or nRF52832. I am a newb in sqlite and it's porting. Can you please provide me any link that explains the porcedre or steps to be followed to achieve the goal?

(2.1) By Gunter Hick (gunter_hick) on 2020-10-28 08:40:29 edited from 2.0 in reply to 1 [link] [source]

I have no idea what libraries freeRTOS provides, except that Wikipedia states "next to nothing". This means you will probably have to implement your own VFS layer to provide file system, locking, timer/sleep and misceallaneous other services.

There is some documentation of the VFS layer and some sample code for inserting a "shim VFS" to allow interception and debugging of VFS methods.

I am using a test harness shim VFS so that VFS calls are duplicated and results compared between the standard linux VFS and my own VFS. Maybe a similar approach - developing a VFS under linux that pretends to be running under freeRTOS - would work in your case.

There are also numerous compile time options to reduce SQlite footprint so that it may run in embedded environments.

(3) By anonymous on 2020-10-28 23:37:22 in reply to 1 [source]

(4) By anonymous on 2022-08-01 18:14:44 in reply to 3 [link] [source]

We have sqlite ported on fatfs. https://github.com/xluoly/raw-os_sqlite/blob/master/sqlite/os_raw.c

It works for me. but It is not multithreaded safe. It is conditional compile for SQLITE_MUTEX_NOOP. I am trying to run under freeRTOS.

Any idea how to port it to freeRTOS compitable mutex protected sqlite for freeRTOS and Fatfs.