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

Hello,

Thank you Amit and Sai to answer me. I created this new thread because I have to join some files which will be very hard to read if i copy and paste them.

To resume, i have a problem to run an application on the internal flash of the TM4C1294 which read some datas on an external SDRAM.

My problem doesn't seems to be on the adressing but on the communication with the EPI stack. When i'm not initialising the EPI stack, i have a timeout on my internet browser when i'm trying to connect on the IP.
When I initialise it when the code contained on the sd_card_bootloader example I get the " 404: the requested file cannot be found" when I connect to the page.
I suppose i forgot something which seems really basic to you but i really don't see what i missed. I checked the clock frequency, the pins and the librairies but don't find the problem on these things. So i guess I missed a basic thing on it.

I join you the code of the cmd and the main if you thing i didn't miss something basic and want to help on it anyway. For the main i suggest to you to include your own librairies because i changed the way of 2-3 of them. I just included the initialisation of EPI on the lwip example by the way.

files web_server.rar

I joined the enet_fsdata.h file if you need.

Thank you by advance.

Best regards,

John

  • John73 said:
    I join you the code of the cmd and the main if you thing i didn't miss something basic and want to help on it anyway. For the main i suggest to you to include your own librairies because i changed the way of 2-3 of them. I just included the initialisation of EPI on the lwip example by the way.

    Looking at the project shows that constant data has been placed FLASHEXT memory region which is in the external SDRAM.

    This means that when the program is loaded the external SDRAM needs to be enabled to correctly write to the external SDRAM.

    For this to work when downloading the program using the CCS debugger this means the the external SDRAM would need to be enabled before the program is downloaded, e.g. from a GEL script. In which case, the SDRAM EPI initialization should probably be removed from the application as re-initializing the SDRAM EPI may corrupt the contents of the SDRAM.

    Also, trying to load constant data into SDRAM means that upon a power-on reset, the SDRAM wouldn't be initialized.

  • Hello Chester

    The original issue that John was facing was found to be the access of SDRAM from EMAC. The SDRAM is not in the mapped address space of EMAC, as a result the EMAC cannot fect the descriptors. By moving the buffer mgmt to the internal SRAM and code space to the external SDRAM, the Webserver works fine.

    As you mentioned the placement of constant into SDRAM will cause issue, the original reference design uses a SD Card Loader to copy the program from SD Card to SDRAM after configuring the SDRAM.

    Regards
    Amit
  • Hi Chester Gillon,

    Thank you about theses precious informations !

    As said Amit, usually the SDRAM is initialised by a bootloader from SD card. So if all is working well i want to boot on the bootloader which will program the SDRAM and after that will boot on my other application on the flash.
    I had some issues to do this so I tried to program my application and these data without the bootlaoder to fix issues with a less complexity.
    I already changed the map of SDRAM and the program on the flash is working well here, my problem is only on the communication with the SDRAM.
    I will disable the initialisation of EPI stack to fix the corrupt as you said, but any idea where i can find a script like that ? Or a way to start to program this script ?

    Thank you.

    Best regards,
    John
  • Hello Amit,

    I already fixed this issue and the step where was stuck the program is unlocked, so working fine.
    As you said, there is some issues to place constant into SDRAM and this is the problem which I'm facing. Do you have any idea how to fix it ?

    If it cannot be fix, that can be a problem because when we will need a bigger size of program and will have to make this extend, we will lost half of the execution speed. The programs which requiere a bigger memory should be, most of time, the programs which need the faster speed.

    Am I right to think that or am I completely confuse ?

    Thank you.

    Best regards,
    John
  • Hello John,

    It is not the size of the program, but the place where the EMAC DMA can access the system. I still think you can have larger programs with the Buffers still in SRAM. With the buffer in SRAM for TX and RX, the EMAC can process the descriptor while larger pages/program still reside in the SDRAM

    Regards
    Amit
  • Hello Amit,

    I think i get what you want to say. the principe is understood but I have completely no idea how to do that, can you advice me a starting point to make it works with the buffers please ? My student skill doesn't permit me to do that without help.

    Thank you,

    John
  • Hello John,

    Only the SRAM needs to be remapped from SDRAM address space to the on chip SRAM buffer. The FLASH section of the project can still reside in the SDRAM address space, and that is where the web page is loaded.

    Regards
    Amit
  • Hello Amit,

    I agree with you about this point but is it possible to make a program with a size of 2 MB with 1MB on the internal flash and 1MB on the external flash ? If yes, how to do it ?

    Regards,
    John
  • Hello John,

    Yes it is possible to do so by creating sections in the cmd file. However the flasher does not understand it and needs to have a custom exe file that can extract the information from the bin file and create 2 bin files. One gets flashed internally and one externally. It is complicated but can be done.

    Regards
    Amit
  • Hello Amit,

    Idid a little software to do that. So I have on my flash the bootloader example to bootload the external memory and my program except the const part (which will go on the external).

    To do that I put the bootload on the start of the memory and after it copied the SD card content into the external memory it calls the program on the internal flash.

    To put the 2 programs on the flash I program the flash with the bootloader and after that I disable the erase of flash when programming and program with the bin file which have to go on the internal. The second bin file is on the SD card.

    Sometimes, when i'm programming again the internal flash i have to erase and start to reprogram from the start. (If you know why it's doing that it can be good to learn to me). Anyway the bootloader and the program are booting well but I still cannot acces to the datas on the external memory, I have the same message than before " 404: the requested file cannot be found".
    The program needs something more to communicate with the const on the EPI ?

    Thank you and sorry about my tortured english.

    Regards,
    John
  • Hello John

    There are 2 setting for programming the internal flash. The first is erase entire flash and second is erase only required sectors. I think the setting is set to the former, which is causing the issue.

    If the web page const is in the EPI, then you may need to relocate it internally.

    Regards
    Amit
  • Hello Amit,

    Thank you to answer me.

    I changed the parameter to erase only the needed sector but i don't understand what you means by " to relocate it internally".

    I can't put all the web pages const on the internal flash if it's what you are meaning because their size is more than 1MB.

    Best regards,
    John
  • Hi,

    Worth to search about the .hex file format - there is a good description at arm.com (at this moment I cannot paste the link, working from a mobile device) -  the brute force approximation about the real binary size is hex size divided by two, but really it is always less than that so your program of 1.5MB will fit in flash without any other SDRAM or sd_card. Unless your project has a strict requirement to use such, as exercise...

  • Hi Petrei,

    Thank you to answer.

    I already visited the way to use a hexfile, and it appears if i'm programming the TM4C with a hex file, an internal software is converting it on binarie file to write on the flash, so that will not work.

    Plus I have a non strict project actually but i know i will have bigger projects in futur with the same hardware, so I want to make it works still I'm on it. Like that I can have a working equipment with all projects. So it seems I have no choice here to go on the way of binarie file.

    Anyway your informations are good to take for me, never heard the powerfull of "size divided by two".

    Regards,

    John

  • Hello John,

    The request for the web page comes from external source. So when the new web page is requested for, you have to relocate the web page to a know SRAM area for viewing. It is tricky since memory space management is required.

    Regards
    Amit
  • Hello Amit,

    I understood what is needed but if we are doing it, the responding time will be very long no ? If I understood well, when the a page is requested I have to copy the page needed to the internal SRAM. After that my micro can finally send the HTML code. If an other page is requested, we have to copy the second page in internal SRAM and can finally send the HTML code of the second page.

    So if I understood well, to run with all the code on the external memory or with the program cut on two parts : one on internal flash and the other on the external flash, will change nothing on the respond time if the page resquested is on the external memory ?

    Regards,
    John
  • Hello John,

    Yes, that is correct. The response time would be slow, but would it change the user experience of being able to go through a large web page?

    Regards
    Amit
  • Hello Amit,

    Thank you to your answer.

    You right, since the webpage isn't to huge shouldn't change something, so i will pursue my project by putting all program on the external memory.

    You are very helpfull to my understanding, thank you again !

    Best regards,
    John
  • Hello John,

    Thank you for your patience. I can understand how annoying it can be if the access did not go the external SDRAM directly allowing for larger web pages to be stored.

    Regards
    Amit
  • Hello Amit,

    I have to thank you to about your patient with me and my student skill. I agree, it can be annoying but it permits me to learn about the TI product's.

    I actually did few tests on the external memory and I have to much respond time if I put all the program on external memory so ... I will have to put the part which is the more asked on the internal flash and an the other part on the external SRAM. As you said I have to relocate the web page to a know SRAM area.

    I know it's tricky and I'm always asking more ... but i completely don't know how "to relocate to a know SRAM area". Have I to write a function to do that or is it something to configure to do that or just a function to call ? After this problem solved, project will be ended.

    Thank by advance.

    Best regards,
    John

  • Hello John,

    The following link you may find useful

    processors.wiki.ti.com/.../Linker_Command_File_Primer

    Basically it allows to create an image that can be stored on Flash (or external SDRAM) and relocated to SRAM for run time.

    Regards
    Amit
  • Hello Amit,

    Thank you about this link, it contains some precious informations. I will work on it !

    Best regards,
    John
  • Hello John,

    It would be good if you can open a post on the CCS Forum as well or search CCS forum for similar relocatable code.

    Regards
    Amit
  • Hello Amit,


    I will do that, I thought my problem came from my code to start the EPI stack. In this case i will search and post if I don't find.

    Thank you again, it's very good to have an expert TI assistance on these tricky subject.

    Best regards,
    John

  • Hello Amit,

    I have a very fast question. As we said, my program lwip on external SRAM is slower then in internal flash. But ... Is it normal to have for the same page (arround 950 Ko) 5 secondes to load it from internal and more than 1 minute to load from external to a computer ?!

    Best regards,
    John
  • Hello John,

    950 KByte?

    Regards
    Amit
  • Hello Amit,

    Yes 950 KB, I know it's huge but i have to test the limits of this component on this application.

    Regards

    John

  • Hello John,

    Yes, it may take that much time depending on how the copy operation is being performed and what is the effective bandwidth on the link.

    Regards
    Amit
  • I have the same link so the time to copy from external memory to internal RAM can multiplie the respond time by 20 ? Is there no way to reduce this time by adding an other memory on modbus (not epi) or comething like that ?

    Regards,
    John
  • Hello John,

    How can the link speed affect the external to internal memory copy?

    Regards
    Amit
  • Hello Amit,

    I found nothing on the subject so I'm asking if it's possible before to search deeper how it could be. Anyway, thank you to your answer !

    Best regards,

    John

  • Hello John,

    I don't think a faster memory would help as EPI is cap'ed at 60MHz.

    Regards
    Amit