Compiles fine on one computer but not another!

I have a truly bizarre issue. We have some legacy code that we want to change. I got the source, but when I compiled it on my computer it wouldn’t run after the download.

So I called the guy who used it last. We verified that my source was identical. He then compiled his code and sent me the .bin file. It worked!

We walked through all of the configurable parameters in my Dynamic C, verifying that the were identical. We verified that we had the same version of the compiler. (9.21.) Yet when I compile the code it doesn’t work, and when he compiles the code it does work.

We even tried loading a newer version of Dynamic C (9.62). Both of us got the same version, and kept all settings as they came “out of the box.” He compiles to a .bin file and it works. I compile to a .bin file and it doesn’t work.

The symptoms of “not working” appear to be that the board cannot communicate. When I single stepped through the code, each time it reads data from off-board, I get bogus data. In his “version” that’s not true. But the code should be identical. (The Rabbit board is talking to another board and some off-board hardware. Custom stuff designed by someone in another company.) Board is: 0x0200, 18Mhz, RCM2020, 128K SRam, 512K Flash. Or so it says when it compiles.

Does anyone have any ideas? The guy whose computer works is half-way across the country, and doing other work. How am I going to make my changes if I cannot even get the original to compile? Short of stealing his laptop… :wink:

Note: He’s compiled on two computers (both Dells). I’ve compiled on two computers (both HPs.) Both of his work. Both of mine don’t!

Help!

Are you using a USB to serial converter on your programming cable? Not all cables communicate with Rabbit products. Are you putting your board into RUN mode properly?

No USB converter.

I don’t understand the second question. Whatever I do is identical when I use his .bin and when I use my .bin. (We compile to .bin to eliminate any issues with debugging and timing, since the extra hardware is real-time, sort of.)

BTW, wow, that was fast!

OH, and my laptop has no com port, but is in a docking station with one. However, my desktop has a com port and we get the same effects with it.

Try compiling to the target, remove the programming cable, then reset the board.
Your code may not work with a docking station. DO you have a dual core processor on your PC? Or usign VISTA? We have tech notes that deal with these issues if you arwe usign an older version of DC

Thanks for the reply.

I’ve tried that. It was the first thing I tried, actually.

I’m using XP SP2, as is the other guy, who’se code works.

New Info:

My buddy has compiled the source code on two different machines in his lab. He emailed me both source and .bin files. The source matches mine. The .bin file works when loaded using RFU.

I have compiled HIS version of the code on four different machines in my lab (including my personal one from home.) Two are HPs and two are Dells. None of the .bin files work when compiles from these machines.

(The original authors of the software have also compiled it and loaded to the boards. It works for them too. They are, however, unavailable now. And probably not much help anyway. Long story.)

He and I both have Dynamic C v9.62. The settings are as the come when installed (right off of the web site), except that we both set the processor type (to the same processor.)

My machines were configured by my IT department. (My personal one is as it came from Dell.) His machines were configured by his IT department. His are both Dells. Two of mine are HP, Two are Dells.

Both of his machines have serial ports. Two of mine do.

[i]The .bin file sizes on his machines are the same as each other. The file sizes on my machines are the same as each other. Those two sizes are different. Mine is 24 bytes smaller.

Clearly, the compiler is emitting different code for him than it is for me. The question is how do I get it to generate the same code for me?[/i]

Does anyone have any ideas???

I’m at the point of digging into the .bin file to see what is different. Or single stepping and seeing if what goes wrong gives me a clue as to what is wrong with the .bin file. Or having him send me his laptop so I can do some digging on it.

Are both of you compiling for speed, or size? This sounds like a compiler optimization problem. Also are both of you compiling to flash, run from ram if your rabbit has that capability.

I found a version of the code that I had made a bunch of changes to before all the other problems. It didn’t work, but it didn’t have the problem that we talked about above. So, I backed out my changes one at a time. I finally got it working. It appears that there is one line of code in this version that is not in any of the others. It controls the clock timing for I/O. That makes sense, given my symptoms.

So, I have a base-line set of code that compiles just fine on my machines. Yippee!

The mystery that remains is this: The other guy’s computers all compile the code into working .bin files without the magic line of code. Now the mystery isn’t why mine doesn’t work, but why his works! I assume there is still some setting that we are missing that controls the I/O clock timing independently (or as a default) of the line of code.

If anyone is interested, the line is this:

WrPortI(GOCR, &GOCRShadow, (GOCRShadow&~0xc0));

It is called the very first thing inside main(), after variable definitions.

Thanks to all who attempted to help. Maybe someone will solve the mystery. Maybe not. But at least I can now continue working on my project.

BTW, in answer to the last post, we were/are compiling for speed, and our processor doesn’t allow compile to flash, run in ram, so we were both compiling to flash. To the best of my knowledge we both had exactly the same configuration, and did everything exactly the same. But clearly that isn’t the case - we obviously have some difference somewhere. Since I have a solution, I can’t justify any more time on this right now. It was supposed to take a day, and it’s been a week…

I have a similar problem with my serial port (same source code behave different).
I file compare the source and was identical my *.bin thru RFU worked fine when compile with 10.44 but when compile to target thru compiler 10.5 fail).

Try previous compiler.

Julio