Shop OBEX P1 Docs P2 Docs Learn Events
Board configuration and cache driver for the new Propeller Platform USB Board - Page 2 — Parallax Forums

Board configuration and cache driver for the new Propeller Platform USB Board

2»

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2012-06-08 22:53
    What do I need to do to try the flash in qSPI mode? I have the chip connected to:

    IO0 - IO3 = 22 - 25
    SCK = 26
    /CS = 27

    Try this assuming you're using the Winbond chip:
        clkfreq: 80000000
        clkmode: XTAL1+PLL16X
        baudrate: 115200
        rxpin: 31
        txpin: 30
        tvpin: 12   # only used if TV_DEBUG is defined
        cache-driver: winbond_sqi_flash_cache.dat
        cache-size: 8K
        cache-param1: (0<<24) | (1<<16) | (26<<8) | 0x01 # 0xiiooccpp - ii=mosi oo=miso cc=sck pp=cs-clr
        cache-param2: (27<<24) # 0xaabbccdd - aa=cs
    
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2012-06-09 08:37
    Yes, the Winbond chip. But that code looks like the config for single SPI. Where do you set the Quad-SPI basepin? The four consecutive pins I'm using are P22, P23, P24, P25 for SIO0 thru SIO3 respectively.
  • David BetzDavid Betz Posts: 14,516
    edited 2012-06-09 10:35
    Oops, sorry. I misread your pin definitons. How about this?
        clkfreq: 80000000
        clkmode: XTAL1+PLL16X
        baudrate: 115200
        rxpin: 31
        txpin: 30
        tvpin: 12   # only used if TV_DEBUG is defined
        cache-driver: winbond_sqi_flash_cache.dat
        cache-size: 8K
        cache-param1: (22<<24) | (23<<16) | (26<<8) | 0x01 # 0xiiooccpp - ii=mosi oo=miso cc=sck pp=cs-clr
        cache-param2: (27<<24) # 0xaabbccdd - aa=cs
    
    The MOSI pin is used as the base of a set of four D0-D3 pins. MISO value isn't really used but it makes the board definition the same if you decide to put a single-SPI chip in instead of the quad-SPI chip.
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2012-06-09 12:26
    Okay, good! Propeller-load appears to be writing to the flash, but I'm getting garbage out. Does the driver reqire the pins be aligned to a nibble, or just contiguous?
    [martin@Dell xmmc]$ make clean
    rm -f *.o *.elf *.a *.cog *.ecog *.binary
    [martin@Dell xmmc]$ make
    propeller-elf-gcc -mxmmc -Os -mfcache -o fibo.o -c fibo.c
    propeller-elf-gcc -mxmmc -fno-exceptions -fno-rtti -o fibo.elf fibo.o 
    [martin@Dell xmmc]$ ll
    total 56
    -rw-rw-r--. 1 martin martin   886 Jan 22 10:45 fibo.c
    -rw-rw-r--. 1 martin martin   888 Jan 19 00:43 fibo.c.orig
    -rwxrwxr-x. 1 martin martin 38996 Jun  9 14:35 fibo.elf
    -rw-rw-r--. 1 martin martin  2976 Jun  9 14:35 fibo.o
    -rw-rw-r--. 1 martin martin   557 Dec  7  2011 Makefile
    [martin@Dell xmmc]$ propeller-load -b ppusb-2-sqi -r -t fibo.elf 
    Propeller Version 1 on /dev/ttyUSB0
    Loading the serial helper to hub memory
    9528 bytes sent                  
    Verifying RAM ... OK
    Loading cache driver 'winbond_sqi_flash_cache.dat'
    1732 bytes sent                  
    Loading program image to flash
    12624 bytes sent                  
    Loading .xmmkernel
    1724 bytes sent                  
    [ Entering terminal mode. Type ESC or Control-C to exit. ]
    &#65533;
    
  • David BetzDavid Betz Posts: 14,516
    edited 2012-06-09 12:44
    Okay, good! Propeller-load appears to be writing to the flash, but I'm getting garbage out. Does the driver reqire the pins be aligned to a nibble, or just contiguous?
    [martin@Dell xmmc]$ make clean
    rm -f *.o *.elf *.a *.cog *.ecog *.binary
    [martin@Dell xmmc]$ make
    propeller-elf-gcc -mxmmc -Os -mfcache -o fibo.o -c fibo.c
    propeller-elf-gcc -mxmmc -fno-exceptions -fno-rtti -o fibo.elf fibo.o 
    [martin@Dell xmmc]$ ll
    total 56
    -rw-rw-r--. 1 martin martin   886 Jan 22 10:45 fibo.c
    -rw-rw-r--. 1 martin martin   888 Jan 19 00:43 fibo.c.orig
    -rwxrwxr-x. 1 martin martin 38996 Jun  9 14:35 fibo.elf
    -rw-rw-r--. 1 martin martin  2976 Jun  9 14:35 fibo.o
    -rw-rw-r--. 1 martin martin   557 Dec  7  2011 Makefile
    [martin@Dell xmmc]$ propeller-load -b ppusb-2-sqi -r -t fibo.elf 
    Propeller Version 1 on /dev/ttyUSB0
    Loading the serial helper to hub memory
    9528 bytes sent                  
    Verifying RAM ... OK
    Loading cache driver 'winbond_sqi_flash_cache.dat'
    1732 bytes sent                  
    Loading program image to flash
    12624 bytes sent                  
    Loading .xmmkernel
    1724 bytes sent                  
    [ Entering terminal mode. Type ESC or Control-C to exit. ]
    &#65533;
    
    Just contiguous.
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2012-06-09 20:41
    I have quad SPI working on the Winbond, but only by adding 4.7k pull-up resistors on all six pins which seems like a horrible kluge. And even then data transfer is unreliable.

    So using quadSPI Winbond flash on U12 will have to be a user hackable option. (Same chip in U9 w/ single SPI is 100%)
  • David BetzDavid Betz Posts: 14,516
    edited 2012-06-09 21:33
    I have quad SPI working on the Winbond, but only by adding 4.7k pull-up resistors on all six pins which seems like a horrible kluge. And even then data transfer is unreliable.

    So using quadSPI Winbond flash on U12 will have to be a user hackable option. (Same chip in U9 w/ single SPI is 100%)
    I found it hard to get the QuadSPI Winbond chip working on a breadboard as well. Rayman's FlashPoint module with the SST QuadSPI chip worked well though.
  • jazzedjazzed Posts: 11,803
    edited 2012-06-09 21:40
    FWIW, I have one pull up on the Chip Select pin according to the data sheet suggestion and have zero problems with either David's winbond driver or the ssf_cache driver.

    One difference might be the way I have the chip connected.

    Propeller : Flash Pin

    P00 : 5
    P01 : 2
    P02 : 3
    P03 : 7
    P26 : 6
    P27 : 1
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2012-06-10 14:48
    Strike three for my point-to-point soldering skills. I ripped up the wires to try Jazzed's layout and apparently eliminated whatever was causing the instability. No errors now on any set of quad-SPI pins with no pull-ups necessary. ~2x speed gain with ebasic as well.

    Sorry for all the "drama"...
  • jazzedjazzed Posts: 11,803
    edited 2012-06-10 15:18
    No errors now on any set of quad-SPI pins with no pull-ups necessary. ~2x speed gain with ebasic as well.


    Congrats.
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-06-10 15:46
    Martin,

    Can you share a way to recreate your success? I was starting to play with it tonight with no success so far.

    Thanks!!
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2012-06-11 09:27
    Use a bypass cap, a good perfboard, double-check your wiring, and use this config for propeller-load:ppusb-2-sqi.cfg
Sign In or Register to comment.