Pumpkin, Inc.

Pumpkin User Forums

Compile problems including src

For issues specific to TI's MSP430 line of ultra-low-power microcontrollers, including compilers (e.g. Quadravox AQ430), IDEs (e.g. IAR Embedded Workbench) and development tools (e.g. TI MSP-FET430 Flash Emulation Tool).

Compile problems including src

Postby Phil W » Tue Jan 14, 2003 10:29 am

Hi,

I am using version 3.1.0-d and successfully linked in with library to my project.

I wanted to increase number of bytes for delay, but could not remake the library's. So included src into my project and copied/modified src/user/salvocfg.h to my project. Unfortunately I get a couple of link errors I don't understand.

I am using IAR Version 1.26B/win for the MSP430.

Below is a copy of the link error messages.

Warning[w6]: Type conflict for external/entry "printf", in module rpt against external/entry in module ?printf; different types
/* In module rpt: */
/* Function, args 2, attr 210 */
int DATA0 printf(signed char DATA0 const * DATA0,
...);
/* In module ?printf: */
/* Function, args 2, attr 210 */
int DATA0 printf(unsigned char DATA0 const * DATA0,
...);
Warning[w29]: Parts of segment SEG119 are initialized (as in module spmem), even though it is of type DATA (and thus not promable)
Warning[w29]: Parts of segment SEG118 are initialized (as in module spmem), even though it is of type DATA (and thus not promable)
Warning[w29]: Parts of segment SEG117 are initialized (as in module spmem), even though it is of type DATA (and thus not promable)
Warning[w29]: Parts of segment SEG116 are initialized (as in module spmem), even though it is of type DATA (and thus not promable)
Error[e46]: Undefined external "OSCtxSw" referred in adc ( C:ProjectsSPVALIDATORSSP1SOFTWAREDebugObjADC.r43 )
Error[e46]: Undefined external "OSDispatch" referred in sched ( C:ProjectsSPVALIDATORSSP1SOFTWAREDebugObjsched.r43 )

The segment warnings I expected, the printf warning I can handle but you may be able to explain.
The errors I cannot explain. My ADC file contains a number of functions that simply uses salvo functions.

I have included below a copy of my salvocfg.h

#include <msp430x14x.h>

//#define OSBIG_MESSAGE_POINTERS FALSE
#define OSBIG_SEMAPHORES FALSE
#define OSBYTES_OF_COUNTS 2
#define OSBYTES_OF_DELAYS 2
#define OSBYTES_OF_EVENT_FLAGS 2
#define OSBYTES_OF_TICKS 4
#define OSCALL_OSCREATEEVENT OSFROM_BACKGROUND
#define OSCALL_OSGETPRIOTASK OSFROM_BACKGROUND
#define OSCALL_OSGETSTATETASK OSFROM_BACKGROUND
#define OSCALL_OSMSGQFULL OSFROM_BACKGROUND
#define OSCALL_OSRETURNEVENT OSFROM_BACKGROUND
#define OSCALL_OSSIGNALEVENT OSFROM_BACKGROUND
#define OSCALL_OSSTARTTASK OSFROM_BACKGROUND
#define OSCLEAR_GLOBALS TRUE
#define OSCLEAR_UNUSED_POINTERS FALSE
#define OSCLEAR_WATCHDOG_TIMER() WDTCTL = (WDTCTL & 0X00FF) + WDTPW + WDTCNTCL
#define OSCOMBINE_EVENT_SERVICES FALSE
#define OSCOMPILER OSIAR_ICC
#define OSDISABLE_ERROR_CHECKING FALSE
#define OSDISABLE_FAST_RESCHEDULING FALSE
#define OSDISABLE_TASK_PRIORITIES FALSE
#define OSENABLE_BINARY_SEMAPHORES TRUE
#define OSENABLE_BOUNDS_CHECKING FALSE
#define OSENABLE_CTXSW_HOOK FALSE
#define OSENABLE_EVENT_FLAGS TRUE
#define OSENABLE_EVENT_READING FALSE
#define OSENABLE_EVENT_TRYING TRUE //********
#define OSENABLE_FAST_SIGNALING FALSE
#define OSENABLE_IDLE_COUNTER FALSE
#define OSENABLE_IDLING_HOOK TRUE
#define OSENABLE_INTERRUPT_HOOKS FALSE
#define OSENABLE_MESSAGES FALSE
#define OSENABLE_MESSAGE_QUEUES FALSE
#define OSENABLE_SCHEDULER_HOOK FALSE
#define OSENABLE_SEMAPHORES TRUE
#define OSENABLE_STACK_CHECKING FALSE
#define OSENABLE_TCBEXT0 FALSE
#define OSENABLE_TCBEXT1 FALSE
#define OSENABLE_TCBEXT2 FALSE
#define OSENABLE_TCBEXT3 FALSE
#define OSENABLE_TCBEXT4 FALSE
#define OSENABLE_TCBEXT5 FALSE
#define OSENABLE_TIMEOUTS TRUE
#define OSEVENT_FLAGS 4
#define OSEVENTS 10
#define OSGATHER_STATISTICS FALSE
#define OSINTERRUPT_LEVEL 0
#define OSLOGGING FALSE
#define OSLOG_MESSAGES OSLOG_NONE
#define OSMAKE_LIBRARY FALSE
#define OSMESSAGE_QUEUES 0
#define OSMPLAB_C18_LOC_ALL_NEAR FALSE
#define OSMPLAB_C18_STACK_SIZE 512
#define OSOPTIMIZE_FOR_SPEED FALSE
#define OSPRESERVE_INTERRUPT_MASK TRUE
#define OSRPT_HIDE_INVALID_POINTERS TRUE
#define OSRPT_SHOW_ONLY_ACTIVE TRUE
#define OSRPT_SHOW_TOTAL_DELAY TRUE
#define OSSET_LIMITS FALSE //
#define OSSPEEDUP_QUEUEING FALSE
#define OSTARGET OSMSP430
#define OSTASKS 10
#define OSTIMER_PRESCALAR 0
#define OSTYPE_TCBEXT0 void *
#define OSTYPE_TCBEXT1 void *
#define OSTYPE_TCBEXT2 void *
#define OSTYPE_TCBEXT3 void *
#define OSTYPE_TCBEXT4 void *
#define OSTYPE_TCBEXT5 void *
#define OSUSE_ARRAYS FALSE
#define OSUSE_EVENT_TYPES TRUE
#define OSUSE_INLINE_OSSCHED FALSE
#define OSUSE_INLINE_OSTIMER FALSE
#define OSUSE_INSELIG_MACRO TRUE
#define OSUSE_LIBRARY FALSE

#define OSLOC_ALL OSLOC_DEFAULT
#define OSLOC_COUNT OSLOC_DEFAULT
#define OSLOC_CTCB OSLOC_DEFAULT
#define OSLOC_DEPTH OSLOC_DEFAULT
#define OSLOC_ECB OSLOC_DEFAULT
#define OSLOC_EFCB OSLOC_DEFAULT
#define OSLOC_ERR OSLOC_DEFAULT
#define OSLOC_GLSTAT OSLOC_DEFAULT
#define OSLOC_LOGMSG OSLOC_DEFAULT
#define OSLOC_MQCB OSLOC_DEFAULT
#define OSLOC_MSGQ OSLOC_DEFAULT
#define OSLOC_PS OSLOC_DEFAULT
#define OSLOC_SIGQ OSLOC_DEFAULT
#define OSLOC_TCB OSLOC_DEFAULT
#define OSLOC_TICK OSLOC_DEFAULT


Can you help?

regards
Phil

Phil W
 
Posts: 36
Joined: Tue Jan 14, 2003 12:00 am
Location: penrith nsw australia

Re: Compile problems including src

Postby Phil W » Wed Jan 15, 2003 5:41 am

if you look at the warning messages I sent at the start, for some reason your rpt() proto's a 'signed char const' whereas IAR's ?printf proto's as a 'unsigned char const'. I had look to see if I could identify where the differences originated but had to give up for other pressing matters. However I believe the code should still work ok even with the warning.

Phil

Phil W
 
Posts: 36
Joined: Tue Jan 14, 2003 12:00 am
Location: penrith nsw australia

Re: Compile problems including src

Postby aek » Wed Jan 15, 2003 6:24 am

Hi Phil.

The whole thing is odd -- rpt.c's proto's are those pulled in by salvo.h ... ultimately by portiar430.h. printf() is used only in rpt.c, and so that's why it's an issue there.

portiar430.h:

code:
#include <stdio.h>
#include <string.h>
#include <in430.h>
#include <stdarg.h>
#include <stdlib.h>

Ahhh ... do you have your own printf()? Then it makes sense, as your proto may be different from IAR's default proto, and it's pulling in IAR's because of the use of #include <...> in portiar430.h ...

------------------

[This message has been edited by aek (edited January 15, 2003).]

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Compile problems including src

Postby Phil W » Wed Jan 15, 2003 6:49 am

Hi,

No I don't use my own printf, infact I do not use it at all.

An extra interesting detail. This warning only occurs when including the src in my project. However after fixing my problem as you found, I manually generated my own library for the src as per my salvocfg.h

there was no warning about printf in the compile for library as the linker was not called.

Recompiling my project, using my new lib instead of the src also produced no warning.
so using the lib may have hidden the potential bug - :-)

phil

Phil W
 
Posts: 36
Joined: Tue Jan 14, 2003 12:00 am
Location: penrith nsw australia

Re: Compile problems including src

Postby aek » Wed Jan 15, 2003 9:13 am

Hi Phil.

1) The file you have omitted from the source-code build is the processor-specific file salvosrcportiar430.s43. It contains OSDispatch() and OSCtxSw(). Add it to your project and you'll compile successfully.

While portiar430.s43 is mentioned in AN-15, I notice it's not prominently mentioned. We'll be updating our documentation to improve on this situation.

2) I notice you've followed our directions and used the "default" user salvocfg.h. This causes more headaches than it's worth (we will be deleting it from future releases). Instead, just define those configuration options that you need different from their defaults. Take a look at the salvocfg.h's in the tutorial programs to see the few configuration options you need for a source-code build. You'll probably just want to add

code:
#define OSBYTES_OF_COUNTS 2
#define OSBYTES_OF_DELAYS 2

to achieve your goal.

Regards,

------------------

[This message has been edited by aek (edited January 15, 2003).]

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Compile problems including src

Postby aek » Wed Jan 15, 2003 9:14 am

Hi Phil.

BTW, what is causing those printf()/OSRpt()-related warnings?

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to TI's MSP430

Who is online

Users browsing this forum: No registered users and 2 guests

cron