Showing results for 
Search instead for 
Did you mean: 

Is it possible to load an array data while debugging?

Associate II


I would like to know if is it possible to load an array data (from a text file or something like that) while debugging.

Imagine to have the array 

int data[100];

I would like to be able to fill it (while debugging) with values generated by me.

Is there a way to do that?


Thanks in advance



ST Employee


What do you mean by "from a text file or something like that"?

int data[100] will consumes 400 bytes (4*100). So you need to take care about the RAM size of your device.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Uwe Bonnes
Principal III

In the debugger, commands like "p data[0] = 0x1234567" will write to the array. Gdb can work with scripts, so create a script with the values you want and run that script.

I mean that I would like to load in my array data created by excel to simulate the acquisition.

Anyway, I have enough RAM to create some constant array already filled with my data and use them

Thanks for your help

Associate II

I'll try them thanks

With Python and probably Excel, you should be able to generate such a script.