We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,all friends:
I declared a constant arry :
unsigned char index_htm[1108] = { 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0d, 0x0a, 0x0d, 0x0a, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0d, 0x0a, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x68, 0x74, 0x74, 0x70, 0x2d, 0x65, 0x71, 0x75, 0x69, 0x76, 0x3d, 0x22,........}
I want IDE place the constant index_htm[] in flash rom, how can I do?
can I use "const unsigned char index_htm[1108] =..."?
My chip is lpc2378.
Its my IDE below: /*****************************************************/ IDE-Version: Keil uVision3 V3.80
Tool Version Numbers: Toolchain: RealView MDK-ARM Version: 3.50 Toolchain Path: BIN40\ C Compiler: Armcc.Exe V4.0.0.524 Assembler: Armasm.Exe V4.0.0.524 Linker/Locator: ArmLink.Exe V4.0.0.524 Librarian: ArmAr.Exe V4.0.0.524 Hex Converter: FromElf.Exe V4.0.0.524 CPU DLL: SARM.DLL V3.50 Dialog DLL: DARMP.DLL V1.44 Target DLL: ..\TKScope\UL2ARM_TKSCP_DRV_ARM_for_uV3.dll V1.37 Dialog DLL: TARMP.DLL V1.44
/***************************************************/
I am confused, help me ,pls.
I am sorry My bad english .
I am waiting for ur answers.
tip:
if you initialize your array complete, you do not have to set the size, you can just use array[] = { values };
If you do not want to count all the elements and you know that i.e. 0x00 is no possible value in the array you could use that as end value
while(val != 0x00) { ... }
or, in this case: while(array) { ... }
BR, /th.
Thank Thorsten de Buhr very much. I thunk nobody answer me . You are intense,thank you.
I have another confused problem,help me,pls.
I compiled the project in Keil uVision3,and I want to know the place (the array after compiled be in address in flash) .
i.e. how can I find the place(address) after
const char index_htm[]={0x02,0xda,...}
be compiled? I found the project.map file,but I cant find the address of the compiled array in flash.
Is there a reason why you need to know the location of this variable?
When running the application, the name of the array equals the address, so your program don't have a problem knowing where it is located.
I just want to find the variable is in flash or in ram.
Print the address and compare with the address region for the flash.
Or make sure that you have enabled map files, and then check the address of the symbol in the map file.
Hi,
sorry for the delay, I hope you are still reading (mail reminder :-)
this should be easy. Type index_htm into the memory window when debugging, and it will show you the location.
Or, because index_htm is already the address :-), so you should be able to do a printf on this. The address of a specific value you will get via
printf("\nAddress: 0x%08x", &index_htm[number]);
or just search the map file for "index_htm"