cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in libnemagfx-float-abi-hard.a / libnemagfx.a or in ST-Toolchain?

Heinz_Baumer
Associate II

Hello.

I try to get the nema-gfx working on a STM32H7S78-DK.

But there's a bug in the NEMA library, or a bug in the ST toolchain.

 
When I try to call the library function nema_cl_create() in my function nema_gfx_init(), according to the STM32H7RS GPU2D document (page 6), stm32h7rs-system-gpu2d.pdf 
the stack is overwritten with values, so the return address on stack (0x7002AEFB) is no longer available (0x00000000) and the cpu goes in hard fault.
 
I suspect it's a bug in the NEMA library.
The correct version for the H7 series was used.
The error occurs with both versions: libnemagfx-float-abi-hard.a and libnemagfx.a.
 
I looked inside the function in the disassembler, and at the end of the function, registers r0-r3 are written to the stack, but much too far! (See images)
 
Stack bevore calling nema_cl_create. Return-adress: okStack bevore calling nema_cl_create. Return-adress: ok

 

Stack after calling nema_cl_create. Return-adress: 0x00000000Stack after calling nema_cl_create. Return-adress: 0x00000000

 

Dissass. inside der nema_cl_create: overwriting behind actual stack endDissass. inside der nema_cl_create: overwriting behind actual stack end

 

The library is integrated into the STM32CubeIDE as usual via Settings -> MCU/MPU GCC Linker -> Libraries.
 
Are there any additional settings required for the libraries in the STM32CubeIDE project to prevent the stack from being overwritten?
 
 
 
 
3 REPLIES 3
JBJOE.1
ST Employee

Hi @Heinz_Baumer 
Yes it sounds like something is wrong, but I expect an error in the setup. 
To help I need to know what your setup is. 
I suspect an issue in the nema_hal.c configuration that links the library to the hardware and memory. 
I suggest you get inspiration from the configuration you get when generating an STM32H7S78-DK app using TouchGFX designer. 
Special attention to the content of nema_sys_init(), compare that with the TouchGFX application (C:\TouchGFXProjects\MyApplication\Appli\TouchGFX\target\generated\nema_hal.c).
Alternatively, if you have access to NeoChromSDK for the H7RS platform you will have another but also working configuration. Look for the file nema_hal_freertos.c. 
If your problems persist let's take it from there. 

Regards, 


 

Jakob BJOERN
Senior Software Engineer | STM32 Graphics
Heinz_Baumer
Associate II

Hello.

nema_cl_create_sized(1024) helps a bit, but there are still problems with the Nema-GFX.

Is there any way to get the NeoChromSDK with examples for my STM32H7S78-DK?

It's not in the ST download section for STM32H7S78, and there's no information on where to get it.
 
 
 
JBJOE.1
ST Employee

Hi @Heinz_Baumer 

You can request NeoChormSDK. Have a look at this post:

Solved: NEWS! STM32H7R7/S7 Product line for graphics - STMicroelectronics Community

Regards, 

Jakob BJOERN
Senior Software Engineer | STM32 Graphics