Shop OBEX P1 Docs P2 Docs Learn Events
Spin compiler download timeouts! — Parallax Forums

Spin compiler download timeouts!

Peter JakackiPeter Jakacki Posts: 10,193
edited 2011-03-16 16:20 in Propeller 1
Here is the problem:

A large program that compiles with 6260 longs fails to load with the infamous "Propeller chip lost on COMx" message. There is nothing wrong with the pcb or power-supply etc. I have rebooted the PC, tried another PC, tried earlier versions of the Propeller IDE, cleaned the board, heated the board, cooled the board, fed external power to it etc etc.

For the programming cable I am using a CP2102 to RS-232 then back TTL. This was working fine with smaller programs. I tried downloading the same large program onto a different model that has a FT232R onboard and that loads fine.

I was able to reduce the compiled code size from the source to find out at what approximate point it would work or not work.

Downloaded different sized variants of the large program and this is what happened:
5924 longs will load
5940 longs will load
5956 longs will fail

So I decided to hookup the analyzer to the port pins to see what was happening.
D3 RXD in
D2 TXD out
D1 SDA
D0 SCL

As you can see from the loadram_ok the IDE download the complete image then polled 3 times for an acknowledgment before verifying and rebooting.

But look what happened when it failed. The IDE spits out only a very short burst of data and then polls for an acknowledgment ~15 times before timing out. When you look at the I2C bus you can see why because the Propeller is booting. Just to make sure it wasn't a reset glitch I hooked another probe to the reset line (not shown in attachments) and you could see the programming reset pulse ok and there certainly wasn't anything else to cause it to do that. The same goes for the power supply, no problems.

I'm still investigating but I thought I'd share this little bit of information hoping that maybe someone would have some new ideas based upon the evidence (other than all the ones we have heard of previously).

My thinking is that the load is going in reverse order and the top of memory is getting clobbered first. Although I haven't checked it seems some boot code or variables are living there. But that doesn't explain the FT232R version working fine. It seems then that the issue might lie with the Windows VCP and the IDE's timing. Of course, anything to do with Windows (I'm using XPSP3) invites trouble.

*Peter*

P.S. I have added a photo of the board under test.

Post Edited (Peter Jakacki) : 2/21/2009 6:20:19 AM GMT
801 x 600 - 290K
801 x 600 - 283K
824 x 658 - 148K

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-21 06:01
    I've had troubles with the CP2102. I suspect it's something peculiar with the Windows driver and its timing, but I have no proof of it. Once I got a fast enough processor so that Windows background tasks didn't mess up the download timing, I haven't had any problems using FTDI USB to serial adapters.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-02-21 06:09
    I'm running a laptop with Core2 Duo,3G RAM, 500G HDD, Nvidia video with dedicated 512M etc so it should be fast enough. My little normal Proplink like cables are FT232R based but alas I am waiting on more chips so I hooked up the CP2102-RS232 and connected it to the RS-232 version of my Proplink variant. I will try an FT232R-RS232 to the Proplink and see how that goes.

    "Peculiar" is a kind word.

    Thanks for the reply Mike.

    *Peter*
  • BradCBradC Posts: 2,601
    edited 2009-02-21 06:44
    Peter Jakacki said...

    My thinking is that the load is going in reverse order and the top of memory is getting clobbered first. Although I haven't checked it seems some boot code or variables are living there.

    It is most certainly not that. The booter runs completely from the COG with no reference to HUB ram while running.

    The "handshake" at the start of a load is reasonably timing critical. I assume the handshake is occurring properly otherwise it would be informing you it can't find the propeller. After the handshake the load must start within about 50-70ms (supposed to be 100ms but I could never seem to get it to wait that long) at most or the propeller will timeout and continue booting from eeprom. Likewise, any delays in sending the data to the propeller may cause the load to timeout and boot from eeprom. Perhaps there is a timing issue with the serial device you are using that does not exist with the FTDI stuff or a strange interaction with your particular installation.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cardinal Fang! Fetch the comfy chair.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-02-21 06:52
    Didn't really think it needed hub ram etc but I just air my musings as I type. I know that others have had similar problems before and they were "fixed" by rebooting or something else, or the problem just went away. Knowing I can fix it simply by using a different USB chip is a fix but it doesn't solve the cause of the problem which seems to rear it's head every so often. It would be nice to know what the cause of the problem is and also to have a fix for it too.

    *Peter*
  • pp_314156pp_314156 Posts: 5
    edited 2011-03-16 15:27
    Interesting analysis. I too have noticed that there is a certain critical size where you can't load propeller programs. Before the critical size, if the download fails, rebooting the laptop helps and then running the propeller tool as the only program. I have used FTDI USB adapters (directly from FTDI) from the beginning so FTDI is not a guaranteed solution. I also tried the USB driver latency setting and it made no difference.

    Does anyone know if Parallax is looking into this seriously?
  • lonesocklonesock Posts: 917
    edited 2011-03-16 16:20
    I had a similar issue when using a USB hub...plugging directly into a USB port on my laptop would work, plugging into the USB hub would fail for anything but tiny programs.

    Jonathan
Sign In or Register to comment.