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.

How to access external memory connected to TM4C1294XL

Hi,

We are using TM4C1294XL processor and connected 64 MBytes of memory with SSI1 port (Same port with which SD card can be connected).

I have tried SSI with uDMA using SSI1 or SW channel but still not able to perform read/write operation. 

If possible can anybody help me to understand how to create directory structure in this memory like we create in SD card?

Any suggestions how to achieve this?

Using CCSV6 for development.

- Bhavesh

  • Hello Bhavesh,

    If it is a serial Flash like the Macronix that you have connected the following post would help you in first checking if the devices are communicating.

    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/385512

    Regards
    Amit
  • Hi Amit,

    Thanks for replying. I have gone through the code and made the changes for 1294NCPDT board as for us the memory is connected via SSI1 port.

    We have connected S25FL512S 512 Mb memory chip from Spansion. As per the data sheet suggests first three bytes as below:

    Byte Address || Data                || Description

    00h                  || 01h                  || Manufacturer ID for Spansion
    01h                  || 02h (512 Mb) || Device ID Most Significant Byte - Memory Interface Type
    02h                  || 20h (512 Mb) || Device ID Least Significant Byte - Density
    03h                  || xxh                   || ID-CFI Length - number bytes following. Adding this value to the current location of 03h gives the address of the last valid location in the ID-CFI address map. 
    04h                  || 00h (Uniform 256-kB sectors)  || Sector Architecture
    05h                  || 80h (FL-S Family) Family ID

    Function SSILibSendReadIDAdvMode() returns 0x0119 instead of 0x0220 as mentioned in the datasheet. Does this make any significant change if we run the same code on different 1294NCPDT board with same configuration?

    Anyway, this indicates that we are able to access the memory.

    Next query is how to perform read and write operation to particular memory address and page via command?

    If you can guide me on this it will be very helpful.

    Thanks,

    Bhavesh

  • Hello Bhavesh

    Did you check the code in the post below (also mentioned earlier) That would contain the code for Device ID check as well.

    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/385512

    Regards
    Amit
  • Hi Amit,

    I tried with the code provided in the above link but it is sending manufacturer Id as 0x0119 instead of 0x0220 as mentioned in the data sheet.
    For Macronix memory does the code provide the exact manufacture id?
    About the paging and memory access I have not tried as got into some issue with Ethernet communication. My question is how to validate the paging and data transaction occurring into and from memory? In the post I did not find relative information on this.

    Thanks,
    Bhavesh
  • Hello Bhavesh

    Please double check the data sheet from Spansion.

    http://www.spansion.com/Support/Datasheets/S25FL512S_00.pdf

    It is supposed to return 0x0119

    Regards
    Amit
  • My bad. I was seeing the Field Definitions table (Table 11.4) and from there I was getting impression that is it should return 0x0220.
    Thanks for clarification.

    Next query is how to validate paging and Read/Write operations. Means from which address have to check the data in memory.

    Thanks,
    Bhavesh
  • Hello Bhavesh,

    The example code will do the same for address 0x00 for 256 bytes. Based on which location set you want to access you will need to change the Address during Program, Erase or Read operation commands to access the appropriate section of memory.

    Regards
    Amit
  • Thanks for the reply Amit. I will check and update the post.
    Currently trying to solve other issue happening with getting time stamp from server. Once this resolves I will check the memory part.

    - Bhavesh
  • Hello Bhavesh,

    I would approach with the smaller more manageable pieces. Makes block/debug more manageable.

    Regards
    Amit
  • Hi Amit,

    I am successfully able to read and write in to memory.

    But I am facing an issue. I am trying to write and than 32-bit (uint32_t) in to memory, but when Its writing and reading only last byte of data. This is due to following line in the code.

    SSIConfigSetExpClk(SSI1_BASE, ui32SysClockFreq, SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 1000000, 8);

    Here last value defines No of bits transferred per frame. If I change this to 16, it is not giving Correct Device ID. As per spmu298a this value can be in 4 to 16. 

    I want to avoid parting 32 into four 8-bits of data and again read 4 bytes and create 32 bit. Is there a way to read and write whole 32-bit of data?

    Thanks,

    Bhavesh

  • Hello Bhavesh,

    If you are using Advanced modes then only 8-bit is possible.

    Regards
    Amit
  • Hi Amit,

    Reading and writing in the memory with 8-bit is done. Its taking time but still within the threshold so manageable.

    But I am facing one weird problem with the Spansion S25FL512S 512 Mb memory.

    I am trying with Bulk Erase command to clear entire flash content but its not erasing and keeping old values (using commands 0xC7 or 0x60). Also Erase 256 kB (4-byte address) command (0xDC) not working. Only Erase 256 kB (3- or 4-byte address) (0xD8) is working and it does not erase full memory.

    Do you have any idea why erase commands not working as expected. I checked data sheet and I am not able to figure out if Protection bits are set or no.

    Added Code zip file for more reference.

    Memory_board.zip

    Thanks,

    Bhavesh

  • Hello Bhavesh,

    Can you read the status register and check what is the value of the BPn bits? They should be all 0's

    Regards
    Amit
  • Hi Amit,

    The code which is in zip file, in "TM4C129_SSI3_MacronixFlash.c" file. Status Register 1, at line 194 is showing 0x02. In while loop also it is showing as 0x02 for 2 times and on line 199 its coming as 0x00. After that Flash command is executed.

    But again command 0xD8 is working but other three (0xDC, 0xC7 or 0x60) are not working.

    Thanks,
    Bhavesh

  • Hello Bhavesh,

    I have a Macronix and Windbond serial flash (not spansion for the obvious reasons), and I checked full chip erase to work fine on both of them. Could there be some quirk of the Spansion Serial Flash that support @ spansion would be able to help you out?

    Regards
    Amit
  • Amit Ashara said:
    support @ spansion

    Finally!

    Cannot imagine forum crue @ brand "s" would devote such time/effort to brand "t's" devices.

    Is this still a brand t based forum?   (one must ask)

    Would not development of long needed ASM code library trump, "divert to solve other maker's issues?"

  • Hello cb1,

    All other command's as stated by the Poster work fine except Chip Erase. That would mean that TM4C has been configured correctly to work (albeit the chance that for Chip Erase configuration is not done correctly). Hardware connections ought to be fine to reach any functional success. Now if there is a device related issue/quirk that I am not certainly aware of I would have to point to the manufacturer (Recent Invensense issue of recommended Pull Up for I2C being an example).

    I didn't mean to be rude to any forum user, but at times it is necessary to correct the direction of a post. Apologies if you or other's think otherwise else.

    Regards
    Amit
  • Amit Ashara said:
    I didn't mean to be rude to any forum user, but at times it is necessary to correct the direction of a post

    No one has suggested that you have ever been "mean" to a poster.   However - both several (here) at my client (et moi) all thought that poster had definitely, "crossed the line" from TM4C based to "brand S specific!"  

    Now you have supplied known good code for very similar devices (from others) does that mean that you will resolve each/every, "external vendor's" device issue?  

    Some limits must be set - and multiple "unfinished tech issues" more directly impacting TM4C-centric issues - remain incomplete.  (or awol)   And - "monkey see - monkey do" - does not this (full) acceptance of a, "Well beyond TM4C issue" encourage multiple others - to make very similar (NON TM4C-centric) postings?   Can that be good?

    As stated - extremely doubtful that (other) brands would assist those w/ brand t issues.   (suspect for good reason...)

  • Hi cb1/Amit,

    No offense but just wanted to make sure that commands are properly invoked from Processor and there is no issue from TI board.

    As Amit mentioned one of the command is working means Processor is able to invoke command properly. Also other memory chips are working so no doubt processor is able to execute commands.

    For other commands, memory chip might need some extra settings/quirks to be done. I have searched and tried all possible ways but was not able to get the thing done as expected so question was raised.

    Meanwhile I will check with Spansion guys and will keep this updated.

    Thanks for your suggestions and guidance.

    - Bhavesh

  • Hello Bhavesh,

    Thank you for taking our arguments constructively. We can try to assist as much as possible. May be an independent code/document review by one of my colleagues may help as well.

    Regards
    Amit
  • @Bhavesh,

    We must keep in mind that - unlike the past - forum here has devolved into "Lone Ranger."   (Amit)   Thus - any post which requires him to make an in-depth read/review of another maker's device necessarily subtracts from his time available for "pure" TM4C issues.

    As stated - several here believed that your questions would have been better directed to your memory vendor - not here.  And that was a fairly obvious tack - was it not?

    Amit's focus is best when it serves his (proper) TM4C centric issues.   If that's to be breached - when, where and just how do we, "Draw the line." 

  • Finally got resolution for this issue.

    There was a little mismatch of signals happening for Erase command to work with Spansion memory.
    There is a different set of arguments to had to be passed for Block erase and Full erase. Also CS down duration required for executing commands are also different.

    There was a piece of code which was changing CS value just after sending of Erase command and thought that Erase is completed. Unlike Read and Write commands, Erase do not notify to calling function. It changes the Busy bit in status register after Erase is successfully completed.
    So I have inserted polling to check this bit and was able to get desired result.

    Thanks for your patience and helping.

    - Bhavesh
  • Hello Bhavesh

    And I think my original code did the same as well!!!

    Regards
    Amit