Hi Peter,

Here is a patch to fix the incorrect boot and info address and sizes.

--- elf32msp430.sc      2010-05-27 15:53:29.000000000 +0200
+++ /home/hans/msp430/elf32msp430.sc    2010-05-27
15:48:37.000000000 +0200 @@ -41,6 +41,22 @@
 FARTEXT_SECTION_MSP430=""
 fi
 
+if [ -z $BOOT_START ] ; then
+       BOOT_START=0x0c00
+fi
+
+if [ -z $BOOT_SIZE ] ; then
+       BOOT_SIZE=1K
+fi
+
+if [ -z $INFO_START ] ; then
+       INFO_START=0x1000
+fi
+
+if [ -z $INFO_SIZE ] ; then
+       INFO_SIZE=256
+fi
+
 cat <<EOF
 OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
 OUTPUT_ARCH(${ARCH})
@@ -50,9 +66,9 @@
   ${TEXT_REGION_MSP430}
   data   (rwx)      : ORIGIN = $RAM_START,     LENGTH = $RAM_SIZE
   vectors (rw)      : ORIGIN = $VECTORS_START,     LENGTH =
$VECTORS_SIZE
-  bootloader(rx)    : ORIGIN = 0x0c00,     LENGTH = 1K
-  infomem(rx)       : ORIGIN = 0x1000,     LENGTH = 256
-  infomemnobits(rx) : ORIGIN = 0x1000,     LENGTH = 256
+  bootloader(rx)    : ORIGIN = $BOOT_START,     LENGTH = $BOOT_SIZE
+  infomem(rx)       : ORIGIN = $INFO_START,     LENGTH = $INFO_SIZE
+  infomemnobits(rx) : ORIGIN = $INFO_START,     LENGTH = $INFO_SIZE
   ${HEAP_MEMORY_MSP430}
 }
 

I tested it with msp430f5438 and msp430f1612 and both seem to have
their correct definitions now. 

Regards,

Hans


On Thu, 27 May 2010 06:58:03 -0500
Peter Bigot <p...@peoplepowerco.com> wrote:

> (I speak here with reference to the binutils patches in the mspgcc4
> repository.  Not sure which release you're using.)
> 
> Chip-specific constants like that are stored in ld/emulparams/msp430all.sh.
> It appears ones for INFO and BOOT were added for some (but not all) chips,
> but are never referenced. They probably should be used in ld/scripttempl/
> elf32msp430.sc in place of the hard-coded constants.  (And maybe
> elf32msp430_3.sc; not sure why that family merits its own script).
> 
> Did you discover this by analysis, or can you provide a short shell sequence
> that generates an elf32 with content in these sections so I can verify
> before/after behavior on various chips?
> 
> Below are sections from the ld manual; I don't know specifically why one
> would want to put data into a memory section but not write it to the chip.
> 
> ``.bootloader''
>      Defines the bootloader portion of the ROM (if applicable).  Any
>      code in this section will be uploaded to the MPU.
> 
> ``.infomem''
>      Defines an information memory section (if applicable).  Any code in
>      this section will be uploaded to the MPU.
> 
> ``.infomemnobits''
>      This is the same as the `.infomem' section except that any code in
>      this section will not be uploaded to the MPU.
> 
> Peter
> 
> On Thu, May 27, 2010 at 5:33 AM, Hans Nieuwenhuis <vz...@xs4all.nl> wrote:
> 
> > Hi all,
> >
> > Just found out that binutils (2.20.1, but also older revs.) installs
> > incorrect linker files for the msp430x54xx parts. These parts have
> > their bootloader starting at 0x1000, but as shown in the snippet blow
> > that's where the linker puts the infomem section. Infomem should be
> > four blocks of 128 bytes starting at 0x1800.
> >
> >  bootloader(rx)    : ORIGIN = 0x0c00,     LENGTH = 1K
> >  infomem(rx)       : ORIGIN = 0x1000,     LENGTH = 256
> >  infomemnobits(rx) : ORIGIN = 0x1000,     LENGTH = 256
> >
> > What is the purpose of the sections infomem and infomemnobits as they
> > both point the same start address? Can someone shed a light on this?
> >
> > Thanks,
> >
> > Hans
> >
> >
> >
> > ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > Mspgcc-users mailing list
> > Mspgcc-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/mspgcc-users
> >

Reply via email to