Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Re: STM32 L4RE - GDB Memory Exhausted (Read 2260 times)
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: STM32 L4RE - GDB Memory Exhausted
Feb 8th, 2023 at 12:57pm
Print Post  
Hi,I was testing some programs today and i came across this error when trying to step into a function call.

Code
Select All
openocd: Open On-Chip Debugger 0.11.0+dev-gb1de116 (2021-12-09-11:34)
openocd: Licensed under GNU GPL v2
openocd: For bug reports, read
openocd: 	http://openocd.org/doc/doxygen/bugs.html
openocd: debug_level: 2
openocd:
=thread-group-added,id="i1"
GNU gdb (xPack GNU Arm Embedded GCC i386) 10.2.90.20210621-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="pagination",value="off"
Note: automatically using hardware breakpoints for read-only addresses.
Reset_Handler () at 52xx.s:62
62	  ldr   sp, =_estack    /* Set stack pointer */

Breakpoint 2, ji::X::X::X::Run (this=0x20000ec0 <ji::X::X::X>) at C:\Users\X\Documents\Github/X.cpp:27
27			radiodevice->Transmit("SAIN");
halted: PC: 0x08009c6c
halted: PC: 0x08009c6e
halted: PC: 0x080052cc
s.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
s.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
The program '' has exited with code 4294967295 (0xffffffff). 

« Last Edit: Feb 8th, 2023 at 2:04pm by Simon@Visual Micro »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2697
Joined: Feb 13th, 2019
Re: STM32 L4RE - GDB Memory Exhausted
Reply #1 - Feb 8th, 2023 at 2:06pm
Print Post  
Thanks for the report.

Can you enable the below options:
  • vMicro > Compiler > Verbose
  • vMicro > Compiler > Show Build Properties
  • vMicro > Uploader > Verbose


Then perform a Build, and use Debug > Attach to Process, and attach the complete output so we can be sure of your current configuration.  If you are using a local board.txt please also attach this.

There are some additional flags that can be added to the GDB config to grow or unlimit completely the memory it has available, but we need to see the output to be sure of which configs to amend in this scenario.
« Last Edit: Feb 8th, 2023 at 2:07pm by Simon@Visual Micro »  
Back to top
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: STM32 L4RE - GDB Memory Exhausted
Reply #2 - Feb 8th, 2023 at 3:10pm
Print Post  
Hi, thanks for replying, i've sent the build settings to the email above. here is an image of the error which pops up when it happens.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2697
Joined: Feb 13th, 2019
Re: STM32 L4RE - GDB Memory Exhausted
Reply #3 - Feb 8th, 2023 at 5:05pm
Print Post  
Thanks for the logs.

My suggestion of the memory limit is incorrect as the 4064 bytes is far smaller than the limit set for this setup.

The same issue is reported here for v10 of GDB which is in use in this board package: https://github.com/Marus/cortex-debug/issues/619

There is a suggestion to turn the -g3 compiler flag down to -g2, which can be done currently by:
1) Add the Local Board.txt to the project, and add the below line into it:
build.vm.ignore_gdb_extra_flags=1
2) Add -g2 to the vMicro > Project Properties > (Micro General Section) > Extra Flags
3) Then run Build > Clean Solution and rebuild and re-upload the project

Does this help to resolve the issue?
  
Back to top
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: STM32 L4RE - GDB Memory Exhausted
Reply #4 - Feb 8th, 2023 at 5:35pm
Print Post  
Simon@Visual Micro wrote on Feb 8th, 2023 at 5:05pm:
Thanks for the logs.

My suggestion of the memory limit is incorrect as the 4064 bytes is far smaller than the limit set for this setup.

The same issue is reported here for v10 of GDB which is in use in this board package: https://github.com/Marus/cortex-debug/issues/619

There is a suggestion to turn the -g3 compiler flag down to -g2, which can be done currently by:
1) Add the Local Board.txt to the project, and add the below line into it:
build.vm.ignore_gdb_extra_flags=1
2) Add -g2 to the vMicro > Project Properties > (Micro General Section) > Extra Flags
3) Then run Build > Clean Solution and rebuild and re-upload the project

Does this help to resolve the issue?


This fixed it! Thank you Simon!
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2697
Joined: Feb 13th, 2019
Re: STM32 L4RE - GDB Memory Exhausted
Reply #5 - Feb 8th, 2023 at 5:38pm
Print Post  
Glad to hear, hopefully the next STM32 Board Package version has an updated version of GDB (11+) which should also resolve the issue.

We will review the -g3 flag addition in vMicro as well in the coming weeks and update if there are any changes in this area.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint