cancel
Showing results for 
Search instead for 
Did you mean: 

Help or Info on STM32h7 running Lua 5.x

Uvamosk
Associate II

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.

 

4 REPLIES 4
Andrew Neil
Super User

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 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
TDK
Super User

What board are you using? How is the clock configured?

Usually IMPRECISEERR is a hardware issue or a clock misconfiguration.

If you feel a post has answered your question, please click "Accept as Solution".
Pavel A.
Super User

 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?

 

 

Andrew Neil
Super User

@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?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.