Hi Nitin, Attached is your "linker.cmd" file, modified to put the strings into P memory. The changes are shown below. In the MEMORY section: .pFlash2 (RX) : ORIGIN = 0x8000, LENGTH = 0x4000 .pConstFlash (RX) : ORIGIN = 0xC000, LENGTH = 0x4000 In the SECTIONS section: #***************************************************************************** .ApplicationConstData : { appconstP.c (.rodata) appconstP.c (.data) } > .pConstFlash #***************************************************************************** This reserves 16K words of P memory, from 0xC000 to 0xFFFF, for constant data in P memory. The file "appconstP.c" shows some examples of the strings we put into P memory. Also please see my message "[motoroladsp] Putting 'const' data into P memory" that was posted to the motoroladsp discussion group on Wed 02/10/02 at 6:35 AM. The ZIP file contains many functions for accessing strings that are located in P memory. I am posting this message to the motoroladsp discussion group, as other members may find this information to be useful. Regards, Art Johnson Senior Systems Analyst PMC Prime Mover Controls Inc. 3600 Gilmore Way Burnaby, B.C., Canada V5G 4R8 Phone: 604 433-4644 FAX: 604 433-5570 Email: http://www.pmc-controls.com -----Original Message----- From: Nitin Madhukar Yewale [mailto:] Sent: Sunday, November 24, 2002 10:28 PM To: Art Johnson Subject: Writing data directly into Program memory through linker.cmd file. Hi Art, I am using 56F827 in my project. I have huge constant data and I want to put in Program memory, I don't want to copy it to data memory. I have gone through your mail regarding "Putting 'const' data into P memory" and source code also. According to my knowledge following are the different ways to put data in Program memory. 1. Use #pragma use_rodata on/off to put in the same. 2. Select the settings under M56F8000 i.e. Make Strings Readonly. Apart from this I will have to change in linker.cmd file also. Please find attached source code which I am trying to do so. I want to put Error_Messages in program memory so that whenenver they require I will read them and display an error message. And also while accessing I can read the program memory contents using memreadP16 function. Could you please tell me what sort of changes I should made in the project file so that I can store data directly into Program memory ? Regards, Nitin | |||
|
RE: Writing data directly into Program memory through linker.cmd file.
Started by ●November 25, 2002