Contiki for PSoC3

A catchall for PSoC3 discussions not captured by the other forums.

Moderator: ericb

Contiki for PSoC3

Postby shamnayse » Sun Jan 19, 2014 10:29 pm

Dear friends,

I would like to port Contiki OS on PSoC 3 platform. Is anyone tried for the same?
Please update me

Sham
shamnayse
Cheese Cube
Cheese Cube
 
Posts: 45
Joined: Fri Dec 28, 2007 10:21 pm

Re: Contiki for PSoC3

Postby bobmarlowe » Mon Jan 20, 2014 12:26 am

I am afraid that this could be VERY difficult if not even impossible. The 8051 core of the PSoC3 has a very limited stack (256 bytes) which even needed some tricks to get C-programs running. At this point I do not know what the Ram and Rom-demands of a Contiki implementations are but that can get very tough as well.

More promising would be to use a PSoC5 with the ARM Cortex M3 core where there are no such limitations except memory constrains. Additionally there are RTOSses as FreeRTOS already adapted even down to the PSoC5 Development Kit from Cypress.

Do not forget that PSoCs are chips with integrated programmable and routable hardware which makes the difference to a normal microcontroller.


Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: Contiki for PSoC3

Postby shamnayse » Mon Jan 20, 2014 1:47 am

Thank Bob

Contiki requires 10 KB RAM 30KB ROM including micro tcp/ip stack and multitasking support. This is from the contiki site

Sham
shamnayse
Cheese Cube
Cheese Cube
 
Posts: 45
Joined: Fri Dec 28, 2007 10:21 pm

Re: Contiki for PSoC3

Postby bobmarlowe » Mon Jan 20, 2014 5:42 am

PSoC 3 Has at max. 64kB flash and 8kB sRam.
PSoC 5 265kB flash and 64kB sRam.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: Contiki for PSoC3

Postby shamnayse » Mon Jan 20, 2014 8:45 pm

This mean simply is not possible because the current requirement of Contiki’s 10K RAM. We need to come up with some memory management mechanism such that ..
1. PSoC3 flash memory can be used as RAM or
2. To reduce/manage the Contiki RAM load of 10K to 6K and reaming 2 of 2K’s pages/block will swaps whichever OS required.

SN
shamnayse
Cheese Cube
Cheese Cube
 
Posts: 45
Joined: Fri Dec 28, 2007 10:21 pm

Re: Contiki for PSoC3

Postby bobmarlowe » Mon Jan 20, 2014 11:38 pm

Sham,
I would strongly suggest you to believe into my doubts that it is most probable not possible to implement Contiki on a 8051 core. I just do not want you to waste your time on something impossible. There is an RTOS from Keil for the 8051 and I would advise you to get a look at its specs and at its restrictions due to the weak core.
Remember that the architecture of the 8051 was created in 1980 and was not changed since then. No modern compiler exists for programming the PSoC-chip in C-language except the Keil C-compiler. Since I had some insight into that matter I know how much effort was needed to generate running C-code. Look at the restrictions concerning reentrant code (which is a MUST for a preemptive OS) the compiler has.

Use a PSoC5 and you get a base that is capable of task-switching.


Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: Contiki for PSoC3

Postby shamnayse » Tue Jan 21, 2014 12:17 am

Thanks a lot Bob, I accept the facts and history but still I would like to do this. Do you feel PSoC4 will be comfortable platform for contiki, because there we will have a powerful core Centex M0 but still there will be limitation of the RAM I guess still there is only 4KB of RAM.

Sham
shamnayse
Cheese Cube
Cheese Cube
 
Posts: 45
Joined: Fri Dec 28, 2007 10:21 pm

Re: Contiki for PSoC3

Postby bobmarlowe » Tue Jan 21, 2014 6:19 am

Yes, you're right. The PSoC4 is a comparable small chip with only 4kB sram but is very handy for small embedded applications. The flash memory is restricted to 32kB.
When you get hands on a PSoC4 Pioneer Kit which is not too expensive you will find a PSoC5 as interface on the board as well.


Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: Contiki for PSoC3

Postby shamnayse » Tue Jan 21, 2014 8:13 pm

hi,

But again there will be the problem of RAM management, how the 10K RAM requirement can be full filled by the 8K RAM.
Can you tell me..? is all 8K sRAM will be available for the user program, or few of them will used for analog and digital blocks configurations,
if user are using few user modules like ADC, PA, SPI etc.


SN
shamnayse
Cheese Cube
Cheese Cube
 
Posts: 45
Joined: Fri Dec 28, 2007 10:21 pm

Re: Contiki for PSoC3

Postby bobmarlowe » Wed Jan 22, 2014 12:04 am

Download and install creator 3.0, create a new project, empty PSoC4, build project and watch the last lines of the output which will tell you exactly how much flash and how much sram are taken away. As an adjustable default 0x0400 bytes (which is 25% of the availlable sram!) are put aside for stack- the heap is defaulted to 0x0100 bytes and can be reduced to zero.


Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: Contiki for PSoC3

Postby bobmarlowe » Wed Jan 22, 2014 12:09 am

oops, sorry, I forgot you are still on PSoC3 (which as I said cannot work) and showed a PSoC4 example (which won't work either).
Try the same with a PSoC3-project.


Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany


Return to “%s” PSoC3 General

Who is online

Users browsing this forum: No registered users and 1 guest

cron