/*
 * examine SPIFI-flash
 *   by uratan! 2012.11.11
 *   revised 2012.12.12
 */

Jump to:
    basic behaviors (11 Nov 2012)
    simple instruction fetch (11 Nov 2012)
    tune params (22 Nov 2012)
    delay for interrput (28 Nov 2012)
    epilogue (7 Dec 2012) (12 Dec 2012)

basic behaviors (11 Nov 2012)

CONDITIONS
001: continuous byte read ('1')


002: repeat "continuous byte read" ('1')


003,004: separated byte read ('2', '3')




005,006: byte in continuous boundary read ('4', '5')




simple instruction fetch (11 Nov 2012)

101,102: execute nops() from RAM / SPIFI ('n')




103,104: execute nops() from SPIFI which is configured unproperly by boot-ROM ('n')






tune params (22 Nov 2012)

CONDITIONS
201: separated byte read ('2', with changing CS_HIGH from 3 to 1)


202: separated byte read ('2', with changing SCK from 18MHz to 72MHz)


203,204: execute nops() from SPIFI ('n', SCK=58MHz)





299: FYI: execute nops() on LPC2141 (from internal flash)




delay for interrput (28 Nov 2012)

CONDITIONS
301: interrupt while executing brchs() from RAM ('b')


302,303,304: interrupt while executing brchs() from SPIFI ('b')






305: simply execute brchs() from SPIFI ('b', phase monitor output is enabled)



  - * - * -

  high-quality push-SW is added for the interrupt test.



epilogue (7 Dec 2012)

Above tests was done under the conditions of SPIFI interface below.   (FYI: patch1204.txt)
when uart3-boot --> [1]   (used for waveform 001-006, 101, 201,202, 301)
when SPIFI-boot --> [2]   (used for waveform 102, 203,204, 302-305)
              SPIFI_CONTROL (0x4000_3000 [RW])
 [1]          +---------------------+---------------------+
  0x6803_FFFF | 0110 1000 0000 0011 | 1111 1111 1111 1111 | <==set by library call
 [2]          +---------------------+---------------------+
  0x4009_FFFF | 0100 0000 0000 1001 | 1111 1111 1111 1111 | <==set at boot time
              +---------------------+---------------------+
                 ||  |    |    ||||
                 ||  |    |    CS_HIGH
                 ||  |    MODE3
                 ||  DisablePreFETCH   (thanks noahk)
                 |FULLCLK
                 RCVCLK                    (other bits are unknown yet)
If you will trace above tests, try it with changing params in the SPIFI_CONTROL register, especially CS_HIGH and DisablePreFETCH.
And compare misc process speed with/without inserting NOPs.

  - * - * -

If you want to use boot-ROM call for spifi_init() instead of it in the library, it may be better to SWAP 3rd and 4th params, like:
result = spifi_init_in_bootROM(obj, csHigh, CLOCK, options); 
  (when chip revision A, boot-ROM version 11.1 @ 0x1040_7ffc)
    (see also the first comment in spifi.c)
      (you shall repeat this ROM call until success (only once or twice, maybe))
        (try also to pass 0 as CLOCK)
L

- * - * -

[12 Dec 2012]
Try also new 'spifi_drv_M3.lib' in the CMSIS package "lpc18xx-2012-12-11.zip".
I will, later, in the future...


    uratan@miomio.jp
upward