Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » MSPDebug
  • » [SOLVED] MSPDebug 0.18 - Section vectors not written [RSS Feed]

#1 Jan. 16, 2012 14:08:38

uvok
Registered: 2012-01-16
Posts: 3
Reputation: +  0  -
Profile   Send e-mail  

[SOLVED] MSPDebug 0.18 - Section vectors not written

Hi,

I am using mspdebug 0.18 under Windows XP. I want to write a program compiled by msp430-gcc to an MSP430G2231 on a TI Launhcpad.
If I write a C program, that's no problem.

However, if I compile an assembler source, the section .vectors is not written to flash. So the program doesn't start.

The assembler source code looks like this:


#include <msp430.h>
.section .text
RESET: mov.w #0x0280,R1 ; Initialize stackpointer - End of RAM
StopWDT: mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT

CalibDCO: mov.w #CALBC1_1MHZ, &BCSCTL1
mov.w #CALDCO_1MHZ, &DCOCTL

SetupP1: bis.b #BIT0,&P1DIR ; P1.2 output
;

Mainloop: xor.b #BIT0,&P1OUT ; Toggle P1.2

; Wait ~1s - 1 000 000 cycles
Wait: mov.w #1000,R15 ; Delay to R15

L1: mov.w #1000, R14
L2: dec.w R14
jnz L2

dec.w R15 ; Decrement R15
jnz L1 ; Delay over?


jmp Mainloop ; Again

no_int: reti ;
;--------------------------------------------------------------------
; Interrupt Vectors Used MSP430x13x/14x
;--------------------------------------------------------------------
.section .vectors
;Adresse wird einfach angegeben
.word no_int ; 0xFFE0
.word no_int ; 0xFFE2
.word no_int ; 0xFFE4
.word no_int ; 0xFFE6
.word no_int ; 0xFFE8
.word no_int ; 0xFFEa
.word no_int ; 0xFFEc
.word no_int ; 0xFFEe
.word no_int ; 0xFFF0
.word no_int ; 0xFFF2
.word no_int ; 0xFFF4
.word no_int ; 0xFFF6
.word no_int ; 0xFFF8
.word no_int ; 0xFFFA
.word no_int ; 0xFFFC
.word RESET ; 0xFFFE (Reset)


It's xcompiled with

>msp430-gcc -nostartfiles -x assembler-with-cpp -mmcu=msp430g2231 -o asm.o test.asm


The section .vectors is available:


D:\>msp430-objdump -D asm.o

asm.o: file format elf32-msp430

Disassembly of section .text:

0000f800 <__ctors_end>:
f800: 31 40 80 02 mov #640, r1 ;#0x0280

0000f804 <StopWDT>:
f804: b2 40 80 5a mov #23168, &0x0120 ;#0x5a80
f808: 20 01

0000f80a <CalibDCO>:
f80a: b2 40 ff 10 mov #4351, &0x0057 ;#0x10ff
f80e: 57 00
f810: b2 40 fe 10 mov #4350, &0x0056 ;#0x10fe
f814: 56 00

0000f816 <SetupP1>:
f816: d2 d3 22 00 bis.b #1, &0x0022 ;r3 As==01

0000f81a <Mainloop>:
f81a: d2 e3 21 00 xor.b #1, &0x0021 ;r3 As==01

0000f81e <Wait>:
f81e: 3f 40 e8 03 mov #1000, r15 ;#0x03e8

0000f822 <L1>:
f822: 3e 40 e8 03 mov #1000, r14 ;#0x03e8

0000f826 <L2>:
f826: 1e 83 dec r14
f828: fe 23 jnz $-2 ;abs 0xf826
f82a: 1f 83 dec r15
f82c: fa 23 jnz $-10 ;abs 0xf822
f82e: f5 3f jmp $-20 ;abs 0xf81a

0000f830 <no_int>:
f830: 00 13 reti

Disassembly of section .vectors:

0000ffe0 <_efartext+0xffe0>:
ffe0: 30 f8 and @r8+, r0
ffe2: 30 f8 and @r8+, r0
ffe4: 30 f8 and @r8+, r0
ffe6: 30 f8 and @r8+, r0
ffe8: 30 f8 and @r8+, r0
ffea: 30 f8 and @r8+, r0
ffec: 30 f8 and @r8+, r0
ffee: 30 f8 and @r8+, r0
fff0: 30 f8 and @r8+, r0
fff2: 30 f8 and @r8+, r0
fff4: 30 f8 and @r8+, r0
fff6: 30 f8 and @r8+, r0
fff8: 30 f8 and @r8+, r0
fffa: 30 f8 and @r8+, r0
fffc: 30 f8 and @r8+, r0
fffe: 00 f8 and r8, r0


Has anyone an idea why the section vectors is not written to flash?
Is it a bug in mspdebug or did I make a mistake in code?

Edited uvok (Jan. 17, 2012 21:29:54)

Offline

#2 Jan. 16, 2012 14:30:59

Raphael
From: Europe
Registered: 2011-04-01
Posts: 14
Reputation: +  0  -
Profile   Send e-mail  

[SOLVED] MSPDebug 0.18 - Section vectors not written

Hello uvok,

your question concerning version 0.18 is in progress:

Best wishes
Raphael


Open source stands for: better quality, higher reliability, more flexibility, lower cost, end to predatory vendor lock-in, freedom, autonomy of decision and a future to mankind!

Offline

#3 Jan. 16, 2012 14:39:14

leonidas
Registered: 2011-03-19
Posts: 57
Reputation: +  1  -
Profile   Send e-mail  

[SOLVED] MSPDebug 0.18 - Section vectors not written

For people with german language background this discussion was initiated here first:
Initial post (German) [mikrocontroller.net]

To understand the background context better.
leonidas

Offline

#4 Jan. 16, 2012 20:22:19

dlbeer
Registered: 2011-04-18
Posts: 16
Reputation: +  1  -
Profile   Send e-mail  

[SOLVED] MSPDebug 0.18 - Section vectors not written

I compiled the code you gave, and then ran "msp430-objdump -x foo". I get this:


Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000032 0000f800 0000f800 00000054 2**0
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .vectors 00000020 0000ffe0 0000ffe0 00000086 2**0
CONTENTS, READONLY


The .vectors section is missing the LOAD flag, so mspdebug ignores it for the purposes of programming. There will be some directive you need to add in your assembly source to specify that the .vectors section is loadable, but I'm not sure what that'll be.

- Daniel

Offline

#5 Jan. 16, 2012 21:59:50

uvok
Registered: 2012-01-16
Posts: 3
Reputation: +  0  -
Profile   Send e-mail  

[SOLVED] MSPDebug 0.18 - Section vectors not written

@dlbeer
Thanks for the tip. Now I know where I have to look closer :)
I will do some research on this topic tomorrow...

Edited uvok (Jan. 16, 2012 22:00:11)

Offline

#6 Jan. 17, 2012 21:33:11

uvok
Registered: 2012-01-16
Posts: 3
Reputation: +  0  -
Profile   Send e-mail  

[SOLVED] MSPDebug 0.18 - Section vectors not written

Problem is solved.
The correct syntax is
.section .vectors, "ax", @progbits


That way, the .vectors section is also loaded into the controller.

(Source (german): http://www.mikrocontroller.net/topic/245253#2504759 )

Offline

#7 March 17, 2017 15:31:28

Shannonlap
Registered: 2017-03-01
Posts: 2
Reputation: +  0  -
Profile   Send e-mail  

[SOLVED] MSPDebug 0.18 - Section vectors not written

This post is being moderated

Offline

#8 March 19, 2017 17:25:54

Shannonlap
Registered: 2017-03-01
Posts: 2
Reputation: +  0  -
Profile   Send e-mail  

[SOLVED] MSPDebug 0.18 - Section vectors not written

This post is being moderated

Offline

  • Root
  • » MSPDebug
  • » [SOLVED] MSPDebug 0.18 - Section vectors not written [RSS Feed]

Board footer

Moderator control

Enjoy the 26th of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support