Part Number: AM2634-Q1
Other Parts Discussed in Thread: SYSCONFIG, UNIFLASH
This FAQ highlights how you make a datastructure to be stored in flash in AM263 microcontroller.
Typically we can do this in AM263Px and AM261x microcontroller where XIP support is there. But this can be done in AM263x as well.
Please see the following example where we are trying to store a const uint8_t array in flash.
- Create a const array called test_buffer. This buffer is kept initialised with some values.

- Create a section in linker where we intent to store test_buffer. The section should have load address as Flash.
- The sysconfig's memory configurator does not allow sections with just load address and run address as Flash. This is because XIP is not there in AM263.
So we will disable linker generation from sysconfig and will add our section manually.

Use the show generated files option in sysconfig to view the button to disabled linker script generation.
- Manually add the linker script in the project. The name of linker script is linker.cmd
- In the linker script, add a section to store the buffer like this

- FLASH_X is the section designated to store items in flash. This is also enabled in the MEMORY option of linker script.

- Now build the project. In the output folder (Release/Debug) folder we can see a file with the extension .mcelf_xip.
- This file has the contents that should go into flash. The .mcelf file will have the contents that will be copied to RAM from FLASH by the SBL.
- Now flash both the .mcelf file which is the application image and .mcelf_xip file using Uniflash GUI tool.
The .mcelf_xip file needs to be flashed at 0xE0000000 offset.

- After flashing, now run the application and check the flash offset where the array was kept. Or we can just search for test_buffer on memory browser.
