This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM7 big table and printf trick

the task is to place a big( 32kb or more ) table in the flash. and code should access it. i use the scf file to place the table on extern flash

here is my code:

(1-1)table.c

#include "table.h"

const struct Pair able[1000]={

{ 222, 33, 6 },
{ 222, 33, 3 },
// long list
};

(1-2)access_table.c

#include "table.h"
exten const struct Pair able[1000];

void dosomething(void)
{ // read table contents
}

(1-3)main.c

#include "access_table.h"

main()
{ dosomething();
} //-------------------------------------
the above code work fine.

then i change to place a big while.

(2-3)main.c

#include "access_table.h"

main()
{ while(1)
{ dosomething();
} }

//--------------------the program will not run to dosomething(), it dosen's reach the table.
but if i

(3-3)main.c

#include "access_table.h"

main()
{ while(1)
{ XX_prinf("somewords"); // XX_printf is the lib function by mcu vendor dosomething();
} }
and place the print function in the dosomething().
-------------then the program should run ok!

so the problem is. with a big table. the program can't run OK, but insert printf, it is ok.

the program can run on other C IDE well. so i think it is the problem for arm and mdk. may be the link process.

so any help kindly form any one of your dear reader??

0