Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Actual usable code size / linker script
25-02-2013, 01:42 AM,
#1
Actual usable code size / linker script
Hi everyone - long time programmer here looking to make my, and hopefully your, lives a bit easier.

This all started with trying to do something real with a Pinguino MX220 board but very rapidly came to an end when I realized the actual usable space on this board is about 14k bytes. So I started to research why. It quickly came apparent the bootloader is using some of the main memory, in fact it hardly uses any boot memory and that's a shame. I am very interested in trying to minimize the space its using in main memory and optimizing what space it does use. I read in other threads you need to request the bootloader source so please consider this the request.

This is the mem section from X3's procdefs.ld file for this board.
MEMORY
{
kseg0_program_mem (rx) : ORIGIN = 0x9D004A00, LENGTH = 0x3600
kseg0_boot_mem : ORIGIN = 0x9D004490, LENGTH = 0x570
exception_mem : ORIGIN = 0x9D003000, LENGTH = 0x1000
kseg1_user_mem : ORIGIN = 0xBFC00400, LENGTH = 0x800
kseg1_boot_mem : ORIGIN = 0x9D004000, LENGTH = 0x490
debug_exec_mem : ORIGIN = 0xBFC02000, LENGTH = 0xFF0
config3 : ORIGIN = 0xBFC02FF0, LENGTH = 0x4
config2 : ORIGIN = 0xBFC02FF4, LENGTH = 0x4
config1 : ORIGIN = 0xBFC02FF8, LENGTH = 0x4
config0 : ORIGIN = 0xBFC02FFC, LENGTH = 0x4
kseg1_data_mem (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x2000
sfrs : ORIGIN = 0xBF800000, LENGTH = 0x100000
}

Perhaps this will become clear when I see the boot source but there are many pieces here that don't make sense to me.

This is the mem section from xc32 V1.11's procdefs.ld file.
MEMORY
{
exception_mem : ORIGIN = 0x9D000000, LENGTH = 0xA00
kseg0_program_mem (rx) : ORIGIN = 0x9D000A00, LENGTH = 0x7600
debug_exec_mem : ORIGIN = 0x9FC00490, LENGTH = 0x760
kseg0_boot_mem : ORIGIN = 0x9FC00490, LENGTH = 0x0
kseg1_boot_mem : ORIGIN = 0xBFC00000, LENGTH = 0x490
config3 : ORIGIN = 0xBFC00BF0, LENGTH = 0x4
config2 : ORIGIN = 0xBFC00BF4, LENGTH = 0x4
config1 : ORIGIN = 0xBFC00BF8, LENGTH = 0x4
config0 : ORIGIN = 0xBFC00BFC, LENGTH = 0x4
kseg1_data_mem (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x2000
sfrs : ORIGIN = 0xBF800000, LENGTH = 0x100000
configsfrs : ORIGIN = 0xBFC00BF0, LENGTH = 0x10
}

Could someone please send me the bootloader source and perhaps explain why the maps are so different. I'm also going to attempt to mod the bootloader for a MX250F128D part to replace the MX220F032D part that's on the board as well.
Reply
25-02-2013, 10:21 AM,
#2
RE: Actual usable code size / linker script
My first thought is not to start with X3 as it's quite old.

Also, that xc32 one looks to be for a rather different PIC32 chip.

John
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)