Welcome, Guest. Please Login.
Surveyor Corporation Surveyor SRV-1
Home Help Search Login

Surveyor Robotics Forum

Welcome to the user support forum for Surveyor SRV-1 robots, SRV-1 robot controllers and SVS stereo vision systems. To register for this forum, please send an email to support@surveyor.com which includes your desired forum user name, your registration email address, and a brief explanation of why you wish to join, and we will create a forum account for you.

Please note that there is a Search button in the forum toolbar for forum topics. Another effective search method for the entire surveyor.com site is to use Google, e.g. "xyz site://www.surveyor.com" where "xyz" is the search topic.



Pages: 1 2 3 4 
Send Topic Print
Executing C-programs (Read 31803 times)
ejs
YaBB Newbies
*




Posts: 17
Re: Executing C-programs
Reply #45 - 01/05/11 at 8:39pm
 
I tired to execute this program in picoC
 
printf("Hello world\n");
 
it loaded successfuly via XMODEM and i was able to verify the contents of the flasbuffer using 'zd'
however when i type in 'Q' it does not print "Hello world"
i also tried writing it into flash memory 'zw' and then type 'Q' but it immediately goes to
 
starting picoc
 
help please! i'm a beginner that has been looking at searching a lot the forums for a while now.
Back to top
 
 
Email   IP Logged
tjump
Global Moderator
*****




Posts: 411
Re: Executing C-programs
Reply #46 - 01/06/11 at 7:13am
 
A couple of things.
 
First, if you write a picoC program but do not exit from picoC after the running of the program then you will go into the picoC translator (starting picoC) and lose control of the SRV. So everytime you write a picoC program you should add the exit(); function at the end...
 
printf("Hello world\n");
exit();
 
Second, I have seen times when SRVs do not return the value (in your case "Hello world") and then with a reconnection it works. This is some little bug we have not been able to isolate so best bet is to try again. It may be related to not exiting picoC but this is not certain at this point.
 
T. Jump
Back to top
 
 
  IP Logged
Simon
YaBB Newbies
*




Posts: 2
Re: Executing C-programs
Reply #47 - 01/18/12 at 3:41pm
 
I've written code to run my SRV1 camera from my iPhone (http://www.youtube.com/watch?v=s8w76_7unBs&feature=mfu_in_order&list=UL) and from Python, using the standard ASCII protocol (http://www.surveyor.com/SRV_protocol.html).  Now I would like to add some code to interact with other digital devices, via the GPIO pins -- e.g., press a button in my iPhone app to assert a value on a given GPIO pin.  It appears that in order to do this I must use Pico C.  So my problem is: how do I compile and upload my Pico C programs to the SRV1 so that I can do this?  I'm guessing it would involve using the zAxx command to read from flash sector xx into the flash buffer, and then using the Q command to run the Pico C program in the flash buffer.  But how do I get this Pico C program into the flash buffer to begin with?  I've successfully run Pico C programs on the SRV1 interactively from my iMac using the ! command, but I don't understand how to upload an entire program at a time.
 
Of course, if there's some way to assert values on the GPIO pins using the ASCII protocol, I'll stick with that!
Back to top
 
 
  IP Logged
tjump
Global Moderator
*****




Posts: 411
Re: Executing C-programs
Reply #48 - 01/19/12 at 5:37am
 
A quick search of the forum should point you to the section under Software all about picoC.
 
http://www.surveyor.com/cgi-bin/yabb2/YaBB.pl?num=1239459317;start=all
 
T. Jump
Back to top
 
 
  IP Logged
Simon
YaBB Newbies
*




Posts: 2
Re: Executing C-programs
Reply #49 - 01/19/12 at 9:41am
 
Thanks for the link to the Pico C forum (http://www.surveyor.com/cgi-bin/yabb2/YaBB.pl?num=1239459317;start=all), but before posting yesterday I did actually look at that forum, and I concluded that there was something I didn't understand -- a step-by-step of how to take a Pico C program fragment, upload it to the Blackfin, and run it.  
 
So, let's say I have a socket open to the Blackfin, and I have a Pico C command like 'printf("Hello world!");' that I want to upload and run -- how (step-by-step) do I do this?
Back to top
 
 
  IP Logged
tjump
Global Moderator
*****




Posts: 411
Re: Executing C-programs
Reply #50 - 01/19/12 at 1:37pm
 
Hmmm? I see directions on how to load a picoC program in the very first post about midway down... There is discussion here that intimates how the process can vary depending on what transfer protocol and OS you are using, how to verify the transfer was successful, etc.
 
So, if you cannot follow this process you will at least need to specify all the details as to the OS, transfer process, et. al. that you are hoping to use and then maybe someone can give you (or point you) to a step-by-step process if anyone is familiar with your particular set of needs.
 
 
T. Jump
Back to top
 
« Last Edit: 01/19/12 at 1:38pm by tjump »  
  IP Logged
Pages: 1 2 3 4 
Send Topic Print