PnE GDB debug launch slow, apparently dependent on size of .data segment

cancel
Showing results for 
Search instead for 
Did you mean: 

PnE GDB debug launch slow, apparently dependent on size of .data segment

340 Views
troybeauparlant
Contributor I

Hello All,

 

To summarize, I am having issues with a PnE GDB debug session taking an unreasonable amount of time to launch which appears to be dependent on the size of my .data segment.

 

My details are I am using KDS 3.0 and KDSK 1.3. I have a custom board with a K64F family of processor that uses the flexbus to connect some external SDRAM. In my linker file I defined a new memory segment m_flexbusram.

m_flexbusram      (RW)   : ORIGIN = 0x60000000, LENGTH = 0x04000000

in my project I define a number of data buffers in the new region so they will be located on my SDRAM. In the format:

unsigned short BUFFER[SIZE] __attribute__ ((section(".flexbusram")));

This is when I first encountered my project freezing at 98% when I tried to launch a debug session. I believed it was truly frozen until I tried shrinking the size of all my buffers located on SDRAM. Experimenting, I found that the speed at which my  debug session launched was linearly related to the size of my buffers. While small, a project build reported my build size to be

text         data      bss         dec

206796   24408   117708   348912

at this size the debug session launches in seconds. Switching to use the desired sizes for my buffers, the build reports

text         data            bss         dec

206828   40804680   117708   41129216

and at this size the session requires about 90 minutes to launch.

Changing the buffer sizes between these two extremes results in linearly relative sizes of my .data segment and relative launch times for my debug session.

 

Once embedded on my board the software boots and runs just fine on power up, its the debug sessions which take lengthy amounts of time to launch. I'm trying to better understand what the GDB server is doing with my initialized data that it dislikes but I so far haven't made progress with my search results. I can include other pieces of the linker file I edited to create the new flexbusram region if anyone believes it is relevant but I wanted to avoid clutter above.

 

Any feedback or advice is of course appreciated!

Labels (1)
0 Kudos
3 Replies

198 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HI Troy.

Can you please create a demo project to show this problem?

I will test it directly from my side.

Thanks!


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

198 Views
troybeauparlant
Contributor I

Hi Jennie,

I have a TWR module, but do not have an external memory expansion so I can test my project on a common platform. I made an example on my custom board and am hoping it ports ok since the project is not using any custom hardware, just the K64F, the flexbus, and the SDRAM.

Similarly to my original post, I have a buffer which if set to a size of 100 compiles with a .data segment of size 324 and can build/download/launch the debug session in <1min. If I increase the buffer size to 1,000,000 the .data size is 2,000,124 and the build/download/launch process takes >4min

My original project has a .data segment of ~40,000,000 and requires about 90 minutes to launch, so holds true to the approximately linear behavior I have been observing.

Thanks for the help,

Troy

0 Kudos

199 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Troy.

I tried to test debug from my side but I met build error.

pastedImage_1.png

I use KSDK1.3. Can you please test your project on another computer, to see how it works?
Before my build, I perform IDE menu "project", "Clean..." to have a clean association.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos