What is spinlock and how to avoid assert spinlock_acquire error
Posted: Wed Jun 01, 2022 12:21 pm
I'm new to new to FreeRTOS. I'm getting this failed assert errors when writing to flash storage (SPIFFS file system). I don't know whether I'm doing something wrong. Any help would be good.
More info: I'm trying to write a character array of size 1024 ever 31 millisecond or almost at 10 Hz.
Little backtrace
From this https://www.esp32.com/viewtopic.php?p=35417#p35417 thread, I learned a little bit more about spinlock and would like to avoid these kinds of errors. Would using mutex help in such a situation?
More info: I'm trying to write a character array of size 1024 ever 31 millisecond or almost at 10 Hz.
Little backtrace
Code: Select all
assert failed: spinlock_acquire spinlock.h:123 ((result == SPINLOCK_FREE) == (lock->count == 0))
Backtrace:0x40081bbe:0x3ffdbe700x400911e1:0x3ffdbe90 0x40095fed:0x3ffdbeb0
0x400916f5:0x3ffdbfd0 0x40091eec:0x3ffdbff0 0x40190f59:0x3ffdc030 0x400e76f1:0x3ffdc050
0x400dfa48:0x3ffdc070 0x400dfa5f:0x3ffdc090 0x400e23cd:0x3ffdc0b0 0x400e2115:0x3ffdc0e0
0x400e1511:0x3ffdc110 0x400e154b:0x3ffdc150 0x400d9375:0x3ffdc180 0x400d9570:0x3ffdc1c0