Jump to content
Sign in to follow this  
ra68gi

Novo Rtos With Boostbasic

Recommended Posts

Hi Dave,

 

Can we implement novo rtos in boost basic?

I understand that boostc and boost basic both use the same linker to generate the hex file. I also understand that the -swcs( software call stack) switch has to be set in order to use novo rtos ie. to say all call functions containing novo rtos's sys_yield() function will use software call stacks. Am i right?

Is it poosible to use the demo free down load to test it? In the SB IDE is there any settings to invoke nova rtos.

I want to get started with rtos. What are the tools i need to buy, min chip requirement, a writeup on rtos would be of great help for beginners like me.

Regards

Raghunathan

 

Note from Dave:I move this text into a new thread as the old one was getting looooong and we had moved off the original subject

Share this post


Link to post
Share on other sites

Raghunathan,

Can we implement novo rtos in boost basic?
In theory yes, but its not been tried. Although it is intended happen.

 

I understand that boostc and boost basic both use the same linker to generate the hex file. I also understand that the -swcs( software call stack) switch has to be set in order to use novo rtos ie. to say all call functions containing novo rtos's sys_yield() function will use software call stacks. Am i right?
Yes. The software call stack is used so each thread can resume where it left off.

 

Is it poosible to use the demo free down load to test it? In the SB IDE is there any settings to invoke nova rtos.
Yes, one of the supplied novo libs would need to be added to the project. Again I've not tried this, so there maybe something I haven't thought of that would cause a problem.

 

I want to get started with rtos. What are the tools i need to buy, min chip requirement, a writeup on rtos would be of great help for beginners like me.
It will work with small devices, but the RAM may run out. The C samples supplied are for the PIC16F88.

 

Have fun.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Hi Dave,

 

When i build your nova c program, i get errors. Why?

 

///////////////////////////////////////////////
// Portb sharing using a semaphore
///////////////////////////////////////////////
// Uses Novo RTOS
//
// This has two tasks. They both share PORTB for
// output. A semaphore is used in binary mode to
// ensure that only one task is using PORTB at a
// time
//
// Target Device: PIC16F88
//
// Author: David Hobday
//
// Version History:
// V1.0 - 19/09/2006
// Initial release.

#include <system.h>
#include <novocfg_pic16t3e5ts1.h>
#include <novo.h>

#pragma DATA _CONFIG, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _PWRTE_OFF & _WDT_OFF & _HS_OSC

#define hTask0 0
#define hTask1 1

#define hSemaPortbAvailable 0

void interrupt( void )
{
// update system time every 1ms (actually is 204.8us x 5 = 1.024ms)
static BYTE intDivider;
if( ++intDivider == 5 )
{
	intDivider = 0;
	SysTimerUpdate();
}

intcon.TMR0IF = 0; //clear TMR0 overflow flag
}

void InitTimer()
{
// configure Timer0	
option_reg.T0CS = 0; // use internal clock
option_reg.PSA = 0; // use prescaler form timer 0	


// so we get an interrupt around every 204.8us with 20MHz Clock
// set prescaller to divide by 4
option_reg.PS0 = 1;
option_reg.PS1 = 0;
option_reg.PS2 = 0;

// enable interrupts
intcon.TMR0IE = 1; //enable TMR0 overflow bit    
intcon.GIE = 1;
}

void Task0()
{
while( 1 )
{
	Sys_WaitSemaphore( hSemaPortbAvailable, EVENT_NO_TIMEOUT );

	portb = 0b00000000;
	Sys_Sleep( 255 );
	portb = 0b10000001;
	Sys_Sleep( 255 );
	portb = 0b01000010;
	Sys_Sleep( 255 );
	portb = 0b00100100;
	Sys_Sleep( 255 );
	portb = 0b00011000;
	Sys_Sleep( 255 );

	SysSignalSemaphore( hSemaPortbAvailable );
	Sys_Yield();
}
}

void Task1()
{
while( 1 )
{
	Sys_WaitSemaphore( hSemaPortbAvailable, EVENT_NO_TIMEOUT );

	BYTE i;
	for( i = 0; i < 5; i++ )
	{
		portb = 0b01010101;
		Sys_Sleep( 255 );
		portb = 0b10101010;
		Sys_Sleep( 255 );
	}

	SysSignalSemaphore( hSemaPortbAvailable );
	Sys_Yield();
}
}

void main()
{	
ansel = 0;
trisb = 0x00;

InitTimer();

SysInit();

SysCreateTask( hTask0, 2, Task0 );
SysCreateTask( hTask1, 2, Task1 );

SysSignalSemaphore( hSemaPortbAvailable ); // allow initial use of portb

// Task0 will be the first to run as it was started first and 
// both tasks have equal priority. Neither task will run however until
// we executed the first yielding instruction.
SysStartTask( hTask0 );
SysStartTask( hTask1 );

while( 1 )
{	
	Sys_Yield();
}
}

 

Building...

BoostC Optimizing C Compiler Version 6.55 (for PIC16 architecture)

http://www.sourceboost.com

Copyright© 2004-2006 Pavel Baranov

Copyright© 2004-2006 David Hobday

 

Single user Lite License (Unregistered) for 0 node(s)

Limitations: PIC12,PIC16 max code size:2048 words, max RAM banks:2, Non commercial use only

 

 

NovoBinarySemaphore.c

 

success

BoostLink Optimizing Linker Version 6.55

http://www.sourceboost.com

Copyright© 2004-2006 Pavel Baranov

Copyright© 2004-2006 David Hobday

 

 

Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)'

Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)'

Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)'

Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)'

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)'

Error: Unresolved external function:'SysStartTask(unsigned char)'

Error: Unresolved external function:'SysStartTask(unsigned char)'

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)'

Error: Unresolved external function:'SysStartTask(unsigned char)'

Error: Unresolved external function:'SysStartTask(unsigned char)'

Error: Unresolved external function:'SysTimerUpdate(void)'

Error: Unresolved external symbol, function:SysTimerUpdate

Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)'

Error: Unresolved external symbol, function:SysiWaitSemaphore

Error: Unresolved external function:'Sys_Yield(void)'

 

Error: Unresolved external symbol, function:Sys_Yield

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

 

Error: Unresolved external symbol, function:SysiUnlinkFromQueue

Error: Unresolved external function:'SysiFindLastHpTask(void)'

 

Error: Unresolved external symbol, function:SysiFindLastHpTask

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

 

Error: Unresolved external symbol, function:SysiAddToSleepQueue

Error: Unresolved external function:'Sys_Yield(void)'

 

Error: Unresolved external symbol, function:Sys_Yield

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

 

Error: Unresolved external symbol, function:SysiUnlinkFromQueue

Error: Unresolved external function:'SysiFindLastHpTask(void)'

 

Error: Unresolved external symbol, function:SysiFindLastHpTask

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

 

Error: Unresolved external symbol, function:SysiAddToSleepQueue

Error: Unresolved external function:'Sys_Yield(void)'

 

Error: Unresolved external symbol, function:Sys_Yield

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

 

Error: Unresolved external symbol, function:SysiUnlinkFromQueue

Error: Unresolved external function:'SysiFindLastHpTask(void)'

 

Error: Unresolved external symbol, function:SysiFindLastHpTask

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

 

Error: Unresolved external symbol, function:SysiAddToSleepQueue

Error: Unresolved external function:'Sys_Yield(void)'

 

Error: Unresolved external symbol, function:Sys_Yield

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

 

Error: Unresolved external symbol, function:SysiUnlinkFromQueue

Error: Unresolved external function:'

 

Failure

"D:\Program Files\SourceBoost\boostc.pic16.exe" NovoBinarySemaphore.c -t PIC16F88

"D:\Program Files\SourceBoost\boostlink.pic.exe" /ld "D:\Program Files\SourceBoost\lib" libc.pic16.lib NovoBinarySemaphore.obj /t PIC16F88 /d "D:\Program Files\SourceBoost\Samples\C\BoostC\novo" /p NovoBinarySemaphore

Exit code was -2.

Removing target: NovoBinarySemaphore.hex

SysiFindLastHpTask(void)'

 

Error: Unresolved external symbol, function:SysiFindLastHpTask

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

 

Error: Unresolved external symbol, function:SysiAddToSleepQueue

Error: Unresolved external function:'Sys_Yield(void)'

 

Error: Unresolved external symbol, function:Sys_Yield

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

 

Error: Unresolved external symbol, function:SysiUnlinkFromQueue

Error: Unresolved external function:'SysiFindLastHpTask(void)'

 

Error: Unresolved external symbol, function:SysiFindLastHpTask

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

 

Error: Unresolved external symbol, function:SysiAddToSleepQueue

Error: Unresolved external function:'Sys_Yield(void)'

 

Error: Unresolved external symbol, function:Sys_Yield

Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)'

 

Error: Unresolved external symbol, function:SysiSignalSemaphore

Error: Unresolved external function:'Sys_Yield(void)'

 

Error: Unresolved external symbol, function:Sys_Yield

Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)'

Error: Unresolved external symbol, function:SysiWaitSemaphore

Error: Unresolved external function:'Sys_Yield(void)'

 

Error: Unresolved external symbol, function:Sys_Yield

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

 

Error: Unresolved external symbol, function:SysiUnlinkFromQueue

Error: Unresolved external function:'SysiFindLastHpTask(void)'

 

Error: Unresolved external symbol, function:SysiFindLastHpTask

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

 

Error: Unresolved external symbol, function:SysiAddToSleepQueue

Error: Unresolved external function:'Sys_Yield(void)'

 

Error: Unresolved external symbol, function:Sys_Yield

Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)'

 

Error: Unresolved external symbol, function:SysiUnlinkFromQueue

Error: Unresolved external function:'SysiFindLastHpTask(void)'

 

Error: Unresolved external symbol, function:SysiFindLastHpTask

Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)'

 

Error: Unresolved external symbol, function:SysiAddToSleepQueue

Error: Unresolved external function:'Sys_Yield(void)'

 

Error: Unresolved external symbol, function:Sys_Yield

Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)'

 

Error: Unresolved external symbol, function:SysiSignalSemaphore

Error: Unresolved external function:'Sys_Yield(void)'

 

Error: Unresolved external symbol, function:Sys_Yield

Error: Unresolved external function:'SysInit(void)'

Error: Unresolved external symbol, function:SysInit

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

 

Error: Unresolved external symbol, function:SysiCreateTask

Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)'

 

Error: Unresolved external symbol, function:SysiCreateTask

Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)'

 

Error: Unresolved external symbol, function:SysiSignalSemaphore

Error: Unresolved external function:'SysStartTask(unsigned char)'

 

Error: Unresolved external symbol, function:SysStartTask

Error: Unresolved external function:'SysStartTask(unsigned char)'

 

Error: Unresolved external symbol, function:SysStartTask

Error: Unresolved external function:'Sys_Yield(void)'

 

Error: Unresolved external symbol, function:Sys_Yield

Failed to locate output file 'D:\Program Files\SourceBoost\Samples\C\BoostC\novo\NovoBinarySemaphore.hex'

Done

 

Failed

Share this post


Link to post
Share on other sites

Raghunathan,

When i build your nova c program, i get errors. Why?

 

Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)'

....

This error will be caused if the appropriate library is not part of the project. The novo functions are in a library thats mean they are added to the code at the link stage. I guess you have edited the project and removed the novo library.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×