Questions (ADSP-21479) .ldr file:generating and wrting to SPI Flash

Yesterday, I asked the question about deleting the ext Segment/Section in my LDF file. Because I haven't got answer yet, I tried to delete all the part from "#if defined(USE_SDRAM" through "#endif //USE_SDRAM". And then I built it and didn't get error message, so I suppose it is ok.

And then I built the ldr file from the created .ldf file with the attached setting. In the setting, I selected Debug in the "settings for configuration" for the .ldf file and .ldr file, (because I first want to run it per the SUB-ICE after it is writen in to the SPI Flash Memory in the developing board). Is it correct?

My another question is how to write the .ldr file into the SPI Flash Memory in my developing board? In VisualDSP++5.0, there is Flash Programmer... in Tools, but I don't know if it work for SPI Flash Memory. If it does, can I use it for my developing board on which there are TJAG port for ADSP-21479 via USB-ICE, USP interface with VDSP++, and a SPI Flash Memory connected to the ADSP SPI port on board? If I can't use it for writing the .ldr file into the SPI Flash, would you please give me other ways for this task, or some example code (better in C) for the .ldr file writing?

yes, you can edit the LDF as you see fit. If any of the memory sections mentioned in the MEMORY{...} map do not exist on your target (e.g. SDRAM), you can remove the corresponding entry from the memory map.

Note, though, that you will also need to remove any 'output sections' that map code/data to that block of memory. e.g. the LDF may contain entries like the following:

seg_sdram_code_sw SW

{

INPUT_SECTIONS( $OBJECTS(seg_ext_code) $LIBRARIES(seg_ext_code))

// place code we couldn't link internally into SDRAM

INPUT_SECTIONS( $OBJECTS(seg_swco) $LIBRARIES(seg_swco))

INPUT_SECTIONS( $OBJECTS(seg_pmco) $LIBRARIES(seg_pmco))

} > seg_ext_swco

This maps to 'seg_ext_swco', so you would need to delete this if you deleted the "seg_ext_swco" entry from the memory map.

In the default LDF the external memory sections are typically wrapped in "#if defined(USE_SDRAM)" conditions. If "USE_SDRAM" is not defined under "Project Options: Link: LDF Preprocessing", then the Linker should never attempt to use this memory.

I have deleted the external Segment/Sections from the Memory Map window.

When I try to delete the relative contents in the LDF file, I still have question. In the LDF file, the statements about the external SDRAM starts from " #if defined(USE_SDRAM)" at Line347. I am not sure if I need to delete some statements such as "reserve_ext_stack_and_heap" at Line363, ".bss_sdram-data" at Line375. And some statements include "if" structure or are part of a "if" structure, can I delete them with all the structure of the statement? Can I just delete the part from Line 347 through Line422?

(Right now I hope to see all the system booting work with the short testing code in short time, so our team could start the hardware design soon. Later I'll back to study the material about Linker with the real application code, so I may ask you more detail questions about its operation then.)

Attached is the LDF file for your consideration. This file was just modified by VisaulDSP when I deleted the ext Segment/Section. After get your answer for above questions, I'll modify it.

Thanks,

Ning

Attachments

my apologies for the delay in responding - hopefully you have experimented with this and found a solution. Either way; anything wrapped in a #if relating to SDRAM can be deleted. Obviously be careful not to delete ones that have a ! (not) symbol like:

#if !defined(USE_SDRAM_STACK)

stackseg

{

// allocate a stack for the application

ldf_stack_space = .;

ldf_stack_length = MEMORY_SIZEOF(seg_stak);

ldf_stack_end = ldf_stack_space + ldf_stack_length;

} > seg_stak

#endif

For those ones, once you have deleted the SDRAM blocks you can also delete the #if conditions.