|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
Printf has just entirely failed to do anything
I started with the default camera code from Kevin Watson a few weeks ago, and I have been making my modifications happily--that is, until yesterday. First, I added two of my own files, which did all the camera calls, consolidating them into a single Camera Update function. Then, I pulled the camera update function calls out of user_routines.c and put my camera update function call into Process local IO. I had something like this working last week, but it refuses to send any bytes out the serial port now.
Things I have tried: -tested my serial link. It is good-I can send programs down + read them back with device reader. I also see IFI> when I reset the bot -tested with another RC. Same problem. -unplugged camera TTL converter. Same problem -Added printfs everywhere in my code. None of them work unless I comment out the #include for serial_ports.h (this breaks the camera functionality of course) And none of the printfs produce any output -Replaced all the files that should never have been modified (serial_ports.c/.h, terminal.c/.h, camera.c/.h are the ones I overwrote with the ones out of Kevin's code). No effect. I'm bashing my head on the wall right now.....please help! JBot PS. I will post the code tonight if you need it. I am using a school machine right now and don't have access to my code right now. |
|
#2
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
Which printf are you using?
The C18 library version that requires you to add "#include <stdio.h>" everywhere printf is called, or one of the older printf_lib.c/h versions? |
|
#3
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
I am using the stdio.h version where it won't compile unless I #include <stdio.h>.
It "Code error"ed out when I commented out the includes for Kevin Watson's serial port code. It worked then for about 5 seconds but it gave me a red light of death afterwards, presumably because I was bombarding it with tons of printfs. JBot |
|
#4
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
I really hate to do this, but since it is slowly creeping down the portal and I really need an answer...BUMP!
I am thinking about re-writing from scratch, but that would be ugly, so please, please tell me what I might be doing wrong... JBot |
|
#5
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
Sorry, we've been racing robots all night. They're having a pushing contest now.
Probably need to attach or email your whole project to look at. It's hard to guess what serial port resource conflict you might have. There are too many answers. |
|
#6
|
||||
|
||||
|
Re: Printf has just entirely failed to do anything
Quote:
If you are indeed the lone programmer for your team (poor guy ) you might want to force some code versioning on yourself. Things like CVS or SVN (check out wikipedia or google it yourself) CAN AND WILL SAVE YOUR BACON! It'll allow you to easily step back in time before you screwed something up, and will also provide an easier time of multiple people working on the project at once. This way you can try training an interested freshman without fear of him making changes you can't get rid of when your team leader asks you "is autonomous mode done yet?" It takes some work to understand, but I promise (and every other user of some code versioning system will promise) it will be worth the effort.--Eric |
|
#7
|
|||
|
|||
|
Re: Printf has just entirely failed to do anything
I had the same sort of occurrence myself this week as I was trying to program one of the 2005 units.
Since you haven't mentioned which controller you're using this may not work. If you have a 2005 CPU it's likely using a 8520 pic, which needs the following environment changes in mplab: From the Configure >> Select Device... menu choose "PIC18F8520" as the pic type In your project use the "FRC_library.lib" for the 8520 (mine is named FRC_library_8520.lib) -To keep my sanity I renamed it in the same fashion as last years revised libraries and linkers were. Also In your project use the "18F8520.lkr" for the 8520 NOW the last ingredient for success in restoring printf's (in my case anyway) Load the FRC_MASTER_V12.BIN and reload your first compiled code (before all of your changes) If you're using a pre 2006 CPU it's probably not been loaded with a FRC_MASTER_V12.BIN but an older version. I'm just guessing (since it's now gone) but ours was probably using the V11 master code as distributed in April 2005. Once the master code was updated my printf's worked fine (no more IFI> terminal freeze ups) |
|
#8
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
OK, the code that is causing me problems is posted:
http://jbotalan.frih.net/07_code.zip No printfs work anywhere. I'm re-writing from the default user code. It will make for cleaner code. I would be interested in finding out why the heck this broke. I'm going to try CVS. JBot |
|
#9
|
||||
|
||||
|
Re: Printf has just entirely failed to do anything
Quote:
Does anyone know if the 2005 and 2006 controllers share a master processor model? Also did you actually do the Master version update on your 2005 controller? It's a little hard to understand as you speculate the controller in question was running v11. Can someone clarify please? |
|
#10
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
Quote:
Oh, I like being the lone programmer! Nobody to fight with over how the code will work! I'm trying to train a freshman, but otherwise I'm it. Thanks again. You learn something new every day. If only I learned something this cool every day... JBot |
|
#11
|
||||
|
||||
|
Re: Printf has just entirely failed to do anything
Quote:
Code:
PIE1bits.TMR1IE = 0; If i understand your original post correctly, it stopped working when you moved the function calls into your abstraction files? I noticed you did not call "Initialize_Camera()" in your abstraction file (or anywhere in your project). Try adding that to user_routines.c in the User_Initialization() function. Let me know if any of these work. -Eric |
|
#12
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
I'll be sure to let you know if these work. I won't be able to check until we get back (on the 4th I think). It's nice to know someone cares enough to pull down someone else's code to look at it. I wouldn't have been as generous before FIRST...
Thanks, JBot EDIT: I was under the impression that Camera_Handler() in camera.c was supposed to be calling Initialize_Camera(), and it is as far as I know. I can call it manually, but depending on the flags set in camera.c, it does get called if camera comms aren't working. Correct me if I'm wrong... Last edited by JBotAlan : 22-12-2006 at 17:31. Reason: Just re-read the code |
|
#13
|
|||
|
|||
|
Re: Printf has just entirely failed to do anything
Matt,
Sorry for leaving you confused. The last step for success (in my eliminating the IFI> prompt freeze up while adding in printf's for my chosen variables) WAS the loading of the MASTER_V12.BIN from the 2006 default code. You are absolutely correct when you mention that there is no explicit documentation of whether it's appropriate to try this. But where is your sense of adventure. The fact that IFI was doing FRC controller processor upgrades from ver 8520PICS to 8722PICS, and Kevin Watson was releasing all kinds of code with instructions on how to load user programs written as enhancements for the 2006 base code onto 2005 processors. Surely, if it were fatal to the processor somebody would have noticed by now that loading the MASTER_V12.BIN shouldnt be done on a 2005 controller. Anyway it works, my 2005 controller is happily running MASTER_V12.BIN and both the FRC Default code and OUR 1114-1503-1680 Common base code that were teaching our programmers with. Perhaps I should have actually read the IFI site for instructions on how to confirm which Master code we were running before I scrapped it, but I did save the bin file for posterity using device reader. The only guessing going on was if it was v 10 or v11 not whether or not I fixed the freeze up at the IFI> stage. Bruce PS Jacob, I looked at your environment (8722PIC, lib & lkr) and you don't have the same printf freeze issue I had. |
|
#14
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
Quote:
Quote:
JBot |
|
#15
|
||||
|
||||
|
Re: Printf has just entirely failed to do anything
Quote:
Quote:
Killing the RC my first year on 358 would have left a bad first impression ![]() Thanks for the information, I've tucked it in with my 'useful things' section of the brain. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compiling Failed | Teh Mike | Programming | 7 | 09-02-2005 13:27 |
| pic: Failed attempt at simulation | CD47-Bot | Extra Discussion | 5 | 17-06-2004 11:03 |
| printf isn't printf-ing. Help! | Meandmyself | Programming | 14 | 15-02-2004 16:27 |
| And now for something entirely different..... | archiver | 1999 | 1 | 23-06-2002 22:46 |