Weird serial problem
pedward
Posts: 1,642
So I downloaded the SIDE to play with my PropKey prototype and test some of the LMM/XMM modes.
I loaded the hello.c file into the PropKey and it worked as expected.
Next I removed the waitcnt and loaded the program to see if XMMC was significantly slower than COG mode (just a quick test).
What I noticed was odd output from the serial console, I reloaded in COG memory model and got the same result:
This is what I get in the serial console without the delay, and the USB activity LED flashes on and off at about .5HZ, which would suggest it's buffering large chunks of data somewhere.
To replicate the bug:
I loaded the hello.c file into the PropKey and it worked as expected.
Next I removed the waitcnt and loaded the program to see if XMMC was significantly slower than COG mode (just a quick test).
What I noticed was odd output from the serial console, I reloaded in COG memory model and got the same result:
Hello World 792 Hello World 793 World 1543 Hello World 1544 Hello World 1545 Hello World 1546
This is what I get in the serial console without the delay, and the USB activity LED flashes on and off at about .5HZ, which would suggest it's buffering large chunks of data somewhere.
To replicate the bug:
- Comment out "waitcnt" in hello.c
- Select COG memory model
- Hit "run" button
Comments
This is the expected behavior on Windows with the driver package I'm using in SimpleIDE. The Qt serial package in event driven mode can get into a bad state on close. I was forced to switch into polled mode. Unfortunately the Qt code can't keep up and the output gets dropped.
There is a work-around for this using the command line propeller-load program. Get a CMD window, then cd "your path". Copy the propeller-load line from the build status and add "-t" without quotes to the command. The command line program has less overhead and will not back up (as I recall).
Thanks,
--Steve
I did some Qt on Linux a number of years ago. I wrote my own comms functions for it then. At the time I was planning on borrowing the comms code from MegaTune to implement on windows.
I'm using QextSerialPort. It works fine as event driven on Linux/Mac and is tolerable on Windows.
The other approach is to use process pipes with the loader.
That works great on Linux and Windows but fails miserably on the MAC.
The look and feel is a little different though - I have it wrapped in #ifdef just in case.