Skip to main content
alper
Associate II
September 9, 2024
Solved

Textarea memmanage handler problem

  • September 9, 2024
  • 1 reply
  • 1985 views

Hello,

I have created custom board with STM32H723 and a external qspi memeory. I can store image data on qspi and showing them on lcd screen. So my external flash its working fine. When i use textarea programs go to Memmanagehandler and stuck. If i try internal flash for textarea program doesnt stuck but nothing show up on the screen.

I use CUBEIDE 1.16 and Touchgfx 4.23

Can anyone help me.

 

 

 

 

Best answer by alper

Hello ,

Sorry for the late reply,

Where is this line "currentLanguageTypedText = typedTextDatabaswArray[id];" ? this line inside Texts.cpp.

Actually searched many forums. And this problem was solved with the help of a Korean friend.

The problem was caused by the mpu (memory protection unit) not being configured correctly.

Thank you for your help.

1 reply

GaetanGodart
Technical Moderator
September 9, 2024

Hello @alper ,

 

Can you explain more in detail this sentence please : "When i use textarea programs go to Memmanagehandler and stuck.".

Can you also share the files related you QSPI and to how you change your TextArea value?

Also, does it work on simulator?

 

Regards,

alper
alperAuthor
Associate II
September 9, 2024

I add a Textarea to the screen with touchgfx designer.

When debug the code step by step, calling the MX_TouchGFX_Init();

after that when debugger came to

currentLanguageTypedText = typedTextDatabaswArray[id];  line.

And than goes to MemManage_Handler.

By the way, firstly initaliaze QSPI and memory mapped mode. Then initaliaze MX_TouchGFX_Init(); .

I dont change the Textarea value

 

 

 

GaetanGodart
Technical Moderator
September 9, 2024

The MemManage_Handler can be reached when :

  • Accessing an invalid memory address.
  • Violating memory protection rules (e.g., accessing a protected region).
  • Stack overflow or underflow.
  • Unaligned memory access (depending on the processor configuration).

 

The most common cases happens because :

  • Null Pointer Dereference (attempting to access memory through a null pointer)
  • Out-of-Bounds Access (accessing an array or buffer outside its allocated bounds)
  • Uninitialized Pointers (using pointers that have not been initialized)
  • Corrupted Memory (memory corruption due to buffer overflows, incorrect pointer arithmetic, etc)
  • Incorrect Memory Mapping (accessing memory regions that are not properly mapped or protected)

In your case, I would assume the value of ID is bigger than the size of the array so you access memory outside of the array.

 

Where is this line "currentLanguageTypedText = typedTextDatabaswArray[id];" ?

You should check the typed text database throughout the execution of your program and see if it changes.

 

Regards,