@@ -25,7 +25,8 @@ user_sram_org = HPSRAM_START;
2525user_sram_size = (user_sram_end - user_sram_org);
2626
2727/* Aliases */
28- #define CACHED_REGION mmap0_0_seg
28+ #define FLASH_CODE_REGION irom0_0_seg
29+ #define RODATA_REGION drom0_0_seg
2930#define RAMABLE_REGION sram0_0_seg
3031#define ROMABLE_REGION FLASH
3132
@@ -38,7 +39,7 @@ user_sram_size = (user_sram_end - user_sram_org);
3839/* Flash segments (rodata and text) should be mapped in the virtual address spaces.
3940 * Executing directly from LMA is not possible. */
4041#undef GROUP_ROM_LINK_IN
41- #define GROUP_ROM_LINK_IN (vregion, lregion ) > CACHED_REGION AT > lregion
42+ #define GROUP_ROM_LINK_IN (vregion, lregion ) > RODATA_REGION AT > lregion
4243
4344/* Make sure new sections have consistent alignment between input and output sections */
4445#undef SECTION_DATA_PROLOGUE
6566
6667 sram0_0_seg (RW) : org = user_sram_org, len = user_sram_size
6768
68- mmap0_0_seg (R) : org = CACHED_ORG, len = CACHED_SIZE
69+ irom0_0_seg (RX) : org = IROM_SEG_ORG, len = IROM_SEG_LEN
70+ drom0_0_seg (R) : org = DROM_SEG_ORG, len = DROM_SEG_LEN
6971
7072 lp_ram_seg (RW) : org = LPSRAM_IRAM_START,
7173 len = 0x2000 - RESERVE_RTC_MEM
@@ -770,7 +772,7 @@ SECTIONS
770772 __rom_region_end = ABSOLUTE (.);
771773 _etext = .;
772774
773- } GROUP_DATA_LINK_IN (CACHED_REGION , ROMABLE_REGION)
775+ } GROUP_DATA_LINK_IN (FLASH_CODE_REGION , ROMABLE_REGION)
774776
775777 /* --- END OF .flash.text --- */
776778
@@ -782,12 +784,6 @@ SECTIONS
782784 . = ALIGN (CACHE_ALIGN);
783785 } GROUP_LINK_IN (ROMABLE_REGION)
784786
785- .flash .align_rodata (NOLOAD) :
786- {
787- /* Subsequent segment lma and vma align */
788- . = ALIGN (CACHE_ALIGN);
789- } GROUP_LINK_IN (CACHED_REGION)
790-
791787 /* Symbols used during the application memory mapping */
792788 _image_drom_start = LOADADDR (.flash .rodata );
793789 _image_drom_size = _image_rodata_end - _image_rodata_start;
@@ -844,7 +840,7 @@ SECTIONS
844840 *(.rodata_wlog )
845841 *(.rodata_wlog *)
846842 . = ALIGN (4 );
847- } GROUP_DATA_LINK_IN (CACHED_REGION , ROMABLE_REGION)
843+ } GROUP_DATA_LINK_IN (RODATA_REGION , ROMABLE_REGION)
848844
849845 #include < zephyr/linker/cplusplus-rom.ld>
850846 #include < zephyr/linker/common-rom/common-rom-init.ld>
@@ -864,7 +860,7 @@ SECTIONS
864860 . = ALIGN (4 );
865861 _rodata_reserved_end = ABSOLUTE (.);
866862 _image_rodata_end = ABSOLUTE (.);
867- } GROUP_DATA_LINK_IN (CACHED_REGION , ROMABLE_REGION)
863+ } GROUP_DATA_LINK_IN (RODATA_REGION , ROMABLE_REGION)
868864
869865 /* --- END OF .rodata --- */
870866
0 commit comments