View previous topic :: View next topic |
Author |
Message |
rwalborn
Joined: 12 Dec 2011 Posts: 8 Location: USA
|
DEBUG HEX VS RELEASE HEX |
Posted: Wed Sep 16, 2015 11:40 am |
|
|
Should the debug hex and release hex files be radically different even those the listing files are almost identical. when comparing the hex files using the file compare tool, there are minor differences in code scattered all thru the code. Is this normal? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Wed Sep 16, 2015 2:45 pm |
|
|
yes it is 'normal' and shows why a program compiled in 'debug' mode will NOT function correctly when burned into a PIC and run 'in the real World'.
It's also why my default is 'release' mode as I've never needed the 'debug' function in 25+ years since I've always tested 'in the real World'.
Jay |
|
|
rwalborn
Joined: 12 Dec 2011 Posts: 8 Location: USA
|
DEBUG HEX VS RELEASE HEX |
Posted: Wed Sep 16, 2015 3:36 pm |
|
|
Thanks for the reply. the reason I asked , is that I have a program that runs connects to usb in debug mode but not in release mode. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Sep 16, 2015 4:25 pm |
|
|
The fuses change between debug and release modes. Compile for both
modes and compare the fuses listed at the end of the .LST file in each
case. See if you can find a problem. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Wed Sep 16, 2015 4:30 pm |
|
|
Without seeing the code or context I have to assume the program is using some of the 'features' of the debugger which of course are not available in the 'release' version.
Using the 'debug' version in the 'real World' could lead to a lot of trouble as someone could 'press a key' and invoke a debugging feature...altering variables, sending bad data or at the very least crashing the PIC.
Those that have used the 'debugger' for years may know about 'hidden commands', memory usage, errors in timing, etc. Things were a LOT simpler 30-40 years ago !
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19512
|
|
Posted: Thu Sep 17, 2015 7:38 am |
|
|
The other thing, is if he is running in debug mode, he presumably has the debugger connected?. If so, there is an extra power connection, and ground, and also the MCLR pin is being controlled by the debugger..... |
|
|
|