Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
Problem with Compiler update

 
Post new topic   Reply to topic    Forum Index -> ZBasic IDE
Author Message
mkrummey



Joined: 09 Mar 2009
Posts: 2

Posted: 09 March 2009, 15:46 PM    Post subject: Problem with Compiler update Reply with quote

I updated the compiler from 2.1.0 to 2.6.9 and my existing application seems to have lots of issues with Task handling and semaphores. Possibly also issues with software serial port. Were there changes that would effect task or code timing in these areas?
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 09 March 2009, 16:23 PM    Post subject: Re: Problem with Compiler update Reply with quote

mkrummey wrote:
I updated the compiler from 2.1.0 to 2.6.9 and my existing application seems to have lots of issues with Task handling and semaphores.
VM or native mode? Can you be more specific about the nature of the problems you're seeing? It will be most helpful if you can distill the code down to the simplest form that still manifests the problem. If that isn't possible, we can also attempt diagnosing the problem using your full application.

If you wish, you can revert to the previous version of the compiler by downloading that version of the compiler using the URL below. It is advisable to rename the more recent files or move them to a different directory before restoring the older ones.
http://www.zbasic.net/download/ZBasic/2.1/ZBasic_2-1-0.zip
Back to top
mkrummey



Joined: 09 Mar 2009
Posts: 2

Posted: 09 March 2009, 17:34 PM    Post subject: Reply with quote

I am using a 24a in VM mode. My application is about 30K and has been operating properly for months, even have commercial systems in the field. There are 5 tasks running with a semaphore protecting the use of the COM4 serial port function. I use the SPI port and associated functions for a piece of serial memory. I updated the compiler to be able to use the 1280 for the next system.

The detail for the main clue that I have so far is that after setting a "semaphore=false", the next routine looking for the semaphore got stuck trying to obtain it. (Infinite loop waiting for semaphore to be available.) When I put a debug.print immediately after the "semaphore=false", it started to work! I replaced the debug.print with a delay(.01) which works also.

I still have other issues but it appears that something has changed relative to the Task handler or timing. To verify that my hardware is not a problem, I have downloaded an image of my application which was compiled with the old version and it works as expected.

It is hard to break apart the application in order to simplify it. Any further ideas? Thanks for your response.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 09 March 2009, 17:51 PM    Post subject: Reply with quote

mkrummey wrote:
The detail for the main clue that I have so far is that [...] [w]hen I put a debug.print immediately after the "semaphore=false", it started to work!
This suggests an optimization issue. We may be able to confirm this if you can send me the listing file. If you aren't currently producing one, add a line like the one below to your .pjt file.
Code:
--list=MyProject.lst
Back to top
mikep



Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX

Posted: 09 March 2009, 17:53 PM    Post subject: Reply with quote

mkrummey wrote:
The detail for the main clue that I have so far is that after setting a "semaphore=false", the next routine looking for the semaphore got stuck trying to obtain it. (Infinite loop waiting for semaphore to be available.) When I put a debug.print immediately after the "semaphore=false", it started to work! I replaced the debug.print with a delay(.01) which works also.
I have seen this type of problem too although I have assumed up to now that it was "working as designed". I use a semaphore in several places and routines that "serialize" data access look like this:
Code:
Public Sub SomeRoutine()
   ' wait for semaphore
   Do While (Not Semaphore(msgSemaphore))
      Call Sleep(0)
   Loop
   
   ' guts of routine removed
   
   ' release the semaphore
   msgSemaphore = FALSE
   Call Sleep(0)   
End Sub
I use the Sleep(0) to give an opportunity for other tasks to run and grab the semaphore. You are right that the code appears to hang if there is no code after setting the semaphore to false.

This "problem" is not new and I have seen in multiple releases going back to 2.5 or so. I have not tested all the intermediate releases of compiler.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic IDE Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group