Real memory size, compiler bug?

General discussion on mikroBasic for dsPIC30/33 and PIC24.
Post Reply
Author
Message
peterverkaik
Posts: 174
Joined: 31 Aug 2009 22:44

Real memory size, compiler bug?

#1 Post by peterverkaik » 20 Nov 2009 20:41

Hi,

Compiling for a P33FJ128GP710 (128kB flash, 16kB ram)

With
const flashreserve as byte[31*1024] = (0)

the build succeeds with
Free rom: 55115 and the flashreserve area is located at $8000

With
const flashreserve as byte[32*1024] = (0)

the build fails with
Linker error: not enough ROM for flashreserve

I tried to move flashreserve to a lower address by
const flashreserve as byte[31*1024] = (0) org $6000
but that had no effect (flashreserve started at $8000)

Why does adding 1kB lead to linker failure?

Also, it appear PC addresses end at $FFFF, meaning the 128kB
is in reality (3/4)*128 = 96kB flash because instructions are only
24bits wide, not 32bits.
Is that right, or is there a way to address beyond $FFFF ?

regards peter

peterverkaik
Posts: 174
Joined: 31 Aug 2009 22:44

#2 Post by peterverkaik » 21 Nov 2009 09:23

My goal is to set aside 48kB of flash.
According to datasheet the flash address space ends at
$15800
48kB equals (48/3)*1024 instructions = 16384
Each instruction occupies 2 addresses, so I
must use 32768 addresses (=$8000).
My reserved area should therefor start at $15800-$8000 = $D800

How do I accomplish that?

regards peter

Post Reply

Return to “mikroBasic for dsPIC30/33 and PIC24 General”