2014-03-04 08:15 AM
hello everyone, I have problem about memory
I download source code ''better string lib'' and I just add 3 C file to project, when I built no error happen, but I want to know exactly result then I debug, and program not complete, not enough memory for program. Although I increase the stack and heap size in startup_code file but nothing change my project use keiluvision4 and st-link debugger thank and regard! #too-vauge2014-03-04 08:28 AM
Ok, but what part are you using? How much memory is in that part? And how much is your project using for data/code? How much memory does the code dynamically allocate, and how large are the local/auto variable requirements?
Check the .MAP file Are you using a code limited evaluation version of the compiler/debugger?2014-03-04 08:31 AM
Hi
You have probably run out of Flash space to store your program binary. String libraries tend to be large.2014-03-04 08:43 AM
I know .MAP file but I have never check memory code dynamic allocate, I don't have experience to do like your advise, can you make it more clearly
STEP BY STEP if you have free time2014-03-04 09:24 AM
'' when I built no error happen, but I want to know exactly result then I debug, and program not complete, not enough memory for program.''
''Are you using a code limited evaluation version of the compiler/debugger?'' First - are you using the code size limited version of Keil? From your initial comments - it sounds like Keil has failed to compile/link binary because it has detected out of memory. Can you post the exact error message? ''I don't have experience to do like your advise, can you make it more clearly STEP BY STEP if you have free time'' If Keil has managed to compile and link, it will then update the map file. If it has been updated - can you upload it?2014-03-04 10:45 AM
For ones own algorithms you should be able to estimate dynamic memory usage and expectations.
In the more general sense one could instrument malloc()/free() utilization and generate metrics for size and frequency of usage, maximum total allocations, and life span, and track issues like fragmentation, leakage and multiple releases. If you are unfamiliar with such things, you could try modelling the behaviour on PC based builds of the code, and with good approximations of the data being processed.2014-03-04 06:27 PM
I already done on PC and it's ok
just on micricontroller not enough memory2014-03-04 06:42 PM
I already done on PC and it's ok, just on microcontroller not enough memory
If you had modelled it effectively you'd know how to quantify ''not enough''2014-03-05 01:04 AM
Hi huy.truong,
It is hard to really understand what kind of problem you have. If it works on PC it certainly does not need to work on MCU.If this is a dynamic allocation problem:Check all malloc() in the code and find out the number of bytes allocated in each call.If this is a stack problem:Take a look at all the functions and make sure that you are not allocating large number of bytes on the stack.e.g.char temp[100][10];orvoid function(temp[100][10])etc.If this is a problem with static code memory:Check output file size.Regards,/rygelxvi2014-03-05 07:32 AM
hi rygelxvi
my project not use large number of byte on the stack, I use malloc to provide heap memory, I already increase Heap on startupcode file but nothing change