Question how to place a specific part of code in SPIFI and have the other part executed from SDRAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Question how to place a specific part of code in SPIFI and have the other part executed from SDRAM

589 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cojanprins on Tue Feb 17 07:11:20 MST 2015
Hello,

I'm working on a project with the integrated WEB server. I have already the project running, booting is from SPIFI, execution from SDRAM. Everything works OK. What I want to achieve is to keep the HTML code in SPIFI (not necessary to copy them at startup into SDRAM, thus saving RAM space).

All my HTML files (automatically converted into C "const unsigned char" arrays) are included in html_list.c, so result of the linkers shows it as: (actually a lot more files are present).


.rodata.ENG_homerepl
                0x00000000      0x6dc ./html/html_list.o
.rodata.ENG_trylogin
                0x00000000      0x2e0 ./html/html_list.o

Is there any way to inform the linker to have all .rodata. from html_list.o to remain with the address range of the SPIFI?

Thanks in advance.

Cojan Prins (The Netherlands)
0 Kudos
Reply
4 Replies

578 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cojanprins on Tue Feb 24 00:30:59 MST 2015
OK, thank you for your reply, that's exactly the info I was looking for  :)
0 Kudos
Reply

578 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Feb 19 06:36:21 MST 2015
You are going to need to modify the linker script in a similar way to in this post...
http://www.lpcware.com/content/forum/running-cmsis-dsp-library-function-ram#comment-1138707

Regards,
LPCXpresso Support
0 Kudos
Reply

578 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cojanprins on Tue Feb 17 08:29:07 MST 2015
For now I have done it by adding folowing lines to the link-file. This works. But now I have all constants in SPIFI flash and all executable code (text) in SDRAM.

I would like to have it more specific, to have all rodata from a specific object file in a certain location in the SPIFI. The option mentioned in the article above describes how to do it for each individual procedure or declaration. I would like to do it for all procedures/declarations from ONE object file. Is that possible?

    /* All constant tables, HTML pages etcetera can remain within SPIFI flash to reduce SDRAM usage */
    .constant_data : ALIGN(4)   
    {
        *(.rodata .rodata.* .constdata .constdata.*)
        . = ALIGN(4);
    } >Flash_00

    /* Executable code should be copied from SPIFI flash into SDRAM for better performance          */
    .text : ALIGN(4)   
    {
         *(.text*)
        . = ALIGN(4);
    } >SDRAM_00 AT>Flash_00
0 Kudos
Reply

578 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Feb 17 07:34:09 MST 2015
Please read this FAQ:
http://www.lpcware.com/content/faq/lpcxpresso/coderodata-different-flash-blocks
0 Kudos
Reply