Forums

TMS320C6000: read/write Flash Memory from Host PCI

Started by cucu 6 years ago5 replieslatest reply 6 years ago139 views

Hello

I have a board based on TMS320C64x. I am trying to read/write from/to ROM memory space through PCI BAR0 (I also change the DSPP based on my address). I could access to other memories (internal memory and even SDRAM). but haven't had any success to access ROM. anything I wrote and then read, I get 0xFF 0xFF 0xFF .....


here is my EMIFA values

EMIFA_GBLCTL, 0x00012070

EMIFA_CE1CTL, 0x73a28e01

EMIFA_CE0CTL, 0xffffff33

EMIFA_CE2CTL, 0x22a28a22

EMIFA_CE3CTL, 0x22a28a42

EMIFA_SDCTL, 0x57227000

EMIFA_SDTIM, 0x000007C7

EMIFA_SDEXT, 0x0005452B

I would be very grateful for any help.


Arash

[ - ]
Reply by BEBSynthesizersJanuary 9, 2017

Are you sure your Flash memory contains something?

A Flash which has been erased contains 0xFF in all bytes, so you are maybe reading this part of the Flash.

Now, without any further details about your schematics and how the Flash is interfaced with the DSP, it's simply impossible to help you more.

[ - ]
Reply by Tim WescottJanuary 9, 2017

I don't know the specifics of your processor, so I'm treating this like a general embedded question for some general hardware.

In addition to what BEB said, ask these two questions of yourself: first, are you doing anything special to write to flash, and second, does the memory system even allow you to "talk" to flash at all?

If the flash is internal to the processor (see how much I don't know?) then it may not allow reads through the PCI interface at all, or you may need to do something specific to make it so.  I have no clue at all what these "somethings" may be, but (given internal flash) would not be at all surprised to find PCI locked out of it either sometimes or permanently.

As to writing, flash always requires some special fandango to open it for writing.  It usually involves writing some sequence of patterns to some sequence of addresses (usually 0xaaaa and 0x5555 feature prominently). If your flash is external, then you certainly need to do this.  Moreover, you need to map what you write to the chips themselves: i.e., if you have 8-bit chips that need a byte written to 0xaaaa to open them for reading, and if you have a 16-bit system, then you need to write a word to 0x15555.

Have fun.  Expect frustration.  On a good day you'll churn and churn and churn and then things will suddenly work and you'll never quite know why.  In a bad year you'll start by thinking everything is working, but then it'll mysteriously fail on the manufacturing line or in the field.

edit: Having an oscilloscope or a logic analyzer on the various lines, and knowing how to use them, is a huge help.  Even when problems are entirely in software, actually seeing the waveforms can bring light to an otherwise dark and impenetrable problem.

[ - ]
Reply by sudheerg_January 9, 2017

Hi Arash,

Which chip select being connected to the FLASH Chip select signal. You need to see the memory map table in the C64X datasheet. You also need to make sure that proper timing values are programmed in the EMIFA Registers.

What is the type of flash being connected to EMIFA. If it is NAND flash then you need to follow some set of commands before reading. 

Please also refer the following TRM:http://www.ti.com/lit/ug/spru266e/spru266e.pdf and connect the logic analyzer to all Address pins and Control signals and check when you are performing a read whether the connected chip select line is triggering or not.

Say for example if /CE2 is connected to flash then when you are performing a read from flash then it should go to low, along with this AOE shall trigger. At this point note down what are the address value on the bus EA[20:1] or EA[20:3].


Best Regards,

GSR

[ - ]
Reply by cucuFebruary 9, 2017

Well it took a quite time to be approved in this site :)

I just wanted to thank everyone because of your detailed answers and sorry I didn't give enough information, I kinda new in this subject, and there are many things I still trying to learn, so sorry about that.

I finally managed to deal with this problem, as you said I should use a specific pattern of commands to communicate with the Flash. 

It may worth to mention the references I used in case anyone faced the same problem.

from this package

evmdm642/lib/evmdm642bsl/evmdm642_flash_erase.c

evmdm642/lib/evmdm642bsl/evmdm642_flash_write.c

evmdm642/lib/evmdm642bsl/evmdm642_flash_read.c

evmdm642/examples/bsl/test/test.c

and also this document

http://www.ti.com/lit/an/spra568a/spra568a.pdf


Arash

[ - ]
Reply by stephanebFebruary 9, 2017

Sorry Arash that it took so long to approve your membership - this isn't typical, there was a glitch in the system.