Tool/software: Code Composer Studio
Hi all
I am a complete newbie to MSP430 launchpad with M430G2553 MCU. I want to perform the following tasks,
1. Calling an assembler function from a C program without passing parameters and return values.
2. Calling an Assembler Function From a C Program and Passing Parameters and a Return Value
3. the assembler function / or from main loop calls a standard C library function say rand() and calls a user made C function mult(a, b)
4. many more ....
I got a tutorial pdf : slaa140.pdf which has full tut with examples of all the above, but bad luck it is for IAR and just copying and pasting the codes didn't work in CCS
so I decided to try myself : I tried the first : Calling an assembler function from a C program without passing parameters and return values.
I made two files inside my CCS project
1. blink.c
#include <msp430.h> /* -------------------external Function Prototypes ------------------- */ extern void set_port(void); /* Function Prototype for asm function */ int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer P1DIR |= 0x01; // Set P1.0 to output direction for(;;) { volatile unsigned int i; // volatile to prevent optimization set_port(); // Toggle P1.0 i = 10000; // SW Delay do i--; while(i != 0); } return 0; }
and 2. asmFile.asm
; ***************************************************************************** .cdecls C,LIST,"msp430.h" ;============================================================================ ; set_port ;============================================================================ .text ; Code is relocatable set_port: _main xoropr xor.b #01h,&P1OUT ; Toggle 0x01 bit Port 1 output ret .end
but on building the project i got errors
Description Resource Path Location Type
#10010 errors encountered during linking; "callingASMinC.out" not built callingASMinC C/C++ Problem
<a href="processors.wiki.ti.com/.../10234"> unresolved symbols remain callingASMinC C/C++ Problem
gmake: *** [all] Error 2 callingASMinC C/C++ Problem
gmake[1]: *** [callingASMinC.out] Error 1 callingASMinC C/C++ Problem
unresolved symbol set_port, first referenced in ./blink.obj callingASMinC C/C++ Problem
pls help me i am in a great need
thanks in advance
waiting patient-lessly for your reply pls reply soon
thanks