this is likely closer to what you want....

i...@dooble-laptop:~$ cat f.s
        .arch msp430x110

        .text
        .org 0xE000
main:   nop
        nop
        nop
        .end
j...@dooble-laptop:~$ msp430-as f.s
j...@dooble-laptop:~$ msp430-objdump -D a.out

a.out:     file format elf32-msp430

Disassembly of section .text:

00000000 <main-0xe000>:
        ...

0000e000 <main>:
    e000:       03 43           nop
    e002:       03 43           nop
    e004:       03 43           nop

redirect the output of msp430-objdump -D a.out > tempfile

then write a simple script to convert to the hex format that you want.

There are a couple things to keep in mind.  Just using assembler, you
need to keep track of what is in flash and what is in ram.  You will
also need to ensure that your code does not interfere with your code
that is already loaded.  The a.out file is a full memory map.  



On Mon, 2009-08-10 at 19:07 -0600, david feldman wrote:
> Thanks for another quick reply - I am getting really close - one fairly minor 
> issue to go:
> 
> I've fixed the source file f.s to look like what gcc expects:
> 
>     .arch msp430x1232
>     .text
>     .org    0xE000
> main:    nop
>     nop
>     nop
>     .end
> 
> This assembles without error using the command line:
> 
> msp430-gcc -c f.s -o f.out
> 
> and I can then convert to intel hex using:
> 
> msp430-objcopy -O ihex f.out f.hex
> 
> And here is my only remaining problem: The object file f.out is about 56K 
> long - it is filled with zero bytes from address 0000 to DFFF, then my 6 
> bytes of expected object code (the three nops) beginning at E000. When this 
> is converted to intel hex, I end up with a giant file full of 16-byte records 
> that try to fill memory from 0000 to DFFF, then the expected 6-byte hex 
> record showing the bytes beginning at E000 which are my tiny program above.
> 
> So my remaining question - how to I tell msp430-gcc to confine it's output to 
> the memory range I want (in this case, E000 up to the length of the program 
> I'm trying to assemble)?
> 
> Thanks again for all the help!
> 
> Dave
> 
> 
> > Message: 7
> > Date: Mon, 10 Aug 2009 16:13:36 -0600
> > From: david feldman 
> > Subject: [Mspgcc-users] Beginner question - getting started with
> > msp430-gcc - command line usage
> > To: 
> > Message-ID: 
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> >
> > I'm in need of some help getting started using msp430-gcc on a linux 
> > machine using command line. I have no prior experience with gcc so there's 
> > a learning curve I'd like help shortening.
> >
> > After kind help from this list, I've installed msp430-gcc and related 
> > binary utilities onto my Ubuntu 9.04 machine from repository at wyper.ca. 
> > The instructions I used (from a handy PDF file at www.develissimo.net) are 
> > much more extensive (including install of debugger proxy, eclipse IDE, and 
> > so on) than I needed in this case (just "binutils".)
> >
> > My need is only to assemble msp430 assembly source file and link into an 
> > intel hex file that I can then transmit to my remotely-located msp430 
> > microcontroller. I do not need jtag support (my microcontroller has a 
> > serial port loader and I won't be using jtag due to it's remote location). 
> > I can only access the remote linux machine (connected to the msp430 
> > microcontroller) via ssh, so I can't use the Eclipse IDE. Therefore, this 
> > is a really basic configuration - just enough to 
> > edit-assemble-link-download, all from command line.
> >
> > I am sure my problem (at this stage) is just lack of appropriate command 
> > line options for msp430-gcc, but when I try to compile a trivial assembly 
> > language program:
> >
> > $ cat f.s
> > include
> > org #0xE000
> > nop
> > end
> >
> > with the command (based on the msp430-gcc documentation on assembling I 
> > found):
> >
> > $ msp430-gcc -D_GNU_ASSEMBLER_ -x assembler-with-cpp -c f.s -o f.o
> >
> > I get this output:
> >
> > f.s: Assembler messages:
> > f.s:1: Error: unknown opcode `include'
> > f.s:2: Error: unknown opcode `org'
> > f.s:4: Error: unknown opcode `end'
> >
> > What other options do I need to tell msp430-gcc how to recognize the 
> > incoming source code?
> >
> > Very tks,
> >
> > Dave
> >
> >
> >
> > _________________________________________________________________
> > Get back to school stuff for them and cashback for you.
> > http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1
> >
> >
> > ------------------------------
> >
> > ------------------------------------------------------------------------------
> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> > trial. Simplify your report design, integration and deployment - and focus 
> > on
> > what you do best, core application coding. Discover what's new with
> > Crystal Reports now. http://p.sf.net/sfu/bobj-july
> >
> > ------------------------------
> >
> > _______________________________________________
> > Mspgcc-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/mspgcc-users
> >
> >
> > End of Mspgcc-users Digest, Vol 39, Issue 2
> > *******************************************
> 
> _________________________________________________________________
> Get back to school stuff for them and cashback for you.
> http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with 
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Reply via email to