FreeRTOS on HCS08

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

FreeRTOS on HCS08

43,231件の閲覧回数
jeffw
Contributor I
I've ported FreeRTOS to HCS08, and the project targets the SARD and EVB boards. I'm working on making SMAC compatible with this project.

Steps

1. Download and install FreeRTOS 3.2.4: FreeRTOS
2. Download the attached zip file
3. Unpack it into a temporary directory.
4. Following the FreeRTOS directory structure, move the sub-folders into their correct places.
5. Open the RTOSDemo.mcp project in CW 3.1.
6. Deploy to a Freescale SARD or EVB.

FreeRTOS-3.2.4-HCS08_Files.zip
Message Edited by dkindler on 2009-08-20 02:33 PM
ラベル(1)
0 件の賞賛
149 返答(返信)

687件の閲覧回数
BlackNight
NXP Employee
NXP Employee

configMINIMAL_STACK_SIZE is set to 100 (in the Processor Expert component, and this is stored in FreeRTOSConfig.h

This is in words, or better in 32bit entities for the ColdFire. If you create a task with configMINIMAL_STACK_SIZE, then it measn that every task gets 400 bytes of stack. Keep in mind that there is as well the IDLE task, so if you have 2 (+ idle) task, then this will be 3*400 bytes.

 

Either you reduce the stack per task (if they do not have much to do), or increase the amount of heap. Keep in mind that there is no special stack for the interrupts, so you need to count this into the stack size.

 

As a hint: enable the vApplicationMallocFailedHook(), so you get an indication what is wrong.

I added a second task to my application like yours, and with 1024 it is triggering the above hook (what I expected).

Increasing the total heap size to 1500 (as there is some memory needed for the TCB, which is around 60 bytes depending on your settings, plus some additional heap bytes) then solved the problem.

 

BK

 

0 件の賞賛

687件の閲覧回数
brauliochi_thin
Contributor I

Thanks for the answer, apparently I resolve the problem activated the events

vApplicationIdleHook

and

vApplicationMallocFailedHook

 

thanks, best regards

0 件の賞賛

687件の閲覧回数
brauliochi_thin
Contributor I

Hi, I got problems, trying to to this import bean, in codewarrior 6.3 with PE v3.06, dont appear the option with tick and interrupt options available:

0 件の賞賛

687件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Hello,

my actual version of 6.3 has PE v3.09, but I did not use it any more because I have switched to the eclipse version (MCU10.x) of CodeWarrior.

Your screenshot says me tha you did not select a timer and SWI yet?

Anyway, I have attached my current version of the RTOS (v6.0.5, I will port it to the 6.1.1 as soon as I find time). It supports S08, ColdFire V1 and ColdFire V2 (I'm using it it with 52259), this might help.

 

BK

0 件の賞賛

687件の閲覧回数
brauliochi_thin
Contributor I

Hi BlackNight, apparently the solution is upgrade the version of Processor expert, to 6.09, I downloaded your new version of the bean freertos, is excellent, thanks!!!

0 件の賞賛

687件の閲覧回数
TurboBob
Contributor IV

Hi,

 

I have installed the component/bean,  and am close to getting it working properly.

 

The notes in the generated code indicate I need to provide an ISR,  in initially it was named the same as some other labels in the code,  not sure if I set it up wrong.

 

I changed the name of the vector in the bean to vPortYieldISR1  and it compiles correctly.

 

However,  I'm not sure which interrupt flag I'm supposed to clear in the ISR,  or what other code is required in the ISR.

 

I believe I understand correctly that the RTOS uses an SWI to initiate the context switch,  so this ISR should clear the SWI flag.

 

It should then call the task switch code.

 

Am I correct?

 

My code seems to be running,  but is stuck in one task,

 

I am using CW 6.3,  with Processor Expert 3.09.  The target is an MCF51JM32.

 

Thanks for your help!

 

Bob

0 件の賞賛

687件の閲覧回数
TurboBob
Contributor IV

Update:

 

I think its working.  The note that the user must provide an ISR appears like it may be a Processor Expert artifact.  When I removed that and set the ISR name back to default the software appears to be behaving.

 

 

Thanks for publishing the component,  I have wanted to use FreeRTOS with ProcessorExpert for a while.

 

 

Regards,

 

Bob Bailey

0 件の賞賛

687件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Hello,

You need at least two interrupts: one is obviously the timer tick interrupt (e.g. firing every 10 ms).

The other thing is the software interrupt (SWI) one (which is used by the RTOS to perform a task switch).

The SWI needs to be set up in the FreeRTOS component so Processor Expert is adding it to the vector table.

As you have seen, it points to vPortYieldISR() which is part of the port: this function cares about clearing the interrupt flag and so on. You do not need to change it. If you change the name, you need to provide your own implementation of that function. You could, but you don't have to.

 

I'm attaching an updated version of the FreeRTOS component: it includes now wrappers to the queue API too.

The screenshot attached shows as well the usage of an additional interrupt to collect FreeRTOS runtime statistics.

 

 

BK

0 件の賞賛

687件の閲覧回数
TurboBob
Contributor IV

Ok,  thanks.

 

Its making a lot more sense now.  The notes that the user needs to provide the ISR is something that Processor Expert puts in there,  but your component takes care of this.

 

Setting the tick time source  and the swi are pretty straightforward.

 

This is great and something I wish Freescale had supported before.

 

Now we just need a USB CDC component that mimics the serial components already in there,  and a good USB bootloader component.  :smileyhappy:

 

Thanks for your help.

 

Bob

0 件の賞賛

687件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Yes, a CDC component and the bootloader are on my wishlist too. What exists is the USB bootloader for the MCF51JM128 on the TWR-LCD which I had created with Processor Expert component (the bootloader itself is not a component itself). Once I find time, I might complete that work.

However, what exists is the USB host component for Keyboard and Mouse: I have it running on the MCF51JM128 and the MCF52259, and it is posted as well on the Tower Geek (www.towergeeks.org) forum: Eclipse CW 10.0

 

BK

0 件の賞賛

687件の閲覧回数
TurboBob
Contributor IV

I have not looked at the TWR_LCD,  I will look into it.

 

The bootloader for the BadgeBoard would make a good component,  as there is no host side required.  The other USB bootloaders that Freescale has offered were handcuffed to the host software,  as the source for the host was never released (that I could ever find)

 

Thanks,

 

Bob

0 件の賞賛

687件の閲覧回数
BlackNight
NXP Employee
NXP Employee

The bootloader for the TWR-LCD has inherited the BadgeBoard Bootloader, and the sources are provided in both distributions. But for the TWR-LCD it shows how the bootloader can be used with Processor Expert (vector relocation, resource allocation, etc).

 

BK

0 件の賞賛

687件の閲覧回数
TurboBob
Contributor IV

I looked around over there for that  bootloader stuff,  and didn't find it.

 

Do you have a link? 

 

 

Also,  working with the FreeRTOS,  and tried a counting semaphore,  and it wouldn't compile. There appears to be a queue component thats not in there.  (I had counting semaphores turned on in the component inspector)

 

I changed my application to use the binary semaphore,   which works excellent.  I just thought I'd mention it.

 

Bob

0 件の賞賛

687件の閲覧回数
BlackNight
NXP Employee
NXP Employee

bootloader with TWR-LCD: I need to dig out the project/link as well. Give me some time and I'll post it here.

 

Counting Semaphores: did you enable them in the properties of the component? (Semaphores > Use Counting Semaphores).

This configures configUSE_COUNTING_SEMAPHORES in FreeRTOSConfig.h

(Hmm, I might even remove that setting for the future, as I could directly set configUSE_COUNTING_SEMAPHORES depending on if some functions are enabled or not).

 

BK

0 件の賞賛

687件の閲覧回数
TurboBob
Contributor IV

yes,  I had that enabled.  I will try to recreate the steps and see what function it could not find.  The #define linkages lead to xQueueCreate I think,  and the compiler couldn't find it.

 

I'll try it again when I'm on that computer.

 

Thanks!!

 

Bob

0 件の賞賛

687件の閲覧回数
TurboBob
Contributor IV

is the FreeRTOS stuff cross-posted on the 32 bit forum?  If not,  then one of us should post a link to this thread.  FreeRTOS seems to be working well,  and I think a lot of guys would be interested.

 

The same would be true about a componentized or PE compatible bootloader.

 

Thanks!

 

Bob

0 件の賞賛

687件の閲覧回数
BlackNight
NXP Employee
NXP Employee

I have found the bootloader for the TWR-LCD (MCF51JM128) (attached).

I see what I can do to transform it into a Processor Expert component (or better: into multiple components) as I want to use it as well with FatFS: I have ported the FatFS (open source) file system which I'm using with SD and microSD cards, and I want to have a bootloader which can load an S19 file from the SD card to flash the application.

 

As for posting the FreeRTOS component to the 32bit forum: go ahead if you want. But (an earlier version from FTF last year) is available as well on the FreeRTOS.org 'contributed ports' page.

 

BK

 

0 件の賞賛

687件の閲覧回数
TurboBob
Contributor IV

I posted a link back to this thread.  The 32 bit guys might not think to look around in the 8 bit forum.....

 

Bob


 

 

0 件の賞賛

687件の閲覧回数
BlackNight
NXP Employee
NXP Employee

I have finished my initial port of the bootloader (TWR-LCD with the MCF51JM128) in the Tower Geeks forum:

http://www.towergeeks.org/group/eclipsecw

The project features a USB (memory device) bootloader as Processor Expert component (well, there are 3 components for it: S19, BootLoaderDisk and BootLoaderUSB) and as well FreeRTOS.

I have not ported it to the JM60, but as the JM60 and the JM128 are very similar, this should not be a problem.

 

BK

0 件の賞賛

687件の閲覧回数
TurboBob
Contributor IV

is there a PE update file for this?  I'm still using CW 6.3.  I tried the Eclipse stuff, but its so different,  I was making backwards progress...

 

 

 

Excellent stuff BTW!  I have been trying to integrate the bootloader in my existing project (not as a separate project).  Progress has been really slow.

 

 

 

Thanks a ton!!

 

Bob

0 件の賞賛

687件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Yes, there is a .PEupd file for this: it is inside the TWR-LCD JM128 folder. Have a look as well into the .pdf there which has additional information.

I did not try it with CW 6.3, but I think the components should work there. Yes, for eclipse you need a learning curve (as for everything new). I still have 6.3 installed 'just in case' and for some old projects I did not convert yet, but eclipse offers so many advantages (with some small disadvantages), that I don't want go back to 6.3 any more.

 

BK

0 件の賞賛