This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294XL + TM4C129SDRAMNVM + lwip + compiler problem pragma

HI everyone !

It's a long thread's title but ... my configuartion is complexe ... but my problem should be easy to solve.

I'm working with CCS 6.1.1.00022  and the TivaWare's example v2.1.2.111

My TM4C1294XL card is plugged on this memory extansion : http://www.ti.com/tool/TIDM-TM4C129SDRAMNVM

The examples with the extansion board are working very well but when I loaded a biggest program, the accesses on this memory was to longs.

So i took the example lwip with one goal : put the program on the internal flash and put the web page on the external flash. Like that my program can run fast and acces just sometimes on the external flash when it's needed.

Here is my problem, the web page is stocked on the enet_fsdata.h file.All things of the web page are declared like that : 

static const uint8_t data_index_htm[] =
{
/* /index.htm */
0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68,
0x74, 0x6d, 0x00,
0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, ............

}

I want theses sections on the external flash so i wrote before this declaration this line #pragma DATA_SECTION (data_index_htm,".page").

I had the following MEMORY on the .cmd :  FLASHEXT (RX) : origin = 0x60000000, length = 0x00200000  

and the SECTION :     .page : > FLASHEXT

So i have : 

MEMORY
{
/* Application stored in and executes from internal flash */
FLASH (RX) : origin = APP_BASE, length = 0x00100000
//Web page in external memory
FLASHEXT (RX) : origin = 0x60000000, length = 0x00200000
/* Application uses internal RAM for data */
SRAM (RWX) : origin = 0x20000000, length = 0x00040000

}

/* Section allocation in memory */

SECTIONS
{
.intvecs: > APP_BASE
.text : > FLASH
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
.page : > FLASHEXT

.vtable : > RAM_BASE
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
}

Like that the gcc -makeall seems stuck on a loop and write me an enormous bin file (if i don't stop the compiler the size of the bin file is more than 1Go !)

So i modified the declarations like that : static uint8_t data_index_htm[] = { [code] }

Like that it's compiling well and i see on the memory browser parts of my web page are on the external flash but ... in the internal flash too ...

If I don't put pragmas all the page is on the internal flash under the .const. When i put the pragma all page on the external flash is under .page(normal here) but on the internal flash the page is now under .cinit ???

I don't understand what is happening here that is confusing me...

Memory adresses of the external flash are the same than the example which is working on it.

I guess i missed something basic here (first time i'm doing something like that).

Edit : The datas are going on the .cinit when if moove out the "const" but the pragma unlike it ... what to do ?

Edit2 : Other variable i test are ok, they are going on the external memory and no bugs of compiler. Problem seems to be with the enet_fsdata.h

Anyway, thanks for the read and maybe the answer :)

Regards,

John

  • polopolo tyty said:
    Like that the gcc -makeall seems stuck on a loop and write me an enormous bin file (if i don't stop the compiler the size of the bin file is more than 1Go !)

    polopolo tyty said:
    /* Application stored in and executes from internal flash */
    FLASH (RX) : origin = APP_BASE, length = 0x00100000
    //Web page in external memory
    FLASHEXT (RX) : origin = 0x60000000, length = 0x00200000

    Memory starts at 0 (or close enough for a quick estimate) and ends at 0x60200000 so your total length is 1535MB. Binary files cannot have gaps.

    You could

    • Create two binary files with different starts
    • Create a hex file (hex files can have gaps)

    Robert

  • Hi Robert,

    Thank you about your answer. You are right, when i let the gcc complete his work the bin file is arround 1.5 Go.

    But something seems strange to me. When i'm using a pragma on my main.c, the gcc makes me a binarie file ...very strange. The size of the bin file is arround 1Mo but when i'm looking on memory browser the flash internal and external contain both my web page.  

    Anyway, I will try your solutions now.

    Thanks again really unstucked me.

    Best regards,

    John