Shop OBEX P1 Docs P2 Docs Learn Events
Trouble with Propeller downloads from Mac OS X — Parallax Forums

Trouble with Propeller downloads from Mac OS X

David BetzDavid Betz Posts: 14,516
edited 2011-07-26 10:43 in Propeller 1
I am working on a loader that uses the ROM loader in the Propeller chip to download code to either hub memory or EEPROM. This loader works fine under Windows and Linux but I'm having trouble getting it to work under Mac OS X Snow Leopard.

I get through the initial protocol verification where the PC sends the Propeller a pseud-random bit sequence and the Propeller sends another one back along with the chip ID. This all works and I get the correct chip ID (0x01). My loader code then sends the command to start a download (0x00000001) along with the count of the number of longs to send followed by the data. After that it sends a 0xF9 byte to prompt the ROM loader to send its ACK byte indicating whether the checksum matched. Problem is I never get the ACK byte.

As I said, this same code works under Windows 7 and Linux. Any idea why the Mac would be giving me trouble?

Here is my code for initializing the serial port on the Mac.
    /* open the port */
    fcntl(hSerial, F_SETFL, 0);

    /* get the current options */
    chk("tcgetattr", tcgetattr(hSerial, &old_sparm));
    sparm = old_sparm;
    
    /* set raw input */
    sparm.c_cflag     |= (CS8 | CLOCAL | CREAD);
    sparm.c_lflag     &= ~(ICANON | ECHO | ECHOE | ISIG);
    sparm.c_oflag     &= ~OPOST;
    sparm.c_iflag     = IGNPAR | IGNBRK;
    sparm.c_cc[VMIN]  = 1;
    sparm.c_cc[VTIME] = 10;
    chk("cfsetispeed", cfsetispeed(&sparm, tbaud));
    chk("cfsetospeed", cfsetospeed(&sparm, tbaud));

    /* set the options */
    chk("tcsetattr", tcsetattr(hSerial, TCSANOW, &sparm));

Comments

  • Tracy AllenTracy Allen Posts: 6,666
    edited 2011-07-26 10:20
    Maybe it is a timing issue. Chip's propellerloader.spin waits 250ms after the final data byte to receive back the checksum ack. No 0xF9 sent though to elicit the response.

    Are you trying to do something that bstl doesn't?
  • David BetzDavid Betz Posts: 14,516
    edited 2011-07-26 10:40
    Maybe it is a timing issue. Chip's propellerloader.spin waits 250ms after the final data byte to receive back the checksum ack. No 0xF9 sent though to elicit the response.

    Are you trying to do something that bstl doesn't?

    Probably not but it's hard to tell since the sources for bstl aren't available.
  • David BetzDavid Betz Posts: 14,516
    edited 2011-07-26 10:43
    Maybe it is a timing issue. Chip's propellerloader.spin waits 250ms after the final data byte to receive back the checksum ack. No 0xF9 sent though to elicit the response.
    Sorry. I forgot to reply to this part of your message. I just downloaded Chip's loader and will look it over carefully. I read his ROM code and it looks like any time the Propeller is sending it expects to receive 0xF9 for each byte it is going to send. Maybe I misread the code. I'll look closer at that too.

    Thanks for your suggestions!
Sign In or Register to comment.