FrustratedWSalvo
Reged: Jul 28 2005
Posts: 4
|
|
I am running MPLab Version 7.01 c/w ICD2, PICLite 8.05PL2, and Salvo 3.32 (Latest). I canno't seem to get even the simpliest project to compile. I am using the free library "sfp42cab.lib" with the 16F877A selected as the device within MPLAB. My salvocfg.h file is as follows:
***** salvocfg.h ***** #define OSUSE_LIBRARY TRUE #define OSLIBRARY_TYPE OSF #define OSLIBRARY_CONFIG OSA #define OSLIBRARY_VARIANT OSB **********************
***** main.c ***** #include #include "salvo.h"
_OSLabel(TaskA1) _OSLabel(TaskB1)
void TaskA(void) { TRISC3 = 0; while(1) { RC3=0; OS_Delay(30,TaskA1); RC3=1; } }
void TaskB(void) { TRISC2 = 0; while(1) { RC2=0; OS_Delay(20,TaskB1); RC2=1; } }
main(void) { Init(); OSInit(); OSCreateTask(TaskA, OSTCBP(1),10); OSCreateTask(TaskB, OSTCBP(2),10);
for(;;) OSSched(); } ****************
***** Error Messages (Build All)***** Clean: Deleting intermediary and output files. Clean: Deleted file "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.obj". Clean: Deleted file "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.cce". Clean: Deleted file "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\mem.obj". Clean: Deleted file "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\mem.cce". Clean: Deleted file "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\WOV.mcs". Clean: Done. Executing: "C:\PICCLITE\BIN\PICL.EXE" -C -E"main.cce" "main.c" -O"main.obj" -I"D:\Electronics\Projects\Wedding_O\Firmware\HiTechC" -Zg9 -O -ASMLIST -W-9 -Q -MPLAB -16F877A Warning[000] C:\PICCLITE\INCLUDE\pic.h 170 : Unexpected text in #control line ignored Warning[000] C:\PICCLITE\INCLUDE\pic.h 174 : Unexpected text in #control line ignored Warning[000] D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\salvocfg.h 4 : Missing newline Warning[000] C:\PICCLITE\INCLUDE\pic.h 170 : Unexpected text in #control line ignored Warning[000] C:\PICCLITE\INCLUDE\pic.h 174 : Unexpected text in #control line ignored Warning[000] D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.c 32 : function declared implicit int Warning[000] D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.c 35 : implicit signed to unsigned conversion Warning[000] D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.c 36 : implicit signed to unsigned conversion Warning[000] D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.c 13 : constant relational expression Warning[000] D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.c 13 : constant conditional branch Warning[000] D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.c 13 : expression generates no code Warning[000] D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.c 25 : constant relational expression Warning[000] D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.c 25 : constant conditional branch Warning[000] D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.c 25 : expression generates no code Executing: "C:\PICCLITE\BIN\PICL.EXE" -C -E"mem.cce" "mem.c" -O"mem.obj" -I"D:\Electronics\Projects\Wedding_O\Firmware\HiTechC" -Zg9 -O -ASMLIST -W-9 -Q -MPLAB -16F877A Warning[000] D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\salvocfg.h 4 : Missing newline Warning[000] C:\PICCLITE\INCLUDE\pic.h 170 : Unexpected text in #control line ignored Warning[000] C:\PICCLITE\INCLUDE\pic.h 174 : Unexpected text in #control line ignored Executing: "C:\PICCLITE\BIN\PICL.EXE" -E"WOV.lde" "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.obj" "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\mem.obj" "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\sfp42cab.lib" -M"WOV.map" -W-9 -O"WOV.cof" -O"WOV.hex" -Q -MPLAB -16F877A Error[000] : undefined symbols: Error[000] : _Init (D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.obj) Error[000] : _OSIdlingHook (D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\sfp42cab.lib: sched.obj) BUILD FAILED: Thu Jul 28 22:02:13 2005 *******************
***** Error (Make) *****
The target "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.obj" is already up to date. The target "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\mem.obj" is already up to date. Executing: "C:\PICCLITE\BIN\PICL.EXE" -E"WOV.lde" "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.obj" "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\mem.obj" "D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\sfp42cab.lib" -M"WOV.map" -W-9 -O"WOV.cof" -O"WOV.hex" -Q -MPLAB -16F877A Error[000] : undefined symbols: Error[000] : _Init (D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\main.obj) Error[000] : _OSIdlingHook (D:\Electronics\Projects\Wedding_O\Firmware\HiTechC\sfp42cab.lib: sched.obj) BUILD FAILED: Thu Jul 28 22:03:10 2005 *******************
Is there an example or any documentation that will provide a step by step walk through with the latest MPLab (version 7)
Any assistance would be greatly appreciated as I am getting very very frustrated. (Hence my User Name)
PS All the salvo files: -Entire inc directory -mem.c -the lib file -main.c -salvocfg.h exist in the project directory and the Hitech c compiler directories are pointed to the same directory.
|
jtemples
Guru
  
Reged: Oct 16 2003
Posts: 1339
Loc: Southern California
|
|
Compiling Salvo code at warning levels less than 0 will generate lots of spurious warnings.
You're calling Init() which isn't defined anywhere.
It's been a while since I used Salvo, but I believe in a library build, you have to define OsIdlingHook yourself. This will be in the Salvo manual.
|
medbox
Reged: Jul 30 2005
Posts: 1
|
|
1. Set properly Project Build Options in MPLAB IDE. Project->Build Options->Project: General Include Path: C:\HT_PIC\include;C:\salvo\inc;c:\yourdirname\demo1 Library Path: C:\salvo\lib\htpicc
It's not necessary to change PICC Global, PICC Compiler, PICC Assembler, PICC Linker.
2. Create Project Directory: demo1 Create new project with Project Wisard for PIC16F877 or another PIC. Don't copy any files in this Directory.
3. Create a new file and place to it the following text:
/************************************************************ Copyright (C) Source: C:\demo1 Author: Revision: 0.1 Date: 07/30/05
************************************************************/
#include "salvo.h"
//*****************( PROTOTYPES )***************************
_OSLabel(TaskA1) _OSLabel(TaskB1)
//*****************( FUNCTIONS )****************************
//*****************( TASKS )********************************
void TaskA( void ) { for (;;) { OS_Yield(TaskA1); } }
void TaskB( void ) { for (;;) { OS_Yield(TaskB1); } }
//*****************( MAIN )*********************************
void main( void ) {
OSInit(); OSCreateTask(TaskA, OSTCBP(1), 10); OSCreateTask(TaskB, OSTCBP(2), 10); for (;;) OSSched(); }
Save this file with the name main.c then add it to Source Files
4. Create a new file and place to it the following text:
/************************************************************ Copyright (C)
Source: C:\Playgrd_3\demo1 Author: Revision: 0.1 Date: 07/30/05
Header file for demo1
************************************************************/ #define OSCOMPILER OSHT_PICC #define OSTARGET OSPIC16
#define OSTASKS 2
Save this file with the name salvocfg.h then add it to Header Files.
5. Add to Source files the following files from salvo\src directory: events.c, init.c, inittask.c, mem.c, gins.c, sched.c, task.c, util.c
This will give you the possibility to see SALVO in action.
6. Build the Project:
Memory Usage Map:Program ROM $0000 - $0034 $0035 ( 53) wordsProgram ROM $06E5 - $07FF $011B ( 283) words $0150 ( 336) words total Program ROM Bank 0 RAM $0020 - $0034 $0015 ( 21) bytesBank 0 RAM $0070 - $0071 $0002 ( 2) bytes $0017 ( 23) bytes total Bank 0 RAM Program statistics:Total ROM used 336 words (4.1%)Total RAM used 23 bytes (6.2%)Loaded C:\demo1\demo1.cofBUILD SUCCEEDED: Sat Jul 30 18:28:30 2005
Select in MPLAB Debugger MPLAB SIM and study the Program execution.
Good Lack.
|
Mark Pappin
 
Reged: Nov 01 2004
Posts: 599
Loc: Brisbane, Australia
|
|
Quote:
1. Set properly Project Build Options in MPLAB IDE. Project->Build Options->Project: General Include Path: C:\HT_PIC\include;C:\salvo\inc;c:\yourdirname\demo1
1. Our compiler knows where to find its own headers - you do not need to, and should not, list the compiler's INCLUDE directory in MPLAB's Include Path.
2. You do not need to list your project's own directory in the Include Path either, as #include "file.h" will search in the source directory first.
Quote:
#include "salvo.h"
You should use <...>, not "...", for any headers which should be searched for along directories in the Include Path.
-------------------- Mark Pappin - HI-TECH Software
|
FrustratedWSalvo
Reged: Jul 28 2005
Posts: 4
|
|
Thank you.... All
I managed to get the little shell to compile... finally I am getting somewhere.
How do I figure out what the tick speed/frequency is??? Are there any built-in functions that I can use to determine the processor utilization, TCB Stack usage etc.???
I really, really appreciate the help.
|
Gerhard
Reged: Apr 21 2004
Posts: 89
Loc: Brazil
|
|
Quote:
How do I figure out what the tick speed/frequency is??? Are there any built-in functions that I can use to determine the processor utilization, TCB Stack usage etc.?
I don't use Salvo... just lurking here.
To find out the tick frequency, you can either RTFM or you set up a timer that toggles a pin, say, every 100 ticks. Then you watch this pin with a scope.
To determine processor utilization, you could toggle a pin in a background task (i.e. lowest priority) that runs always when no other task is running. Then you watch that pin. As long as it toggles, your processor is in the (basically idle) background task.
|