link.icf 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*###ICF### Section handled by ICF editor, don't touch! ****/
  2. /*-Editor annotation file-*/
  3. /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
  4. /*-Specials-*/
  5. define symbol __ICFEDIT_intvec_start__ = 0x08000000;
  6. /*-Memory Regions-*/
  7. /*
  8. * IMPORTANT: Please check your specific chip's datasheet for correct memory sizes.
  9. * The following values are for a GD32E230 with 64KB Flash and 8KB SRAM.
  10. */
  11. define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
  12. define symbol __ICFEDIT_region_ROM_end__ = 0x0800FFFF; /* 64KB Flash */
  13. define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
  14. define symbol __ICFEDIT_region_RAM_end__ = 0x20001FFF; /* 8KB SRAM */
  15. /*-Sizes-*/
  16. /*
  17. * The CSTACK is used for main function before scheduler start and for interrupt handlers.
  18. * The HEAP is the C library heap, which is rarely used in RT-Thread.
  19. * RT-Thread uses the remaining RAM for its own dynamic memory heap.
  20. */
  21. define symbol __ICFEDIT_size_cstack__ = 0x400; /* 1024 bytes, a safer size */
  22. define symbol __ICFEDIT_size_heap__ = 0x100; /* 256 bytes, can be smaller */
  23. /**** End of ICF editor section. ###ICF###*/
  24. define memory mem with size = 4G;
  25. define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
  26. define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
  27. /* Remove the non-existent RAM1 region */
  28. /* define region RAM1_region = mem:[from __region_RAM1_start__ to __region_RAM1_end__]; */
  29. define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
  30. define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
  31. initialize by copy { readwrite };
  32. do not initialize { section .noinit };
  33. /* Keep RT-Thread FinSH command symbols */
  34. keep { section FSymTab };
  35. keep { section VSymTab };
  36. keep { section .rti_fn* };
  37. place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
  38. place in ROM_region { readonly };
  39. place in RAM_region { readwrite,
  40. block CSTACK, block HEAP };
  41. /* Remove placement in the non-existent RAM1 region */
  42. /* place in RAM1_region { section .sram }; */