|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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 |
|
#2
|
|||
|
|||
|
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) |
|
#3
|
|||||
|
|||||
|
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 |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
|||||
|
|||||
|
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 |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
Quote:
Quote:
JBot |
|
#8
|
||||
|
||||
|
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. |
|
#9
|
||||
|
||||
|
Re: Printf has just entirely failed to do anything
Quote:
so good call.Aside from your efforts to start from the default code, I can send you a basic environment that has a working camera without too much of our robot-specific code in it just so you can verify its not the source you're building from. Another possibility-what version of the IFI loader are you using? If you use the old version with code sizes> 32k (or whatever the max was for 2005's RC), you can get wicked crazy problems. That might explain why things stopped working as you added more functions/files. -Eric |
|
#10
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
Good news & bad news...
I dropped your code as-is into one of our controllers and a printf I added to user_routines.c worked fine. Master code v12 IFI_Loader v 1.1 I ran without the camera as a first test then connected the camera. Which printf in what routine in particular were you having trouble with? P.S. In the version you posted none of the camera code is ever called from anywhere, so there won't be any "uncalled for" printf's from any of that code. I added a call to CAL_Update(); in Process_Data_From_Master_uP and uncommented the #include "camera_abstraction.h" and I'm seeing the printf's from the camera code. Last edited by Mark McLeod : 23-12-2006 at 09:24. Reason: Added version #'s |
|
#11
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
I'm using IFI Loader 1.1.0. I see no printfs anywhere, at all when I put this code into my rc. I've verified it's not my terminal program, serial port, or the rc itself as I loaded old code and it showed all the printfs fine. I can't test anything until somewhere around the 4th because I can't get into the shop until then. I had added printfs directly into main() because nothing else was working, and even that wasn't working. I suppose I should update the master code because I am pretty sure nobody bothered to do so last year--I think we're running v11 still.
Thanks again JBot EDIT: Is that what the new master code was released for--a fix in printf? I knew there was new code out there but I don't remember ever updating. I even have the binary on my machine right now, I just need to upload it. |
|
#12
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
Quote:
The master code revisions usually are just to match changes in the field control software. v11 was released to fix a random twitch in the pwm outputs for Victors, but nothing that affects the behavior of our User code. The Master version won't affect your printf. I dumped v11 into my test controller just to eliminate that as a potential cause, and your code still works fine. Your code is small enough to fit and run on the older PIC-based controllers, so the IFI_Loader version isn't a likely issue. But if you get a Vex kit as a present you'll be able to test your code at home! I'd start with a close look at the simple solutions. When you get back to the robot after the holidays double check that you're downloading the .hex file you think you are. I notice you're putting the .hex file in a different directory than the source code (C:\old_'07_Code), so check the date on the file IFI_Loader is pointing to and verify it's new. Double check your C18 version (2.4). I'm sure you have the current version, but verify there aren't older versions or the Vex version conflicting. What's the history of the PC you're using? Has it been used for several years? Has MPLAB/C18/etc. been reinstalled around the time your troubles began? Last edited by Mark McLeod : 23-12-2006 at 18:32. |
|
#13
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
Quote:
Quote:
Quote:
Quote:
It might work right now. I have no idea. I'll have to test it when we get back. JBot |
|
#14
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
Quote:
The MPLAB version won't matter much either. It's just an editing/organizing tool. Don't sweat it until you're in a position to test again. It'll only drive you nuts. Right now what you've got looks good to me. I'll post the working hex file I compiled and you can use it to eliminate your PC/MPLAB/C18 as any kind of a suspect. Here's the hex file and the camera initialization output printfs I'm seeing. (ignore the "MLM" that's my test printf from user_routines.c) Last edited by Mark McLeod : 27-02-2007 at 12:57. |
|
#15
|
|||||
|
|||||
|
Re: Printf has just entirely failed to do anything
Alright, thanks. Got the file, will try it when we get back.
Some of the characters in the output are interesting, but I won't worry about it right now. Thanks You deserve a candy bar... Here you go: http://www.nadf.com/images/3musketeers_c.gif hehe...I'm going nuts already. Think of what the season is going to do... JBot |
![]() |
| 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 |