Shop OBEX P1 Docs P2 Docs Learn Events
odd bug? — Parallax Forums

odd bug?

BloodyCactusBloodyCactus Posts: 6
edited 2012-08-03 21:14 in Propeller 1
Ran into some odditity. Dont know if its a propgcc bug or something in my setup... never used a prop before but I wired it up like the pdf states, I attached 4 lkm1638 boards and ported the TM16xx library from arduino. I un c++ ified it into a C library with a struct to be stateless. I've run 4 cogs, and it works. well... sometimes. I need to do a clean, compile then load it to eeprom 10 times before it will run. it may work the first time, it may work on the 10th time.

can I gdb through the propstick?

I seem to get a better result if I have a waitcnt between running a _start_cog_thread

wondering if I have some kind of timing issue. Its compiled as lmm model, also propgcc was built from a HG pull of the repository on the 30th of july.

whats the best way to debug this stuff?

my code;
http://mega-tokyo.com/propgcc_1638test.zip


RkEfNl.jpg

Comments

  • ersmithersmith Posts: 6,096
    edited 2012-08-03 18:37
    At 32 longs your stacks may be a bit on the small size -- stack interference would certainly account for the odd behaviour you're seeing.

    That looks like a pretty cool project!
  • jazzedjazzed Posts: 11,803
    edited 2012-08-03 21:14
    I seem to get a better result if I have a waitcnt between running a _start_cog_thread

    It takes 100us to start a new COG. I always use a method to detect the cog start status for critical communications code. Sometimes preexisting drivers like TV.spin don't offer such feedback, so a basic delay can be used to allow for start-up time. In many cases though the delay is not important.
Sign In or Register to comment.