JM and FreeRTOS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

JM and FreeRTOS

6,894 Views
RajahMC
Contributor I
Does anyone have a FreeRTOS port for the JM128?

Thanks for your time,
Rajah
Labels (1)
0 Kudos
Reply
33 Replies

2,253 Views
thinkchip
Contributor II

thanks a lot, for this addaptation for this micro, I have a question, what its the clock frecuency more efficient for the freeRTOS? could be addapted the cmx stack usb with the freeRTOS? :smileysurprised: again, thanks

 

best regards

 

:smileyhappy:

 

sorry for my bad english 

0 Kudos
Reply

2,253 Views
thinkchip
Contributor II

Hi, I got problems, if I use more than 2 task, my program doesn't work, I think that its because of use of ram, how much ram use each task? regards

sorry for my bad english

 

0 Kudos
Reply

2,253 Views
thinkchip
Contributor II

Hi again, the problem that I haved was that was insuffycient ram, I change the configMINIMAL_STACK_SIZE (256) for 128, and start to works, sorry for my terrible english, I promisse that I going to learn

 

best regards

0 Kudos
Reply

2,253 Views
BSN
Contributor I

Hi think chip There is not an "optimal" frequency for FreeRTOS tick

 

That will depend on your application..

 

If system tick is too often, then you will waste time while running some same task because of system tick interrupting it too often to evaluate tasks states. If it is too slow, your time base may be too large. You will only switch between tasks when the system tick happens.

 

 1ms is fine for a lot of applications...

 

Don't worry about your english. I am not a native speaker either..!

 

Eduardo

0 Kudos
Reply

2,253 Views
TurboBob
Contributor IV

Are there any updates on this topic?

 

I want to implement FreeRTOS on an MCF51JM,  I'm sure I can get the USB stuff running,  but making FreeRTOS play nice with Processor Expert looks to be a larger task.

 

I'm using Codewarrior 6.3. 

 

Thanks guys.

 

Bob

0 Kudos
Reply

2,253 Views
wrljet
Contributor II

I had FreeRTOS v4p7 working in CodeWarrior 6.2.   Not using Processor Expert though.

 

 

0 Kudos
Reply

2,253 Views
TurboBob
Contributor IV

I have gotten spoiled by the convenience of Processor Expert,   its benefits outweigh its limitations in my experience.

 

I have used FreeRTOS on other projects using other CPUs,  the project I am working on now uses the Coldfire JM, so I would love to use FreeRTOS.

 

I saw your work,  and may use it as a guide.

 

Thanks!!

 

Bob

0 Kudos
Reply

2,253 Views
TurboBob
Contributor IV

for anyone following this thread,  my prayers were answered in this thread:

https://community.freescale.com/thread/11692

 

Go to the last couple pages,  there is a custom component (bean) posted.

 

it works with CW 6.3,  Processor Expert 3.09,   drop in, configure,  and go....  works great.

 

Now I need to get the bootloader working,  am going to use the badgeboard style,  drag-n-drop software.  CW is arguing with me.  But I don't give up easily....  :smileyhappy:

 

 

Regards,

 

Bob

 

 

0 Kudos
Reply

2,253 Views
PaoloRenzo
Contributor V

Hi all

 

Seems like you have already solved your FreeRTOS issue

 

This might also helps

 

Here's another FreeRTOS port with the last 5.3.0 release for our newest MCF51CN12 MCU with Ethernet:

 

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?ProdMetaId=PID%2FDC%2FMCF51CN128&isAdvance...;

 

Some differences: it uses RTC and also force interrupts to improve RTOS performance

 

Sorry for the long link

 

Paolo

0 Kudos
Reply

2,253 Views
thinkchip
Contributor II

Hi Paolo Renzo, this version of MQX RTOS could be portable for MCF51JM128?

thanks

regards

0 Kudos
Reply

2,253 Views
PaoloRenzo
Contributor V

Hi

 

Sorry but I don't know details about MQX. Shared sw and link was made with FreeRTOS and not with MQX. You may want to open a new conversation thread to ask for details about that.

 

I'm only able to answer FreeRTOS questions :smileyhappy:

 

Regards

0 Kudos
Reply

2,253 Views
thinkchip
Contributor II

Hi Paolo, i'm sorry, but the link that you says, send to me to a page of mqxrtos, could you repost again the link please

 

regards

sorry for my very bad english

0 Kudos
Reply

2,253 Views
thinkchip
Contributor II

Hi again, I download directly from the page www.freertos.org

new version 5.3.1

know the questions is if this version of freertos for mcf51cn128 could be portable for mcf51jm128?

the version that posted in this space for jm does not work well for me

regards

 

0 Kudos
Reply

2,255 Views
JWW
Contributor V
Rajah MC,

V1 ports do exist... But I'm not aware of the JM128 version yet.  I expect it to be easy to do, as I'm aware of another V1 port.  The catch is probably finding a good USB stack to use in conjunction with FreeRTOS. 

What features do you need supported?  Are you using the USB on the JM128?

-JWW

0 Kudos
Reply

2,255 Views
RajahMC
Contributor I
Hi JWW,

Thanks for your response. I will need support for USB for the JM.

I did see a FreeRTOS port for QE on the forums.

I am making changes to the QE port to make it work with the JM.
I am stuck with an ILLEGAL_BP when debugging and I have no
clue as to what is causing it. Once I have it working, I was planning
add support for USB.

I was hoping someone had one working already :smileyhappy:

Rajah
0 Kudos
Reply

2,255 Views
JWW
Contributor V
I believe there is a newer version (update for V1) coming out. 

I'll double check to see if there are parts (pieces of code) that can be released to improvement stability etc...

-JWW



Note: Latest port on web has ColdFire V2 support

FreeRTOS.orgTM V5.1.0 Now Available:
New ports include ColdFire V2 using CodeWarrior

www.freertos.org

0 Kudos
Reply

2,255 Views
RajahMC
Contributor I
Hi JWW,

I managed to take the QE RTOS code base and modified it to work
with the JM demo board.  I also added two example tasks.

I am working on adding USB now, getting a good USB stack seems
to the biggest issue right now. Will post code if I get it working.

Thanks for everyones time.

Credits go to thm59 for the QE port.
http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&message.id=4132&query.id=16552#M...

Rajah

JMMyProgs.zip
Message Edited by t.dowe on 2009-10-21 01:58 AM
0 Kudos
Reply

2,255 Views
BSN
Contributor I

Hi.

 

I believe there are some errors in this port.

 

The "dummy save" and "dummy restore" should not be used. Instead, use some "naked" attribute for system ISRs.  After the "dummy restore" instructions, registers D0 and D1 might be changed, and just after that task context is saved. That can cause errors in any very simple task.I.e., the context is modified by the system interruption!!!

 

Also, there is a wrong line that has been (accidentally I suppose) inserted in a system file (queue.c).

 

Besides in hardware.c functions, inline assembly is used, modifying directly cpu registers without saving their values before. That can lead to errors.

 

I had also some problem with memcpy from <string.h> in CodeWarrior 6.2 forColdfirev1. That need to be checked out more carefully. But anyway, replacing memcpy in queue.c by a "home made" code in C can fix that problem.

 

Soon I should be posting a version that works fine for MCF51JM128

 

Eduardo A.

0 Kudos
Reply

2,255 Views
wrljet
Contributor II

Any updates on this project?

 

Bill

 

0 Kudos
Reply

2,255 Views
BSN
Contributor I

Hi Bill

 

I'm sorry for not answering before...(as I had said, that I would..!)

 

I have searched a little bit about some "naked" attribute, but Aff... it is not that easy to find such a "clear" information! So I was using the fixed version I explained before. (I have also changed that memcpy and the hardware issues...). For memcpy, I could not force the compiler to use my definition of memcpy... it was always taking the codewarrior implementation of memcpy, so I had to change in queue.c "memcpy" by "memcpy_alt". That is  clearly not the best way to do it. But it works.. If you know how to force compiler to give preference to user functions instead of his owns, let me know!

 

In this version, two headers "hardware.h" and "usertasks.h" have been manually inserted into main.c, hardware.c and usertasks.c, because I'm using Codewarior "free", and I'm limited in number of files. I could change those for the includes, but I prefered to let it like that, so I'm sure that what I am posting here works... no mistakes. :smileyhappy:

 

Eduardo

 

Port_MCF51JM128.zip

 

 

Message Edited by t.dowe on 2009-10-21 01:59 AM
0 Kudos
Reply