PDA

View Full Version : Mystery Compile Error



RossWaddell
- 30th January 2010, 23:30
I just received the PIC BASIC Pro upgrade (v2.60) and set it up on my new PC. When I try to compile a program that used to work just fine with my older PICBASIC Pro version, I get this error:

fatal: out of memory (pbpw.exe)

I'm using MicroCode Studio (v2.0.0.5) which came with the CD containing the PIC BASIC Pro installer.

Anyone know what's wrong here? Other programs do compile just fine (i.e. blink.bas)

mackrackit
- 31st January 2010, 04:32
The only time I have seen

fatal: out of memory (pbpw.exe)
is when I try running MCS on Linux with WINE.

What is your OS?
And posting your code might help too.

mackrackit
- 31st January 2010, 05:40
http://www.melabs.com/faq/02039124.htm#02070858

RossWaddell
- 31st January 2010, 18:40
I'm running Windows XP SP3 and PBP 2.6 with MCS 3.0.0.5

The code is this:

DEFINE OSC 20

FLASH_RATE VAR BYTE
LED_0 VAR PORTB.0

FLASH_ON = 1500
FLASH_OFF = 500

lblLoop:
High LED_0
Pause FLASH_ON
Low LED_0
Pause FLASH_OFF

GoTo lblLoop

End

Again, this worked on my old PC with a previous version of PBP.

RossWaddell
- 31st January 2010, 18:50
Also, if I try to compile one of the sample files from c:\pbp\samples (e.g. adcin3x) I get tons of these errors:

Error c:\pbp\pbppic14.lib 272 : [225] Undefined Symbol 'PORTE'

mackrackit
- 31st January 2010, 19:29
That is starting to sound like the wrong PIC is selected???

RossWaddell
- 31st January 2010, 22:23
I thought so too, but I'm doing a compile only - not programming the chip. I tried selecting the PIC that I wrote that code for (12f629) but it still showed the same error.

mackrackit
- 31st January 2010, 22:34
Now I am confused. What PIC and what code?


I tried selecting the PIC that I wrote that code for (12f629) but it still showed the same error.
The 12F629 does not have a PORTB or E if you are referring to the code in post #4.

Use GPI0.x

RossWaddell
- 1st February 2010, 00:32
Sorry, it was other code for the 12f629 I was thinking of - this code was written for my test PIC, 16f84a.

mackrackit
- 1st February 2010, 01:43
Also, if I try to compile one of the sample files from c:\pbp\samples (e.g. adcin3x) I get tons of these errors:

Error c:\pbp\pbppic14.lib 272 : [225] Undefined Symbol 'PORTE'
The 16F84A does not have an E port.

You may want to post the whole code and the configs and maybe a screen shot of how the code editor is set.

You have to compile for the correct PIC and re-do the code to match.

RossWaddell
- 1st February 2010, 14:56
I installed PBP 2.60 & MCS 3.0.0.5 on my laptop and this code works (selecting 16f84a):

DEFINE OSC 20

FLASH_ON VAR BYTE
FLASH_OFF VAR BYTE
LED_0 VAR PORTB.0

FLASH_ON = 1500
FLASH_OFF = 500

lblLoop:
High LED_0
Pause FLASH_ON
Low LED_0
Pause FLASH_OFF

GoTo lblLoop

End

I tried bumping up the memory allocation for the Windows XP virtual machine that is reporting the out of memory error, but no luck.

mackrackit
- 1st February 2010, 15:05
I tried bumping up the memory allocation for the Windows XP virtual machine that is reporting the out of memory error, but no luck.
What is the parent OS?

This may help
http://www.picbasic.co.uk/forum/showthread.php?t=12532

RossWaddell
- 1st February 2010, 15:40
It's an iMac with Mac Snow Leopard OS (10.6.2). I'm using Parallels Desktop to create the Windows XP virtual machine.

mackrackit
- 1st February 2010, 16:10
It's an iMac with Mac Snow Leopard OS (10.6.2). I'm using Parallels Desktop to create the Windows XP virtual machine.
OHHhhh...
Well like I said, MCS and Linux do not get along and MACs are Unix based also... I think...
I do not know the file structure of a MAC but with Linux I make a *.bat file for each project and keep it in the projects directory. At compile time I run the BAT.

I also use GEDIT for writing code. Never got along with EMACS...
In Linux and WINE there is a "C" directory as in windows, PBP and MPASMWIN will live there.

Below is a BAT example. If errors are found a *.ER and a *.ERR file will be created in the projects directory. I name it "hex.bat".
The HEX will be there also.
Maybe something like this will work for you...



cd /media/16GBSTIC/PIC_PROG/16f887

wine c:/pbp/pbpw -e -s -ac:/Program\ Files/Microchip/MPASM\ Suite/MPASMWIN -p16f887 z:/media/16GBSTIC/PIC_PROG/16f887/887.bas

wine c:/Program\ Files/Microchip/MPASM\ Suite/mpasmwin /e /l 887.asm

RossWaddell
- 1st February 2010, 16:24
Thanks Dave! I will try that tonight. If I understand your batch file correctly, then:

- switch to the folder containing the . bas project file (I presume so the resulting .asm & .hex files will be created in the same place)

- compile .asm file with appropriate switches to tell it what PIC you're using and what .bas file to compile

- create .hex file

Where could I get more info on some of the command line switches you're using?

e.g. c:/pbp/pbpw -e -s -ac

and mpasmwin /e /l

mackrackit
- 1st February 2010, 16:55
Thanks Dave! I will try that tonight. If I understand your batch file correctly, then:

- switch to the folder containing the . bas project file (I presume so the resulting .asm & .hex files will be created in the same place)
Yes, everything will be in the projects directory.


- compile .asm file with appropriate switches to tell it what PIC you're using and what .bas file to compile

- create .hex fileAnd tell the directory.


Where could I get more info on some of the command line switches you're using?

e.g. c:/pbp/pbpw -e -s -ac

and mpasmwin /e /l
The PBP manual has a section about using the command line. Actually PBP is a command line program. And for the MPASWIN stuff. Open MPLAB and under Help/Topics pick MPASAM Assembler.
Then in the index tab "Command Line Interface" sub set "Assembler".