www.mikrocontroller.net

Forum: Mikrocontroller und Elektronik MSP430F1611 - Controller hängt beim löschen des Speichers

Autor: Sebastian K. (albatros82)
Datum: 25.07.2007 09:13

Hallo,

Seit gestern kämpfe ich mit einem merkwürdigen Problem. Mein MSP lässt
sich wie gewohnt mit meiner Software bespielen und startet auch.

IAR Assembler for MSP430
V3.30A/W32 (3.30.1.9)

Normalerweise bleibt er dann jedoch am einstiegspunkt "main" stehen.
Momentan kommt er aber erst garnicht bis zum Einstiegspunkt Main sondern
bleibt vorher in einer Endlosschleife hängen. Nachforschungen führten zu
dieser Funktion:

__data16_memzero:
 0053EE   0F4C          mov.w   R12,R15
 0053F0   0F5E          add.w   R14,R15
 0053F2   033C          jmp     0x53FA
 0053F4   CC430000      clr.b   0x0(R12)
 0053F8   1C53          inc.w   R12
 0053FA   0C9F          cmp.w   R15,R12
 0053FC   FB23          jne     0x53F4
 0053FE   3041          ret

In meinen Augen löscht sie den Speicher des Controlles von der Adresse
in R12 bis zur Adresse in R15 (0x2F53).  Jedoch erreicht das Register
R12 niemals den Wert in R15. Scheinbar wird das Register durch irgendwas
immer wieder zurückgestezt.

Setzt man den PC auf die Adresse 0053FE zeigt der Debugger das erwartete
Verhalten und springt zu Main. Jedoch sind dann logischerweise nicht
alle Variblen zurückgestezt.

Ein anderer Workaround ist es die Codeoptimierung auf maximal zu
stellen. Jedoch lässt sich der Code dann nicht mehr gescheit Debuggen.

Fakt ist auch das ich relativ viele globale Variablen definiert habe.
Kann es sein das ich da einfach übertrieben habe?

Hat da jemand eine Idee was das ein könnte?

Grüße Albatros
Autor: Humberto (Gast)
Datum: 19.03.2008 19:54

Hi Albatros!

I have read your email and, in fact, I can not help you, but I need to
know if you could solve the problem (MSP430F1611 - __data16_memzero).
I am asking this because I am in front of this problem right now! So
could you to solve the problem? If so, can you help-me sending me the
workaround, please.

Thank you so much.

Best regards

Humberto

humbertovgomes@gmail.com
Autor: Stefan (Gast)
Datum: 19.03.2008 21:31

The problem:
IAR compiler inserts __low_level_init in front of your main().
This is done e.g. to initialize variables you defined!
If there are too many variables then __low_level_init will take to long
time and your watchdog will fire before you are able to disable WDT in
main()!

solutions:
- define less (global) variables
- or try higher MCLK, so the code will run faster
- or try some other optimization switches
But the most reasonable solution would be to change cstartup code, so
WDT is disabled before or in __low_level_init
Autor: Stefan (Gast)
Datum: 20.03.2008 07:31

>- or try higher MCLK, so the code will run faster
OK, nonsense. Forget about this ;-)
Autor: Humberto (Gast)
Datum: 09.05.2008 19:15

Hey Stefan,

Thank you so much!
Sorry by the delay, but the forum didn't send me any message, and I was
solving another problem of the shelf.. :)
With your tip I could solve the problem, you were completely right, I
fixed it declaring the global arrays with the __no_init IAR directive.

Thanks again

Humberto

Antwort schreiben

Die Angabe einer Email-Adresse ist freiwillig. Wenn Sie automatisch per Email über Antworten auf Ihren Beitrag informiert werden möchten, melden Sie sich bitte an.

Wichtige Regeln - erst lesen, dann posten!

  • Suchfunktion und Betreffsuche benutzen - vielleicht gibt es schon einen ähnlichen Beitrag
  • Aussagekräftigen Betreff wählen
  • Im Betreff angeben um welchen Controllertyp es geht (AVR, PIC, ...)
  • Groß- und Kleinschreibung verwenden
  • Längeren Sourcecode nicht im Text einfügen, sondern als Dateianhang
  • JPEG-Dateien (.jpg) nur für Fotos und Scans verwenden
  • Schaltpläne, Screenshots usw. als PNG oder GIF anhängen

Formatierung (mehr Informationen...)

  • [c]C-Code[/c]
  • [avrasm]AVR-Assembler-Code[/avrasm]
  • [pre]vorformatierter Text (z.B. Code in anderen Sprachen)[/pre]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] - Link zu Artikel





Hinweis: der Originalbeitrag ist mehr als 6 Monate alt.

webmaster@mikrocontroller.netImpressumWerbung auf Mikrocontroller.net