Trouble with Propeller downloads from Mac OS X
David Betz
Posts: 14,516
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.
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
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.
Thanks for your suggestions!