Shop OBEX P1 Docs P2 Docs Learn Events
sporadically failed boot from SPI flash - Page 2 — Parallax Forums

sporadically failed boot from SPI flash

2»

Comments

  • RaymanRayman Posts: 13,891
    evanh wrote: »
    I'm measuring about 35 µA more on VDD and 980 µA more on VIO with the PLL at 25 MHz vs RCFAST.
    Do you have the total current for these cases?

  • evanhevanh Posts: 15,187
    I set up for minimal activity to keep lowest and steady current draw. They were around 25 mA for VDD and 7 mA for VIO.

    I use an old test program I'd made for finding the min/max power needs of the prop2. All cogs were set to run the following. I found that a cog cycling WAITX uses less power than a stopped cog:
    program1
    .loop
    		waitx	#500
    		jmp	#.loop
    
  • RaymanRayman Posts: 13,891
    Ok, so it's ~ a 15% increase in current to leave the PLL on.
    That sounds acceptable to me, considering the apparent risk with turning it off...
  • cgraceycgracey Posts: 14,133
    What is the risk of turning the PLL off?
  • evanhevanh Posts: 15,187
    It'll be a fixed amount for the PLL at any particular frequency. The prop2 total current can be ramped up a lot at that frequency but the PLL current won't change. I kept the total minimal in my testing to make it easiest to pick out the PLL usage.

    PS: I've just rerun testing with a little more care not to be using extra power and got refined answer:
    Prop2 revB-globtop (VDD = 1.86 V)
            |     VIO         VDD
    --------|-----------------------
     RCFAST |  6.320 mA   23.350 mA
     25 MHz |  7.287 mA   23.392 mA
    
     Diff   |    967 uA       42 uA
    
  • evanhevanh Posts: 15,187
    cgracey wrote: »
    What is the risk of turning the PLL off?
    Fear of the unknown.

  • RaymanRayman Posts: 13,891
    cgracey wrote: »
    What is the risk of turning the PLL off?

    @jef_vt seems to be having some issue that appear to be related to coming back to PLL on after having PLL off.
    Or, is it all sorted out now?
  • evanhevanh Posts: 15,187
    He hasn't confirmed. I'm guessing he's conducting a series of long tests with updated firmware. The silence I'm taking as a good sign.

  • cgraceycgracey Posts: 14,133
    The only advantage I see in leaving the PLL on is that you can switch to it immediately, without any delays.
  • RaymanRayman Posts: 13,891
    Well, it also seems that the exact non-PLL frequency varies from chip to chip...
    Although, maybe that's not so important...
  • evanhevanh Posts: 15,187
    Actually, RCFAST seems to be a surprisingly consistent frequency of 25.1 MHz for revB silicon. It changed from revA to revB but Chip did that I think. Has anyone measured revC? It should be at 25.1 MHz, same as revB.

  • jmgjmg Posts: 15,145
    evanh wrote: »
    Actually, RCFAST seems to be a surprisingly consistent frequency of 25.1 MHz for revB silicon. It changed from revA to revB but Chip did that I think. Has anyone measured revC? It should be at 25.1 MHz, same as revB.
    The changes are more likely related to batch, as within a batch the variation is less, than between batches.


  • evanhevanh Posts: 15,187
    So the question still is, what is revC getting?
  • ozpropdevozpropdev Posts: 2,791
    edited 2020-09-05 00:26
    evanh wrote: »
    Actually, RCFAST seems to be a surprisingly consistent frequency of 25.1 MHz for revB silicon. It changed from revA to revB but Chip did that I think. Has anyone measured revC? It should be at 25.1 MHz, same as revB.
    FYI My RevB RCFAST runs at 26.7MHz

    Edit: and my RevB Glob-top RCFAST runs at 25.6MHz
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-09-05 00:32
    If I connect a scope to P32 on my revB EVAL and boot into TAQOZ ROM and type "32 PIN $8000_0000 NCO" I get 12.6MHz which means RCFAST is running at around 25.2MHz.

    Typing "RCSLOW" (and losing comms) it reads 10.4kHz so 20.8kHz for RCSLOW.


    Note: I could have typed "RCSLOW 200,000 WAITX RCFAST" to return back to the console after about 10 seconds.
  • evanhevanh Posts: 15,187
    edited 2020-09-05 02:38
    ozpropdev wrote: »
    FYI My RevB RCFAST runs at 26.7MHz
    Edit: and my RevB Glob-top RCFAST runs at 25.6MHz
    Wow, that's a lot different. I thought all reports had been 25.1 MHz.

    So, RCFAST is different on every die, but relatively temperature stable. Whereas RCSLOW has large temperature drift.

    EDIT: RCSLOW jitter is around 3500 ppm. RCFAST looks to have 250 ppm high frequency jitter but then there is a sub 1 Hz wobble that is larger.

  • evanhevanh Posts: 15,187
    Just measured RCFAST on my two revB boards. The glob-top is almost bang on 25.10 MHz and the finished ES is 25.17 MHz. So not much in it here.

  • It's a nice frequency for VGA, but I found it's a bit too unstable for proper syncing on an LCD (maybe an analog monitor could show it).
  • jmgjmg Posts: 15,145
    rogloh wrote: »
    It's a nice frequency for VGA, but I found it's a bit too unstable for proper syncing on an LCD (maybe an analog monitor could show it).

    RC oscillators have just a bit too much jitter, so the monitors act like oscilloscopes, and the Y axis nicely plots the jitter over each line time...
    Could be useful for debug, but not something you would ship out the door :)
  • For anyone reading the forum that have more or less the same problem like me, I have a solution that works for me.
    I worked around the problem. I just do this instead of reset:
    asm
    coginit #0,#0
    endasm
    
    I don't think the problem is in the clock, as the propeller starts booting and loads the first 1024 bytes from flash.
    I think the data is read wrong (1 bit or so).
    So if rebooting is a problem, don't reboot :smile:
  • RaymanRayman Posts: 13,891
    edited 2020-09-05 13:44
    Very interesting... Hope we can get to the bottom of this...

    Does a hard reboot (pressing a reset button or reset via FT231X) have the same 1% failure rate?

    Or, is it something about a soft reboot that is the problem?

    Also, are you sharing the flash chip pins with a uSD card or anything else?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-09-05 14:14
    evanh wrote: »
    Just measured RCFAST on my two revB boards. The glob-top is almost bang on 25.10 MHz and the finished ES is 25.17 MHz. So not much in it here.

    Are you using a frequency counter or the scope?
    I just went and referenced against the P2D2 RTC and got a much better idea of the clock with a simple loop that times 32768 pulses from the RTC clock output available on P34 through a 100k resistor. I also timed it again back at 300MHz so I guess the 24.9775MHz figure for RCFAST is pretty close.
    TAQOZ# 50 ms RCFAST CLKFREQ? 300 clkfreq! . --- 24977544  ok
    TAQOZ# CLKFREQ? . --- 300004320  ok
    
  • evanhevanh Posts: 15,187
    edited 2020-09-05 14:27
    Hmm, maybe the same PLL glitch can lockup a programmed reset. I note Eric has reboot() function in fastspin that drops back to RCFAST before performing the reset.

  • evanhevanh Posts: 15,187
    edited 2020-09-05 14:48
    jef_vt wrote: »
      mode_20mhz   = %0000_0001_000000_0000000111_1111_10_00 '20MHZ
    

    Ah, interesting. Looking at Eric's code for clkset(), the above introduces a problem. clkset() in fastspin uses the mode value to decide if the clock source select should be the PLL or not. If the mode is greater than 1 then it selects the PLL. The above, with a 10 MHz crystal, will produce an 80 MHz sysclock under fastspin.
    pri _clkset(mode, freq) | oldmode, xsel
      xsel := mode & 3
      if xsel == 0 and mode > 1
        xsel := 3
      oldmode := __clkmode_var & !3  ' remove low bits, if any
      __clkfreq_var := freq
      __clkmode_var := mode
      mode := mode & !3
      asm
        hubset oldmode	' go to RCFAST using known prior mode
        hubset mode		' setup for new mode, still RCFAST
        waitx ##20_000_000/100 ' wait ~10ms
        or  mode, xsel
        hubset mode         ' activate new mode
      endasm
    
  • evanhevanh Posts: 15,187
    edited 2020-09-05 15:18
    Oh, now I remember, the mode compare is there as a correction for a missing XSEL. Some early mode examples didn't include XSEL.

  • evanhevanh Posts: 15,187
    evanh wrote: »
    Just measured RCFAST on my two revB boards. The glob-top is almost bang on 25.10 MHz and the finished ES is 25.17 MHz. So not much in it here.
    Are you using a frequency counter or the scope?
    Huh, I missed your question last night. Answer is my Yokogawa scope. Same I use for jitter measure.
Sign In or Register to comment.