Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

Parallel Flash Problems

I have searched tediously through the forums for any help on this, and have tried a lot of different things.

I am using the same Flash chip as on the NIOS II Cyclone II Eval board on a custom design; the AM29LV128REI (16-bit design in 8-bit mode). When I run nios2-flash-programmer --debug, it reads the CFI table, however, only a few bytes are a wrong, and it always seems to be the same bytes. I tried extending the timings to make them longer, and this changes the results, but it's still not correct. Sometimes, when it reads it correct, I can't program it, I get verify errors.

I have used SignalTap to try and see what's going on, and it hasn't helped narrow down the problem. For example, when reading one of hte bytes from the CFI table, the address gets setup correctly, CEn goes low, then OEn a few cycles later. Sometimes, this doesn't produce the proper value; instead, the value shows up on the next cycle (address+1). On a 16-bit device in x8 mode, the reading of address and address+1 should be the same value. Since the software probably latches data in on the first reading, it is sometimes wrong.

Anyway, it's hard to picture this being a signal-integrity problem since it's such low speed, and it's not even that far away. Any hints on debugging this?

16 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by liangyi@Feb 23 2006, 01:50 AM

    hi,

    i look the flash schematic, nothing wrong.

    have you checked the flash soldering?

    does flash pins have short circuit?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=12910)

    --- quote end ---

    --- Quote End ---

    I am very good at soldering, and have also tried two different chips, so it is highly unlikely that I soldered it wrong twice. I will check this again of course.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by queisser@Feb 23 2006, 04:05 PM

    other than 0x5a, which other addresses fail?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=12925)

    --- quote end ---

    --- Quote End ---

    That&#39;s what is odd - the whole CFI table is correct except that address.

    here&#39;s some more info:

    I made my own independant Verilog core to read the whole CFI Table, no NIOS processor or RAM or anything else... and it reads it flawlessly multiple times. This would indicate some sort of Signal-integrity error... when I add the nios processor, DDR etc.. that&#39;s when that byte starts to go weird. But no highs peed components are next to the Flash, so I don&#39;t understand why it would be an SI issue.

    Here&#39;s something else: If I program the flash, it says verify failed... but I canr ead back the data and visually see that it matches what it should, so I think it&#39;s probably failing because of the same byte. If I had the source code to nios2-flash-programmer, it would help, but I don&#39;t. I programmed a .flash file with a boot copier in it, powered the board on, and it successfully booted and ran the code! I don&#39;t get why it&#39;s saying it failed then.

    All in all, this problem has too many contradictions!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by jdhar+feb 23 2006, 04:09 pm--><div class='quotetop'>quote (jdhar @ feb 23 2006, 04:09 pm)</div>

    --- quote start ---

    <!--quotebegin-queisser@Feb 23 2006, 04:05 PM

    other than 0x5a, which other addresses fail?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=12925)

    --- quote end ---

    --- Quote End ---

    I made my own independant Verilog core to read the whole CFI Table, no NIOS processor or RAM or anything else... and it reads it flawlessly multiple times. This would indicate some sort of Signal-integrity error... when I add the nios processor, DDR etc.. that&#39;s when that byte starts to go weird. But no highs peed components are next to the Flash, so I don&#39;t understand why it would be an SI issue.

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=12926)</div>

    [/b]

    --- Quote End ---

    Spooky!

    Can you put a signal analyzer or scope on the physical pins themselves and look at the timing difference between the plain Verilog and NIOS system?

    Also, is it clock frequency dependent?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Definitely spooky... unfortunately, I don&#39;t have access to tools such as LAs or Scopes... they would really be helpful now though! it seems more like the internal fabric fo the FPGA screwing things up. I would be extremely surprised if this were a pure SI issue since it&#39;s such low speed, and it&#39;s very close to the chip (about 1"). I think I&#39;m going to write my own flash programmer so I can see what is failing and what isn&#39;t; alteras Flash programmer doesn&#39;t give nearly enough info.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    ok, this just got really weird:

    I decided to make my own flash programmer using NIOS II, but without the HAL routines (just using IORD/WR_DIRECT). Since I have a x16 chip in x8 mode, I use the Write buffer command to write 16 bytes.. very simple. I wrote them starting at address 0x0, which is the reset address... if I write 16 bytes with NO 0xFFs, and reset the board, I can see the processor reading all 16 bytes correctly. However, if I program an 0xFF at byte location 3 for example, upon reset, all the other bytes EXCEPT 0x3 read correctly! This makes no sense! I&#39;m erasing the sector before programming... but for some reason, when it gets to the address location that I tried to program an 0xFF in, the data lines just go crazy. It reads all the other bytes with no errors.

    To get around this, I tried filtering out 0xFFs in code.. if I see an 0xff, I simply don&#39;t write to that location.. that doesn&#39;t work either. If I erase the whole chip, I can see 0xFFs being read fine.. but as soon as I program something around a 0xFF without touching it, it gets garbled up.