2026-03-26 11:19 AM
Hello,
I have been working on a project attempting to get Lua 5.5, Freertos running on a STM32h723.
I used cubeMX to generate my project with Freertos enabled.
I brought in Lua 5.5 library from their website https://www.lua.org/download.html
I was able to get it compiling and my project as a whole builds and flashes without errors.
Now the part that I'm struggling with. If for any reason Lua has a error the STM32 goes into hard fault and most of the time it seems to be a BusFault caused by IMPRECISERR.
I'm trying to figure out if getting Lua to work on the Cortex-m7 is more involved than just adding the library. As I was watching a video from a person that was getting LuaJIT ported to the STM32h7 and he had talked about a few issues he had in regards to the Cortex-m7 https://www.youtube.com/watch?v=U9Jnah4uXBY Though I will admit he was trying to port over the Lua Just In Time compiler and other things that I don't believe base Lua has.
I would appreciate it if anyone is willing to help if possible.
Thank you.
2026-03-26 11:34 AM - edited 2026-03-26 12:04 PM
You might be better of with a Lua-specific group or mailing list: https://www.lua.org/faq.html#2.1
PS:
Have you tried building it on Linux, as described on the page you linked: https://www.lua.org/manual/5.5/readme.html
PPS:
A quick forum search suggests that there was an embedded Lua project, eLua - which might be more appropriate?
[ANN] eLua (Lua for microcontrollers) 0.7 released
The http://www.eluaproject.net site seems to be dead, but there is a GitHub: https://github.com/elua
2026-03-26 12:45 PM
What board are you using? How is the clock configured?
Usually IMPRECISEERR is a hardware issue or a clock misconfiguration.
2026-03-26 9:59 PM
> If for any reason Lua has a error the STM32 goes into hard fault
What does this mean, exactly? Which sort of error? Can you first get it working without FreeRTOS?
If multiple RTOS threads use Lua, is the interpreter state thread-local?
2026-03-27 3:55 AM
@Uvamosk wrote:If for any reason Lua has a error the STM32 goes into hard fault
See: Debugging Cortex-M Hard Faults
Again, try running it on Linux, and see what happens there in these cases.
That should help you understand what your embedded code should be doing.
Maybe it's relying on some Linux system resource which is just not present?