Lpc_1768_freertos_task_stack_size

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Lpc_1768_freertos_task_stack_size

1,256件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by upadhyaya.sreenivasa on Tue Jul 05 21:54:56 MST 2011
[FONT=Times New Roman]Hi
I am trying to implement FREERTOS concepts in LPC1769 MCU.
when multiple tasks are created ,the code does not work when the combined stack sizes of the tasks exceed certain limit.
In general whats the stack size limit when for tasks??

[/FONT]
0 件の賞賛
返信
4 返答(返信)

1,222件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Wed Jul 06 01:55:25 MST 2011

Quote:

[FONT=Times New Roman]when multiple tasks are created ,the code does not work when the combined stack sizes of the tasks exceed certain limit.
[/FONT]

[FONT=Times New Roman]

This all depends.
What kind of memory management are you using?
Per default the lpc17xx FreeRTOS port places stacks on the heap.
Depending on which version of FreeRTOS you grabbed from the net there will be a certain default heap size (defined using configTOTAL_HEAP_SIZE in FreeRTOSConfig.h).

I suggest to start with the FreeRTOS project from the project wizard that is delivered with the new LPCXpresso 4.0.5 setup. That will give you a nice and easy introduction to FreeRTOS with the new 7.0.1 version.

And buy the FreeRTOS book from Richard's website. It is so much easier to use an Operating System when you know how to use it

[/FONT]
Quote:
[FONT=Times New Roman]In general whats the stack size limit when for tasks??
[/FONT]

[FONT=Times New Roman]
There is no general stack size limit. It all depends on your application: how deep is the function call tree, how much local variables do you plae on the stack, which library functions do you use?
Most systems write a test-pattern to the stack space, let the application run and check the stack usage while running. You can then reduce the stack space when there is a lot of unused space but be warned...


Quote:

[/FONT]On the LPC176x series, you can easily set the FreeRTOS memang library to use the second 32k block of AHB memory.



And you do this using:
__attribute__ ((__section__(".bss.$RAM2")))  static union xRTOS_HEAP


in the heap2.c file in FreeRTOS (providing your memmang is set up to use heap2.c.

Rob
[FONT=Times New Roman]

[/FONT]
0 件の賞賛
返信

1,222件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Wed Jul 06 00:23:14 MST 2011

Quote: TheFallGuy
Maybe better to ask this question on the freertos forum:



Can you explain why? The OP is quite specific about the platform being LPC1768/9.

Are you saying that this is a too generic question?

My helpful suggestions may put the OP on the right track. Bugging Richard about it is going to achieve what, exactly?
0 件の賞賛
返信

1,222件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Tue Jul 05 23:52:03 MST 2011
Maybe better to ask this question on the freertos forum:
http://sourceforge.net/projects/freertos/forums/forum/382005
0 件の賞賛
返信

1,222件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Tue Jul 05 23:16:29 MST 2011

Quote: upadhyaya.sreenivasa
[FONT=Times New Roman]
In general whats the stack size limit when for tasks??

[/FONT]



Can you be more specific? Have you done the appropriate analysis on your task's requirements for stack size?

On the LPC176x series, you can easily set the FreeRTOS memang library to use the second 32k block of AHB memory. If that isn't enough, well, dang, you have a very vigorous application :eek:
0 件の賞賛
返信