Forum Discussion
Altera_Forum
Honored Contributor
8 years ago --- Quote Start --- That's great. Unfortunately I do not have the knowledge to do that. Could you show me how you directed the linker to place only these certain sections of code in OCRAM (and which sections exactly). Are you using Much appreciated. David --- Quote End --- Sure. Here are the steps I took. 1. Edit BSP with an ocram private(you can use any name) sector. https://www.alteraforum.com/forum/attachment.php?attachmentid=14599 2. You need to edit the linker script of NIOS. For example:
Rest of the script...
.private : AT ( LOADADDR (.text) + SIZEOF (.text) )
{
PROVIDE (_alt_partition_private_start = ABSOLUTE(.));
*(.private .private.*)
. = ALIGN(4);
PROVIDE (_alt_partition_private_end = ABSOLUTE(.));
} > ocram_private
PROVIDE (_alt_partition_private_load_addr = LOADADDR(.private));
.rodata : AT ( LOADADDR (.private) + SIZEOF (.private) )
{
Rest of the script...
3. In C code, instruct linker to put function on private section, e.g.: __attribute__ ((section(".private"))) extern void write_page( ) 4. Edit bootloader(alt_load.c) to load that section memory, already a function available, just call: ALT_LOAD_SECTION_BY_NAME(private); Good Luck