# Unexpected exception while running LVGL project

**URL:** <http://forum.squareline.io/t/unexpected-exception-while-running-lvgl-project/278>\
**Category:** Uncategorized\
**Created:** [May 13, 2022, 5:04pm UTC](http://forum.squareline.io/t/unexpected-exception-while-running-lvgl-project/278 "2022-05-13T17:04:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndyFraser](http://forum.squareline.io/letter_avatar_proxy/v4/letter/a/a183cd/32.png) [@AndyFraser](http://forum.squareline.io/u/AndyFraser)\
**Post date:** [May 13, 2022, 5:04pm UTC](http://forum.squareline.io/t/unexpected-exception-while-running-lvgl-project/278/1 "2022-05-13T17:04:00Z")

</div>

My LVGL project just crashed with the following:

> [Error] (94.100, +94100) search\_suitable\_block: Asserted at expression: sl\_map && “internal error - second level bitmap is null” (in lv\_tlsf.c line #577)  
> [Error] (94.100, +94100) search\_suitable\_block: Asserted at expression: sl\_map && “internal error - second level bitmap is null” (in lv\_tlsf.c line #577)

Any idea what might have caused this?

Andy

---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [May 16, 2022, 7:01am UTC](http://forum.squareline.io/t/unexpected-exception-while-running-lvgl-project/278/2 "2022-05-16T07:01:51Z")

</div>

Seems like an out of memory or an out of bounds write issue. Out of memory should have been reported correctly with an “out of memory” error though, so it’s rather the latter.

Can it be something in your code? E.g. in event handlers?

---

<div class="post-metadata">

**Author:** ![AndyFraser](http://forum.squareline.io/letter_avatar_proxy/v4/letter/a/a183cd/32.png) [@AndyFraser](http://forum.squareline.io/u/AndyFraser)\
**Post date:** [May 16, 2022, 7:59am UTC](http://forum.squareline.io/t/unexpected-exception-while-running-lvgl-project/278/3 "2022-05-16T07:59:55Z")

</div>

I do use a thread to poll a serial port and update the UI but it seems to work fine most of the time but occasionally I see this fault. I will dig deeper into my code.

Andy

---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [May 17, 2022, 9:34am UTC](http://forum.squareline.io/t/unexpected-exception-while-running-lvgl-project/278/4 "2022-05-17T09:34:07Z")

</div>

In this case be sure to use a mutex as described here: [Operating system and interrupts — LVGL documentation](https://docs.lvgl.io/master/porting/os.html)

---

<div class="post-metadata">

**Author:** ![AndyFraser](http://forum.squareline.io/letter_avatar_proxy/v4/letter/a/a183cd/32.png) [@AndyFraser](http://forum.squareline.io/u/AndyFraser)\
**Post date:** [May 18, 2022, 7:39am UTC](http://forum.squareline.io/t/unexpected-exception-while-running-lvgl-project/278/5 "2022-05-18T07:39:23Z")

</div>

Thanks - I will give the mutex a go and see if it solves my problem.

Andy
