Tool/software:
hello
I have a library compiled as .lib that I want to add in the SDRAM section of my main project that will run in FLASH. I want to add it in such a way that the .text section of the library goes to a SDRAM_CODE section and the .far section of the library goes to a SDRAM_DATA section.
The problem I am encountering is that when inside the main code the first function of the library is going to be used, the whole execution is stopped and the DSP is restarted.
As additional information I'm using CCS 2.21.00 and the same project with the same code works perfectly in RAM, but in FLASH I have the described problem.
The .cmd file of the main project in FLASH looks like this:
-stack 0x100 MEMORY { IPRAM_BOOT : origin = 0x00000000, len = 0x00000400 /* 1 Kbytes */ IPRAM_VECTOR : origin = 0x00000400, len = 0x00000200 /* 512 bytes */ IPRAM : origin = 0x00000600, len = 0x0005FA00 /* 382.5 Kbytes */ FLASH_BOOT : origin = 0x01400000, len = 0x00000400 /* Block 0, 1 Kbytes */ FLASH : origin = 0x1406000, len = 0x0009A000 /* Blocks 2 to 12, 616 Kbytes */ IDRAM : origin = 0x80000000, len = 0x00080000 /* 512 Kbytes */ /* SDRAM_DATA contains data */ SDRAM_DATA : origin = 0x02000000, len = 0x00500000 /* 5 MB */ /* SDRAM_CODE contains code */ SDRAM_CODE : origin = 0x02500000, len = 0x00300000 /* 3 MB */ } SECTIONS { .boot_load:{} load = FLASH_BOOT, run = IPRAM_BOOT .vector: {} load = FLASH, run = IPRAM_VECTOR .text: {} load = FLASH, run = IPRAM .cinit: {} load = FLASH, run = IDRAM .data: {} run = IDRAM .pinit: {} load = FLASH, run = IDRAM .switch: {} load = FLASH, run = IDRAM .bss: {} run = IDRAM .cio: {} run = IDRAM .far: {} run = IDRAM, RUN_START(far_run_start), RUN_SIZE(far_run_size) .stack: {} run = IDRAM .const: {} load = FLASH, run = SDRAM_DATA .slowmem: {} run = SDRAM_DATA .text_sdram_code: { library.lib (.text) } load = FLASH run = SDRAM_CODE .text_sdram_data: { library.lib (.far) } run = SDRAM_DATA } /* Custom Variables declaration * use without _ */ _v_far_run_start = far_run_start; _v_far_run_size = far_run_size;
Any kind of help or approach is appreciated.
Regards