PDA

View Full Version : "overwriting previous address contents" - NOT the usual fuse problem



pic18f442
- 2nd March 2011, 02:00
Hi All,

I've got a laptop with a new install of PBP 2.60A. If I try to compile anything targetting a PIc18xxx, I get a bunch of errors:

"overwriting previous address contents (0000)"
"overwriting previous address contents (0001)"
"Program word too large. Truncated to core size. (017D18C4)"
"Each object file section must be contiguous (section .config_000000_untitled.o)
"Program word too large. Truncated to core size. (017D18D8)"

This happens even if the program contains just the word 'clear' - nothing else. So it's not resulting from manually setting the fuses in the file, without erasing them from the include file.

I'm running MPLAB v8.53, however I've also tried the latest version - no joy. MPASMWin reports version 5.36.

I have another PC running the exact same version of PBP and MPLAB (at times I've literally copied the c:\PBP and c:\Program Files\Microchip folders over) that works perfectly. If I copy the .asm file from the laptop to the PC, it compiles fine. If I use MicroCode Studio and target the ancient included version of MPASM, it also works fine. When I try using a modern MPASM (either 5.36 or 5.39) it fails with the above errors.

I'd really love to get a modern MPASM working so I can use MPLAB with COFF support and debug with an ICD3. Does anyone have any suggestions?

Thanks.

Darrel Taylor
- 2nd March 2011, 02:45
What is the name of your source code file?

Be sure not to name it something like ... 18F442.bas

pic18f442
- 2nd March 2011, 03:18
Hi Darrel,

I've tried quite a few, such as abc.bas, untitled.pbp, rrr.bas, and several more obsene variations as time passed :)

Please see the attached .zip for a complete MPLAB project.

Thanks!

mackrackit
- 2nd March 2011, 04:15
If I use MicroCode Studio and target the ancient included version of MPASM, it also works fine.

This is on the laptop? Do you have two versions of MPASM on the laptop? If not then MCS is using the "modern" MPASM.

pic18f442
- 2nd March 2011, 05:04
It is on the laptop. I'm in the process of nuking and re-installing everything again, so I can't give exact details - but Microcode Studio Pro automatically installed MPASM V3.9 in c:\progra~1\mecanique\mcsp\mpasm . If I select this version, it works. If I instead point it to the MPLAB\mpasm folder, it fails.

I've verified the versions by manually running each MPASM on the .asm file, and also viewing the output of the list file.

pic18f442
- 2nd March 2011, 05:40
OK, I _think_ I have 'fixed' it (fixed, as in this is a hack but it seems to work). In case anyone else is having the same trouble, try the following

1) Download MPASM 5.2 from microEngineering Labs - http://melabs.com/support/mpasm.htm

2) copy this over the top of the existing MPASM in the MPLAB folder.

You should now be able to compile files in MPLAB, but not debug them, as no object file or debugging information is generated(!)

3) In MPLAB, go project -> build options -> project, then the PICBASIC PRO tab, then click 'use alternate settings'. Make sure it says -n ampasmwin -k# -oo -> the -oo passes -o to the assembler, which forces it to generate an object file.

This seems to work, but I'm not sure why I didn't have to go through this for the desktop.

pic18f442
- 2nd March 2011, 06:27
Sorry, posted too early - the above doesn't actually work as the generated files are wrong and cannot be simulated :(

On my desktop, simulating a PBP program then viewing Program Memory gives

Line:Address:Opcode:Label
1:0000:EF02:GOTO INIT

on my laptop, you get

GOTO 0 instead, so it instead becomes an endless loop. The INIT location is still shown elsewhere in the code, but the instructions are not updated to match!

Darrel Taylor
- 2nd March 2011, 17:24
The project compiles ok for me with PBP 2.60A and MPLAB 8.53.
The files generated do not match the ones in your zip file though.

Your P18F442.inc header from MPASM does not match, and it appears to be creating code for a 16-bit processor.

It's possible that the registry entries are invalid.
And that would happen if you just copy installations from another computer, because the setup program writes those entries.

You may want to try the attached file that was written by Charles Leo.
It hasn't been tested completely but seems to work so far.

It attempts to correct the paths and registry entries needed to compile with PBP and MPASM.
It also writes a new PBPMPLAB.bat file in your PBP folder, in case it was modified.

Make sure MPLAB is closed before running it.
If you have multiple MPLAB installations, open the correct MPLAB first, then close it.

If your "System Search Path" has a path to MPASM, that should be removed manually.

pic18f442
- 3rd March 2011, 22:20
Thanks very much for your help, but I'm afraid that suggestion didn't work.

I took the nuclear option and re-installed windows on the laptop hard drive, then installed MPLAB and PBP. It worked! I then let Vista update itself. Then the problem came back.

I think given the time spent already, I'll use a different laptop running XP.

Thanks again.