Sometimes when it reports "There is not enough ROM space..." is a stack space issue

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
tsenyigming
Posts: 64
Joined: 15 Feb 2009 08:38

Sometimes when it reports "There is not enough ROM space..." is a stack space issue

#1 Post by tsenyigming » 02 Aug 2023 09:14

MikroC PRO for PIC still on sale but my compiller stoped update since 2019. But this time what I am reporting is old issue. Sometimes when I used almost all FLASH ROM space, the ROM space calculation are not accurate. See bellow screen shot:
before.png
before.png (241.24 KiB) Viewed 551 times
When Line 1211 to 1226 are commented, free ROM is 361 bytes. But when Line 1211 to 1226 are not comment. like bellow screen shot:
After.png
After.png (200.43 KiB) Viewed 551 times
The compiller reports: "...There is not enough ROM space..."
Yet I don't think bellow codes will take 361 bytes:
char BZ_on(){
LATA.B5=1; //RA5
return 1;
}

if(timer>20){
BZ_on();
}
else{
BZ_off();
}
I tried many times to solve it. Finally I succeed. I found this may be stack problem: too much of nesting subroutine calls.
So this is a bug: It's not exactly ROM space issue, but of the stack space issue that mikroC PRO for PIC compiller shall report.
[/size]

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Sometimes when it reports "There is not enough ROM space..." is a stack space issue

#2 Post by filip » 03 Aug 2023 13:54

Hi,

Can you please attach minimal project that demonstrates this issue ?

Regards,
Filip.

tsenyigming
Posts: 64
Joined: 15 Feb 2009 08:38

Re: Sometimes when it reports "There is not enough ROM space..." is a stack space issue

#3 Post by tsenyigming » 05 Aug 2023 04:29

filip wrote:
03 Aug 2023 13:54
Hi,

Can you please attach minimal project that demonstrates this issue ?

Regards,
Filip.
I have made small progress on this project so you will find the demonstrates like:
before.png
before.png (288.25 KiB) Viewed 423 times
When line 1443 is not comment, ROM space issue recurred:
After.png
After.png (254.49 KiB) Viewed 423 times
Line 1443 won't take 187 bytes. So, this is the problem.
Bellow is the project:
4G_RD_jig.rar
(737.27 KiB) Downloaded 27 times

Post Reply

Return to “mikroC PRO for PIC General”