SQLite Forum

Sqlite3 amalgamation stuck in pageFindSlot for embedded platform on ARM Cortex-M
Login

Sqlite3 amalgamation stuck in pageFindSlot for embedded platform on ARM Cortex-M

(1) By Jigar PAtel (jigarpatelp) on 2020-10-05 12:28:56 [source]

Hello,

I'm using SQLITE3 amalgamation 3.33.0. I've ported it for embedded platform using chan FATFS for mmc with arm gcc compiler for STM32.

I've setup minimum stack size to 0x2000. Setup SQL heap with sql_config with size of 1MB in sdram.

Configured FATFS to use LFN upto 255 Character.

Configured PRAGMA journal_mode=OFF;

while trying to create a table code stuck in below path here is my call graph when stuck.

Thread #1 (Suspended : Step) HardFault_Handler() at stm32h7xx_it.c:85 0x8001f9e <signal handler called>() at 0xffffffe9 pageFindSlot() at sqlite3.c:66,055 0x8019fec allocateSpace() at sqlite3.c:66,139 0x801a176 insertCell() at sqlite3.c:71,248 0x801f088 sqlite3BtreeInsert() at sqlite3.c:73,329 0x8021db8 sqlite3VdbeExec() at sqlite3.c:90,288 0x80321c0 sqlite3Step() at sqlite3.c:83,694 0x802b66c sqlite3_step() at sqlite3.c:83,751 0x802b7ea sqlite3_exec() at sqlite3.c:1,23,501 0x8055f34

where it stucks at memcpy(&aData[iAddr], &aData[pc], 2); in pageFindSlot() function while pc = 3601 and maxPC = 4088. Ran this multiple times the codes always stuck at this point.

Here is my modified configuration all others are defaults.

#define SQLITE_OS_OTHER 1

#define SQLITE_THREADSAFE 0

#define SQLITE_TEMP_STORE 3

#define SQLITE_DEFAULT_WAL_SYNCHRONOUS 1

#define SQLITE_DEFAULT_LOCKING_MODE 1

#define SQLITE_ENABLE_MEMSYS5 1

Didn't understand how to troubleshoot it further. Can anybody point me how to resolve this issue.

Thanks