Bug 59558 - [MSP430-gcc] CPU setup, pre start program
Summary: [MSP430-gcc] CPU setup, pre start program
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.5.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-19 10:57 UTC by Roberto Pomo
Modified: 2016-10-16 07:02 UTC (History)
1 user (show)

See Also:
Host: Linux version 3.2.0-56-generic (buildd@roseapple) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #86-Ubuntu SMP Wed Oct 23 09:20:45 UTC 2013
Target: msp430g2553
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Pomo 2013-12-19 10:57:08 UTC
Gcc: msp430-gcc (GNU GCC patched mspgcc-20110716) 4.5.3
Run on msp430G2553
Library used: Energia 0101E0009
compiled on host: Linux version 3.2.0-56-generic (buildd@roseapple) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #86-Ubuntu SMP Wed Oct 23 09:20:45 UTC 2013

I have wrote a big program with many library and i test it from some month, all OK but, when i add new code i found a strange think, the CPU do nothink so i use debugger and i find the problem:

using msp430g2553 with 510 bytes of ram memory used (512 max), (calculation way: i enlarge the variable and i use the linker error to calculate the size, i reduce the size for stay in the limit)

With debugger i discover:
the first instruction CPU load from 0x0120 WDTCTL in 0x03fc address ram and make an or so the location becam 0x5408, it use this value for reset wdt, i think before energia initialize it, SP is initialized to 0x0400 when the code use CALL and RET (for init) overwrite that value at 0x03fc so when it use the value for clear Watchdog happen a PUC because the write pin(password) is not correct (WDTPW that has to be 5A high byte is 0xda, call return address of the stack).
i reduce the code of 4 bytes for be sure and it works.
All is ok only the space conflict with stack and temporary variable is a problem.

I hope to be clear, i'm ready to give more detail.

I think is a problem of the library for initialization but i don't know which component is.

Roberto Pomo <jkroby@p3r.info>
Comment 1 Peter A. Bigot 2014-11-16 19:59:53 UTC
This report is against the out-of-tree target implemented in mspgcc, not the subsequent integrated port to MSP430 referred to as msp430-elf.  C++ was never officially supported in mspgcc, and mspgcc itself is no longer supported.
Comment 2 Andrew Pinski 2016-10-16 07:02:07 UTC
Invalid then .