STM8S003F3 configuration problems

Configuring cocoOS

STM8S003F3 configuration problems

Postby adityaxa » Thu Nov 16, 2017 5:58 am

Hi,

We have been successfully using cocoOS on STM8S003F3. However, I was wondering about the following.

1. We only need Tasks and Events from cocoOS, however; we are unable to disable Msg Queues from cocoOS.
We tried setting N_QUEUES = 0; however, that gives a compile error.

2. Is it possible to make the cocoOS modular enough to disable functionalities when required, such as disabling Msg Queues / Semaphores to be run on extremely low spec'd devices.

Please do let me know.
adityaxa
 
Posts: 5
Joined: Fri Jun 23, 2017 6:08 pm

Re: STM8S003F3 configuration problems

Postby peter » Thu Nov 16, 2017 7:07 pm

Hi,
thanks for pointing this out!

It is a bug in os_msgqueue.c
line 73: nQueues = 0;
line 74: #if( N_QUEUES > 0 )

the statement at line 73 should of course be moved below the #if( N_QUEUES > 0 ) .

Just move it and it will compile with #define N_QUEUES 0

/Peter
peter
Site Admin
 
Posts: 22
Joined: Wed Mar 07, 2012 9:32 am

Re: STM8S003F3 configuration problems

Postby adityaxa » Sat Nov 18, 2017 11:25 am

Thanks, I was able to get it to build after that change.

However is it possible to build cocoOS without including message queue, semaphore and events?

I was hoping if it’s possible to build the OS specifically to support individual components..

For e.g. those people who do not require semaphore could completely remove that feature

Though this is coming from a belief that removing semaphore/events/message queue is even possible and would reduce the space required by the Os..
adityaxa
 
Posts: 5
Joined: Fri Jun 23, 2017 6:08 pm

Re: STM8S003F3 configuration problems

Postby Purple » Fri Nov 24, 2017 6:10 am

However is it possible to build cocoOS without including message queue, semaphore and events?


As far as I remember, just setting them to 0 in the config will have the compiler optimize those functions out anyway, essentially disabling them.
Purple
 
Posts: 3
Joined: Thu Jul 20, 2017 12:16 am

Re: STM8S003F3 configuration problems

Postby adityaxa » Mon Nov 27, 2017 5:52 am

Are we sure ?

Because in the OS_init and other functions related to tasks there are a lot of references towards MSG_Queue and Events.
adityaxa
 
Posts: 5
Joined: Fri Jun 23, 2017 6:08 pm

Re: STM8S003F3 configuration problems

Postby Purple » Mon Nov 27, 2017 7:07 am

Well, a function call will still take place, but will return immediately since the body is empty... Could be a good feature request to be able to disable them completely.
Purple
 
Posts: 3
Joined: Thu Jul 20, 2017 12:16 am

Re: STM8S003F3 configuration problems

Postby adityaxa » Mon Nov 27, 2017 7:57 am

Yes, because from what I can see..

os_msgqueue.o is consuming 602 bytes.. and 27 rw data..

Though the number seems small.. its huge when you put that into perspective from a 8Kb processor..

I2C library is consuming only 665 bytes..
adityaxa
 
Posts: 5
Joined: Fri Jun 23, 2017 6:08 pm

Re: STM8S003F3 configuration problems

Postby adityaxa » Wed Nov 29, 2017 9:00 am

I basically commented out all the MSG_Queue calls.. And it still works..

So for sure, OS doesn't need MSG queue but still was utilising so much space.
adityaxa
 
Posts: 5
Joined: Fri Jun 23, 2017 6:08 pm


Return to Configuration

Who is online

Users browsing this forum: No registered users and 1 guest

cron