FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [July 2008 Threads] Heap 2 model into PIC18Hi People I wonder if you could help me with this. I´ve been trying for a while Freertos on PIC18 microcontrollers with heap_1 model but now I´m using the heap_2 model and I find an erratic behaviour. I´m doing a ks108 graphic lcd driver for freertos and I wanted it to be with dinamical allocation of objects. It was working relatively ok but now It dont. I´ve modified the linker script for 18F4620 and I´ve been looking in the forum about the portCOMPILER_MANAGED_MEMORY_SIZE issue but couldn´t solve it. Some task (like the line primitive) when it is context switched get his stack data corrupted.
I´m planning to donate the effort so any kind of help would be accepted.
Is it possible to use it with heap 2 model? If so what I should do to use it correctly?
Let me know and I´ll send you the code, it does some nice things with the LCD :)
Best regards.
RE: Heap 2 model into PIC18Posted by PICmeup on July 27, 2008 could be just memory fragmentation. Do you check the pvPortMalloc return value for null?
RE: Heap 2 model into PIC18Hi PICmeup, As example, when the line "initiator" is called asks for a semaphore. If not Null, it takes the semaphore and starts the line task passing multiple parameters by reference, the semaphore handles is between them. When the line task ends it "gives" the semaphore and wakes up the "initiator". I do not receive a NULL to the semaphore and the task initiates correctly BUT when the line task gets context switched a variable used to store the slope of the line is corrupted. I´ve made a change to the port for PIC18 as others in the forum tried changing portCOMPILER_MANAGED_MEMORY_SIZE to 0x14 and adding a MOVFFPOSTINC0, PREINC1 to the portSAVE_CONTEXT and and a MOVFFPOSTDEC1, POSTDEC0 to the portRESTORE_CONTEXT but without success.
Regards
RE: Heap 2 model into PIC18No one has an answer on this? Is heap_1 the only possible memory model for PIC18? What do I have to do? start before the scheduler all tasks to allocate memory on the queue, suspend them and then restarted when needed when I need a Task to work when called?
Best regards.
RE: Heap 2 model into PIC18Posted by Paul_Piak on July 31, 2008 Hi,
If you change portCOMPILER_MANAGED_MEMORY_SIZE, you should understand that it should be 1 less than .tmpdata+.mathdata See this message: http://sourceforge.net/forum/message.php?msg_id=3826722
Paul
RE: Heap 2 model into PIC18Thanks Paul_Piak, I've read It. I've just tried everything to make it work, but without success.
I tested malloc and free implementations in heap 1 and heap 2 models alone (without starting the OS) and they work fine on the PIC18, that's why I think the problem is with the port implementation for PIC18. Just when the task get context switched the data gets corrupted.
Has anyone tried heap_2 model into PIC18? Whats the maximum configMINIMAL_STACK_SIZE for this microprocessor?
Regards
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|