News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Compilation failed but no reason why

Started by TimB, Jan 22, 2023, 12:19 PM

Previous topic - Next topic

TimB


Hi

I'm looking for pointers to why my code will not compile

I suspect its due to lack of ram but since there is no messages issued I do know any for sure

Tim


JonW

What IDE you using Tim?  I have seen this with Positron Studio and if compiled on the  Mechanique one it will give the  errors.

keytapper

For digging on lack of RAM, I suggest to look at the <project_name>.lst if is available. At its end will show how much RAM is occupied.
Other things are on the failed assembly, but depends on one's skill.
Ignorance comes with a cost

TimB


Thanks

It was the ram. The Assembler was seeing it but P Studio said no asm was generated or there was any error messages. I had to work my way though adding ram usage bit by bit to see the offending extra code usage that tipped it over. The thing is I added up my vars and it did not push the limit although it was very near.

Removing an array elsewhere gave me enough bytes to get it to compile

Thanks all

JohnB

Positron Studio will report the same information as is provided by the compiler in the .PBE file.  If that is non existent then you will get no error message except no exe file report.  If anyone has other information please let me know and I will try and improve the reporting.
JohnB

tumbleweed

If you try to compile something like this
Dim buf[20000] As Byte
clear buf

you get a non-specific err in the PBE file (no module or line info):
ERROR
Not enough RAM for all the variables. Reduce the amount, or switch to a larger device.
and it doesn't show up in studio... you just get 'compilation failed' and 'Unable to create new Assembler or Hex file'

The error message format is different than say a syntax error:
dim buf[10] as byte
clear buff       // oops, wrong variable name...

>Error at Line [8]    In file [E:\pds_examples\test.bas]    *** Item ' buff ' not found! ***


top204

Please remember that not all error messages have a line number associated with them.

This is because of several factors, but the main ones are a general preprocessor error, or the lack of RAM or the lack of flash memory, because it is no specific command at fault, but when the RAM is accumulating and using the compiler's dynamic system RAM for internal operations, or after the compilation has occured and it reads the .lst file to find out how much flash memory was used.

However, the .pbe file will always contain the text "ERROR" if an error occurs, so the IDE can pick it up and display the line or lines of text contained in it.


JohnB

Just tested the latest version of Positron Studio and the insufficient ram message is displayed.
JohnB