Re: [Mspgcc-users] Fwd: New MSP430 GCC version release available!

2015-09-21 Thread Grant Edwards
On 2015-09-21, Peter Bigot <big...@acm.org> wrote:

> I no longer use MSP430 and at some point will stop updating my
> archive. Earlier this summer I was using the upstream gcc+binutils
> (5.0.0-based at the time, selected specifically for C++14 support),
> built as documented at
> http://pabigot.github.io/bsp430/msp430elf.html.  Stock GNU tools work
> fine with MSP430 now, though they sometimes do lag in applying
> patches that appear in the TI fork.  Only the device-specific headers
> and linker scripts from TI (also in my archive) are necessary when
> using upstream versions.

Things have come a long way since I first started using mspgcc about
11 years ago.  I'm glad TI stopped dragging their feet and acting
generally obstructive and got behind gcc.  I'm no longer an active
user of the '430, but I'd like to extend my personal thanks to
everybody who worked on mspgcc over the years (especially in the old
days) -- and thanks/congratulations to whoever at TI finally slapped
some sense into management at TI and got them to support gcc.  Back in
the day it must have been embarassing to many at TI to see how highly
everbody regarded Atmel due to thier commitment to gcc and
open-source.  [Expecially considering how annoying and hard to support
the AVR architecture was compared to the '430.]

-- 
Grant Edwards   grant.b.edwardsYow! Will this never-ending
  at   series of PLEASURABLE
  gmail.comEVENTS never cease?


--
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] .data initialization not working

2014-12-08 Thread Grant Edwards
On 2014-12-08, Nicholas Clifton ni...@redhat.com wrote:
 Hi Peter,

 Nick: Are you saying that the linker scripts are changing so that a global
 variable definition like this:

 int myvar = 43;

 will result in myvar being stored in RAM, and no initialization of it so
 the value of myvar when main starts is not 43?

 No.  I am saying that myvar will be stored in the .data section of the
 executable image and that its value in this image, will be set to 43. 
 In addition the section header for the .data section will be set to an 
 address in RAM, so that when the executable is loaded into the MCU's 
 memory the correctly initialised variable will be ready to be used.

That makes no sense.  Code is is flash.  On startup, where is that 43
going be?  If it's not in flash, where?

 What has changed is the presumption of where the executable is stored
 before it starts executing.

 Previously there was an implicit assumption that the executable would
 be stored in the ROM of the system and that at program startup there
 would have to be an explicit copying of data from the ROM image into
 RAM.

That's how embedded microprocessors that run from flash _work_.

 With the current linker scripts there is an assumption that the
 executable is stored externally, and it is brought into system memory
 before execution begins.

So you're assuming that an MSP430 with a few KB of flash and a few
hundred bytes of RAM is running some sort of OS that's going to load
the program from disk into RAM and run it?

 With this scenario there is no need to copy data between ROM and RAM
 as the data is just loaded directly into RAM.

By _WHAT_?

-- 
Grant Edwards   grant.b.edwardsYow! Life is a POPULARITY
  at   CONTEST!  I'm REFRESHINGLY
  gmail.comCANDID!!


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] .data initialization not working

2014-12-08 Thread Grant Edwards
On 2014-12-08, Peter Bigot big...@acm.org wrote:
 Unfortunately this list doesn't support attachments.  Perhaps somebody
 could put it on E2E and add a pointer.

 Interesting that TI proposed a solution that doesn't work for ROM
 resident applications, which are all but the most infinitesimal
 subset of the applications that use an MSP430.  (It's so implausible
 I'm half convinced I don't understand exactly what's happened here.)

I agree.  This is completely baffling.  Either somebody has
incorrectly described what's going on, or we're all supposed to hook
up disk-drives and blocks of SDRAM to our '430s and run some sort of
OS on them.

-- 
Grant Edwards   grant.b.edwardsYow! I'm having a RELIGIOUS
  at   EXPERIENCE ... and I don't
  gmail.comtake any DRUGS


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] .data initialization not working

2014-12-08 Thread Grant Edwards
On 2014-12-08, Eric Price pr...@smartmote.de wrote:

 to me the change to the TI linker scripts simply makes no sense

None at all.  It seems to be assuming that an MSP430 is running some
sort of OS with some sort of external non-volatile storage from which
it loads/runs programs.

-- 
Grant Edwards   grant.b.edwardsYow! Okay ... I'm going
  at   home to write the I HATE
  gmail.comRUBIK's CUBE HANDBOOK FOR
   DEAD CAT LOVERS ...


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] msp430-elf-g++ optimizing out main()

2014-09-24 Thread Grant Edwards
On 2014-09-23, Wylder Keane wylder.ke...@gmail.com wrote:
 I've been using the new msp430-elf-g++ released on 2014-09-03 to build and
 debug, and while attempting to reduce the binary size I've added the
 following arguments for the compilation and linking phases (except
 gc-sections is linker only).

 -fdata-sections -ffunction-section -nodefaultlibs --gc-sections

 While greatly reducing the code space, it also seems to think main() isn't
 a root and optimizes it away... needless to say this isn't very good.

A would guess that the -nodefaultlibs option is preventing the
inclusion of the standard startup code, which is what normally calls
main().  That unresolved reference to main is what would normally
cause the linker to pull in main.

You can probably work around it by passing -u main to the linker, but
unless there is startup code calling main it won't really matter
whether it's linked in or not.

-- 
Grant Edwards   grant.b.edwardsYow! Should I do my BOBBIE
  at   VINTON medley?
  gmail.com


--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] msp430-elf-g++ optimizing out main()

2014-09-24 Thread Grant Edwards
On 2014-09-23, Wylder Keane wylder.ke...@gmail.com wrote:

 Interesting that main() is not considered a root with gcc. The crt0.S start
 code which references main is in the binary that is generated event with
 the nodefaultlibs call.

So you end up with an uresolved reference to main when using
--gc-sections et al?

-- 
Grant Edwards   grant.b.edwardsYow! Your CHEEKS sit like
  at   twin NECTARINES above
  gmail.coma MOUTH that knows no
   BOUNDS --


--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Unable to use LARGE MEMORY MODEL with RH GCC

2014-05-31 Thread Grant Edwards
On 2014-05-30, Eric Decker cire...@gmail.com wrote:

 CCS is Code Composer Studio which is basically a gui front end to the
 gcc toolchain.

Is that thing still around?  It used to be so bad that the TI FAE I
knew told everybody to avoid it at all costs and referred to it as
Code Composter.  Perhaps it's improved... 


Remember: an IDE is no substitute for knowing how to use the
underlying toolchain.

-- 
Grant


--
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] msp430-elf-gcc upcoming release

2014-04-23 Thread Grant Edwards
On 2014-04-22, DJ Delorie d...@redhat.com wrote:

 I was surprised to see DJ's comment that there actually was no
 standard system interface; the standard interface I was referring to
 is the one documented at http://neptune.billgatliff.com/newlib.html

 The key to a successfully ported newlib is providing stubs that
  bridge the gap between the functionality newlib needs, and what your
  target system can provide.

 This bridge is what I was referring to.  Newlib calls read() but does
 not provide an implementation of it.  Libgloss provides various
 target-specific implementations of read(), the one I wrote for msp430
 uses CIO to communicate with the simulator/debugger.

Why is newlib calling read(), and from what is it expecting to read?

 I was expecting for MSP430 to also simply implement the functions
 stubbed in newlib's libnosys, but at first glance it looks like the
 CIO one uses different names, and maybe doesn't support all the same
 functions.

 Hmmm... it should be all the same names.  I only changed the existing
 libgloss hooks.  But, I don't always do all the hooks, usually only
 write() and exit() are needed for our testing.

Again, why should newlib be calling write() and what is it expecting
to write _to_?

What does it expect exit() to do?

-- 
Grant Edwards   grant.b.edwardsYow! Did you move a lot of
  at   KOREAN STEAK KNIVES this
  gmail.comtrip, Dingy?


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] msp430-elf-gcc upcoming release

2014-04-23 Thread Grant Edwards
On 2014-04-23, Peter Bigot big...@acm.org wrote:

 Again: whatever the environment wants it to do.  In my case, I'm
 using printf(3c) in my code, and I want it to output to one of the
 UARTs, which newlib accommodates by using write(2) to descriptor 1,
 just like any other standard C library.

 This works because I supply a _write() function that does that.

But it's not called like a normal C function, it goes through some
sort of syscall interface so you don't actually link your _write()
function with newlib?

 Or maybe it sends the data to an LCD. Maybe exit() starts blinking a
 red LED if the return code isn't zero. Whatever any of the system
 functions do, it's my choice, and I like that newlib allows me that
 control.

Hmm. Is there an option to build a non-hosted version of newlib which
doesn't assume any underlying OS support.

-- 
Grant Edwards   grant.b.edwardsYow! Is it 1974?  What's
  at   for SUPPER?  Can I spend
  gmail.commy COLLEGE FUND in one
   wild afternoon??


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] msp430-elf-gcc upcoming release

2014-04-23 Thread Grant Edwards
On 2014-04-23, DJ Delorie d...@redhat.com wrote:

 But it's not called like a normal C function, it goes through some
 sort of syscall interface so you don't actually link your _write()
 function with newlib?

 It *is* called like a normal C function.  You really do just link
 libgloss.a (or your equivalent) in with your app like you would any
 other library.

I see.  I guess to me a syscall interface implies something other
than a normal C function call to a function that's linked with the
caller.

-- 
Grant Edwards   grant.b.edwardsYow! In Newark the
  at   laundromats are open 24
  gmail.comhours a day!


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] msp430-elf-gcc upcoming release

2014-04-22 Thread Grant Edwards
On 2014-04-22, Peter Bigot big...@acm.org wrote:

 I expect there'll be some issues with newlib as well; it appears to
 use a unique syscall interface that I haven't tried to reverse
 engineer.

I don't understand.  A syscall API is usually the interface between
libc code (which is running in user mode) and an underlying OS kernel
that's running in protected mode.  Into what What OS kernel is newlib
expecting to be able to make syscalls?

For example, the syscall interface I deal with is the API between
either glibc or uclibc and the Linux kernel.  It's architecture
specific, since the the mechanism for swithcing to/from protected mode
usually has to be done in assembler.  It's typically something like:

  * Load parameters in to specific registers

  * Execute some variety of SWI instruction to generate a hardware
exception/interrupt.

-- 
Grant Edwards   grant.b.edwardsYow! Actually, what I'd
  at   like is a little toy
  gmail.comspaceship!!


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] MSP430 GCC goes Red Hat

2013-12-12 Thread Grant Edwards
On 2013-12-12, Mitnacht, Thomas t-mitna...@ti.com wrote:

 For all of you interested in an official beta version of the MSP430
 GCC have a look at the latest MSP430 blog post
 http://e2e.ti.com/blogs_/b/msp430blog/archive/2013/12/09/you-beta-believe-it-gcc-and-ccsv6.aspx

From the above page:

The new BETA version of GCC for MSP430 has arrived and offers a
full open source tool chain including the GCC compiler, BinUtils, GDB
Debug, and DLLv3. 

What is DLLv3?

It sounds frighteningly Microsoftesque...

-- 
Grant Edwards   grant.b.edwardsYow! I hope the
  at   ``Eurythmics'' practice
  gmail.combirth control ...


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Size of global variable

2013-07-29 Thread Grant Edwards
On 2013-07-29, ravim ravi.mandl...@gmail.com wrote:
 My apologies if I am asking something irrelevant to this forum. We are using
 mspgcc and mspdebug for our project. We are facing some issues with what we
 assume might be stack overflow. The timer interrupts stops working after
 around 2 hours, however device still receives packets. Also, when we reset
 the device after timer gets stuck, they never turn back on unless we
 re-install the code.  We are trying to debug.

 I wanted to know if there is any possible way we can know the size of
 global variables in the binary?

Not easily, no.

It's pretty easy to find the total size of non-automatic initalized
variables (section .data) and total size of non-automatic
uninitialized variables (.bss) by looking at a linker map file or by
using the size or objdump commands on the linked ELF file.

You can generate a linker file by passing the -Map mapfilename
option to the linker.  If you are using the gcc binary to do the
linking, then you can tell it to pass an option on to the linker by
using the -Wl option:

gcc -Wl,-Map,foo.map -o foo.elf file1.o file2.o file3.o

However, I'm not aware of a simple way to find the sizes of only the
_global_ variables and not include local variables that have a static
storage class (The .bss and .data sections include both global and
local variables).

 This will help us narrow down a few specifics. We know there is
 something in TinyOs when we make, it let us know size of global
 variables, we are looking for something similar in mspdebug.

Why mspdebug?

-- 
Grant Edwards   grant.b.edwardsYow! I want a VEGETARIAN
  at   BURRITO to go ... with
  gmail.comEXTRA MSG!!


--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] mspgcc Red Hat release

2013-07-08 Thread Grant Edwards
On 2013-07-08, Brendan Conoboy b...@redhat.com wrote:
 On 07/04/2013 07:10 PM, Peter Bigot wrote:
 I have no information about Red Hat's toolchain other than what's been
 announced here, but:

 Red Hat's MSP430 toolchain is entirely unrelated to mspgcc.  I am unaware
 of any information having been provided related to support for libc or
 specific MCUs in this new work.  While msp430mcu and msp430-libc might work
 with some fiddling, it's not clear they're needed, I very much doubt
 they're the intended solution, and they certainly don't incorporate any
 changes to accommodate Red Hat's implementation.

 There is now msp430 support in newlib:

 http://www.cygwin.com/ml/newlib/2013/msg00362.html

 Since we did a clean re-implementation of the MSP port we can't comment 
 on the pre-existing mspgcc library solutions: We really don't know.  Our 
 plan is to support and enhance standard upstream infrastructure.  For 
 libc this means newlib.

How does newlib compare with the old msp430 libc when it comes to
size?  In the past, when I've tried newlib for embedded work it was
_huge_.

-- 
Grant Edwards   grant.b.edwardsYow! Th' MIND is the Pizza
  at   Palace of th' SOUL
  gmail.com


--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] mspgcc undefines too-many-bits shifts in weird way

2013-04-22 Thread Grant Edwards
On 2013-04-21, Paul Sokolovsky pmis...@gmail.com wrote:

 It's all nice and good. But there's difference between undefined,
 any value and weird.

No, there isn't.  Undefined means _exactly_ that: you might get any
value -- no matter how wierd you think it.

 Because too many bits shifts may be undefined in C standard, but
 shifts by arbitrary number of bits are very well defined in
 arithmetic - and by very definition of (unsigned) shift, any value
 shifted by more bits than available in its representation is 0.

That's not what the C standard says.

 That's logical, that's what users know, that's what they expect from
 compiler,

They're wrong to expect that.  If the standard says the result is
undefined, then expecting anything in particular is wrong.

 So, msp430-gcc just masks out higher bits of shift count, and in this
 case leaves original value intact. Which turns term ((1  BITS) -
 1), which is common to do BITS-modular arithmetic, and would be
 expected to just optimize out in case of a full type, into an
 expression killer with infinite loops, etc. ensuing.

If you write incorrect code, you oughtn't be surprised when it behaves
incorrectly.

-- 
Grant Edwards   grant.b.edwardsYow! Will this never-ending
  at   series of PLEASURABLE
  gmail.comEVENTS never cease?


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] mspgcc undefines too-many-bits shifts in weird way

2013-04-22 Thread Grant Edwards
On 2013-04-21, Paul Sokolovsky pmis...@gmail.com wrote:
 On Sun, 21 Apr 2013 17:06:51 -0500 Peter Bigot big...@acm.org wrote:

 This decision was intentional, as documented in
 https://sourceforge.net/p/mspgcc/bugs/118/.  My recollection is that
 the choice of how to make things consistent was informed by similar
 behavior in the contemporaneous gcc for x86 or at least one other
 target architecture.

 Thanks for the reference. So, I tested it with x86 gcc 4.4, 4.5, 4.6,
 4.7 (packages as shipped by Ubuntu), all of them produce
 mathematically expected result.

That's irrelevent.

 msp430-gcc 4.5.3, 4.7.0 both produce unexpected result.

That's per the standard.  If you write code that depends on some
particular behavior for somethign that's undefined, then that code
is wrong.

-- 
Grant Edwards   grant.b.edwardsYow! I'm wearing PAMPERS!!
  at   
  gmail.com


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Compiler optimization bug?

2013-02-08 Thread Grant Edwards
On 2013-02-08, Robert Henig rhe...@redwoodsys.com wrote:

 gSlaTxFrame.payloadPtr is a char*, so
 gSlaTxFrame.payloadPtr[gSlaTxFrame.pos]. You are more expert then me
 with compilers so I won't argue. But it is strange to me that or'ing
 char into the low byte of an unsigned short causes the high byte of
 the short to become 0xff.

You're not or-ing a char into the low byte of an unsigned short.

You're promoting a char to an short, and then or-ing that short short
into the destination unsigned short.

When the signed char is promited to a 16-bit integer, it is
sign-extended (that's what the sxt instruction is for).

  0x00-0x7f   promotes to   0x-0x007f
  0x80-0xff   promotes to   0xff80-0x

That's the way it works according to the C language standard.

If the sxt instruction wasn't there, the generated code would be
wrong.

 I will do some tests to verify.

 += instead of |= fixes the problem in the code.

Only if you can assume the low byte of the destination is 0x00 to
start with.  If not, then you won't get the right result.

A better solution would probably be:

  short-dest |= (unsigned char)whatever;

If you're just shuffling 8-bit wide chunks of data around, always,
always, always use unsigned char.  Or better yet, uint8_t.
  
-- 
Grant Edwards   grant.b.edwardsYow! Will the third world
  at   war keep Bosom Buddies
  gmail.comoff the air?


--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Follow-ups for TI compiler (CCS) and mspgcc

2012-10-29 Thread Grant Edwards
On 2012-10-29, Peter Bigot big...@acm.org wrote:

 Since a Code Composer Studio license gets you full compiler support
 for ARM and MSP430 (and I think C2K) microcontrollers on two hosts
 covering Windows and Linux for about $450, it's a reasonable next
 step for somebody going beyond hobbyist needs.

It's good to hear that TI supports Linux!  It's been a long time
coming, but they still seem to have beaten IAR...

 (Being a command-line--oriented developer, I do find it a little
 confusing that CCS = Code Composer Studio seems to refer to the
 development environment, whereas the compiler is a separately
 versioned anonymous component, which I think I'm calling TI
 Compiler where it needs to be identified.)

I assume that one can ditch the pointy-clicky IDE and use the TI
compiler with make?

-- 
Grant Edwards   grant.b.edwardsYow! DIDI ... is that a
  at   MARTIAN name, or, are we
  gmail.comin ISRAEL?


--
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] MSP430 GCC goes Red Hat

2012-10-26 Thread Grant Edwards
On 2012-10-26, David Brown david.br...@hesbynett.no wrote:

 Another issue is that TI make and sell their own msp430 toolchain -
 Code Composer Studio.  I would like to hear exactly how TI see CCS
 and gcc fitting together and/or competing.  It is certainly possible
 for TI to support both toolchains, but it could be a delicate path to
 tread.

TI is still prentending that Code Composter for the '430 is real?

The last time I went to an MSP430 event (which was a few years ago),
the FAE openly discouraged people from trying CC for the '430.  He
told everybody to use IAR for playing with eval kits (he also briefly
mentioned gcc).

World+dog seemed to be of a single mind: that CC for the 430 was
useless, but management at TI didn't want to admit it in public.

-- 
Grant Edwards   grant.b.edwardsYow! In 1962, you could buy
  at   a pair of SHARKSKIN SLACKS,
  gmail.comwith a Continental Belt,
   for $10.99!!


--
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] MSPGCC Code Size vs IAR

2012-05-16 Thread Grant Edwards
On 2012-05-16, Stefan N?rnberger s...@zelle79.org wrote:

 If it is purely about code size you should definitely compile without
 the debugging symbols (drop the -g switch). This should reduce the
 size of the binary dramatically.

If that's true, it's a compiler bug isn't it?.  Enabling debug symbols
should not affect the generated code or the size of the resulting text
segment. Enabling debug symbols with certain types of optimization
doesn't always produce usable results (in terms of setting breakpoints
on particular source lines, single-stepping, etc.), but it shouldn't
produce a larger code size.

-- 
Grant Edwards   grant.b.edwardsYow! We have DIFFERENT
  at   amounts of HAIR --
  gmail.com


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Stack push inside inline assembly

2012-04-17 Thread Grant Edwards
On 2012-04-17, JMGross msp...@grossibaer.de wrote:

 Access to word members inside a packed struct is NOT done as a word
 read/write, but through a rather complex chainof operation, because
 the alignment of the struct and therefore of the member is unknown.

Why is the alignment of a structure member unkown?

Unless the structure is packed, the alignemnt should be known.

-- 
Grant Edwards   grant.b.edwardsYow! I'm definitely not
  at   in Omaha!
  gmail.com


--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Stack push inside inline assembly

2012-04-17 Thread Grant Edwards
On 2012-04-17, Grant Edwards grant.b.edwa...@gmail.com wrote:
 On 2012-04-17, JMGross msp...@grossibaer.de wrote:

 Access to word members inside a packed struct is NOT done as a word
 read/write, but through a rather complex chainof operation, because
 the alignment of the struct and therefore of the member is unknown.

 Why is the alignment of a structure member unkown?

 Unless the structure is packed, the alignemnt should be known.

Actually, now that I think about it, the alignment of fields in packed
structures is known as well: bitfields are aligned on bit boundaries,
everyting else is aligned to byte boundaries.

-- 
Grant Edwards   grant.b.edwardsYow! It don't mean a
  at   THING if you ain't got
  gmail.comthat SWING!!


--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Want use gettimeofday function , but there is no sys/time.h in the include directory.

2012-02-24 Thread Grant Edwards
On 2012-02-24, steve ayer a...@handhelds.org wrote:

 not necessarily.  you can certainly provide a device with a seed 
 timestamp that will carry through an app's runtime.

What happens when the app is idle and the processor sleeps with the
clos shut down?

 there's also ntp for folks who run an ip stack on top of their radio.

-- 
Grant Edwards   grant.b.edwardsYow! My haircut is totally
  at   traditional!
  gmail.com


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Want use gettimeofday function , but there is no sys/time.h in the include directory.

2012-02-24 Thread Grant Edwards
On 2012-02-24, Peter Bigot big...@acm.org wrote:
 On Fri, Feb 24, 2012 at 10:09 AM, N. Coesel n...@nctdev.nl wrote:
 At 16:37 24-2-2012, Grant Edwards wrote:
On 2012-02-24, steve ayer a...@handhelds.org wrote:

 not necessarily. you can certainly provide a device with a seed
 timestamp that will carry through an app's runtime.

What happens when the app is idle and the processor sleeps with the
clock shut down?

 You work around that. Maybe a hardware RTC? IMHO there is very little
 point in trying to argue time and date functions are irrelevant to a
 microcontroller environment.

I'm not arguing that they're irrelvent, I'm just wondering if it makes
sense to talk about trying to write a universal gettimeofday()
function for inclusion in the library.

 A lot of devices do need to keep track of date  time. Instead of
 re-inventing the wheel its better to use a different (small) C
 library which has these functions and stay Posix compliant.

 Agreed; the underlying function might have to be user-provided just
 as putchar is for msp430-libc, but the API should be standard.

I'm not sure I see the point of the extra layer.  Are there other
library functions besides gettimeofday() that would call the
underlying, user-provided function-that-isnt-gettimeofday?

-- 
Grant Edwards   grant.b.edwardsYow! I want to dress you
  at   up as TALLULAH BANKHEAD and
  gmail.comcover you with VASELINE and
   WHEAT THINS ...


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Want use gettimeofday function , but there is no sys/time.h in the include directory.

2012-02-24 Thread Grant Edwards
On 2012-02-24, Peter Bigot big...@acm.org wrote:
 On Fri, Feb 24, 2012 at 12:30 PM, Grant Edwards
grant.b.edwa...@gmail.comwrote:

 On 2012-02-24, Peter Bigot big...@acm.org wrote:
  On Fri, Feb 24, 2012 at 10:09 AM, N. Coesel n...@nctdev.nl wrote:

 A lot of devices do need to keep track of date  time. Instead of
  re-inventing the wheel its better to use a different (small) C
  library which has these functions and stay Posix compliant.
 
  Agreed; the underlying function might have to be user-provided just
  as putchar is for msp430-libc, but the API should be standard.

 I'm not sure I see the point of the extra layer.  Are there other
 library functions besides gettimeofday() that would call the
 underlying, user-provided function-that-isnt-gettimeofday?


 My point is that there is value in re-using the POSIX API including struct
 timeval and gettimeofday/settimeofday, which have commonly understood and
 documented semantics, rather than inventing a new time representation and
 way to manipulate it.

Agreed.

 It may be that gettimeofday is the fundamental function that must be
 user-provided.

That was my question.

 (Although clock_gettime() might be an alternative to consider,
 especially since it's paired with clock_getres(), which could be
 useful.)

Yes, it looks like those might be a better base.  AFAICT, you can
implement gettimeofday() on top of clock_gettime(), but not the other
way around.

 Once you have gettimeofday with struct timeval, you can add
 localtime/gmtime and struct tm, and then strftime, and you can
 interact with your RTC with a well-known API.

-- 
Grant Edwards   grant.b.edwardsYow! Well, O.K.
  at   I'll compromise with my
  gmail.comprinciples because of
   EXISTENTIAL DESPAIR!


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Simulation and algorithm timing

2012-01-07 Thread Grant Edwards
On 2012-01-07, David Brown david.br...@hesbynett.no wrote:
 On 06/01/12 20:30, Grant Edwards wrote:
 On 2012-01-06, steve ayera...@handhelds.org  wrote:

 of course, you could put a wire on an unused gpio pin and put the
 device on a scope; that will give you accurate timing of code
 segments.

 In my experience that's usually the easiest method by far...


 One thing to watch out for here is that when you write something like:

   ...
   setPinHi();
   test code ...
   setPinLo();
   ...

 you might not be timing all of the test code, or only the test code. 
 The compiler can often move the code around the setPin statements, 
 especially if they are macros or functions that the compiler can see 
 during the compilation.

True.  When measuring timings like that it's always a good idea to
have a peek at the assembly to make sure you're measuring what you
think you're measuring.  When working with the 3.x msp430 compiler, I
never saw it move any code from inside a set-pin/clear-pin pair to
outside, but it's certainly allowed in many circumstances. You can try
to convice the compiler not to do so by inserting memory barriers or
moving test code into a function and calling it, but I've never had
to.

It's quite possible that the 4.x compiler is more aggressive about
moving stuff around.  When working on low level stuff like an MSP430,
I pretty much always have my Makefiles set up to generate mixed
C/assmebly language listings so that it's easy to keep an eye on what
the compiler is doing.  One advantage of that is that you quickly
learn what C constructs are handled efficiently by the compiler wand
what aren't -- you learn that the smallest, fastest way to do things
in C on an MSP430 is not the same as on an AVR.

-- 
Grant





--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Simulation and algorithm timing

2012-01-07 Thread Grant Edwards
On 2012-01-07, Peter Bigot big...@acm.org wrote:
 On Sat, Jan 7, 2012 at 9:00 AM, Grant Edwards grant.b.edwa...@gmail.com 
 wrote:

 It's quite possible that the 4.x compiler is more aggressive about
 moving stuff around. ?When working on low level stuff like an MSP430,
 I pretty much always have my Makefiles set up to generate mixed
 C/assmebly language listings so that it's easy to keep an eye on what
 the compiler is doing. ?One advantage of that is that you quickly
 learn what C constructs are handled efficiently by the compiler wand
 what aren't -- you learn that the smallest, fastest way to do things
 in C on an MSP430 is not the same as on an AVR.

 The 4.x compilers (especially 4.6.x) do optimize much more
 aggressively, but if you use the defined peripheral registers like
 P2OUT mspgcc had better not re-order them across sequence points,
 since those are marked volatile.  If you do see something like this,
 it's almost certainly a bug and I'd appreciate it being reported on
 the SF tracker.

However the test code might be non-volatile, and as such GCC is
still free to move it outside the set/clear pair (AFAICT).  The GCC
documentaion I've found appears to indicate that the restriction on
moving code across sequence points only affects volatile accesses.
Quoting from 
http://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/Volatiles.html#Volatiles

   The minimum either standard specifies is that at a sequence point
   all previous accesses to volatile objects have stabilized and no
   subsequent accesses have occurred.  

Note that the GCC docs only say that _volatile_ accesses can't be
moved across sequence points. More searches reveal similar statements
along with a few seemingly well-informed postings where it is
explicitly stated that non-volatile accesses may be moved across
sequence points.

For example from http://blog.regehr.org/archives/28 (which appears to
be a rather well-informed article):

  Summary: Most compilers can and will move accesses to non-volatile
  objects around accesses to volatile objects, so don't rely on the
  program ordering being respected.

I don't know if it's still an issue, but at one point he mentions a
volatile bug in MSP430:

  Compilers are not totally reliable in their translation of accesses
  to volatile-qualified objects.  I've written extensively about
  this subject elsewhere, but here's a quick example:

volatile int x;

void foo (void) {
  x = x;
}

  The proper behavior of this code on the actual machine is unambiguous:
  there should be a load from x, then a store to it.  However, the port
  of GCC to the MSP430 processor behaves differently:

$ msp430-gcc -O vol.c -S -o -
foo:
  ret

[I don't know which version of mspgcc that refers to, and it's not
really related to our topic but it does lead me to believe that the
author knows what he's talking about.]
  
Anyhow I can't find anywhere in GCC docs that say non-volatile
accesses can't be moved across sequence points or volatile accesses.
If sequence points and volatile accesses only constrain ordering of
accesses to volatile objects, and what you're timing doesn't involve
volatile objects, then adding sequence points doesn't matter.

However, adding a memory barrier ought to do the trick.  I think.

Pointers to GCC docs actually stating what to expect would be
most welcome...

-- 
Grant Edwards   grant.b.edwardsYow! I KAISER ROLL?!
  at   What good is a Kaiser Roll
  gmail.comwithout a little COLE SLAW
   on the SIDE?


--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Simulation and algorithm timing

2012-01-07 Thread Grant Edwards
On 2012-01-07, Peter Bigot big...@acm.org wrote:
 On Sat, Jan 7, 2012 at 10:28 AM, Grant Edwards
grant.b.edwa...@gmail.com wrote:

 However the test code might be non-volatile, and as such GCC is
 still free to move it outside the set/clear pair (AFAICT).

[...]

 Anyhow I can't find anywhere in GCC docs that say non-volatile
 accesses can't be moved across sequence points or volatile accesses.
 If sequence points and volatile accesses only constrain ordering of
 accesses to volatile objects, and what you're timing doesn't involve
 volatile objects, then adding sequence points doesn't matter.

 However, adding a memory barrier ought to do the trick. ?I think.

 Yes, today I think you're right.

I've always been a bit fuzzy on this stuff, so don't bet the farm on
my opinions.  It seems to be a common belief in embedded programmers
that compilers aren't allowed to (and won't) move anything past a
volatile access, but I've never been able to find any convincing basis
for that belief.

 In fact, that's what I thought back in early December when I added
 cycle timing to test430 and found a situation where the compiler
 helpfully moved the test code out from between the start/stop counter
 reads.  I did something that stopped that from happening, though I
 don't remember what; it wasn't a memory barrier.

 Later in December, the topic arose again in the context of the thread
 at http://gcc.gnu.org/ml/gcc/2011-12/msg8.html, during which
 discussion I became convinced any such move was a compiler error,
 apparently because I mis-read Richard Guenther's response in
 http://gcc.gnu.org/ml/gcc/2011-12/msg00026.html.  The discussion
 there ultimately revealed an underlying gcc bug that will eventually
 be fixed in a 4.7.x release, so confusion about the issue is common
 even among those who are expected to know better.

I don't have a complete copy of the C standard, but some of the
excerpts I have read certainly didn't make anything any clearer in my
mind. I think reading standards like that is a skillset that takes a
lot more work/practice than I've put in.

 Pointers to GCC docs actually stating what to expect would be
 most welcome...

 The current version of what you cited
 (http://gcc.gnu.org/onlinedocs/gcc/Volatiles.html) is the best I know
 of,

That is clearer than the older versions.

Now, if only I wasn't perpetually confused over what's a sequence
point and what isn't...

[I know it's well defined, but that doesn't mean I can remember it
correctly.]

-- 
Grant Edwards   grant.b.edwardsYow! I'm thinking about
  at   DIGITAL READ-OUT systems
  gmail.comand computer-generated
   IMAGE FORMATIONS ...


--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Simulation and algorithm timing

2012-01-06 Thread Grant Edwards
On 2012-01-06, steve ayer a...@handhelds.org wrote:

 of course, you could put a wire on an unused gpio pin and put the
 device on a scope; that will give you accurate timing of code
 segments.

In my experience that's usually the easiest method by far...

-- 
Grant Edwards   grant.b.edwardsYow! S!!  I hear SIX
  at   TATTOOED TRUCK-DRIVERS
  gmail.comtossing ENGINE BLOCKS into
   empty OIL DRUMS ...


--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Breakpoints in MSPDebug

2012-01-03 Thread Grant Edwards
On 2012-01-03, Jesse Frey jmf...@alaska.edu wrote:
 you can use
 msp430-objdump -dS object files
 disassemble and intermixed source and disassembly. you can also go the
 other way with msp430-addr2line

Another option I often use is to tell the assmebler to produce a
listing file:

main.elf: main.c
msp430-gcc -g -Wa,-ahl=main.lst -Wall -Werror [...] -o main.elf main.c

-- 
Grant Edwards   grant.b.edwardsYow! My life is a patio
  at   of fun!
  gmail.com


--
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Trouble with mspgcc (ld.exe and memory.x)

2011-12-12 Thread Grant Edwards
On 2011-12-12, William Lopes williamlopes@gmail.com wrote:

 Now I understood. Then I can to program using ELF file only? What is
 command for this?

 mspdebug will happily program using the ELF version.

Yes, you can program an MSP430 part using the ELF file.

The mspdebug program is one way to do that:

  http://mspdebug.sourceforge.net/

-- 
Grant Edwards   grant.b.edwardsYow! !  Now I understand
  at   advanced MICROBIOLOGY and
  gmail.comth' new TAX REFORM laws!!


--
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] link question

2011-09-26 Thread Grant Edwards
On 2011-09-26, Bustamante, Paul pbustama...@ceit.es wrote:

 When I have a 10 functions in a file funcs.c, and I only use one of
 them, when I link to the main program (main.c), all the functions in
 the file funcs.c are included in the .elf file.

 How I can link that only the functions that I use will be included in
 the .elf file?

Compile with the -ffunction-sections option (you may also want the
-fdata-sections option), then link with the --gc-sections option.

The -ffunction-sections option will place each function in a separate
memory section (-fdata-sections does the same thing for variables). 

The --gc-sections linker option will discard any sections that are not
referenced.

IIRC, there have been a couple recent versions where support for those
features was broken, but I think it's all fixed now.

-- 
Grant Edwards   grant.b.edwardsYow! I want EARS!  I want
  at   two ROUND BLACK EARS
  gmail.comto make me feel warm
   'n secure!!


--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Stack checking

2011-08-29 Thread Grant Edwards
On 2011-08-29, JMGross msp...@grossibaer.de wrote:

 I've been reading this thread for a while and it 
 makes me wonder if there is some kind of tool 
 which can analyze the code and determine the 
 stack usage? I think this may be a safer route 
 than to depend on a real-time stack check. The 
 big question is: what do you do when the stack 
 overflows? Just resetting the MCU is probably not 
 an option so you'll have to add extra code to 
 handle such an 'exception'. That does not seem very trivial to me.

 Stack usage is a dynamic thing and happens at real-time. 
 Unless you code a benchmarck that always executes 
 exactly the same way, there is no way to determine stack 
 usage.

That's not always true.  I theory, if your call tree is static (no
calls via pointers or other computed means), then you can determine
the stack usage by static examination of the call tree since the frame
size for each function is know.  Then you have to add on top of that
the stack usage by the interrupts (if you don't nest interrupts,
that's pretty straight-forward)

 Some minor, small projects might be analyzeable, but for the
 majority, it's up to you to guess and hope :)

If you're lucky, you can do your prototyping and testing with a chip
that has extra RAM.  That way you can allocate plenty of stack space
to each thread, fill the stack with an identifiable pattern, and then 
measure the stack usage after have done stress-testing testing that
covers as much of the call tree as possible.  Then you multiply your
measured stack usage by a fudge-factor and cross your fingers.

-- 
Grant


--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free Love Thy Logs t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] ld flag --gc-sections not working any more?

2011-08-05 Thread Grant Edwards
On 2011-08-05, William Chops Westfield wes...@mac.com wrote:

 On Aug 4, 2011, at 8:18 AM, Peter Bigot wrote:

 --gc-sections should now be fixed
:
  Use of msp430-ar will work as expected

 Hmm.  So is there a tool that will take a source module
 (with multiple functions) compiled with the relevant compiler
 options (-ffunction-sections and -fdata-sections) and produce
 a random-access library of the sort you would have gotten if
 you had broken down the source to file-per-function?

No, that's not possible in the general case [see below].

 That way you'd get benefit with or without special linker
 support...

Not really.

One of the great things about the --gc-sections method is that you can
have private data/functions that are shared by all of the public
functions in a file.  Let's say you split the file up into separate
files: one for each function (private or public) and one for each
global or file-scope variable.  The result?  You have to make all of
the functions publically visible and all of the data shared by those
fuctions publically visible.

For example, my module may consist of 5 publically visible
functions, 1 publically visible variable, 7 private functions, and 12
priviate variables.  Using --gc-sections I have one object file which
exposes 6 global symbols.  Splitting it up would create 25 object
files and 25 global symbols, and all of the module's private data and
fuctions are now visible to the rest of the program.

It's all about encapsulation and controlling namespace clutter.

It could be easily argued that those features should have been
provided by the C language design, and I wouldn't disagree.  But, they
weren't.  We're pretty much stuck with C, and --gc-sections goes a
long ways in patching a major hole in C's design.

Personally, I think Modula-2/3 or Ada are all probably better suited
for embedded systems use than C, but that's pretty much a moot point.
C++ tried to fix some of C's encapsulation and namespace shortcomings,
but the result was a complete dog's breakfast.

-- 
Grant Edwards   grant.b.edwardsYow! Is it 1974?  What's
  at   for SUPPER?  Can I spend
  gmail.commy COLLEGE FUND in one
   wild afternoon??


--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos  much more. Register early  save!
http://p.sf.net/sfu/rim-blackberry-1
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] ld flag --gc-sections not working any more?

2011-08-05 Thread Grant Edwards
On 2011-08-05, Peter Bigot pabi...@users.sourceforge.net wrote:
 On Fri, Aug 5, 2011 at 12:06 AM, William Chops Westfield
wes...@mac.com wrote:

 On Aug 4, 2011, at 8:18 AM, Peter Bigot wrote:

 --gc-sections should now be fixed
 ? :
 ?Use of msp430-ar will work as expected

 Hmm. ?So is there a tool that will take a source module
 (with multiple functions) compiled with the relevant compiler
 options (-ffunction-sections and -fdata-sections) and produce
 a random-access library of the sort you would have gotten if
 you had broken down the source to file-per-function?

 I personally don't know of such a tool; it seems --gc-sections is the
 way this is need is expected to be met.  FWIW, as an experiment I
 added the flags to msp430-libc and it seems to work, though the
 savings is naturally not particularly impressive (90 bytes of a 28KB
 image from a monolithic TinyOS program).

The benefit is seen mainly when you want to reuse code or build
multiple versions of a program with different features enabled.

For example, you write a library module providing a half-dozen
publically visible functions: it may have another half-dozen private
functions and some private data.

In a given program you may only use one or two of the public
functions.

Without --gc-sections you have come up with a set of preprocessor
macros to enable/disable the building of individual public functions.
Then inside the module you need even more complex cpp magic to figure
out which private functions and data are needed based on which public
functions have been enabled.  Then you have to re-compile the module
everytime the configuration changes.

Either that, or you replace your single object file with a dozen plus
object files and you expose all of the module's private data to
everybody and his dog.

If you're just bulding multiple versions of one program with different
features enabled, --gc-sections allows you to do that without having
to recompile anything -- it's all handled at the link stage.  If you
want to build the full-fat version, you link in all the files.  If you
don't want features A and B, you don't link in object files A and B.
The linker figures out what other functions/data aren't need now that
A and B have been left out, and those functions get left out as well.

-- 
Grant Edwards   grant.b.edwardsYow! Somewhere in DOWNTOWN
  at   BURBANK a prostitute is
  gmail.comOVERCOOKING a LAMB CHOP!!


--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos  much more. Register early  save!
http://p.sf.net/sfu/rim-blackberry-1
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] ld flag --gc-sections not working any more?

2011-08-03 Thread Grant Edwards
On 2011-08-03, Peter Bigot big...@acm.org wrote:

 There should be no reason to use --gc-sections.

Why not?  I've been using it for over a decade and find it very useful.

-- 
Grant Edwards   grant.b.edwardsYow! Spreading peanut
  at   butter reminds me of
  gmail.comopera!!  I wonder why?


--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos  much more. Register early  save!
http://p.sf.net/sfu/rim-blackberry-1
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] ld flag --gc-sections not working any more?

2011-08-03 Thread Grant Edwards
On 2011-08-03, Peter Bigot big...@acm.org wrote:

 The library archives are built so that unreferenced functions are not
 linked in.

There are other files in most projects besides the library archives. ;)

 Furthermore, I believe gc-sections operates on whole sections, not
 functions, so unless you have code built with -ffunction-sections it
 would make no difference.

Yes, in order for gc-sections to be useful you need to use
-ffunction-sections and -fdata-sections -- and that's generally how
people use it.

 Until the binutils update from half an hour ago, I have no reason to
 believe mspgcc supported -ffunction-sections correctly.

The old 3.x version did.  I used it for years.

 (The linker changes will not be back-ported to the 4.5.3 LTS
 release.) The same should hold for -fdata-sections.

Are you saying that -fdata-sections is broken in recent versions of
mspgcc?

 If you see a reduction in code size when you use --gc-sections, and
 what it removes really wasn't necessary, figure out why it got put in
 there in the first place and fix it there.

That's pretty narrow-minded.

When reusing code, it's _very_ useful to be able to put a set of
related functions in a single file so that you can avoid name-space
issues and only expose certain selected names in the global namespace.
If all of the functions aren't needed for a given project, you
-ffunction-sections and -gc-sections can be used to discard the ones
that aren't needed.  This has been a common way of doing things for a
long time.  I've been using it for at least a dozen years and I
certainly didn't invent it.  I don't see how you can decided all of a
sudden that it's not valid.

Putting each function in a separate file produces a big mess both --
both in relation to namespace pollution and managing source files.

-- 
Grant Edwards   grant.b.edwardsYow! ... the HIGHWAY is
  at   made out of LIME JELLO and
  gmail.commy HONDA is a barbequeued
   OYSTER!  Yum!


--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos  much more. Register early  save!
http://p.sf.net/sfu/rim-blackberry-1
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] ld flag --gc-sections not working any more?

2011-08-03 Thread Grant Edwards
On 2011-08-03, aliko ali.tli...@gmail.com wrote:
 To correct issue I've changed couple of lines in memory.x file as where 
 suggested in one forum.
 from:
  KEEP(*(.init))
  *(.init0)  /* Start here after reset.   */
  *(.init1)  /* User definable.   */
  *(.init2)  /* Initialize stack. */
  *(.init3)  /* Initialize hardware, user definable.  */
  *(.init4)  /* Copy data to .data, clear bss.*/
  *(.init5)  /* User definable.   */
  *(.init6)  /* C++ constructors. */
  *(.init7)  /* User definable.   */
  *(.init8)  /* User definable.   */
  *(.init9)  /* Call main().  */

 to:

  KEEP(*(.init))
  KEEP(*(.init0))  /* Start here after reset.   */
  KEEP(*(.init1))  /* User definable.   */
  KEEP(*(.init2))  /* Initialize stack. */
  KEEP(*(.init3))  /* Initialize hardware, user definable.  */
  KEEP(*(.init4))  /* Copy data to .data, clear bss.*/
  KEEP(*(.init5))  /* User definable.   */
  KEEP(*(.init6))  /* C++ constructors. */
  KEEP(*(.init7))  /* User definable.   */
  KEEP(*(.init8))  /* User definable.   */
  KEEP(*(.init9))  /* Call main().  */

Yep, that's the solution.

 And now firmware works good. The size of firmware using gc-sections
 is 77% of that not using it and it does metter I think.

Of course it does.

-- 
Grant Edwards   grant.b.edwardsYow! I'll eat ANYTHING
  at   that's BRIGHT BLUE!!
  gmail.com


--
BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos  much more. Register early  save!
http://p.sf.net/sfu/rim-blackberry-1
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] compiler optimization bug in mspgcc4?

2011-07-13 Thread Grant Edwards
On 2011-07-13, Ricky Wong Yung Fei yfwongri...@gmail.com wrote:

 I know I could actually compare the assembly outputs of the both OS
 image, but before I do so, I would like to confirm the likelihood of
 this being a bug as I'm not very good with gcc internals e.g. when
 programs work in O0 but not O1 and above, is it normally a bug with
 the optimizer?

With other more widely used backends, I'd say it's almost always a
programming error (e.g. a missing volatile keyword).  The MSP430
backend doesn't have as many miles on it as the IA32, ARM, or SPARC
backends, so there's more of a chance it is an optimizer-induced
backend bug.

Narrowing it down to a specific bit of code is the only way to tell...

-- 
Grant Edwards   grant.b.edwardsYow! What GOOD is a
  at   CARDBOARD suitcase ANYWAY?
  gmail.com


--
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on Lean Startup 
Secrets Revealed. This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] modulo

2011-05-10 Thread Grant Edwards
On 2011-05-10, Miriam Dali miriamd...@yahoo.fr wrote:

 Thank you for your answer , I'm really sorry my question was not clear :(
 I wrote a simple code in C, but when I port it to mspgcc it doesn't give me 
 the right value. This is a part of my code:
 unsigned short int xk=3588, yk=47541, yk1, sig=10, de=1;
 unsigned long int xk1;
 xk1=( xk+(sig*(yk-xk)*de));
 yk1=xk1 % 65535;

 the result that I expect is xk1=443118 and yk1=49908, but in mspgcc it gives 
 me xk1=yk1=49902
 I don't know where is the fault may be in the type choice?

sig*(yk-xk)*de is too big to fit in 16 bits, so the result of that is
getting truncated, and which wrong answer you get will depend on the
order in which the mulitply operations are done.

You need to tell the compiler to calculate xk+(sig*(yk-xk)*de using
32-bit operations not 16-bit operations, so make one of the variables
on the right hand side (e.g. yk) a long integer.

-- 
Grant Edwards   grant.b.edwardsYow! I want a WESSON OIL
  at   lease!!
  gmail.com


--
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] modulo

2011-05-10 Thread Grant Edwards
On 2011-05-10, Miriam Dali miriamd...@yahoo.fr wrote:

 Thank you for your answers, I tried to cast yk to long int as you
 said, the result that I get is: xk1=fffbc2ee, and yk1=49898 it's the
 same  result when I cast all the variables

Show us the code.

-- 
Grant Edwards   grant.b.edwardsYow! Hey, wait
  at   a minute!!  I want a
  gmail.comdivorce!! ... you're not
   Clint Eastwood!!


--
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] official mspgcc forum

2011-05-04 Thread Grant Edwards
On 2011-05-04, msp430 microcontrollerfr...@gmx.at wrote:
 hello mspgcc community,
 
 There is a mspgcc forum at: http://develissimo.com/forum/
 We want it to make it the official mspgcc forum!

This mailing list is the official mspgcc forum.

 develissimo is a NEW 2011 electronic platform targeting open
 source development only!
 
 There are great advantages over mailing-lists:

I call BS on that..

 The Forum should support you with fine layout,

Web forums are a huge waste of time.  I monitor a dozen or two 
mailing lists in only a few minutes per day.  I use slrn pointed
news.gname.org, but there are other equally efficient methods.  Were I
to attempt to do the same via web forums it would waste hours of my
time.

 the possibility to communicate via PMs(personal messages),
 hide your personal data such as email from the outside world,
 control and share social networking data, and a bunch of
 other nice features, such as: +Show new posts since last
 visit +Mark all topics as read +Search functions +Chang
 layout via different included stylesheets. +Add avatar +User
 defined settings +User ability to write their own electronic
 blogs etc.
 
 Hopefully you will join us!

Not a snowball's chance in a CAT scanner.

 Other interesting electronic related forums are: MSPDebug,
 Eclipse, KiCAD, Ktechlab, SDCC, GCC, Programming Sections, C,
 C++, Java, Python, and a lot more!
 
 Develissimo launched March 2011 and has reached production
 stage. Have a look at http://develissimo.com/ main page.
 
 best greetings
 Raphael from develissimo.com
 
 ps: lets move from old style mailing lists to new 2011 Forums.

Let's not.  Mailing lists are brilliant for this sort of thing.  We
forums are screen-wasting time-sinks designed primarily to sell ads.

-- 
Grant Edwards   grant.b.edwardsYow! over in west
  at   Philadelphia a puppy is
  gmail.comvomiting ...


--
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Anyone know what RWM in the TI 5438 means?

2011-04-06 Thread Grant Edwards
On 2011-04-06, JMGross msp...@grossibaer.de wrote:

 Ah. ?I guess I got taken in by TI calling the MSP430 a RISC machine.
 Yea, that's a lie. I asked a TI FAE about that when it came up in his
 power-point sleep--a-thon. He admitted it was a lie.
 I'd say technically its marketing.
 There's a difference?

 There's a difference between a lie, not telling the whole truth and
 simplifying things. The MSP isn't a CISC too. It's more RISC than
 CISC

I disagree.  It lacks almost all of the characteristics typical of a
RISC architecture:

 * fixed, single-clock execution?  No.
 * fixed width instructions? No.
 * load/store architecture? No.
 * pipelined? No.
 * Harvard architecture? No.
 * branch delay slot? No 
 * small instruction count? Yes.
 
Not all RISC architectures have all of the above, but simply having
a small instruction count just isn't good enough IMO.
 
 (and has all advantages of a CISC by not having the drawbacks), so
 yes, it's not RISC but RISC-like. But you cannot explain ten pages of
 how RISC like it is when writing an ad.

 So RISC is much closer to the truth than CISC, and there's no 'MISC'
 in the middle. Also, RISC is no trademark and no otherwise protected
 term. It's a (not protectable) acronym and using it does not tie you
 to any definition. It's different to saying it follows the RISC
 standard, which would be a lie if such a 'standard' did exist.
 However, the cited description of a RISC processor is no standard at
 all, just a description.

RISC is indeed a rather loose term based on a variety of criteria --
all but one of which (small instruction count) are not met by the
MSP430.

I really like the MSP430 architecture, but it's not a RISC processor.
It's an elegently stripped-down CISC processor.

-- 
Grant Edwards   grant.b.edwardsYow! This PORCUPINE knows
  at   his ZIPCODE ... And he has
  gmail.comVISA!!


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Anyone know what RWM in the TI 5438 means?

2011-04-06 Thread Grant Edwards
On 2011-04-06, JMGross msp...@grossibaer.de wrote:

 Well, I like it too, but it is definitely not a stripped-down CISC.
 It is a fresh start with the RISC idea in mind, but not following the
 established implementations of this idea.

I just don't see how not following the the established idea of what
RISC is can result in something that should be call RISC.

To me, it looks more like a PDP11 redesign with 16 registers instead
of 8.  Unfortunately, increasing the register set size required that
some of the PDP11's orthogonality had to be thrown out.

 Saying that it cannot be RISC without having the listed attributes is
 like saying you may not call yourself a human without blonde hair,
 blue eyes and being tall. (which is nonsense, as we all know) :)

Saying it's RISC without following the commonly accepted idea of what
RISC is just seems like redifining RISC to mean anything at all.

-- 
Grant Edwards   grant.b.edwardsYow! I just had my entire
  at   INTESTINAL TRACT coated
  gmail.comwith TEFLON!


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Anyone know what RWM in the TI 5438 means?

2011-04-05 Thread Grant Edwards
On 2011-04-05, Eric Decker cire...@gmail.com wrote:
 On Mon, Apr 4, 2011 at 8:43 PM, Steve Underwood ste...@coppice.org wrote:


 A large part of the MSP430 instruction set is read-modify-write. How do
 you think all those memory to memory operations work?


 Ah.  I guess I got taken in by TI calling the MSP430 a RISC machine.

Yea, that's a lie.  I asked a TI FAE about that when it came up in his
power-point slee--a-thon.  He admitted it was a lie.

-- 
Grant Edwards   grant.b.edwardsYow! RELATIVES!!
  at   
  gmail.com


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Changes to mspgcc CRT capabilities in uniarch release

2011-03-17 Thread Grant Edwards
On 2011-03-17, JMGross msp...@grossibaer.de wrote:
 - Urspr?ngliche Nachricht -
 Von: Grant Edwards
 Gesendet am: 16 Mrz 2011 17:51:51

 It's not only that the datasheets talk about disabling the watchdog.
 Disabling an already disabled watchdog does no harm.
 neither is enabling it again a problem, if you actively want to use it.
 But not enabling it when the docs say it is enabled
 What docs say it's enabled when main() is entered in an app built with
 mspgcc?

 The processor datasheet says that after a BOR/POR/PUC the WDT is
 enabled.

And that's still true.  The processor datasheet is mute about the
behavior of startup code that's shipped with compilers.

 Disabling it by inherently placed default compiler code, especially
 if this is neither well documented nor easily to prevent, is worse
 than bad.

I agree that the behavior needs to be documented and there should be
an option to specify that the WDT not be disabled during startup.

 IMHO, leaving it enabled during startup would have been more
 desirable.

 Not only more desireable, but a MUST.

But, it wasn't done that way, and we can't decide now that it MUST
have been.

 I think a way to prevent the startup code from disabling the WDT is
 an absolute requirement.

 indeed. Here we totally agree.

 But, as long as there's a way to get either behavior, I don't think
 changing the default behavior should be undertaken lightly.

 Not if 'the way' means writing your own startup code (in assembly
 language) or using compiler-specific switches, attrivutes and other
 things, just to get the expeccted default behavior.

Agreed. Replacing the startup code with user-written code isn't a
good-enough option.

 besides being less than not obvious, it also digs the gap between
 mspgcc and the 'official' MSP compilers even deeper.

 However, being unprotected for some milliseconds (which is an
 eternity) while you think you are, isn't good. In fact, it is way
 worse than being protected when you don't think you are :)

 Is an option to prevent the WDT from being disabled by startup code
 insufficient for that scenario?

 Yes, if it is not the default behavior.

 Imagine a PC where the BIOS will silently switch off the UDMA without
 an option to enable it,

My hypothetical stated that there _was_ an option to leave it enabled.

You seem to be knocking down a straw man.

-- 
Grant Edwards   grant.b.edwardsYow! I feel like a wet
  at   parking meter on Darvon!
  gmail.com


--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Changes to mspgcc CRT capabilities in uniarch release

2011-03-16 Thread Grant Edwards
On 2011-03-16, JMGross msp...@grossibaer.de wrote:

 - Urspr?ngliche Nachricht -
 Von: Chris Liechti
 Gesendet am: 15 Mrz 2011 20:26:40

 It's not only that the datasheets talk about disabling the watchdog.
 Disabling an already disabled watchdog does no harm.

 neither is enabling it again a problem, if you actively want to use it.

 But not enabling it when the docs say it is enabled

What docs say it's enabled when main() is entered in an app built with
mspgcc?

 while it has been disabled by the compiler _does_ do harm.

IMHO, leaving it enabled during startup would have been more
desirable.  I think a way to prevent the startup code from disabling
the WDT is an absolute requirement.

But, as long as there's a way to get either behavior, I don't think
changing the default behavior should be undertaken lightly.

 There are many devices where the MCU is only powered when an event
 occurs. The MSP is no chip for a router that runs for mothn without
 reboot. It is for devices which require low power consumption. And
 the lowest is shutting down when not required. :) That's what the new
 .5 LPMs were designed for.

 However, being unprotected for some milliseconds (which is an
 eternity) while you think you are, isn't good. In fact, it is way
 worse than being protected when you don't think you are :)

Is an option to prevent the WDT from being disabled by startup code
insufficient for that scenario?

 a hardware watchdog is also often used to protect against programming
 errors (e.g. not enough stack space for all combinations of interrupts
 and foreground code). this kind of protection is not needed during
 startup as the code there is proven (and interrupts locked).

 Using a WDT for dixing software bugs is very bad style. What happens?
 The device resets and runs into the same condition again. It's a
 dirty way to 'fix' defective code or faulty program design.

One might claim that having a backup generator available to power the
cooling pumps in a nuclear reactor is bad style too, but I'm not
going to argue against that!

-- 
Grant Edwards   grant.b.edwardsYow! I'm having an
  at   EMOTIONAL OUTBURST!!  But,
  gmail.comuh, WHY is there a WAFFLE
   in my PAJAMA POCKET??


--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Include files for assembler

2011-03-06 Thread Grant Edwards
On 2011-03-05, Matt mkni...@tesco.net wrote:

 If you use a .S suffix for the assmebly file, then you can assemble
 them with gcc, and it'll do the normal cpp stuff.

 Thanks Grant. That works a treat on the command line. I just need to
 work out how to make Eclipse do it!

You're on your own there.  I've tried Eclipse a couple times, and both
times left a pretty bad taste in my mouth.

-- 
Grant


--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Include files for assembler

2011-03-05 Thread Grant Edwards
On 2011-03-05, Matt mkni...@tesco.net wrote:

 I'm using mspgcc-4.4.5/Eclipse/Ubuntu to compile a mixed C and asm
 project for 'F2013. I have assembler functions in their own .S file
 that use some TimerA registers. Is there a way to make GNU assembler
 recognise C-style header files?

If you use a .S suffix for the assmebly file, then you can assemble
them with gcc, and it'll do the normal cpp stuff.

-- 
Grant Edwards   grant.b.edwardsYow! Wow!  Look!!  A stray
  at   meatball!!  Let's interview
  gmail.comit!


--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] mspgcc4 version 20110213 released

2011-02-15 Thread Grant Edwards
On 2011-02-14, Peter Bigot pabi...@users.sourceforge.net wrote:

 The package has now been reduced to include patches only for the
 actively developed upstream releases: binutils 2.21, gcc 4.4.5, and
 gdb 7.2.  And, of course, the immortal insight 6.8.1.

ITYM the undead insight 6.8.1.  ;)

[I must admit that once-upon-a-time I did find the combined
C/assembly/register display useful when debugging some startup code.]

-- 
Grant Edwards   grant.b.edwardsYow! My life is a patio
  at   of fun!
  gmail.com


--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] mailing list administrivia

2010-11-30 Thread Grant Edwards
On 2010-11-30, JMGross msp...@grossibaer.de wrote:
 - Urspr?ngliche Nachricht -
 Von: Matthias Andree
 Gesendet am: 29 Nov 2010 12:15:21

 The list is driven by Mailman, so you can subscribe with all your
 accounts that you need to post from and set all but one to nomail
 mode, i. e. you can post because you're subscribed, but you don't
 receive copies.

 Interesting. How does one know this if he's not the list maintainer?

You point a browser at the link in the header of every message:

  https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Or you send a message to the help address that's in the headers of
every message:

  mailto:mspgcc-users-requ...@lists.sourceforge.net?subject=help

 And how does this work? I'm sure there is a howto somewhere and if
 you know 'how to' you'll find the howto. :)

It's all in the headers.  All mailing lists put everything you need to
know to subscribe, unsubscribe, or adjust your settings in the headers
of every message.

 Your webmailer should offer the opportunity to save local copies
 anyways, such as Auto-Bcc, sent folders, or thereabouts.

 Yes. The webmailer. Then the copies are in a private folder of the
 mailer, and not where they are on my main system. Anyway, as I said
 before, there i sno sense in forcing people to rearrange their
 organisation to fit this group. As the reuired reorganisation needed
 of a different group may be incompatible, leaving people to decide to
 use one of them but not both. That's surely not the intention of a
 mailing list.

I'm not sure what you're saying in that paragraph.  The proposed
changes for this list will make it the same as many, many other lists.

If your mail client is so bad, perhaps you'd be better off reading the
list via gmane.org:

  http://news.gmane.org/gmane.comp.hardware.texas-instruments.msp430.gcc.user

Personally, I use a news client and point it at gmane's NNTP server.
  
 Also, why keeping a copy in sent when the mail already bounces back
 through the list (unless it is rejected)?

Bounce means something very specific in the context of e-mail and
mailing lists.  I don't think you mean bounce.

 I'm sure there are many people who see it the same. Yet since they'll
 never appear here, you'll never know of them and therefore you might
 think there are none. :)

 Your messages don't usually appear threaded but start new threads. 
 This is a nuisance.

 Hmm, well, I didn't know and will look into this, but I doubt there's 
 anything I can do.

Yes there is:

 1) Use a working mail client (web-based or otherwise).  Gmail works fine.

 2) Use the web UI at gmane.org.

 3) Use an NNTP client pointed to gmane.org's NNTP server.

 The mailing program I usually use is a portable low-footprint program
 that does not mess with the inbox unless I explicitely tell it so.

The mailing program you usually use is broken.

 It's a but like the old Windows Messaging 2.0. Download of headers
 only, unless you click on a mail and so on. I got it from my hoster
 and I'm happy with it for ten years now (with updates, of course).
 Small, fast, portable, useful. And it normally does its job.

Except it seems to be broken in several respects, or you wouldn't be
breaking thread nor complaining now about how your mail client works
with mailing lists who require posters to subscribe.

 It allows plain text posting by subscribers, so what's the point?

 Plain text posting is a technique from the last milennium and neither
 up-to-date nor commonly available unless you're system administrator
 and deliberately configure your system against the default.

Whatever.

Feel free to start your own mailing list.

-- 
Grant Edwards   grant.b.edwardsYow! Do you think the
  at   Monkees should get gas on
  gmail.comodd or even days?


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Application size

2010-11-25 Thread Grant Edwards
On 2010-11-25, JMGross msp...@grossibaer.de wrote:

 msp430-size -t program.elf

For more details:

  msp430-objdump --headers program.elf

For even more details, tell the linker to produce a map file, and look
at that.

-- 
Grant



--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] mailing list administrivia

2010-11-16 Thread Grant Edwards
On 2010-11-16, Peter Bigot p...@peoplepowerco.com wrote:

 1) I propose to change the list management so that email to it from
people who are not subscribed is immediately bounced (saying that
the list requires subscription for posting), rather than put into
a pending bucket where Chris or I have to look at it.  If it's
worth our time to read, it's worth the sender's time to subscribe
so they can see responses.

Sounds reasonable to me.  It would be nice of the change in status was
reflected at Gmane.org, but even if it isn't, people will figure it
out.

 2) Anybody who subscribes from an address that implements a screening
filter like Boxbe so that mail to the list results in a request to
add yourself to the recipient's Guest List will be summarily
unsubscribed.  Maybe I'll send an email saying why.  I won't
bother to add myself to your guest list to tell you that it's
happened.  Manage your spam without inconveniencing me, thank you
very much.

No problem with that.

-- 
Grant Edwards   grant.b.edwardsYow! I just remembered
  at   something about a TOAD!
  gmail.com


--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2  L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
___
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Re: [Mspgcc-users] Creating .lst files with C code

2010-07-02 Thread Grant Edwards
On 2010-07-02, JMGross msp...@grossibaer.de wrote:
 Von: N. Coesel
 Gesendet am: 01 Jul 2010 14:19:57

 I too use objdump to generate a complete project listing from the elf
 file.

I've never seen that work except for extremely trivial programs.

 It has, however, some serious drawbacks.

As in it doesn't work?  :)

 Not only that jumps and calls are not printed with their symbolic
 name, also the source code in the listing is sometimes (often) from a
 completely different file or from different lines of the same file.
 So it is virtually useless.

AFAIK this is the result of compiling with optimisation on. If you
want a proper list file with source code mixed in, you should compile
without optimisation (-O0) and with full debugging enabled (IIRC -g3).
At least thats how it works for me when using GCC in general.

 No, its not an optimization problem. The individual .lst files of the
 object files are fine. Sometimes, the source is a bit mangled by
 optimization, (and sometimes, the assembler will show som boguse
 unreachable code warnings too due to optimization, but in general it
 fits. At least the source is form the same function. But in the
 global .lst file that objdump generates, the source code is a real
 mess.

Generating source listings from a linked program using objdump has
never worked for any target architecture I've tried.  IMO, you're
beating your head against the wall trying to generate source listings
with objdump.

Generating them for individual files by passing appropriate flags to
the assembler has always worked on all the architectures I've used
(though I can't vouce for gcc 4.x on the '430, it works fine with
3.x).

 I can't find a pattern too. Sometimes the source code is okay,
 somethimes it is a completely different part of the right file,
 sometimes it is from a completely different source file not related
 to the code at all.

That's the behaivior I've always seen when trying to generate source
listings using objdump.

 If I switch on some more info in the global .lst, the comments show
 'File a, line x' yet the source code is from file b, line x or even
 line y. So the info is there (File a line x would be correct). Even
 the path of file a is shown correctly (so using VPATH is not 
 aproblem) But then somehow things get messed up. Seems that objdump
 is unable to extract line x in file a and extracts line y from file b
 instead.

Based on how completly it's broken and how long it's been that way, I
assumed that it wasn't supposed to work...

-- 
Grant Edwards   grant.b.edwardsYow! I have accepted
  at   Provolone into my life!
  gmail.com




Re: [Mspgcc-users] Creating .lst files with C code

2010-06-30 Thread Grant Edwards
On 2010-06-30, Diane Gagne drose.ga...@gmail.com wrote:

 I am in the process of moving from mspgcc 3.2.3 to mspgcc4, but I am
 having trouble with the creation of the .lst files.  When my source
 is compiled with the 3.2.3 the list files have the C code printed in
 them along with the assembly.  Using the same makefile, and compiling
 with the mspgcc4 the C code goes away which makes it harder to read.

 I realize that objdump will give me close to what I am looking for,
 but those files do not have the jumps listed.

 Is there a way to get the C code back, maybe a default option changed
 that I do not realize?

Can you give us a hint as to what options are you using to generate
the listing?

-- 
Grant Edwards   grant.b.edwardsYow! I just remembered
  at   something about a TOAD!
  gmail.com




Re: [Mspgcc-users] Unused functions occupying unnecessary memory

2010-06-22 Thread Grant Edwards
On 2010-06-22, JMGross msp...@grossibaer.de wrote:

 If I understood the linker scripts correctly, the linker will put all
 .text and .text.* compiler segments into the linker text segment.

 After the unreferenced .text.* sections are discarded, the remaining
 ones will all be placed into the .text section in the output file.

 As I undestood you, the linker should do this for any (complete)
 object file anyway, independently of the gc-sections setting.

The discarding of unreferences sections is enabled by the
--gc-sections linker option.

 Yet it doesn't. Any object file is put into the binary, whether
 referenced or not.

Unless you specify the --gc-sections option linker option.

 So there are no empty segments to be discarded by -gc-sections.

I'm not sure what empty segments you're talking about.

 segments - = sections. I think I got the 'empty' by browsing the ld
 option description. Or i dedutcted it from your expression of
 discarded unused content.

unused != empty

 Are you _sure_ you passed the -gc-sections flag to the linker?
 no (see below)

 First, both -ffunction-sections and -gc-sections flags are commented
 out in your makefile.

 I tried with and without. The version I posted was the last test
 (without both).

 Second, it's '--gc-sections' not '-gc-sections'

 I tried both :)

And both would have produced an error/warning using your posted
makefile, which should have prompted you to try figure out what you
were doing wrong rather than claiming the feature didn't work:

$ make
msp430-gcc -g -ffunction-sections --gc-sections -Wa,-ahl=main.lst -O2
-Wall -Werror -mmcu=msp430x149 -Wa,-ahld=main.lst -o main.elf main.c
cc1: unrecognized option -fgc-sections'
make: *** [main.elf] Error 1

$ make
msp430-gcc -g -ffunction-sections -gc-sections -Wa,-ahl=main.lst -O2
-Wall -Werror -mmcu=msp430x149 -Wa,-ahld=main.lst -o main.elf main.c
cc1: warning: c-sections': unknown or unsupported -g option
msp430-objcopy -O srec main.elf main.hex


 Third, if you uncomment them and add the second hyphen, you're still
 not passing --gc-sections flag to the linker, you're passing it to
 the compiler (which should have resulted in a error message).

 If you want to pass the --gc-sections flag to the linker via the gcc
 command line, you need to use either -W,--gc-sections or -Xlinker
 --gc-sections

 That's the point. (or nearly, according to the GC manual, it is -Wl,x
 (which works)

Right.  Sorry about the typo.

 I read the ld documentation and missted the fact that the compiler
 gets the options first, even if added to LDFLAGS.

The ld documentation has no way of knowing what program you're passing
LDFLAGS to in your Makefile.

 Nevertheless, I don't understand why foo() is added to the binary by
 the linker default, while it is not referenced and in its own object
 file.

Because you didn't pass the --gc-sections flag to the linker to tell
it to discard unreferenced sections.

 With the use of -Wl, I come to this conclusion:

 1) without --gc-sections, the linker keeps ALL code passed to it in
an object file, no matter whether anything in an object file is
referenced or nothing at all.

Yes. Thats why I said you have to use both the -ffunction-sections and
--gc-sections options.

 2) with use of --gc-sections, the linker will ignore any object files
content, if nothing in this object file is referenced from outside

Yes.

 3) using -ffunction-sections AND --gc-sections, the compiler will put any
 function in its own .text.* (sub)section and the linker will discard any of
 them which is not referenced, even if in the same object file as other,
 referenced code.

Yes.

 Since 1) is the default, binary files may be unnecessary large by
 default.

Yes.

 Thanks for your clarifications. It makes life a bit easier for me (I
 can skip some #ifdefs now in the modules), now that I know (I think) 
 how it really works.

-- 
Grant Edwards   grant.b.edwardsYow! I don't understand
  at   the HUMOUR of the THREE
  gmail.comSTOOGES!!




Re: [Mspgcc-users] Unused functions occupying unnecessary memory

2010-06-21 Thread Grant Edwards
 ihex $(TRGDIR)/$(NAME).elf $(BINDIR)/$(NAME).hex

 $(NAME).txt : $(NAME).hex
   $(TITXT) -o $(BINDIR)/$(NAME).txt $(BINDIR)/$(NAME).hex

 all: $(NAME).txt
   $(SIZE) $(TRGDIR)/$(NAME).elf

 ## BLOCK 8)  make instruction to delete created files ##

 clean : $(SRC) $(ASRC)
   @echo deleting files...
   $(RM) $(addprefix $(OBJDIR)/,$(OBJ)) $(addprefix 
 $(OBJDIR)/,$(OBJ:.o=.lst))
   $(RM) $(TRGDIR)/$(NAME).a
   $(RM) $(TRGDIR)/$(NAME).elf
   $(RM) $(TRGDIR)/$(NAME).lst
   $(RM) $(BINDIR)/$(NAME).hex
   $(RM) makefile.d
   @echo rebuilding dependencies...
   $(CC) -mmcu=$(MCU) -E -MM -I. -I$(INCSRC) $^  makefile.d
   @echo CLEAN complete.

 ## calculate dependencies #
 #makefile.d : $(SRC) $(ASRC)
 # $(CC) -mmcu=$(MCU) -E -MM -I. -I$(INCSRC) $^  makefile.d
 # -E stop after preprocessing, output preprocessor output
 # -M create include rule isntead of preprocessor output
 # -MM like -M but ignore includes from system directory

 ## dependecies, add any dependencies you need here ###
 -include makefile.d

 if 'dummy.c' is included to the SRC-line, the function foo() is placed into 
 the binary, even if never referenced or used.
 Based on your explanations, I'd expect it to never appear there (unreachable).

Thank you for posting a real example.  Now we can figure out what's
going on.

First, both -ffunction-sections and -gc-sections flags are commented
out in your makefile.

Second, it's '--gc-sections' not '-gc-sections'

Third, if you uncomment them and add the second hyphen, you're still
not passing --gc-sections flag to the linker, you're passing it to the
compiler (which should have resulted in a error message).

If you want to pass the --gc-sections flag to the linker via the gcc
command line, you need to use either -W,--gc-sections or -Xlinker 
--gc-sections

-- 
Grant Edwards   grant.b.edwardsYow! I want you to MEMORIZE
  at   the collected poems of
  gmail.comEDNA ST VINCENT MILLAY
   ... BACKWARDS!!




Re: [Mspgcc-users] Unused functions occupying unnecessary memory

2010-06-21 Thread Grant Edwards
On 2010-06-21, Grant Edwards grant.b.edwa...@gmail.com wrote:

 Thank you for posting a real example.  Now we can figure out what's
 going on.

 First, both -ffunction-sections and -gc-sections flags are commented
 out in your makefile.

 Second, it's '--gc-sections' not '-gc-sections'

Oops. That one's my fault.  I just noticed that I've been typing it
incorrectly with a single preceding hyphen during this discussion.

 Third, if you uncomment them and add the second hyphen, you're still
 not passing --gc-sections flag to the linker, you're passing it to the
 compiler (which should have resulted in a error message).

 If you want to pass the --gc-sections flag to the linker via the gcc
 command line, you need to use either -W,--gc-sections or -Xlinker 
 --gc-sections

-- 
Grant Edwards   grant.b.edwardsYow! Xerox your lunch
  at   and file it under sex
  gmail.comoffenders!




Re: [Mspgcc-users] Unused functions occupying unnecessary memory

2010-06-21 Thread Grant Edwards
On 2010-06-15, Grant Edwards grant.b.edwa...@gmail.com wrote:
 On 2010-06-15, JMGross msp...@grossibaer.de wrote:


 The suggested compiler/linker flags, however, let the compiler treat
 each function as a separate compilation unit, starting at its own
 0-offset address.
 [...]

 Also, it keeps the compiler for doing optimizations like common
 subexpression elimination or using the most efficient way to call
 functions or access variables, as they are all referenced as 
 externals.

 I'd also be interested in seeing examples of that.

I've only got one MSP430 project laying around at the moment, and it's
pretty small: only about 1KB of code.  Compiling with -O2 generates
the exact same code with -ffunction-sections as it does without.

If somebody does come across a situation where -ffunction-sections
causes worse (or just different) code to be generated, it would be
nice if you could let the list know.  Even if there isn't anything we
can do to improve the code generation, it will at least allow other
mspgcc users to make an intelligent tradeoff decision.

-- 
Grant Edwards   grant.b.edwardsYow! ONE LIFE TO LIVE for
  at   ALL MY CHILDREN in ANOTHER
  gmail.comWORLD all THE DAYS OF
   OUR LIVES.




Re: [Mspgcc-users] Unused functions occupying unnecessary memory

2010-06-18 Thread Grant Edwards
On 2010-06-18, JMGross msp...@grossibaer.de wrote:

 I dug out some older project files and if I understand their old
 makefile correctly, all object files were put into a library (.a) and
 then this was fed into the linker. So maybe this was the reason for
 the missing code if the project object files inside the library
 weren't in the right order.

That will indeed cause problems.  For pretty much all of the linkers
I've used, libraries were only processed once at the point in the file
list where they were encountered.  If an object file later in the list
needs something from a library that has already been processed, that
symbol will go unresolved.

 If you do come across a case of -ffunction-sections and -gc-sections
 not working, please post it.  It should work, and I know for a fact
 that it used to.

 Following example:

 Any project (does not matter which).
 Compiled with -ffunction-sections and linked with -gc-sections.
 Now add a dummy function
 void foo(void){};

 After compilation, the function foo is in a segment called .text.foo.
 So -ffunction-sections work.
 After linking, the function is in the linked binary. Binaries are identical,
 no matter whether -gc-sections was used or not.

As I've said, doing that works fine for me.

By post an example I meant provide source files and a makefile the
exhibit the problem so that we can try to fix it.

 Onother example. Once again any project. One object file was added to
 the project, containing the above function. Again the binaries are
 identical, no matter whether -gc-sections was used or not. foo() was
 always part of the binary.

 Is it possible that if not ld itself then the linker scripts have
 been altered in a way that breaks -gc-sections?

That's possible.  If you can post an example that fails for you and
works for us, then we can start trying to track down the source of the
problem.

 I'd really like to put this kind of options (including optimization
 settings) into the appropriate source file only (by a pragma) instead
 of having them active for the whole project (unless one wants to make
 rather complex makefiles)

yes, that would be nice, but it would be very difficult due to some
fundamental architecture decisions that were made in both gcc and
binutils a long time ago.

 Not really.

OK, then submit a patch.

Based on what I've seen from my work on gcc and binutils, it looked
pretty difficult to me.  Perhaps my understanding of gcc/binutils
internals isn't as good as yours.

 The last fix to gcc for -ffunction-sections -fdata-sections support
 went in at the end of May 2008, so I would expect the 12/2008 build of
 gcc to work.  I'm not sure what ld 060404 means.  ld should have
 version number like 2.19.3.  What I can say is that it worked for me
 the last time I tried it, and others have reported it working more
 recently.

 D:\msp430-ld -v
 GNU ld version 060404 20060404
 D:\

 Hmmm, now that you ask, I checked the file date and it was May 2006.
 Looks like I called the wrong one. :(

 The ld version that's called by msp430-gcc is 
 GNU ld (GNU binutils) 2.18
 (I checked the makefile output)

I think that should be recent enough.

Yes, if the linker supports changing address modes, then it does
move the following code.

 Then it needs to also adjust all symbolic mode accesses,
 even local ones which are not subject to relocation.
 Quite some work. And requires a lot special knowledge about the
 target system structure.

Yes it does.  That's why it's supported on a per-target basis and not
all targets have had support for that sort of thing added.

 If the linker goes through the object file, analyzes every
 instruction (if it is an instruction)... well, why do we have an
 assembler stage? :)

Various reasons -- not the least among them is history:  when you
first write a compiler, there is often an existing assembler and
linker that you can use.

 Well, I'm better safe than sorry and I guess someone else did too.
 Why else is this whole -ffunction-sections thing an option and
 disabled by default?

 Because it's a somewhat new feature and it's not the way people are
 used to having things work.  When a new feature gets added, it's
 usually disabled by default in order to preserve as much
 backwards-compatibilty as possible.

 Hmmm, backwards compatibility considerations are only neccessary if
 something may have unexpected side-effects to the unaware.

The main side-effect is the way sections are named.  It's possible
there are side-effects to the way code is optimized, but I've never
seen that.

-- 
Grant Edwards   grant.b.edwardsYow! What's the MATTER
  at   Sid? ... Is your BEVERAGE
  gmail.comunsatisfactory?




Re: [Mspgcc-users] Unused functions occupying unnecessary memory

2010-06-17 Thread Grant Edwards
 turned them
off, the code didn't fit into the flash.

I know I'm probably starting to sound repetitive, but can you provide
a real example so that we can try to fix that feature?

 And I'm certain that the two functions in question are not referenced
 ever as I just added them to the code. Also, I added some
 sections/moved the vector table and the code/data in these sections
 is never referenced anywhere, yet they are still in the binary. (and
 I do not explicitely keep them in the linker script). I wonder what's
 (not) going on. It's ld 060404, part of the mspgcc build from
 12/2008.

The last fix to gcc for -ffunction-sections -fdata-sections support
went in at the end of May 2008, so I would expect the 12/2008 build of
gcc to work.  I'm not sure what ld 060404 means.  ld should have
version number like 2.19.3.  What I can say is that it worked for me
the last time I tried it, and others have reported it working more
recently.

 Even more, I think the linker will keep everything I feed it as
 source file, whether anything in an object file is ever used or not.
 I normally only include those object files which _are_ in use, but...
 I just included a completely unrelated file with never-used functions
 into the makefile and my binary has grown. So what's wrong?

I have no way of knowing unless you provide an example.

 IIRC, the linker will convert long branches into short/relative
 jumps at link time.  At least it does that for all the other targets
 I use...

 interesting. Still two wasted bytes (I don't think the linker will
 move the following code and adjust any other jumps if necessary),

Yes, if the linker supports changing address modes, then it does
move the following code.

 but faster. I wonder if this is done for branches with unrelocated
 destinations or with already linked ones too?

I've only personally witnessed it for instructions containing
relocated addresses.

 I'm just curious. Altering the assembly instructions is nothing a
 linker should do imho.

Then don't enable that option.  For Gnu binutils it's called
--relax.

 Also, some addressing modes cannot be used under such a setup.
I don't understand why.  Can you provide an actual example?

 I'm not sure whether the compiler ever uses relative addressing modes
 but I doubt this will be usable if the destination is in a different
 segment. A fixed distance to the destination is the base of relative
 addressing. And with separate segments there is no such fixed
 position.

Again, stuff like that can be fixed up at link time.

 Some things like optmizing addressing modes for far/short
 destinations have to be done at link time instead of compile time,
 but I don't see how that hurts anything.

 The linker messes with the addressing modes?

It can.

 That's really new to me.

From the ld man page:

 --relax

An option with machine dependent effects. This option is only
supported on a few targets. See section ld and the H8/300. See
section ld and the Intel 960 family. On some platforms, the
--relax' option performs global optimizations that become possible
when the linker resolves addressing in the program, such as
relaxing address modes and synthesizing new instructions in the
output object file. On platforms where this is not supported,
--relax' is accepted, but ignored. 

I'm not sure if this option does anything for the '430 or not.  It's
possible that nobody has implimented it for the MSP430.  On other
targets I've used, it would change addressing modes to speed/shorten
code at link time.  I thought it worked for the '430, but it's
possible (probably even) that I'm remembering another target I was
using at the same time as the '430.

 Isn't it just placing the proper relocated addresses into the holes
 left by the compiler?

Sometimes.

 Well, I'm better safe than sorry and I guess someone else did too.
 Why else is this whole -ffunction-sections thing an option and
 disabled by default?

Because it's a somewhat new feature and it's not the way people are
used to having things work.  When a new feature gets added, it's
usually disabled by default in order to preserve as much
backwards-compatibilty as possible.

 Maybe I have been too suspicious and I'm sorry if I wasted your time.
 I'm not an information source for ongoing compiler/linker development
 anyway sicne I don't use the latest version. In a production
 environment, an old compiler with known bugs is better than a new one
 with perhaps unknown bugs (same for embedded OS versions). We made
 this mistake once and will never do again unless we're really forced
 to. Also, my boss pays me for working on the projects, not the
 compiler :) In his opinion, I'm making too many experiments already,
 wasting too much time (luckily he _needs_ me)

-- 
Grant Edwards   grant.b.edwardsYow! Gibble, Gobble, we
  at   ACCEPT YOU ...
  gmail.com




Re: [Mspgcc-users] Unused functions occupying unnecessary memory

2010-06-17 Thread Grant Edwards
On 2010-06-17, Przemek Klosowski przemek.klosow...@gmail.com wrote:
 On Thu, Jun 17, 2010 at 3:01 PM, Grant Edwards
grant.b.edwa...@gmail.com wrote:
 On 2010-06-17, JMGross msp...@grossibaer.de wrote:

 interesting. Still two wasted bytes (I don't think the linker will
 move the following code and adjust any other jumps if necessary),

 Yes, if the linker supports changing address modes, then it does
 move the following code.

 FWIW, this is a well-known and tricky problem, because you can get
 circular dependencies: short addressing at location A can only reach
 site B if site B also uses short addressing, and vice versa. There's a
 standard algorithm that deals with, for quite some time---I remember
 first reading about it in the 80s.

Yep, IIRC, it's an example of a large class of non-linear problems
that includes modelling of physical systems where changes in the state
of a node/cell affects the states of other nodes/cells.

You try to find the the best overall approximation to a solution using
an iterative approach that makes multiple passes through the data
until no more improvements can be made.

That sort of an agorithm is called a relaxation algorithm.

If I'm remembering things correctly from many years ago, one main
groups of problems in that class is calculating the final state of an
irregular physical structure when the applied stresses are changed.
The structure will relax into a new equilibrium state that minimizes
overall strain. Or stress.  Or something like that. But don't quote
me, I'm an EE.

Or maybe I'm incorrectly mixing together unrelated things simply
because they all use the world relaxation or relax.

-- 
Grant Edwards   grant.b.edwardsYow! I was born in a
  at   Hostess Cupcake factory
  gmail.combefore the sexual
   revolution!




Re: [Mspgcc-users] Unused functions occupying unnecessary memory

2010-06-16 Thread Grant Edwards
On 2010-06-16, JMGross msp...@grossibaer.de wrote:

 I had this happen long time ago when I included the different object
 files or libraries in the wrong order with GCC under linux. After
 reordering them so that their contend had already been referenced,
 all was well. I think I had similar problems (immediately solved)
 with mspgcc.

Those problems were with the --gc-sections feature?

It sounds to me like you were linking libraries before you linked the
object files that referenced the routines in the library.  That's a
different, unrelated issue.

 If these compiler flags allow treating different functions in the
 same files to be kept or discarded depending of whether they are
 used, it's obvious that they need to be be considered unused when
 they haven't been referenced yet.

The garbage collection algorithm used by the linker shouldn't depend
what order you link the object files.  If you've got examples where it
seems to matter, please post it because that's a bug and needs to be
fixed.

 (It would be pretty useless to have such a feature if it could be
 inhibited by circular references of dead code.)

True, but that doesn't mean that the object files have to be a
partially ordered set.  Nodes are not discarded based on a
reference-count -- they're discarded based on a reachability.

 Unless the linker has been greatly improved since then, the problem
 should be there. Maybe I'm wrong.

You seem to be assuming a single-pass linker.  It works in two passes.
First it reads all of the object files.  Then it starts at all of the
nodes (symbols) marked as keep and traverses the reference graph
marking all reachable nodes.

When it's done traversing the graph, it discards any nodes that
haven't been reached from the initial set of keep nodes.

Are you sure you're not thinking about the requirement that libraries
be paritially ordered with respect to referencing objects?

 About the reduced effectiveness of the optimization, this one is
 obvious. If the linker is allowed to include or discard parts of a
 compilation unit depending of their usage, the compiler may not do
 any optimization that crosses the boundary between functions.

I'm afraid that's not at all obvious to me.

Example: A C file contains two functions: foo() and bar().  foo() is
called by various external functions.  bar() is called only by foo().
The compiler can inline bar() without causing any problems.

 Else either common code may disappear when not linked or a reference
 is generated that will keep the normally unused other function from
 being excluded from the build.

Sorry, you've lost me.  I'm not saying it doesn't happen, but I can't
visualize it.  Do you have an example?

 Or the common part is referenced by both with a branch (instead of a
 relative jump), making the code less efficient.

IIRC, the linker will convert long branches into short/relative
jumps at link time.  At least it does that for all the other targets I
use...

 Also, some addressing modes cannot be used under such a setup.

I don't understand why.  Can you provide an actual example?

 Optimizations INSIDE a function are not touched, of course. Only
 those across functions (e.g. identical exit code). The common
 subexpression elimination was a bad example. (I was a bit in haste
 when I wrote this, it was at the end of my office hours)

Some things like optmizing addressing modes for far/short destinations
have to be done at link time instead of compile time, but I don't see
how that hurts anything.

-- 
Grant Edwards   grant.b.edwardsYow! This ASEXUAL PIG
  at   really BOILS my BLOOD
  gmail.com... He's so ... so
   ... URGENT!!




Re: [Mspgcc-users] Unused functions occupying unnecessary memory

2010-06-15 Thread Grant Edwards
On 2010-06-15, Alex Polbach alex.polb...@wimet.es wrote:

 I have been noticing that a function that is not used by any module in
 program gets linked anyway, occupying some precious amount of memory.

 Suppose that you were sharing a common module but you only needed
 some functions of it. Is there a way to avoid linking all the unused
 functions?

Yes.

Add -ffunction-sections to CFLAGS.

Then link add --gc-sections to LDFLAGS.

If you also want to discard unused variables, add -ffdata-sections
to the compiler flags.

See the ld and gcc info pages for details.

-- 
Grant Edwards   grant.b.edwardsYow! Here I am in 53
  at   B.C. and all I want is a
  gmail.comdill pickle!!




Re: [Mspgcc-users] Unused functions occupying unnecessary memory

2010-06-15 Thread Grant Edwards
On 2010-06-15, Grant Edwards grant.b.edwa...@gmail.com wrote:
 On 2010-06-15, Alex Polbach alex.polb...@wimet.es wrote:

 I have been noticing that a function that is not used by any module in
 program gets linked anyway, occupying some precious amount of memory.

 Suppose that you were sharing a common module but you only needed
 some functions of it. Is there a way to avoid linking all the unused
 functions?

 Yes.

 Add -ffunction-sections to CFLAGS.

 Then link add --gc-sections to LDFLAGS.

 If you also want to discard unused variables, add -ffdata-sections
 to the compiler flags.

 See the ld and gcc info pages for details.

NB: I haven't tested these options with mspgcc in a long time, but at
one point several years ago they worked fine.

-- 
Grant Edwards   grant.b.edwardsYow! Excuse me, but didn't
  at   I tell you there's NO HOPE
  gmail.comfor the survival of OFFSET
   PRINTING?




Re: [Mspgcc-users] Unused functions occupying unnecessary memory

2010-06-15 Thread Grant Edwards
On 2010-06-15, Alex Polbach alex.polb...@wimet.es wrote:

 Thanks a lot for so fast answers!!

 I have added both flags to CFLAGS and LDFLAGS and they work just fine.
 Very neat solution.

I'm not sure how much those features get used with mspgcc, but I found
them to be invaluable if you want to share code between projects or if
you want to be able to do different builds of a project that have
different features enabled: when you disable (e.g. with #if/#endif) a
function, then all of the code/data that were used only by that
function is automatically left out.  IIRC it worked even when you
disable code with if(0) {}.

When I first implemented those features for mspgcc there were obscure
cases where a function would get discarded when it shouldn't have been
due to omissions in the linker script.  AFAIK, that shouldn't be a
problem, but it's something to keep it in mind if you get linker
errors due to inexplicably missing symbols: the solution is to mark
the symbol with the KEEP() command in the linker script.

-- 
Grant Edwards   grant.b.edwardsYow! Will it improve my
  at   CASH FLOW?
  gmail.com




Re: [Mspgcc-users] Unused functions occupying unnecessary memory

2010-06-15 Thread Grant Edwards
On 2010-06-15, JMGross msp...@grossibaer.de wrote:


 The suggested compiler/linker flags, however, let the compiler treat
 each function as a separate compilation unit, starting at its own
 0-offset address. This means teh compiler will not resolve any local
 references and let it all to the linker. Since all references are
 passed to the linker, the linker can link or discard every of these
 sections depending on the open references. What's references from a
 different module is kept, what's not referenced will be discarded.
 But it may happen that parts are discarded bwcause not yet referenced
 by any of the already loaded modules, bu twill be later and then the
 reference cannot be resolved as the target had been discarded
 already.

If that happens, it's a bug. Can you post an example of that so it can
be fixed?

 Also, it keeps the compiler for doing optimizations like common
 subexpression elimination or using the most efficient way to call
 functions or access variables, as they are all referenced as 
 externals.

I'd also be interested in seeing examples of that.

-- 
Grant Edwards   grant.b.edwardsYow! I'm a nuclear
  at   submarine under the
  gmail.compolar ice cap and I need
   a Kleenex!




Re: [Mspgcc-users] Why would mspgcc complain

2010-05-21 Thread Grant Edwards
On 2010-05-20, Paul F. Sehorne p...@sehorne.org wrote:

 I removed the double quotes from around {0x79, 0x56, 0x34, 0x12} and
 the error is no more. I still don't know why it works with the quotes
 with IAR's compiler

If the original code works with the IAR compiler, then that compiler
is broken (and in a rather odd way).

-- 
Grant





Re: [Mspgcc-users] Why would mspgcc complain

2010-05-20 Thread Grant Edwards
On 2010-05-20, Paul F. Sehorne p...@sehorne.org wrote:
 I'm portiing the TI Chronos Sports Watch firmware from IAR.  Why would 
 mspgcc complain error: invalid initializer

 [code]
 // In smpl_config.h (changed smpl_config.dat to a header file)
 #define THIS_DEVICE_ADDRESS  {0x79, 0x56, 0x34, 0x12}

 // In nwk_types.h
 typedef struct
 {
uint8_t  addr[NET_ADDR_SIZE];
 } addr_t;


 // In nwk_globals.c
 static const addr_t   sMyROMAddress = THIS_DEVICE_ADDRESS;  // compiler 
 complains nwk_globals.c:60: error: invalid initializer
 [/code]

That's because your initializer is a string, and addr_t isn't a
string. It's a structure.

-- 
Grant Edwards   grant.b.edwardsYow! I think my career
  at   is ruined!
  gmail.com




Re: [Mspgcc-users] problem converting signed short to abs unsigned long

2010-02-24 Thread Grant Edwards
On 2010-02-24, Carl c...@turner.ca wrote:

 Sorry, here is the code for the msp430:

 #include io.h
 int main(void)
 {
 short x = -32768;
 unsigned long  y = -x;
 LPM0;
 }

 And same code as my previous posting for the PC:

 #include stdio.h
 int main()
 {
 short  x = -32768;
 unsigned long  y = -x;
 printf(sizeof short =%d, x=%d, y=%lu\n, sizeof(short), x, y);
 }

 As you can see there is no int type used.

Yes, there is.  The expression '-x' has a type of int.  On
the MSP430, that's 16 bits and has a value of 0x8000.  When you
assign that to a long, it gets sign-extended to 0x8000.

On the PC, '-x' is 0x8000, and when assigned to a long,
it's still 0x8000.

Don't take this the wrong way, but I think you need a good
introductory book on C.

-- 
Grant






Re: [Mspgcc-users] problem converting signed short to abs unsigned long

2010-02-23 Thread Grant Edwards
On 2010-02-23, Carl c...@turner.ca wrote:

 Ok, I agree not a problem with abs(). But from a C programmer's point of
 view there is a difference in the way the msp430 is handling the
 calculation/conversion. For example from my PC:

 #include stdio.h
 int main()
 {
 short  x = -32768;
 unsigned long  y = -x;
 printf(sizeof short =%d, x=%d, y=%lu\n, sizeof(short), x, y);
 }

 Output: sizeof short =2, x=-32768, y=32768

 While on the msp430 it would give:

 Output: sizeof short =2, x=-32768, y=4294934528

 If the msp430 was treating the operation as on a short I would
 expect the msp430 y variable to have a value in the range of a
 short as the result.

 I'm not sure why there is a difference

The values being passed to printf and then displayed are
unsigned.  On the '430, that's 16 bits.  On the PC that's 32
bits.

 and maybe the PC gcc is not doing the right thing.

They're both doing the right thing.

 Do you know where in the C standard it defines the correct
 behavior?

Not off the top of my head.

-- 
Grant Edwards   grante Yow! Did something bad
  at   happen or am I in a
   visi.comdrive-in movie??




Re: [Mspgcc-users] problem converting signed short to abs unsigned long

2010-02-23 Thread Grant Edwards
On 2010-02-23, Carl c...@turner.ca wrote:
 On Tue, 2010-02-23 at 23:08 +, Grant Edwards wrote:
 The values being passed to printf and then displayed are
 unsigned.  On the '430, that's 16 bits.  On the PC that's 32
 bits.

 A short on both my system and 430 is 16 bits. A long on both my system
 and the 430 are both 32 bits. I can inspect the memory with gdb. The
 problem is the upper 16 bits of y on the 430 are set. Why does it do
 this?

 On PC:

 (gdb) p sizeof(y)
 $1 = 4
 (gdb) p /x y
 $2 = 0x8000

 On 430:

 (gdb) p sizeof(y)
 $1 = 4
 (gdb) p /x y
 $2 = 0x8000

Unless you provide the code that was run up to that point,
there's no way to answer your question.

But, I suspect that on the msp430, the value in question was an
int at some point and then got converted to a long. 

On the MSP430, that resulted in the value being sign-extended
when it got converted from 16 to 32 bits.  On a PC, an int
and long are both 32 bits, so there is no sign extension when
a value is converted from an int to a long.

-- 
Grant Edwards   grante Yow! Am I having fun yet?
  at   
   visi.com




Re: [Mspgcc-users] Size of functions

2009-11-18 Thread Grant Edwards
On 2009-11-18, N. Coesel n...@nctdev.nl wrote:
 At 15:54 18-11-2009 +, you wrote:
On 2009-11-18, David Brown da...@westcontrol.com wrote:
 N. Coesel wrote:

 The old security by obscurity trick, that has /such/ a good reputation?
 
 Any means of security is security by obscurity by definition.
 All protections schemes come down to hiding a secret
 (obscurity). Whether its a key, a secret algorithm, etc.

 The phrase security by obscurity is normally taken to mean
 security by hiding the way it works, i.e., trying to hide
 the code or algorithm.

Exactly.  Security by obscurity does not refer to the fact 
that you need to keep a secret key a secret.  It refers
specifically to the dependance on keeping the design and
implementation of the _algorithms_ a secret.

Quoting Paul Schneier in _Secrets__Lies_:

  A good security design has no secrets in its details.  In 
  other words, all of the security is in the product itself
  and its chageable secret: the cryptographic keys, the
  passwords, the tokens and so forth.  The antithesis is
  _security_by_obscurity_: The details of the system are 
  part of the security.  If a system is designed with
  security by obscurity then that security is delicate.

Later in the same book:  

  Again and again in this book I rail against _security_by_
  _obscurity_: proprietary cryptography, closed source code,
  secret operating systems.

  
Security by obscurity doesn't work.

 Which is big a misconception!

History appears to show otherwise.

 - If you make the way the lock works publicly available then you need a
 complex lock and a big key. This security measure relies on the key staying
 hidden and that it will take a long time to pick the lock.

 - If you keep the way the lock works secret,

You can't.  At least not for long.

 you can keep the lock and the key very simple. This security
 measure relies on keeping both the lock and the key secret.
 Trying to pick the lock is an almost impossible task.

 Both methods require keeping a secret.

True.

 So both methods rely on obscurity anyway!

But the phrase security by obscurity (at least as it is used
in the software and crypto world) refers _specifically_ to the
keep the lock design secret method.

You can keep a key secret by not telling anyone.

To keep a lock secret you have avoid giving a copy of it to
anyone -- IOW the only way to keep a lock secret is to never
actually use it.

So you're right.  A secret lock design is effective as long as
it is never used.

-- 
Grant Edwards   grante Yow! I'm having a
  at   tax-deductible experience!
   visi.comI need an energy crunch!!




Re: [Mspgcc-users] Developers: Bazaar branches

2009-09-29 Thread Grant Edwards
On 2009-09-29, JMGross msp...@grossibaer.de wrote:

 That's what I meant with a 'mesh cloud'. It still needs to be
 stored somewhere. On a single place (that is hopefully
 available) or on every single system in a copy, constantly
 updating with the others (who are hopefully online and have a
 recent version available).

Except that's not how a distributed control system works.  It's
not the case where there are mutliple mirrored copies of a
single repository.  SVN uses a single repository on a single
server, and there is no mechanism to allow the repository
stored in multiple places.

 If it's not stored somewhere, it is not available, no matter
 which type of distribution is used. In my opinion, a dedicated
 server (with some backups) is by far better than a repository
 that is or is not available and is or is not up to date.

I don't think you understand how distributed version control
systems work.  It's not the same as having a repository
that's stored in the cloud.

 The fact that TortoiseSVN (and I guesst SVN itself does so
 too) keeps a working base together with the (actually altered)
 working copy makes it a somewhat distributed repository too,

Yup, that's how SVN works. You can do a diff/revert using just
the local copy but most all of the other operations still
require a live connection to the server.  DVCS systems don't.

 as every user has a certain repository revision (not necessary
 the newes, depending on the latest update) on its computer and
 can make DIFF or revert operations without any connection to
 the repository.

True.

 Unfortunately there is no Linux version of Tortoise (only for
 SVN itself), but since both are compatible and linux users (at
 least the programmers) are usually fond of console usage... :)

Tortoise doesn't really have anything to do with how SVN works,
so it doesn't matter whether or not there's a Linux version.
The local snapshot is characteristic of the underlying SVN
system.  There are plenty of other GUI interfaces to SVN, but
there are still fundamental differences in the way than a
single-reposity system works and the way that a distributed
system works.

-- 
Grant




Re: [Mspgcc-users] Developers: Bazaar branches

2009-09-28 Thread Grant Edwards
On 2009-09-28, JMGross msp...@grossibaer.de wrote:


 Has anyone thought of using SubVersion?

I imagine they have.  It's not really distributed the way the
systems under discussion are.  SVN still uses a single central
repository that everybody must have fairly constant access to.

-- 
Grant




Re: [Mspgcc-users] Developers: Bazaar branches

2009-09-28 Thread Grant Edwards
On 2009-09-28, JMGross msp...@grossibaer.de wrote:

 And for the need of a server, well, yes, sure. Every
 repository needs to be stored somewhere.

No, not really.

 Without access to the storage place I cannot access the
 repository. No matter whether it is a dedicated server, some
 webspace somewhere or a mesh cloud.

Some other revision control systems don't rely on a single,
central server the way RCS, CVS, SVN do.  Such systems are
usually referred to as distributed revision control systems.
Most open-source development projects tend to be moving away
from the single-central-server model to the more distributed
model.

  http://en.wikipedia.org/wiki/Distributed_revision_control

-- 
Grant

  




[Mspgcc-users] Are there any instructions for building binutils/mspgcc?

2009-09-14 Thread Grant Edwards
I've lost the recipe for building binutils/mspgcc.  The shell
script I've used for the past few years no longer produces a
working toolchain. AFAIK, absolutely nothing has changed.  But
after building binutils and mspgcc on a new machine I'm now
getting errors like this:

msp430-gcc -g -O2 -mmcu=msp430x149 -Wa,-ahld=main.lst -o main.elf main.c
//home/grante/msp430/gnu/bin/../lib/gcc-lib/msp430/3.2.3/msp2/libgcc.a(_copy_data.o):
 In function `__do_copy_data':
/home/grante/msp430/toolchain/src/gcc-3.2.3/gcc/config/msp430/libgcc.S:(.init4+0x2):
 undefined reference to `__data_size'
/home/grante/msp430/toolchain/src/gcc-3.2.3/gcc/config/msp430/libgcc.S:(.init4+0x8):
 undefined reference to `__data_load_start'
//home/grante/msp430/gnu/bin/../lib/gcc-lib/msp430/3.2.3/msp2/libgcc.a(_clear_bss.o):
 In function `__do_clear_bss':
/home/grante/msp430/toolchain/src/gcc-3.2.3/gcc/config/msp430/libgcc.S:(.init4+0x2):
 undefined reference to `__bss_size'
make: *** [main.elf] Error 1

According to 
http://www.nabble.com/linking-problems-in-linux-%28undefined-symbols%29-td18834672.html
those undefined symbols are fixed by this patch:

  packaging/patches/binutils-14x1-20x1-20x2-20x3-22x4-42x-42x0-461x.patch

Except they're not.  There's nothing in that patch that adds
the undefined symbols.  Rather, those symbols appear to be
added by binutils-ld_scripts.patch, but I've not been able to
get that patch to apply to binutils 2.17.

Is there a list somewhere of what patches you need
in what order to build what versions of binutils?

-- 
Grant Edwards   grante Yow! If elected, Zippy
  at   pledges to each and every
   visi.comAmerican a 55-year-old
   houseboy ...




Re: [Mspgcc-users] some stuff missing from stdio ?

2009-02-27 Thread Grant Edwards
On 2009-02-27, Steve DeLaney onramp...@yahoo.com wrote:

  

 Hi all, I'm new to mspgcc so bear with me if these topics are
 repetitive, but

 The stdio.h seems incomplete -   FILE and fopen(), fclose(), etc.
 appear to be missing.

You're using an MSP430 that has a filesystem on it?

 This is raising havoc with a port I'm working on which is
 ANSI C.  I'm puzzled how a C99 compiler and libc can have a
 subset of stdio

Read up on the sections of the standards about free-standing
C implementations.  I don't think stdio.h is required at all
for a free-standing implementation.

 any ideas on the best way to resolve it?

Write your own filesystem and FILE I/O libraries I guess.

[WTH was all that quoted stuff for?]




Re: [Mspgcc-users] IAR Library conversion

2009-02-11 Thread Grant Edwards
On 2009-02-11, Przemek Klosowski przemek.klosow...@gmail.com wrote:

 I don't know IAR but I suspect that .r43 are the IAR-generated binary object
 files for MSP430. If that's the case, you are asking how to link them into a
 GCC project. This depends on the compatibility of the calling convention
 used by those two compilers---how they pass parameters, which registers they
 preserve/clobber across procedure calls, etc.

In addition to calling convention issues, there are object file
format compatibility issues that will need to be resolved.

Both are rather tricky problems.

-- 
Grant Edwards   grante Yow! Could I have a drug
  at   overdose?
   visi.com




Re: [Mspgcc-users] MSP430F5438 support

2008-12-16 Thread Grant Edwards
On 2008-12-16, fgd fgarc...@epicom.es wrote:

 so, has anyone used gdbproxy with the msp430f5438 ? I've been
 trying to make it work for some days now, both with the linux
 and windows version of gdbproxy, but all I get is a message
 saying could not find device (or device not supported)...

 When I have tried it from windows, it would work with IAR and
 code composer, but then if I copy the dll's these programs are
 using and try to make them work with gdbproxy, I get the above
 message... has anyone else here seen this problem?

Yes.  

I had the same problem with MSP430F24x0.  It worked fine with
IAR and CC debuggers, but was not supported by gdb-proxy either
under Linux or under Windows (not even when using the .dll
files taken from the IAR or CC directories).

There was no solution.

I offered to help troubleshoot/fix the problem, but offers went
unacknowledged.  I even went so far as to offer to sign an NDA.
Again, ignored.

TI's customer support is horrible, and the MSP430 JTAG
implementation sucks (both the HW in the part and the software
tools support).  The MSP430 would be a great part if it wasn't
so painful to use.

-- 
Grant Edwards   grante Yow! Somewhere in Tenafly,
  at   New Jersey, a chiropractor
   visi.comis viewing Leave it to
   Beaver!




Re: [Mspgcc-users] The future of mspgcc / newbie questions

2008-12-05 Thread Grant Edwards
On 2008-12-02, p...@plastitar.com p...@plastitar.com wrote:

 For the second time I'm trying to build the mspgcc toolchain.
 While trying to get reoriented I read that the key developer
 of Insight is putting Insight out to pasture.

Insight was always rather fragile for me, but I haven't used it
for 5+ years.

IMO, there is very little future
 http://sources.redhat.com/ml/insight/2008-q4/msg00014.html

I'm not sure what that has to to with the future of mspgcc.

 What are the pros and cons of using DDD and GNAT/GPS for MSP430's?

I do use DDD once every couple years and it always seems to
work fine (though Motif is still as ugly as ever).

Personally, I prefer gdb's command line.  But, I'm old.

-- 
Grant Edwards   grante Yow! I just got my PRINCE
  at   bumper sticker ... But now
   visi.comI can't remember WHO he
   is ...




[Mspgcc-users] toolchain build script fails due to missing makeinfo

2008-10-28 Thread Grant Edwards
I've been using the same build script to build msp430 gcc
toolchains for 5 years, but it recently stopped working because
makeinfo is missing:

  mkdir -p -- ./libiberty
  Configuring in ./libiberty
  configure: creating cache ./config.cache
  checking whether to enable maintainer-specific portions of Makefiles... no
  checking for makeinfo... /home/grante//toolchain/src/binutils-2.17/missing 
makeinfo --split-$
  configure: WARNING:
  *** Makeinfo is missing. Info documentation will not be built.
  checking for perl... perl
  checking build system type... i686-pc-linux-gnu
  
Then later the make install fails because the .info files are missing.

Except makeinfo _isn't_ missing:

  $ which makeinfo
  /usr/bin/makeinfo

  $ makeinfo --version
  makeinfo (GNU texinfo) 4.11
  
  Copyright (C) 2007 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
  
I've even run a few .texi files through makeinfo and it
generated .info files just fine.

Why does the build process think makeinfo is missing?

-- 
Grant Edwards   grante Yow! I wish I was a
  at   sex-starved manicurist
   visi.comfound dead in the Bronx!!




Re: [Mspgcc-users] toolchain build script fails due to missing makeinfo

2008-10-28 Thread Grant Edwards
On 2008-10-28, Grant Edwards gra...@visi.com wrote:

 I've been using the same build script to build msp430 gcc
 toolchains for 5 years, but it recently stopped working because
 makeinfo is missing:

   mkdir -p -- ./libiberty
   Configuring in ./libiberty
   configure: creating cache ./config.cache
   checking whether to enable maintainer-specific portions of Makefiles... no
   checking for makeinfo... /home/grante//toolchain/src/binutils-2.17/missing 
 makeinfo --split-$
   configure: WARNING:
   *** Makeinfo is missing. Info documentation will not be built.
   checking for perl... perl
   checking build system type... i686-pc-linux-gnu
   
 Then later the make install fails because the .info files are missing.

 Except makeinfo _isn't_ missing:

   $ which makeinfo
   /usr/bin/makeinfo

   $ makeinfo --version
   makeinfo (GNU texinfo) 4.11

It appears that texinfo 4.11 is broken/incompatible with older
configure scripts.  I rolled texinfo back to 4.8, and it's
building OK.

-- 
Grant Edwards   grante Yow! I smell like a wet
  at   reducing clinic on Columbus
   visi.comDay!




Re: [Mspgcc-users] msp430-gdbproxy support for 2618 device?

2008-10-03 Thread Grant Edwards
On 2008-10-03, Stephen Glow sg...@embeddedintelligence.com wrote:

 In the end, it turned out that my problem was that gdbproxy
 simply doesn't support any of the newer devices under Linux.

It's been like that for ages.  There are parts that are 3 years
old that still aren't supported.

 This is rather disappointing to me, and a clear example of the
 problems with closed source utilities.

Agreed.  It's just another example of TI's generally shoddy
JTAG support for the msp430.


 I ended up getting gdbproxy working under a vmware virtual
 machine running windows.

You're lucky.  For the part I've been using, even the Windows
version of msp-gdbproxy doesn't work, and neither does
mstp430-jtag (windows or Linux). :/

-- 
Grant Edwards   grante Yow! The Osmonds!  You are
  at   all Osmonds!!  Throwing up
   visi.comon a freeway at dawn!!!




Re: [Mspgcc-users] Software Toggle Example ( fet140_1.S )

2008-09-24 Thread Grant Edwards
On 2008-09-24, Ralf Hildebrandt ralf-hildebra...@gmx.de wrote:
 Ali Shah wrote:

 SetupP1:
 bis.b   #0x05, P5DIR; P5.4  output
 bis.b   #0x06, P5DIR; P5.5  output
 bis.b   #0x07, P5DIR; P5.6  output

 #0x05 == _0101 in binary
 #0x06 == _0110 in binary
 #0x07 == _0111 in binary

 So it seems your intention is
   bis.b   #(BIT4+BIT6+BIT7), P5DIR ; P5.4-6  output

 BITx are predefined constants in common.h.


 mov.b   #llo(0x), P5OUT ; Toggle off P5

 P5OUT is a byte register.
   mov.b   #0xFF, P5OUT ; Toggle off P5



 Let me give you one hint: C-Compilers are great. They generate very good 
 code - especially for the MSP430 which is a C-friedly architecture.

Secifically, the C compiler knows about bis and bic
instructions and will use them when it can. To take the above
as an example, this code will generate a single bis
instruction:

  #define Bit(n) (1(n))

  P5DIR |= Bit(4)+Bit(5)+Bit(6);
  
-- 
Grant Edwards   grante Yow! I don't know WHY I
  at   said that ... I think it
   visi.comcame from the FILLINGS in
   my rear molars ...




Re: [Mspgcc-users] JTAG Security Fuse

2008-06-26 Thread Grant Edwards
On 2008-06-26, Chris Liechti cliec...@gmx.net wrote:

 burning the fuse required 7V that the adapter must provide.

 Further, it looks like the TI USB FET won't work.

 i though it should? msp430-jtag -l TIUSB --secure might
 work.

 Once blown, can the chip (and fuse) be erased via JTAG or
 firmware?

 the BSL isn't influenced by the security fuse.

 the fuse can't be repaired, thus the JTAG is permanently
 disabled.

So it really _is_ a fuse.  That's in contrast to Atmel's AVR
where they call EEPROM cells fuses.  Presumably there's some
historical reason for Atmel's use of that term, but it sort of 
makes them sound dumb when they talk about un-blowing a fuse.

-- 
Grant Edwards   grante Yow! Hey, waiter!  I want
  at   a NEW SHIRT and a PONY TAIL
   visi.comwith lemon sauce!




Re: [Mspgcc-users] Most Linux-friendly JTAG interface?

2008-06-23 Thread Grant Edwards
On 2008-06-23, Randall Nortman rnmsp...@wonderclown.net wrote:

 But I guess the question really just boils down to: parallel
 port, USB, or other?

In my experience, parallel port is both cheaper ($15 from
sparkfun.com) and easier to get running.  However, parallel
port doesn't support spy-bi-wire, so there are a few parts
which require USB.  That said, USB isn't _that_ hard to set up,
but it may require a few hours of futzing around with kernel
modules and/or udev rules.

-- 
Grant Edwards   grante Yow! Are we THERE yet?
  at   
   visi.com




Re: [Mspgcc-users] Most Linux-friendly JTAG interface?

2008-06-23 Thread Grant Edwards
On 2008-06-23, Andy Warner an...@pobox.com wrote:
 On Mon, Jun 23, 2008 at 2:13 PM, Randall Nortman
rnmsp...@wonderclown.net wrote:
 I am a complete MSP newbie, though not new to embedded development.
 I'm just wondering what kind of JTAG interface is most friendly to
 developing on a Linux host using mspgcc and related tools.  Looks like
 [...]
 But I guess the question really just boils down to: parallel port,
 USB, or other?

 This is going to sound strong, but if you want good linux support,
 you might want to consider using AVR/arm instead.

I'd have to agree that TI's support for JTAG pretty much sucks.
I've never been able to get gdb debugging working for the '23x0
chips (even under Windows).  I won't even start in on their
non-conformance to the IEEE JTAG specs that makes it impossible
to set up a proper chain that incorporates an MSP430.

-- 
Grant Edwards   grante Yow! Please come home with
  at   me ... I have Tylenol!!
   visi.com




Re: [Mspgcc-users] GCC 3.3.6 make fail on 'msp430_emit_return'

2008-06-22 Thread Grant Edwards
On 2008-06-20, Greg Hoover ghoo...@greg-web.net wrote:

 Well apparently GCC 3.2.3 doesn't support i686 darwin -- I get this
 error:

 I tried, unsuccessfully and was told that 3.2.3 was the officially  

Yes, 3.2.3 is the supported version of the cross compiler.
It doesn't matter whether 3.2.3 supports i686 darwin -- you're
not building it for i686 darwin.  You want to build it for the
msp430 target.

I've never had any problems building gcc 3.2.3 with any gcc 3.x
or 4.x host compiler (I'm currently using 4.1.2 to build
3.2.3).

-- 
Grant Edwards   grante Yow! Yes, but will I
  at   see the EASTER BUNNY in
   visi.comskintight leather at an
   IRON MAIDEN concert?




Re: [Mspgcc-users] Anybody get non-project debugging to work in CCE? [virus checked]

2008-06-11 Thread Grant Edwards
On 2008-06-11, reinhard.gri...@solutions.endress.com 
reinhard.gri...@solutions.endress.com wrote:

 What I want to do is:
 
   1) Reset the processor.
 
   2) Start the processor.
 
   3) Stop the processor.
 
   4) Dump out RAM contents in hex.
 
 If TI's debugger can't do that, then I'm going to have to
 declare it a rather large steaming pile

 If gdb5.1.2 can do memory dumping, then cce20 should do it for
 you.  But AFAIR gdb can dump memory in a reasonable way since
 6.x

GDB would do just fine.  If msp430-gdbproxy supported the F23x0
parts, I'd be set.

I'm amazed at what a mess CCE3 is.  TI should just throw in the
towel and give up on doing their own development tools --
they're obviously incapable of doing a competent job of it when
their own FAEs are warning people to stay away from CCE.

Maybe I'll see if I can find a copy of cce20.  I'm puzzled why
IAR has problems with my board.  It works fine with an eval
board with a processor from the same family, so there must
something specific about my board that is causing problems with
IAR that doesn't cause problems with msp430-jtag or
Elprotronics.  I think I'll disconnect our fancy low-voltage
reset circuitry to see if that helps.

-- 
Grant Edwards   grante Yow! NANCY!!  Why is
  at   everything RED?!
   visi.com




Re: [Mspgcc-users] msp430-gdbproxy support for 2618 device?

2008-06-11 Thread Grant Edwards
On 2008-06-11, Mat Barnes m.barne...@gmail.com wrote:

 Can anyone tell me if the '2618 device is supported by any version of
 msp430-gdbproxy?

 Unless something dramatic has happened recently the newer devices
 (x2xx and x4xx) are only supported by the lastest Windows build of
 msp430-gdbproxy.

Where can one get the latest build?  The version available at
soft-switch.org is over two years old.

 If you're lucky enough to have have a windows installed
 machine to use as a proxy then connecting to it from gdb is no
 different to connecting to a locally running proxy. (Of course
 you can also do all your development and debugging under
 windows.

I could live with using a windows proxy machine with a '23x0,
but I can't find a windows build of gdbproxy that supports it
either.

-- 
Grant Edwards   grante Yow! I haven't been married
  at   in over six years, but we
   visi.comhad sexual counseling every
   day from Oral Roberts!!




Re: [Mspgcc-users] msp430-gdbproxy support for 2618 device?

2008-06-11 Thread Grant Edwards
On 2008-06-11, Stephen Glow sg...@embeddedintelligence.com wrote:

 Can anyone tell me if the '2618 device is supported by any version of 
 msp430-gdbproxy?

 I've tried the version on the sourceforge page, and also the version on 
 soft-switch.org, but so far I consistently get an error when starting 
 msp430-gdbproxy:

 ---msp430-gdbproxy msp430 /dev/ttyUSB0

 Remote proxy for GDB, v0.7.1, Copyright (C) 1999 Quality Quorum Inc.
 MSP430 adaption Copyright (C) 2002 Chris Liechti and Steve Underwood

 GDBproxy comes with ABSOLUTELY NO WARRANTY; for details
 use `--warranty' option. This is Open Source software. You are
 welcome to redistribute it under certain conditions. Use the
 '--copying' option for details.

 debug: MSP430_Initialize()
 debug: MSP430_Configure()
 debug: MSP430_VCC(3000)
 error: msp430: External power detected (38)
 debug: MSP430_Identify()
 error: msp430: Could not find device (or device not supported) (4)
 debug: MSP430_VCC(0)
 debug: MSP430_VCC(3000)
 error: msp430: External power detected (38)
 debug: MSP430_Reset(ALL_RESETS)
 debug: MSP430_Close()
 msp430-gdbproxy: target_msp430.c:746: msp430_open: Assertion
 `!msp430_status.is_open' failed.
 Aborted

 Sorry if this is a dumb question, is it documented someplace that I'm 
 missing?

Nope, that's pretty much what I see when I try to use it with
the 23x0 parts also. 

 If this processor isn't supported, are there any plans to update 
 gdbproxy to add support for it?

I've been trying for almost a year to find out how one goes
about getting support for a specific part added to
msp430-gdbproxy.  AFAICT, the answer is you don't.

 How are people working with this chip if it's not supported by
 gdbproxy?  I really just need to program the flash, I can live
 without a debugger if necessary.

Try using msp430-jtag to program flash.  Even though gdbproxy
doesn't support the 23x0 parts, msp430-jtag does.

-- 
Grant Edwards   grante Yow! If I had a Q-TIP, I
  at   could prevent th' collapse
   visi.comof NEGOTIATIONS!!




Re: [Mspgcc-users] msp430-gdbproxy support for 2618 device? [virus checked]

2008-06-11 Thread Grant Edwards
On 2008-06-11, reinhard.gri...@solutions.endress.com 
reinhard.gri...@solutions.endress.com wrote:
:
 I could live with using a windows proxy machine with a '23x0,
 but I can't find a windows build of gdbproxy that supports it
 either.

 I'm almost sure that the msp430.dll is the culprit who has to detect the 
 MCU type.  So go and get the newest version from your JTAG provider.  Mine 
 is from Olimex and I have no problem with the 2618 - at least gdbproxy 
 detects it.

I tried multiple different versions of msp430.dll that all
worked fine with other applications and the same target.  I
tried .dll files from both IAR Kickstart and Elprotronics.
mspgcc-gdbproxy doesn't recogize the '23x0 with either .dll
although other applications do recognize it using the same .dll
files.

-- 
Grant Edwards   grante Yow! I have many CHARTS
  at   and DIAGRAMS..
   visi.com




Re: [Mspgcc-users] msp430-gdbproxy support for 2618 device?

2008-06-11 Thread Grant Edwards
On 2008-06-11, Stephen Glow sg...@embeddedintelligence.com wrote:

 I'm trying to use msp430-jtag under Linux now, but can't seem to get 
 that working either.

 I'm using a USB based debugger (MSP-FET430UIF from TI).  Do you know if 
 that is supported for this chip under Linux, or does msp430-jtag only 
 work with parallel port debuggers for this device?

msp430-jtag works with a USB interface, but getting the USB
interface installed and working is a bit tricky.  You have to
get the right version of the kernel/driver, and then you have
to set up a few udev rules to reconfigure the USB driver after
it first recognizes the device.

IIRC, somebody posted a summary of how to do it a few days back.

-- 
Grant Edwards   grante Yow! It's OKAY -- I'm an
  at   INTELLECTUAL, too.
   visi.com




Re: [Mspgcc-users] msp430-gdbproxy support for 2618 device? [virus checked] [virus checked]

2008-06-11 Thread Grant Edwards
On 2008-06-11, reinhard.gri...@solutions.endress.com 
reinhard.gri...@solutions.endress.com wrote:
:
 I tried multiple different versions of msp430.dll that all
 worked fine with other applications and the same target.  I
 tried .dll files from both IAR Kickstart and Elprotronics.
 mspgcc-gdbproxy doesn't recogize the '23x0 with either .dll
 although other applications do recognize it using the same .dll
 files.

 May be the one contained in 
 http://www.olimex.com/dev/soft/msp430/MSP430-DLL%20drivers%201.021.zip 
 will help?

I'll give it a try, but it sure looks to me like it's
gdbproxy's fault and not the DLL's fault.

-- 
Grant Edwards   grante Yow! Are you still an
  at   ALCOHOLIC?
   visi.com




Re: [Mspgcc-users] msp430-gdbproxy support for 2618 device? [virus checked] [virus checked]

2008-06-11 Thread Grant Edwards
On 2008-06-11, reinhard.gri...@solutions.endress.com 
reinhard.gri...@solutions.endress.com wrote:

 I'll give it a try, but it sure looks to me like it's
 gdbproxy's fault and not the DLL's fault.

 So, why does my gdbproxy (windows xp) detects the 2618
 correctly?

Presumably because your copy of gdbproxy supports the 2618?

-- 
Grant Edwards   grante Yow! I'm having an
  at   emotional outburst!!
   visi.com




Re: [Mspgcc-users] Status of Linux gdbproxy

2008-06-11 Thread Grant Edwards
On 2008-06-11, Stephen Glow sg...@embeddedintelligence.com wrote:

 Does anyone know exactly what the development status of
 gdbproxy is at the moment?  It seems like lots of people are
 having problems getting the Linux version of this program to
 work with newer devices.  The files on source forge haven't
 been updated for well over a year.  Has this program been
 abandoned by it's developers?

AFAICT, yes.

 Why exactly is this software closed source anyway?

Because TI wants it that way.

My guess is that they're ashamed of the details involved and
don't want anybody to see them. From what they have documented
of their JTAG implimentation it's apparent that it, um, leaves
a bit to be desired.

 I realize there's some sort of NDA involved, but does anyone
 know what that covers?  The JTAG interface seems to be fairly
 well documented by TI. 

 How can we fix this problem?

I've been asking those questions for a long time.  I've
volunteered to sign an NDA, I've volunteered to test new
versions of gdbproxy, I've volunteered to actually work on
gdbproxy, I've volunteered to send hardware for which support
is desired.  

I've never gotten any response at all.

-- 
Grant Edwards   grante Yow! Somewhere in Tenafly,
  at   New Jersey, a chiropractor
   visi.comis viewing Leave it to
   Beaver!




[Mspgcc-users] Use msp430-jtag to dump my program's RAM contents?

2008-06-10 Thread Grant Edwards
I'm trying to figure out how to use msp430-jtag to stop my
program and dump out RAM contents so that I can look at the
contents of some buffers my program is filling with state info.

Uploading from RAM using the --upload option seems to work (it
prints out a bunch of hex data), but the data don't look at
like the data that my program is writing.

Is it not possible to dump out the state of program
variables/buffers using msp430-jtag?

-- 
Grant Edwards   grante 
  at   
   visi.com




Re: [Mspgcc-users] Use msp430-jtag to dump my program's RAM contents?

2008-06-10 Thread Grant Edwards
On 2008-06-10, Grant Edwards gra...@visi.com wrote:

 I'm trying to figure out how to use msp430-jtag to stop my
 program and dump out RAM contents so that I can look at the
 contents of some buffers my program is filling with state
 info.

 Uploading from RAM using the --upload option seems to work (it
 prints out a bunch of hex data), but the data don't look at
 like the data that my program is writing.

Oh, I should have added that I've verified that using --upload
to read flash definitely works.  So it sure looks like the act
of running jsmp430-jtag is messing with the contents of RAM.

-- 
Grant Edwards   grante Yow! I have a very good
  at   DENTAL PLAN.  Thank you.
   visi.com




[Mspgcc-users] IAR EW can't talk to '2330

2008-06-10 Thread Grant Edwards
Since msp430-gdbproxy doesn't support the '23x0 chips, I'm
trying to use IAR EW to download and run a hex file that was
generated using mspgcc.  Downloading the file works fine using
either IAR or Elprotronic's programmer.  I can talk to the
board all day long with msp430-jtag without a single error.

However, IAR reports constat communication errors when I try to
actually run the program.  If I hit retry a few times, the
program actually seems to start, and when I stop the program
(after a few retries and communication error dialogs, the
program coutner is in the right place and the contents of RAM
are correct.

Any ideas what would cause constant JTAG communication problems
for the IAR debugger that wouldn't affect msp430-jtag or the
Elprotronic flash programmer?

-- 
Grant Edwards   grante Yow! I can't decide which
  at   WRONG TURN to make first!!
   visi.comI wonder if BOB GUCCIONE
   has these problems!




  1   2   3   4   >