Code Flashing Issues

I am currently working on modifing some code that we have for a past robot in hopes of figuring out where we went wrong.

We compiled and downloaded some code to the robot, and needed to change a couple of things. I made a few changes (and one in a printf statement) and recompiled and downloaded the code. When it was running, in the terminal I noticed that the change I made in the printf statement had not been made. Thinking that I might of loaded the wrong hex, I deleted all of the hex files in the folder, recompiled and downloaded it. We had the same result. The change in the printf statement had not been made, which leads me to believe that the new code that is supposedly getting downloaded is not properly flashing onto our FRC Controller.

I reset the control between each download attempt, and set it to program mode, however when the program began to run it was always running and older version and we were getting the old printf statement to the terminal.

Any Ideas on how to clear off the old code and hopefully get the new set flashed on?

Thanks in Advance


Are you sure that your actually getting to where the printf occurs in the code. It is not impossible that there is a problem with the code being loaded onto the RC however it is pretty unlikely that it would not load at all (assuming ifi loader appears to be working, i.e. the progress bar comes up and the code executes at the end) it would be more likely that if there was a problem it would corrupt the code.

If you want to put up the file with the printf statement in it then we might be able to help more.


MP-LAB? :confused: Assuming yes…

Make sure MP-LAB is working the correct subdirectory.

(Easy way, Project -> Close: see what subdirectory it says it’s in.)

Make sure IFI Loader is getting from the correct subdirectory.

If you put everything in a new subdirectory to make a new project, the MP-LAB workspace may still be pointing to the old subdirectory.

Sometimes if things aren’t working right, the best bet is to copy all the files to a new subdirectory and use project wizard to create a new project. There is a time limit sometimes of how many different things you could try to fix it versus just recreate it.

After Preview: I suppose JamesBrown could be right, that the code isn’t reaching the printf, but …

I just figured the old printf was printing, so, yes, if there were changes in code around the printf, it could be code issues. Or it may be MP-LAB looking at the wrong locations. (Hey! That sounds like a song!)


Any man whose errors take ten years to correct is quite a man.
J. Robert Oppenheimer

Yes, I am using MP LAB.

I had previously moved everything into a new folder (and deleted all of the old hex files as to make sure that I was indeed flashing the most current). The thing that makes me believe that it’s not flashing correct is that the printf statement occurs and it outputs

offset1: offset2:

and when I was editing the code i made a typo to where it was “offsetf” instead of offset2, however when outputting on the terminal it still says offset2.

Make doubly sure that you’re editing the right file. The editor can keep a connection to the file in the old folder until you close everything and open it again from the project window.