This page is for you! If you’d like more information about something I’ve posted about, or if there is a topic you think I should post about, please leave a comment and I’ll get right to it (as fast as my schedule permits it)!
I have started to list things in my bucket list (still ongoing).
For feature requests or bug reports on the McuOnEclipse project end Processor Expert components, you should use the GitHub issue tracking system:
- McuOnEclipse Processor Expert components: https://github.com/ErichStyger/McuOnEclipse_PEx/issues
- McuOneEclipse example projects: https://github.com/ErichStyger/mcuoneclipse/issues
I’d love a follow-up to “Dissection of MCU10 Projects” that addresses how to do version control of the MQX portion of a Freescale project. From their release notes it appears that you must create a custom configuration within the MQX directory structure for your custom board’s PSB and BSP. It is then a sequence of individual builds in a specific order to generate files that get used in the next sub-build. Then the libraries it creates get included in your project’s final build. So what parts of that go into VCS? Can the custom BSP and PSP be located in the same folder as the rest of your version-controlled source code, or must they co-mingle with the MQX “installed” files?
LikeLike
Good suggestion! Hmm, I really need to work on such a post, as I have faced exactly that problem too.
LikeLike
Hi Erich,
Thank for the Blog with answer a developer really wants.
I am a Embedded design Engg. few month back started working with the MQX+K60+CW10.3 (wiil soon update to 10.4 after reading you r updated on it.) Erich i was searching for the solution to the Problem posted by “KBell on April 13, 2012 at 21:58 ” have you answered it. as i am not able to locate it. if not please clear some air on it.
LikeLike
Hi Swapnilkatre,
Storing MQX files in a version control system does not differ from another kind of project. But I did not use MQX for my projects as with FreeRTOS things are much easier for me, use less footprint and is much easier to learn. MQX was too heavy, and it seems our question confirms this?
LikeLike
Hi, I am newbie using freertos, I am working with codeworrior v6.3 (classic) and I just installed you processor expert freertos component,I wonder if you were so kind and show me how to use it by example, it maybe two flashing leds at different rates?
I am using a coldfire v1 MCF51JM128 MCU on a DEMOJM board.
LikeLike
Sure, good idea. But why not in eclipse/MCU10.2 instead. It is much easier and more powerful with the Eclipse version of CodeWarrior.
LikeLike
I have posted now a tutorial for FreeRTOS (https://mcuoneclipse.wordpress.com/2012/06/28/tutorial-freertos-on-demojm/). It is using the Eclipse based CodeWarrior, but applicable as well to the classic CodeWarrior version. If you are using classic CodeWarrior, then you need to enable the ‘classic’ property in the FreeRTOS Embedded Component. Everything else is the same.
LikeLike
Hi, Erich.
Excellent tutorial, intuitive, graphical, clear, complete, step by step, etc..
I followed it and I was able to reproduce the example in my demojm board.
Now I know how to use the component in my applications, moreover some concepts on FreeRtos are more clear for me now.
Thanks a lot, I say again: excellent tutorial.
LikeLike
Thanks :-). I know for myself how useful this can be. Glad to hear that you were able to follow the steps and you came to a good result. I face sometimes the problem that things might be obvious for myself, but not for anyone else….
LikeLike
Hi Erich –
Thank you for the two articles on PC-lint. Would it be OK if we linked to those articles from our gimpel.com website?
LikeLike
Hi Anneliese,
yes, sure, no problem at all.
Erich
LikeLike
What about support for the ColdFire plus devices? They’re sort of a hybrid of the ColdFire V1 (same MCU core) and Kinetis (in that it uses LDD instead of the “classic” device drivers).
LikeLike
Good suggestion! I have not tried the ColdFire plus devices yet, but this definitely something I need to add to my bucket list. At least I realize that I need to update my components which deal with LDD/traditional components.
LikeLike
P.S. Thanks for all the great work. In the past I’ve only ever used device initialization; your components seem to make Processor Expert actually useful.
LikeLike
You are welcome. And yes, I agree, without the additional components it is just about initializing the peripherals (which is a lot of value already). But to get to the next level, more software drivers and components are needed.
LikeLike
I just found your site from your reply to my question on the forum, excellent site. I wished I had found it much earlier.
My question is does freeRTOS work with a free USB stack and file system. We use MQX and cw10.3 but it has serious problems and does not integrate well with Processor Expert. We have a lot of code in PE and find it invaluable.
But without the middleware USB & file system, we can’t switch. Or any alternatives you can think of would also be appreciated.
Thanks
LikeLike
Hello, as for the USB stack, I have transformed the FSL USB Stack into a Processor Expert component. I support USB CDC for now. That stack is not open source, but free of charge. I have posted articles around that stack on my blog too. As for the file system, I’m using FatFS for which I have created a Processor Expert component too. That in combination with FreeRTOS works very well for many of my projects, and as well for many projects at the university.
LikeLike
Erich, would you have an exjample project for the Kinetis, with PE using your PE USB component and the FatFS with or without your RTOS? This would help me see how much work it would be to switch our code over. I am very willing to switch; right now we have had a major problem with MQX and the K20 since Jun 23. The SR is still being worked on and our project is in danger of being cancelled.
LikeLike
Yes, see https://mcuoneclipse.wordpress.com/2012/07/30/fatfs-with-kinetis/.
This project is using FreeRTOS, but only because it makes it easier to have a shell running as a main process. If you do not want to use the RTOS, simply remove/disable the component and do not create a task. I used FatFS without an RTOS in another project too, and FatFS has hooks which can be used if you still need parallel access to files and file system.
LikeLike
I realize this is a separate comment but I am not familiar yet with how to ask a question here. Or perhaps that is the problem that this is a blog and not a forum… my appologizes please.
We also need a way to work with the Flextimer to measure an incoming square wave and repoduce it with a small multiplier on another pin of the k20. Would you be able to direct us to anyway to do this? There is no driver in MQX for the Flextimer. I did see a post on your blog about PE not having fully implemented the Flextimer, but you gave a work around that I did not understand, would you mind expanding or pointing me to a link to read?
I re-read your answer and it is almost too much to hope for… to be able to escape MQX and get a working USB and File system with and RTOS and be allowed to use PE!!
LikeLike
I have not used the FlexTimer that way, and I won’t have much time to look into it with my current schedule. If not already done, I suggest to post that question in the Freescale forum?
LikeLike
I understand, Yes, I have have posted several times on the forum but there is a surprising lack of knowledge on the FLextimer and MQX. I am going to try to get out of the MQX system altogether. I think all the work you have done will make that possible on freeRTOS and Processor Expert. For now I will need to complete the current issue which is getting the Flextimer to work.
Would you be able to send me the link to your comments on how to use the timer component? I have looked and read through the posts but cannot find the post… although now I am begining to wonder if I misread this. If so just a note to say I am wrong would be helpful so I don’t continue to look. Thanks again.
LikeLike
I was wondering about your comment on the FlexTimer and that I said something about this. The only thing I can remember posting on this 🙂 is the article in https://mcuoneclipse.wordpress.com/2012/08/13/tutorial-timer-led-with-processor-expert-for-kinetis/
LikeLike
Yes, that was it. The FlexTimer is not implemented completely in the LDD in PE in cw10, so I think I must have misremembered the post. It is a shame because this was better implemented under the legacy CW 6.3 system although without the LDD model; a headache but necessary for MQX. I guess they haven’t gotten around to it as yet.
Thank you.
Robert
LikeLike
You might have a look at the new MCU10.3: Timer handling has been simplified for LDD, but I had not much time to play with it.
LikeLike
hey Erich,
My name is Vitor, i’m 17 years old (since 16 working with codewarrior and freescale). I was born and live in brazil so i do not have too much websites to bring me the solution of my problens with codewarrior, so i wanna say tank’s by this awesome blog and keep with your good work.
Vitor
LikeLike
Hi Vitor, many thanks :-). Good to see that it is useful for you. And this was exactly the reason for this blog: my students and co-workers have asked questions around CodeWarrior and Eclipse, and after I had answered that for example by email, the same kind of question came again later from someone else. So I thought it might be a good idea to publish ideas and tips and tricks, so everyone can benefit.
LikeLike
Erich, i was thinking…
How coud i help with this blog? i have alot of experiences that i wanna share whith other people… these days i was working whith DWIN Displays and a freescale mcu … if you want i can do some posts.. or idk.. something to help you 😉
LikeLike
Hi Vitor, this sounds very interesting and like a lot of fun. 🙂
LikeLike
Erich, I think Device Initialization is a PE subset without the methods? So I was hoping that I could ask you a question for the FlexTimer FTM0, I have picked PTC1 FTM0_CH0 as an input capture, which is pin 71 on the k20dx256VLL10 100QFN package, and here is the issue I routed PTC3 pin 73 which is supposed to be FTM0_CH2, as a toggled output compare. But DeviceInit says that I cannot use PTC3 and that the only pin available is PTA5. I can see in the K20_SUB_FAMILY data sheet on page 69 that ALT4 is FTM0_CH0 for PTC1 pin 71, and ALT4 is FMT0_CH2 for PTC3 pin 73. Would you know why I can’t use both of these pins? Is this a mistake in PE/Device Init? Or is there another reason that I can’t use the same timer FTM0 as both an input capture on channel 0 and an output capture on channel 2. The FlexTimer is supposed to be backwards compatible with the TPM module timer from the Coldfire series. I used TPM1CH2 as timer input capture and TPM1CH3 as an output compare on the MCF51JM128, without a problem… I was wondering if you encountered this problem, or is it just a misunderstanding on my side? I can’t see anything in the doc set that precludes this combination of using an output and an input on the same timer for the Kinetis K20…. Thank you for any advice you might have
Robert
LikeLike
Hi Robert, yes, Device Init is just the initialization, but no drivers. I do not have your device so I cannot check for sure. But I have learned that that the pins available heavily depend on the package and the actual part number. I think your question might be better asked in the Freescale Processor Expert forum? It could be an issue in Processor Expert, or it could be an issue in the documentation, or it could be an issue in the device too.
LikeLike
Hi Eric,
The FSL_USB_Stack is a very nice component. Is there any chance that it will support the K20DX256ZVLK10_100 in the near future?
George
LikeLike
Hi George, thanks :-). I’m working right now on integrating the USB HID support, along with a USB MSD bootloader project. But I definitely need to get the K20 on the list of supported devices. I have it added to my list.
LikeLike
Hi George,
just to follow up: there is now USB CDC device, USB HID Keyboard device and USB MSD Host available on the K20 (see https://mcuoneclipse.com/2013/07/10/usb-msd-host-for-the-frdm-k20d50m-board/)
LikeLike
Hi Eric,
Thanks for your assistance in getting the host component to work. I rebuilt a project with a K20 derivative and it works great.
Thanks,
George
LikeLike
Hi George,
thanks for letting me know. Good to hear that things can progress on your side. What I still want to do is to add HID mouse and HID host support 🙂
Erich
LikeLike
Hi Erich
I found the answer to my problem above about the K20 FlexTimer unable to toggle the output pin on a compare. The reason that the output would not toggle on the Timer even though it was set as a toggle pin was that the property Software control (FTMx_SWOCTRL) had been enabled. I did not understood the implication of this property. Apparently if it is on, even though the toggle is on and the output control is enabled, the control by the FTM is overridden and it will not toggle on compare. I think this is an oversight in Device Initialization, because these properties should be linked together to qualify/disqualify each other when one or the other is used. The doc set says that the Timer always has priority in hardware if the toggle is on. But it seems that is true only if this new FlexTimer field is not set, (FTMx_SWOCTRL).
Anyway, just a heads up on this, it took a lot of time to sort out.
LikeLike
Thanks for your blog – it’s the most useful thing for the Freedom boards / KL25Z processors out there.
Can I request you do a posting of how to get printf() working over the UART on the Freedom board *without* using processorexpert? Just straight and simple C code.
Thanks!
LikeLike
Hi Frank,
Thanks for the flowers :-).
About your request: I can work on that. But it raises a few questions:
– Did you know that you can use my projects as well *without* Processor Expert? Simply use the generated code. Maybe I should post something about this too.
– printf() (with using all the formatting like %d,etc) is *not* straigt and simple. And in my view printf() should never be used in an embedded design. It is pure code bloat, plus an evil source of stack overflows. But I can work on a post on how to use it, but I think it would lead to a wrong path: because my mantra is “printf() is for the desktop world, not for embedded” 😉
– What for sure I could (and should?) do is a post on how to use things like writing a string/number. Would that be ok?
Thanks,
Erich
LikeLike
Hi Frank,
as a follow-up, there are two new posts:
– how to use projects without Processor Expert: https://mcuoneclipse.wordpress.com/2012/10/14/removal-of-processor-expert-for-a-project/
– how to use the UART: https://mcuoneclipse.wordpress.com/2012/10/14/tutorial-printf-and-hello-world-with-the-freedom-kl25z-board/
Hope this helps,
Erich
LikeLike
There is now a specific tutorial how to add/use printf(): https://mcuoneclipse.com/2013/02/07/tutorial-printf-with-and-without-processor-expert/
LikeLike
Hi Erich
I have used your blog on how to use the Attach in the Debugger configurations, this is a critically important issue. I have a project that seems fail after a period of time and now I can see why using the attach link. I was handicapped before. Thank you.
If you could do a blog on one further important tool, this would be extremely helpful, and that would be to be able to “Trace” and “Profile” the task execution. I know the TAD gives some static values at breakpoints, but I have seen trace and profiling tools mentioned in CW and never gotten them to work. Not in the Eclipse based or legacy CW systems. Perhaps this is just with MQX or special probes? But then even if this were true it would be very helpful to know if the could or could not be done and under what circumstances.
Regards
Robert
LikeLike
Hi Robert,
Have a look at https://mcuoneclipse.com/2012/03/23/tracing-with-freertostrace-from-percepio/.
this is with an RTOS, and provides excellent insights into the execution of the system.
LikeLike
ahhh… it is now too painful not to switch to FreeRTOS and your components. It has to be done. I think you mentioned that you did not have the k20 ported, but do you have either the k60 or k40? I am fairly certain that the k20 would work with either port because it does under the bsp builds for MQX. Or can I just go ahead with switching to the k20 with PE and there is no problem. Or if there is a problem is there anyway around the problems?
Regards
Robert
LikeLike
Hi Robert,
I have not ported the USB stack to K20. But FreeRTOS runs on any of the Kinetis devices.
LikeLike
Yes, now I remember. That is the insurmountable problem; without the USB stack we are doomed. Well if you do port the stack to the k20/40/60 (they are the same core) you will find a lot of new users. There is a great deal of activity in the forums for these processors. There was a faint glimmer of hope… that has now receded into oblivion.
LikeLike
Robert, the stack *is* ported for KL25Z, K40 and K60, see my posts on this. But I had no bandwidth to try in on a K20. It might run, but I was not able to verify this.
LikeLike
Then I will try it and I will bet it works. The core is the same. I think this will be actually fun to do, versus the torment it was to get our system to port to the k20 from the 51jm128. Thank you, I think I detect a faint light in the distance.
Robert
LikeLike
Hi Erich,
i am new to the Kinetis family and also new to CodeWarrior with its ProcessorExpert. Your blog helps very much getting in to it.
What i am currently trying to do sounds easy but i have my little problems with it…
What i want is a CodeWarrior project with GCC, ProcessorExpert and MQX. I would need ethernet with DHCP and CAN. My idea was to use the ProcessorExperts LDD drivers with MQX 3.8. It seems that just this combination is not supported in CW10.2 or 10.3.
Maybe you have some information for that. I think that this is a standard configuration that other users could also be interested in.
LikeLike
Hi Ansgar,
There is an MQX-Lite for Kinetis-L which is very well integrated with Processor Expert. I have not combined the ‘normal’ MQX with Processor Expert, although it should be possible with some tweaking. The MQX architecture is somewhat ‘teak it or leave it’, and makes it hard to integrate with other systems. Processor Expert on the other side has similar challenges. That’s why I use FreeRTOS as it is much better to integrate with any other systems, is open source and much better scalable especially for smaller microcontrollers.
LikeLike
Hello Erich,
Right know I have a simple demo apllication running and I want to expand this application with TCP/IP functionality. The fact that FreeRTOS itself recommends the uIP Stack made me currious about it.
Do you have experience with using FreeRTOS and uIP with using Codeworrior? Because the only demo i found is written for IAR (http://www.freertos.org/embeddedtcp.html).
LikeLike
Hi Manuel,
good question! I have used in two project lwip (http://savannah.nongnu.org/projects/lwip/) with FreeRTOS, one with the MCF51CN128 and the other with the MCF52259 and CodeWarrior.
LikeLike
Hi Erich,
thanks for the link. The fact that i am new to freeRTOS and CW doesn’t make it easier to start with a TCP Stack 😉 Could you give me a hint where and how to start.
You can answer me by mail if it makes things easier for you.
LikeLike
Hi! I received my Freedom Board the other day, but I’m having some problems. Until now I was using the HCS08 and some Coldfire V1, but I’m new to the Kinetis MCU, and they are very different. I tried to use the DAC with help from processor expert but I don’t know exactly how to use this function:
DA1_SetValue(LDD_TDeviceData *DeviceDataPtr, LDD_DAC_TData Data)
I don’t know what I have to put in “LDD_TDeviceData *DeviceDataPtr”. I read the information in the Freescale info center but I still can’t understand this.
Sorry if this is an stupid question :P, but I hope that you can make a tutorial or simply point me in the right direction.
Thanks!
LikeLike
Hi! I have touched the topic of DeviceDataPtr in a light way in https://mcuoneclipse.com/2012/07/26/there-is-a-time-and-date-for-both-worlds/.
That pointer holds a ‘device handle’ and only makes sense in the context of an RTOS or if multiple code parts are accessing the driver. In many cases I simply pass NULL to it. That device handle is returned if you call the driver Init() routine, and is destroyed if you call the DeInit() routine.
As for getting more information: right click on the component and select ‘help on component’: this gives usually example code how to use it.
LikeLike
Now it’s more clear to me. Thank you very much and congratulations on the amazing website!
LikeLike
Hello, I’m playing around with my Freedom board since 2 weeks now. Was fun until I tried to divide a integer with another integer which results in a big crash. I’m not sure but the bug seems to be connected to the GNU GCC tool chain. Do you have any information about this issue.
I’m using Code Warrior for MCU Version: 10.3.;
PS. you tutorials keep me going. Many thanks
LikeLike
Hello, thanks :-), and no, I have not seen such an issue. Maybe you can send me that integer division source code/line so I can try it on my side? Use my email address on the bottom of the blog About page.
LikeLike
I’m sorry ,correction, a 32 bit (long int) with an int 😉
LikeLike
Are you sure you are not dividing by zero?
quickly did this:
unsigned long uL=10;
int i=2, res;
res = uL7/2;
and no issue for me.
LikeLike
I got it working now, found a variable out of range, but even after that correction It did not behave properly. Powering off the board and restarting the environment did help after several tries. I got a screen shot with “No source available for “_aeabi_idiv (0x000004AC)()””. I’ll send it to you in the morning too tired now :). Thanks for the promptness.
LikeLike
Hi! Sorry to bother you one more time :P! I have a Nokia 5110 LCD display and I was trying to use your processor expert component so I can use this LCD with an 9S08SH8. But I don’t understand exactly how I have to configure the pins. I have RES, SCD and D-C in the PDC8544 component, but also I need to configure the pins for the SPI module. If I choose the MOSI pin in the SPI, then I can’t select it for the D-C pin… or maybe I don’t have to do it this way…:P
Thanks for all your help.
LikeLike
I got it all wrong… I thought that D-C was the data input pin. Sorry!
LikeLike
Yes, D-C is an output pin to tell the LCD if it is a command (C) or data (D).
LikeLike
Erich, this is a bit off topic but related to the USB circuit, I was wondering if you can give any advice on using the USB as a charger? We have lots of amperage and if we plug in an Android nexus s, it charges at 450ma, if we plug in an iPod it charges only at 9ma and doesn’t show a charging symbol. I was wondering if the USB DM and DP lines have to be set in any special configuration or if there was device signalling that needs to occur?
LikeLike
Robert, yes, some lines require a special protocol on the D+/D- lines in order to activate the charging circuit. Some of the Apple devices for sure are like this to my knowledge.
LikeLike
Hello, Erich,
Thank you for the effort put into the superb tutorials for the FRDM-KL25Z.
Unfortunately I am not able to view mcuoneclipse.com from my mobile while on a data connection (I get ‘ Page not Found’ from the browser).
I can view it fine while on WiFi.
I am on Android 4.04, using Chrome.
Do you know why this is so ?
I am writing here as the subject was not related to any of the tutorials.
Thank you,
LikeLike
Hi Royce,
not sure why this should be a problem. But I know that some firewalls (e.g. in China) might block sites. Is it the same problem if you use https://mcuoneclipse.wordpress.com/ instead?
LikeLike
Yes Erich, it is the same with https://mcuoneclipse.wordpress.com/ too.
And I can access perfectly using Wifi. So no one’s blocking it here :-)!
Guess I need to email the WordPress people about this.
Perhaps you could do the same being a user.
Thank You!.
LikeLike
I guess this is more of an Android problem? I do not see that kind of issues with any of my devices (but none is Android, I admit).
LikeLike
I commend you for a great tutorial site! It has greatly helped me, a hobbyist, to become accustomed to my new FREEDOM board.My prior experience has been with a Zilog board. I am having a problem with PE and configuring a pin to trigger a read from the capture reg of a free-running timer. I count the overflows easily, but can’t find the appropriate config for reading the ticks in the capture reg. Do you have an example that would assist me?
LikeLike
Hi Dale, I have added this subject to my bucket list.
LikeLike
Hi Erich,
It would be great if you could do some tutorials in using the ADC (single & differential mode), and the DAC.
Thank You !
LikeLike
Hi Royce, yes, I have added this to the bucket list.
LikeLike
Thanks, Erich,
A humble recommendation that you get all the hardware peripherals (of the FRDM board) tutorials done with first…
This will help keep up the interest to see things work, and users can then play with the examples to develop their own complete apps,
Then they can learn other abstract concepts (like Subversion, DOS shell project etc).
After developing their own large apps, they will understand the need to learn these concepts.
LikeLike
Hi Royce,
yes, that’s why I have published tutorials for the LED, accelerometer and the touch interface, along with USB CDC and SCI.
LikeLike
I have one project for the ADC in single mode for 3 channels. If you are intersted, this is my mail (julioefajardo@gmail.com)
LikeLike
I didn’t mean to sound rude or ungrateful :-), just that I’m dying to see the rest of the peripherals working (on the FRDM board) … I find most of the available documentation very sparse, and your tutorials, as of today, are the best source to understand their usage.
Again thanks for all the effort put in !
LikeLike
Hi Erich,
Could you please do a tutorial on ‘How to create your Own Processor Expert Embedded Components’ ? Thanks!
LikeLike
Hi Royce,
as a starter: there is a CDE user guide inside MCU10.3:
MCU\Help\PDF\CDE_userguide.pdf
Additionally: http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=PE_CDE&fpsp=1&tab=Documentation_Tab
There is as well material about the FTF 2012 Hands-On Workshop available:
Hands-on Workshop: Component Development Environment for Processor Expert Software
(available on http://www.freescale.com/webapp/sps/site/overview.jsp?code=FTF_OLLTABLE)
I hope this helps as a starter,
Erich
LikeLike
Thank You this info ! It should be enough to get me started !
LikeLike
Hi Erich
I find that Eclipse CDT sometimes continues to show compiler errors in the ‘Problems’ window even after I have fixed them. This means that the most reliable way of checking for errors and warnings is to look at the console window. When the ‘fixed’ errors persist in the Problems window they can sometimes be fixed by building in all build configurations. But sometimes, even then, they still persist and the only way I know of removing them is to recreate the workspace. I just wondered if you have noticed this behaviour and have any tips?
BR
David
LikeLike
Hi David, I noticed that too in older Eclipse versions, but not that much recently. The thing is that the Eclipse CDT error parser plugins are parsing the console output, an that parsing might not be correct, indeed. So you are right: looking at the console is something I do always too. To remove the errors, I simply select them and delete them in the Problems view. This always worked for me. With MCU10.3 it is even possible to select the whole ‘root’ of all errors, and delete it (in earlier versions I had to select all the errors). Maybe this helps?
LikeLike
Thanks Erich, I haven’t tried deleting the errors – I will try that. Thanks for your help.
David
LikeLike
Hi Erich,
I have been studying your tutorials *religiously* for months. I can’t thank you enough for the work you put in for us.
Unfortunately, at the moment I am struggling with reading analog values into my CW program. I think I have the component set correctly in PE. I have tried to make sense of the PE component help pages. They leave much to be desired.
Can you point me to where I can find simple examples of how to use the ADC pins for the KL25Z?
Once again,
Thank you.
LikeLike
Thanks for the reminder on that ADC thing. I have posted now a tutorial: https://mcuoneclipse.com/2013/02/10/tutorial-adc-with-the-freedom-board/
LikeLike
Whooops. Nevermind Erich. I got it.
Thanks anyway.
LikeLike
Hi Hillbilly,
Would you care to share the information on using the ADC pins (a link to the source of the info, perhaps) ?
Thanks !
LikeLike
I know my ADC tutorial was long overdue. But it is available now: https://mcuoneclipse.com/2013/02/10/tutorial-adc-with-the-freedom-board/
LikeLike
Hi Erich,
Been busy … was not able to follow this blog for a while.
Nice to see lots of new projects/tutorials !
But I have a (repeat) request.
Kindly post some tutorials on using the USB host facility on the FRDM board.
One goes in for a powerful device like the KL25Z because of the extra features like USB capability. Apart from that, we can usually get by using a fast 8 bit processor like AVR or an Arduino board.
So please post some tutorials on using the additional ‘non-8-bit’ features on this board.
You have a post ‘Enabling USB host Mode …’ where you enumerated a Thumb-Drive.
Kindly share your code as to how one may read/write a mass storage device.
Thank You !
LikeLike
thanks to your tutorials able to get a hang on freescale’s KL25z frdm boads. I came across this link : http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FREEMASTER&fpsp=1&tab=Design_Tools_Tab
i wanted to know how to use this tool with my frdm KL25z boards can you help me with this? or atleast point me to some useful links . i did find a pre-compiled example, not able to establish communication with the board and the GUI. So wondering if i could get some heads up
LikeLike
Hi Pradyumna,
I have not worked with FreeMaster (I only had looked at it a while back). I can add it to my bucket list, but I guess will not be able to look into it soon.
LikeLike
Hi Erich!
I want to know if you are working on USB_MSD_Host and FATFS in PE.
I need this to complete a project, and work with the USB_Stack just gave me headaches.
Any guide or help?
LikeLike
I forgot to say that I’m working with Codewarrior 10.3, the Freedom board and K20.
LikeLike
Yes, I made some progress this week (updated software is on GitHub). I had to fix struct alignment in the USB stack code (for gcc). Basics were working in a ‘hacked together’ project, I still need to clean it up a little bit. For now you could use what is on GitHub probably. But I do not have a K20, I used it only with the KL25Z.
LikeLike
How nice! Glad to hear it, right now I check and see that I can go by. Thanks for the prompt response and the effort you put into this. I’ve been considering translating your posts into Spanish to help my school mates here in the Dominican Republic, clearly recognizing your authorship and sending them to your blog. I love the work you’ve been doing and I have your permission to proceed.
🙂
LikeLike
Hi Alex,
Glad to see that things are useful. Would be great to see things translated to Spanish because at least from the WordPress statistics I see there is a great community in Latin Americas. 🙂
LikeLike
Hi Erich,
Thank you for the wonderful Blog. I have a request. It’s really basic. It would be really great if you could post some tutorial for demonstrating Input capture and Output compare using Timer_LDD component.
LikeLike
Hi Subramanian,
I’m already using the input capture/timer for my Ultrasonic module (https://mcuoneclipse.com/2013/01/01/tutorial-ultrasonic-ranging-with-the-freedom-board/). Maybe this gives you a starting point?
LikeLike
Thank you very much Erich. The tutorial and the video was wonderful. I would like to request for is Touch sensing using TSI module. I tried blinking LED on touch. I wanted to measure capacitance of the sensor. It would be great if there was some tutorial along with how to use FreeMaster.
LikeLike
Hi Erich,
Thanks a lot thank you.. Any soon you come across anything regarding FreeMaster with FRDM-KL25z &TSI please post reference manuals giving me hard time
LikeLike
Erich,
Within the past few years I have been working a company that implements control systems for factories, power plants, production sites, etc. One of the things that I often find myself wondering is if I could replicate some of the control/monitoring conditions that our high-end equipment does, but more scaled down (and probably less accurate). I thought it might be nice to see some examples/tutorials of different communications. For example, I am currently struggling to recreate the OneWire arduino library to use with my FRDM-KL25Z and a series of Dallas DS18B20 temperature sensors (http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf) along a OneWire bus.
Thanks
LikeLike
Hi Tim,
yes, I’m aware of these OneWire devices, but never used it. I have it added to my Bucket list page, but first I would need to order one of these devices.
LikeLike
The one I mentioned is fairly cheap (~$4 US). Sparkfun, Adafruit, and Newark/Element 14 all carry the TO-92 package. I ordered 10 at one point, so I would be willing to part with a couple. These 1-wire bus components are really neat, considering the size and flexibility.
LikeLike
Hi Erich
Have you written an article about automatically inserting comments using the Eclipse CDT?
I have in mind how to insert a comment block above a C function or C++ method definition, that would specify name, author, parameters etc. I know that I can define one using Eclipse’s Code Templates, but I can’t find out what keystroke to use to actually insert the comment block in my source file.
BR
David
LikeLike
Hi David,
have you considered using doxygen (https://mcuoneclipse.com/2012/06/25/5-best-eclipse-plugins-1-eclox-with-doxygen-graphviz-and-mscgen/)? Doxygen has the feature that it can automatically add a header to the function and to generate then documentation out of it.
Best regards,
Erich
LikeLike
Hi Erich
Thanks. Actually I had already seen your post on Doxygen, but I am not sure that our team is ready to use it. I notice that the Eclox plugin inserts a function comment block with Doxygen fields if you type /** ENTER. I would like to get that to work with our own block, but can’t make it work currently.
Best regards,
David
LikeLike
Hi David,
ok, I see. Would it be acceptable if you write something like ‘myComment’ and then it would be expanded to your own block? Let me see if I could post a blog today on something like this.
Erich
LikeLike
Hello, my name is Alexander.
I’m teacher assistant in MCUs programming, in my course I have been working with S08/CFv1 MCUs, but with the Freedom Board arrive, I would like to introduce ARM Cortex M0+. My problem is that I was reading technical domumentation about this MCU and I’m very confused, because a lot of things change when you compare ARM with S08 or CFv1.
Could you help me to find documentation and tutorials about Freedom Board and ARM cortex M0+ architecture, in my course I cover basics and some advances skills, then it would be great to find easy documentation acces to me.
Nice blog, Thanks a lot for your help
Alexander
LikeLike
Hi Alexander,
I’m using now S08, ColdFire V1, V2 and the ARM Cortex-M0+ all together in my classes. It all depends if as an engineer/student you know the basics of a microcontroller (like the S08). I have found with this it is not that hard. Yes, the ARM Cortex has certain specialities (like how interrupts work, etc), but at the end: it is a microcontroller :-). I suggest to have a look at the arm.com web site which comes with good information as a starter. The other suggestion is that you could join the Freescale University program: They might have some classroom bookware introducing the ARM Cortex-M0+.
LikeLike
Hi Mr. Styger, thanks for your response.
I’m MCU architecture and programming teacher for undergraduate engineers. As you, I use S08 and CFv1 in my course, but I’d really like to introduce ARM cores (and specially if it come from Fresscale).
Thanks a lot for all the information that you put on this web, It’s very useful for whole community.
LikeLike
Hi Erich,
I am unable to use the RTC in the FRDM board. Is there any clock or oscillator thing to be taken care of? Can you post any tutorial or give an explanation regarding what is to be done for using RTC in general providing details like oscillators or crystal requirements.
Thank you
LikeLike
Hi Subramanian,
I think this discussion helps:
(link not valid any more)
LikeLike
I went through it.Could you give me a rough idea about how I could use an 8MHz crystal on the XTAL-EXTAL and derive 32KHz clock?
KL05 is the processor of interest in which clock distribution Fig5-1 a multiplexer to switch clock source of RTC.
From the freescale link, what I understood was that they are expecting an extra 32k oscillator to be given to RTC_CLKIN. Would this result in adding extra IC , using 2 oscillators? If yes, Could this be avoided?
I require all this to happen without CPU intervention because I am planning to use RTC in VLLSx mode. Please mention if there is any constraint.
LikeLike
My rough idea is to use that extra 32 kHz crystal.
LikeLike
Erich, thanks for your great help getting the CMSIS DSP library working with CW-MCU 10.3. Now that I’m using DSP functions it would be very valuable to be able to visualize the data. Currently I printf my arrays to the Console window and then Copy-Paste to Excel. That takes a really long time…
Is there an existing tool for Eclipse that helps to visualize data? Perhaps something that would create a screen plot of data values in a specified array?
LikeLike
Hi Greg,
In case this is of interest: I’m using an LCD (over I2C) to plot my graphs. You can see how this looks in https://mcuoneclipse.com/2013/01/21/lie-to-me-or-building-a-polygraph/.
The othe way which comes ot my mind is FreeMaster.
LikeLike
Hi Eric,
Great Blog. i have a question for you.
Have you tried porting FreeRTOS 7.4.0 in MCF52259 demo kit? I tried the demo project available with FreeRTOS for this microcontroller without success. I am using codewarrior version 7.2.
Thanks
Jayaram
LikeLike
I’m using FreeRTOS 7.2.0 for now (no time to port to 7.4.0 right now). But this should not matter. But it works perfectly with the MCF52259 demo and tower kit, but I’m using CodeWarrior 10.x (Eclipse). The 7.2 version you are using is very old, and the compiler not recommended. I remember that this version even has a different stack calling convention, so many examples might not work. Is there a chance that you could use the Eclipse version?
LikeLike
Hi,
I have installed the Codewarrior 10.3 version and tried the demo project given in FreeRTOS for coldfire mcf52259. I am using MCF52259demo kit.But while debugging, I am getting “Cold PE Protocol Adapter: No USB connection found”
Thank you very much for the reply.
Jayaram
LikeLike
Hello,
it could be that the OSBDM on your board is a very old one? Have you upgraded it with the latest P&E software available on http://www.pemicro.com/osbbdm?
LikeLike
hello Erich,
nice tutorials up here … bought a KL25z freedom dvelopment board. i’m finding difficulty in working with RTC in that board was wondering if you help me with a walk though to use RTC
LikeLike
Hello,
there is a thread going on this in the Freescale Forum:
freescale community thread/301330
LikeLike
hello ,
yes i did come across this thread but i dont know where i’m going wrong
thankyou
LikeLike
you will need either a 32 kHz additional external crystal, or to use the solution explained by Graeme Bragg in his response in freescale community thread/301330
LikeLike
yup ‘ll try thank you
LikeLike
Hey Eric,
your tutorials are great. Give me a tip please..
I need to build a interface between the FRDM-KL25Z and LabVIEW. I’d like to acquire data using the ADC and send this data through USB. So, what tutorials would you recommend that I can follow in order to be able to do that?
Thanks
Jean
LikeLike
Hi Jean,
thanks :-).
I recommend that you use normal SCI to the OpenSDA which then translates it to USB.
I wrote a while back a tutorial how to print things with Processor Expert (https://mcuoneclipse.com/2012/10/14/tutorial-printf-and-hello-world-with-the-freedom-kl25z-board/) using Serial_LDD. With the release of MCU10.3, things are now even easier: you simply can add the AsynchroSerial component to the project, specify the UART/Pins with the baud, and your are ready to go. I use that approach with my Shell component (see https://mcuoneclipse.com/2013/03/20/freedom-robot-solves-the-maze/).
For ADC I have a dedicated tutorial here: https://mcuoneclipse.com/2013/02/10/tutorial-adc-with-the-freedom-board/
LikeLike
Hi Eric,
Excellent Blog. I am using codewarrior 10.3 and I want to port FreeRTOS on the coldfire mcf52259 board. There is no demo project for eclipse based version of CodeWarrior on FreeRTOS source files provided. I tried CW7.2 and the demo project – ”RTOSDEMO” given in the file. But I am getting error in that – “ColdFire Protocol PE : No USB connection found”.I have updated the latest PE OSBDM driver from the link which you gave .
Can you please guide me on porting the freertos on coldfire board. I want to do simple tasks with it.
Thank you
Jayaram
LikeLike
Hi Jayaram,
thanks :-).
The demo at https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/TWR-52259/MCF52259_FatFS is using FreeRTOS.
Maybe I should load there a demo just with the RTOS?
CW7.2 is clearly very old, and that compiler has several issues, plus the problem that it using a different call stack.
As for porting: no need to port it, as I already did this.
See for example https://mcuoneclipse.com/2012/03/18/tracing-freertos-with-a-hardware-probe/
LikeLike
Hi Jayaram,
FYI, I have committed a simple FreeRTOS application for the TWR-MCF52259 on https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/TWR-52259/MCF52259_FreeRTOS
Have fun 🙂
Erich
LikeLike
Hi Eric,
I downloaded the folder from your link. Imported the project and tried building it. It shows 84 errors. Main error was “invalid project path” and ”syntax errors”. The project name was “MCF52259_FreeRTOS : FLASH”. Should I need to do some changes in the settings. I am using codewarrior10.3.
Thank you
Jayaram
LikeLike
Hi Jayaram, have you generated code with Processor Expert? The amount of errors looks to me that you have not done this? Do you have a ‘Generated_Code’ in your project?
LikeLike
Hi Eric,
I don’t have a “Generated_Code”.. I opened the project and gave build all. Can you please tell me what I have to do to generate code using Processor expert? I haven’t used Processor Expert before?
Thank you very much for your reply.
With regards
Jayaram
LikeLike
Hi Jayaram,
ah, ok, that explains it. Right click on the .pe file and select ‘generate code’. I recommend that you have a look at the tutorial here: https://mcuoneclipse.com/2012/09/07/tutorial-enlighting-the-freedom-kl25z-board/ which has as well a section ‘Generate Code’.
Good luck!
LikeLike
Hi Eric,
I tried generating the code from Processor Expert. I got this error. “The Component FreeRTOS is not supported in this version of Processor Expert”. I am using Codewarrior10.3. Should I import some package for this code?
Thank you very much
Jayaram
LikeLike
Hi Jayaram,
yes, you need the FreeRTOS (and LED) components imported from GitHub. See
https://github.com/ErichStyger/mcuoneclipse/wiki/Getting-Started
LikeLike
Hi Erich i need a help with a 4×4 keypad scan code, i don´t know how to start and what component i need. I´m programing with KL25Z microcontroller is there any example project?
Thanks for your time.
LikeLike
Hi Xabi,
no, I do not have such an example project.
Erich
LikeLike
HI Eric,
I tried your FreeRTOS processor Expert code. I am able to generate code only after removing the LED already there with a new set of LEDs as you have given in https://mcuoneclipse.com/2012/06/28/tutorial-freertos-on-demojm/.
I am now able to generate code. When I build it is fine. When i run, it is showing error
“Old OSJTAG/OSBDM firmware detected. The embedded firmware needs to be in bootloader mde to update. Please unplug the USB cable, insert a jumper on the 2 pin bootloader header(connecting JM60IRQ to ground) and reconnect the USB cable”.
I have updated the from P&E link that you had given earlier. Which jumper are they referring to?
Thanks very much for your help
Jayaram
LikeLike
Hi Jayaram,
That’s the standard update procedure with OSBDM/OSJTAG.
I think you are using the DEMO52259 board? Check the schematics of your board. There is the jumper J5 connected to the IRQ pin of the JM60. You need to close that jumper while power-up the board, then the board will be in bootloader mode. I believe this jumper might not be factory populated, so you might consider to solder a jumper header on it. But it works as well with a metal paper clip: you only need to pull IRQ low while the JM60 power-ups, so you can hold a paper-clip on the jumper footprint at startup and you can remove it right afterwards.
I hope that your OSBDM on the DEMO52259 is not very old. Because then you might need the P&E updater utility to update it.
Erich
LikeLike
Hi Eric,
Thank you very much for your help. I updated the firmware as you suggested. Now I have downloaded the program and all the LEDs are in ON condition. Is there a tutorial in this website where you have given how you went about creating the project and creating those processor expert packages(*.PEupd files). Also which code I have to change to play with these LEDs?
Thank you very much for your patient help .
Jayaram
LikeLike
Hi Jayaram,
Such a tutorial is something I have in my mind, but first I need to find the time to write it. But there is already a lot of material available from Freescale, see https://github.com/ErichStyger/mcuoneclipse/wiki. And as for the LED code: maybe simply google for ‘mcuoneclipse LED’ and then you will find the relevant articeles.
LikeLike
Hi Eric,
Thank you very much for your help. I have a doubt. In the code “Application.c” in FreeRTOS demo for mcf52259, code is LED1_neg which has to toggle the LED. But after running the code in mcf52259, the LEDs are continuously in ON condition. Is it wrong? Am I making some mistake?.
Thank you again.
Jayaram
LikeLike
That sounds like your RTOS is not running the tasks. I tried it on my end with my board, and it is working. So I guess you need to debug your application to find out what is going on.
LikeLike
Hi Eric,
As you were saying, I think RTOS is not running the tasks. The LEDs are just getting ON due to some error. The code is generated, It is getting built and when I give run, the reset LED blinks twice (red colour LED). Is it glowing because of some error or will it blink while downloading the program?
When I tried changing the “application.c” code that you have written, output does not change. It remains the same. Can you please what exactly you mean by “debug the application”?
Thank you very much
Jayaram
LikeLike
‘debug the application’ means to use the debugger to download the code, and step through it.
LikeLike
Hi Erich,
This is a very good blog. I have tried using KL25 FRDM board. Now that I have bought KL05 board, I have a request to you. Since there is a 32k crystal available on the board, it would be great if you could demonstrate internal RTC and wake up functionality along with the clock settings for VLLS modes. It just could be as simple as lighting an LED after waking up.
LikeLike
Thanks :-). That’s a good topic, and I have added it to my growing bucket list (https://mcuoneclipse.com/the-bucket-list/).
LikeLike
This is a very good topic. I think it can be of great use in monitoring applications. I request Erich to update the blog with a tutorial on this topic as soon as possible. I can’t wait to try this out in KL05 Board. 🙂
LikeLike
Hi,
Only just found this website and i would just like to say thanks for all the great tips and tutorials, fully credit for an excellent collection of very useful and time saving articles.
If you have time could you please look a some Bootloaders for the Kinetis parts, there is an application note AN2295 but it does not support CW 10.3, and the application note is not very well written (or at least not as clear as your articles – the linker files, memory and vector table re-arranging need much more explaining – ).
another alternative to a bootloader is using the second flash block in the parts that contain FlexNVM, re-programming and swapping blocks again there is an application note but it is for IAR and again would be better explained in one of your articles.
Many thanks for the excellent resource you have created, you have saved me hours 🙂
LikeLike
Hi Brian,
thanks for the positive feedback :-).
As for bootloader and Kinetis: I nearly have completed writing my own (very simple) bootloader. It is using a serial communication channel, and works right now with a shell connection and S19 files on Kinetis, plus on ColdFire with USB MSD. Nothing super fancy, but works pretty well. I planned to write an article/tutorial about it, probably this week end.
LikeLike
Hi,
That would be great, it seems that most of the bootloaders around skip over important information (e.g. The memory map and why things need moving around, how and why the linker files need changing for the bootloader and the application space and how the bootloader is programmed to the board). From a PIC / AVR… background a bootloader is simple but the Kinetis / ColdFire look a little more complex / involved.
It would be good if somebody (:)) could write a simple article regarding the bootloader and memory map over something simple like a USART (thus removing more complex topics like USB…). as a bootloader is very important and most projects require them.
I have written a library for C# and C++ that can decode S19 and intel hex files into a byte array ready for sending (i will happily send you this if it is of any help).
NOTE:Have a look at AN4533 this an alternative option over a bootloader and would also make for a good article, as it is kind of unique to micros with two flash blocks
Thanks,
Brian
LikeLike
Hi,
I would also be very interested a bootloader article, particularly the flash block memory swap application note.
Thanks,
Andy
LikeLike
Hi Andrew,
yes, I agree that this would be an interesting topic. But I fear that the topic of a basic bootloader is work enough for me.
LikeLike
I just launched this project for electronics tinkerers. I think you might find it interesting to write about: http://www.kickstarter.com/projects/966383008/coaction-hero-32-bit-open-source-arm-cortex-m3-boa.
Please let me know if you want any more info or have any questions.
Thanks,
Tyler
LikeLike
Hi Tyler,
yes, this is an interesting project. I only think that it should use an ARM Cortex M4 instead of only an M3? I mean if this would be a M4 board, that would be definitely something I would order right away. Has this been considered? Or what was the reason to use an M3?
LikeLike
I would like to know how to use SetFieldValue and GetFieldValue functions using KL25Z microcontroller. If it is possible, I would like an example code. Thanks.
LikeLike
Hello,
I’m wondering why you want/need these functions? Why not simply using BitIO component?
As for the LDD component: see https://mcuoneclipse.com/2012/11/12/tutorial-bits-and-pins-with-kinetis/
LikeLike
Hi Erich,
We have developed a low cost wireless Arduino board that we think may be interesting to your readers. It is based on the ATMega128RFA1 and uses Atmel’s wireless mesh stack. It also has a built in V-USB port for the bootoader and serial terminal and is fully compatible with Arduino. Some other unique features we’ve added is built-in range testing and wireless programming. There is a new video up showing two wireless boards working together and accepting commands from a WiFi shield.
Right now we have a page up on Indiegogo to try and generate interest http://www.indiegogo.com/projects/miniswarm-scalable-wireless-arduino-radio-module
Press release: http://www.sbwire.com/press-releases/gregor-simeonov-and-jonathan-scobble-launch-indiegogo-campaign-to-generate-20000-for-their-scalable-wireless-arduino-radio-module-miniswarm-235437.htm
We’d be more than happy to provide some hi-res media for a blog post :-). Thank you!
LikeLike
Hi Gregor,
that’s indeed an interesting project! I have created a similar project based on a FSL MC13213 SoC which has similar characteristics as the ATMega128RFA1, but less FLASH and RAM. But what was constraining my project was the performance (40/20 MHz), and I see that the ATMega has 16 MHz. What I see are Kickstarter projects using ARM cores: that gives the performance kick, with plenty of RAM and FLASH, while still be low power. I’m looking into EngergyMicro (Gecko) and other ARM micontroller vendors, and feel that would be a better alternative? See that RFduino project: https://mcuoneclipse.com/2013/03/31/rfduino-wireless-cortex-arduino-to-the-size-of-a-finger-tip/
LikeLike
Hi Erich!
What I would like to see are more projects based on MQX (or at least MQX lite) and Processor Expert. Freescale gives us such a nice OS with all the drivers and extensions (USB, SD Card, Shell, etc.) already built in. Unfortunately, they are not easy to use for new users and high-level Processor Expert support is not included or is insufficiently documented.
FreeRTOS is certainly also a very nice OS but it heavily depends on third-party drivers and porting them is not always easy. I think that many Freescale users would be happy to see your good basic tutorials also cover MQX and maybe your excellent projects and tutorials ported to MQX (well, this is probably not an easy task).
Thanks a lot for this wonderful site!
Anguel
LikeLike
Hi Anguel,
Thanks, and yes, MQX comes up from time to time. We are not using MQX at the university because as you say it is not easy to learn. More important, it does not support other processors (like the Freesale S08) we are using, and the performance and memory (FLASH and RAM) footprint is not near where we need it. More important: MQX is not open source, and we could use it only for Freescale Processors, while FreeRTOS is truely Open Source without chains attached. That’s why FreeRTOS is the #1 RTOS used according to the UBM Embedded Market Study. You are right that there are not that many high level Processor Expert components delivered by Freescale, but that’s not a problem of FreeRTOS, that’s a problem of Freescale. That’s why we have created the Processor Expert components available on GitHub.
For sure, I’ll keep an eye on MQX lite, as we are using it in a pilot project. I think it is not about one RTOS only: it is about using the right one for your needs, with all the consequences. So MQX really might be the right choice for you. It is only (as you say) that writing such tutorials is a lot of effort, so I’m writing them for things I use and need for my classes, so I have a benefit, and hopefully many others reading it too. I’ll keep an eye on MQX 🙂
Thanks for the suggestion!
LikeLike
Thank you Erich! I wish Freescale had a site like yours. That would certainly attract many developers and help them get started with the development jungle.
LikeLike
Hi Erich
The main reason we have not pursued freeRTOS is the open source license. Can you explain please, do we have to make *all* the code of the entire project available to the community or is it possible to release just some of the code… for example that uses freeRTOS functions like the main line scheduling and so on?
If it were possible to keep some measure of propriety away from the theft by Countries like China that do not respect IP rights in the same manner that the western countries do, we would use freeRTOS.
Regards
Robert
LikeLike
Hi Robert,
I suggest that you read the FreeRTOS license 🙂
It is not that ‘Open Source’ means ‘you need to share your source code’ automatically. FreeRTOS is using a ‘modificed’ GPL license, sometimes named ‘LGPL’ (lesser GPL):
“The FreeRTOS.org source code is licensed by the *modified* GNU General Public
License (GPL), text provided below. A special exception to the GPL is
included to allow you to distribute a combined work that includes FreeRTOS
without being obliged to provide the source code for any proprietary
components. See the licensing section of http://www.FreeRTOS.org for full
details. ”
What it means is that you do *not* need to share your source code. You only need to share the RTOS code if you modify it in a substantiel way. So your IP is protected, and you do not need to open it, even if you link and use FreeRTOS.
Yes, there are other open source projects using GPL: there if you link with a GPL IP, you get ‘infected’ by that IP. This is not the case for FreeRTOS. I would not have used it otherwise too for my projects with customers 😉
LikeLike
Erich,
What’s the relationship between the Freescale Baremetal USB Stack package that they release from their website (latest version 4.1.1) and what you have on your GIT site?
Thanks, Greg
LikeLike
Hi Greg,
I need to compare it with 4.1.1, but it should be very close to it. What I did is taking the 4.0.x sources and have built a wrapper around it for Processor Expert, for my needs. When I started doing this, there were no such Processor Expert components as delivered in the stack (as in 4.1.1). I still believe my version is easier to use, but that’s of course my view. But from the functionality it is very close, and I see that Freescale has picked up many of my changes and fixes, and what I saw they aligned the 4.1.1. release to what I have provided as feedback.
Does this help?
LikeLike
Hi Erich, recently bought a few Freedom KL25Z and I noticed variations compared to I already had, the diodes are different, the components are located differently and there are three new pin I do not know what they’re for. The revision of the board is the 2013 and I do not get the new schematic anywhere. You know anything about this?
LikeLike
Hi Carlos,
I just have received last week an additional board I have ordered and it was still RevD.
I have not found the schematics neither. But it could be for that board issue I had reported in https://mcuoneclipse.com/2013/03/03/pololu-freedom-line-following-robot/: The FRDM board does not create 5V from VIN, so you need to put in an additional 3-pin regulator to create that 5V. And this is what I thin these 3 pins are for.
LikeLike
Hi Carlos, what do you have written on the SCH sticker on the backside of the board? I have REVD
LikeLike
Hi Erich,
I am trying to use DMA with scatter gather functionality. If possible, please provide me any sample project using DMA with scatter gather functionality and processor expert.
Thanks to you in advance.
Regards,
Jagadeesh.
LikeLike
Hi Jagadeesh,
thanks for that suggestion. But I have not explored that area yet, so I do not have something ready for you.
Erich
LikeLike
Hi Eric,
I’ve found your blog very useful. Thanks much.
If possible please provide a project example for the MKL25Z128FRDM Freedom board for post generation of the CRC and run time verification of the CRC. Storing the CRC via the linker may be helpful. It seems this should be standard in the manufacturing environment to ensure one is releasing the proper programming file. I have looked at your existing CRC project, but an example for the MKL25Z128FRDM would be more helpful to many.
LikeLike
Hi John,
thanks, I definitely have this one added to my list.
Best regards,
Erich
LikeLike
Hi Erich
Great blog! I am working with a TWR Kinetis KL25 Board and your blog has helped me resolve a lot of bugs. Since I am new to this platform I prefer to write the drivers without using Processor Expert, so that I can know exactly what happening at the register level . I am writing a driver for Accelerometer using I2C. I do most of coding looking at the reference manual, but unfortunately there isn’t any information for the Accelerometer interfacing. I did have a look at your tutorial for the same on the Freedom Board, but an example elaborating in more detail how the I2C driver and Accelerometer is implemented,would really help me understand the code much better.
Thanks
LikeLike
Hi Lead Coder,
thanks for that feedback, appreciated. Have you seen my tutorial creating a driver for the MMA5451Q?
This should give you some ideas.
And there is this one on I2C:
PS: with using Processor Expert I know as well exactly what is happening at the register level. Nothing wrong with not using Processor Expert. It is maybe like using an assembler vs. a compiler: some prefer to write in assembly, some prefer to write in C/C++. And using C/C++ does not prevent you to use assembly, or to see what the compiler does 😉
LikeLike
Thanks for your quick response. I have felt at a lot of times that my own drivers are far simpler and shorter than the ones generated by Processor Expert. Also at times for a newb like me, it can get really hard to understand the code generated 😛 I guess with time I shall be using more of Processor Expert. Till then self coded drivers FTW! 😀
LikeLike
Yes, I have sometimes as well the feeling that provided code is ‘harder to understand’ or ‘not as efficient as it could be’. That might be true, but probably only in a few cases. Similar to things in the ANSI library: should I use the provided routines, or do I feel I could do it better? The ‘code overhead’ typically comes because the driver is more mature and knows that it needs to deal with all the edge cases/etc. Or that it has to fit a broad and different usage of it. If you just need it for your narrow use case, then indeed it might be worthwile to make your own. To the end it is all about ‘make or buy’, or how much time you can affort to ‘re-invent the wheel’. On the other side: while building a wheel I can learn a lot of things I was not aware of before 🙂
LikeLike
Hi Erich,
I start to use the KL25Z and I want to know how can I create my own package for Processor Expert. I have several libs that I created with another projects that I use microcontrollers, ex: Zilog, and now I want to work with ARM technology. I want to port the codes for KL25Z by Processor Expert because I don’t want to continue import several files .C and .H all the times that I’ll need to create I new project.
Thanks.
LikeLike
Hi André,
you can create your own package/components with the CDE (Component Development Environment) of Processor Expert. I have published a tutorial as an example how to do this here: https://mcuoneclipse.com/2013/03/31/tutorial-creating-a-processor-expert-component-for-an-accelerometer/
LikeLike
Erich, I need a 16-bit x 600 Hz data logger in order to sleep-relevant movement data from an accelerometer mounted near the sleeper’s head. It seems like would be quite easy for an EE (I am a psychologist) and may already have been done. If you are aware of such a device built for Arduino or similar platform, I would be grateful to hear about it. Thanks, Steve
LikeLike
Hi Steven,
yes, this should be vey well doable. That would make about 1.2 KByte of data per second to be written to an SD card like in this post:
LikeLike
Hi Erich,
Great blog!
I am using CodeWarrior for MCU 10.2 (Eclipse based).
Suddenly today I cannot open all my Processor Expert based projects I did in the last months.
I get the following error: “Could not initialize class com.processorexpert.configuration.PEConfiguration”.
Do you know what error is it and how to fix it?
Thanks.
LikeLike
Hi Alessandro,
hard to say, but here are a few things to check:
– create a new workspace, copy your project into that workspace, and then import it. If the problem goes away, then it could be a corrupted .metadatfolder
– maybe the ProcessorExpert.pe (XML) file is corrupted? Are you using a version control system? If you are not using it properly, things might have merged into that XML file rendering it with wrong information. You can open the Processor Expert.pe file with a text editor to see if there is anything wrong in it.
I hope this helps.
LikeLike
Hello Erich,
I like your site very much and it helps me to extend the knowledge on Eclipse CW. Thanks for this!
I have an issue (I guess you might have it as well) since I added http://www.eclipse.org/mpc/ Marketplace Client I encounter the problems to start Eclipse correctly.
There are error dialogs
1. Cannot initialize Drop
2. An SWT error has occured
than I ignore them I continue working but I think this is not correct behaviour I am using Eclipse CW 10.4 on Windows 7.
Do you use MPC Marketplace Client within your Eclipse?
Thank you!
Best regards,
Peter
LikeLike
Hi Peter,
no, I have not added teh MPC Marketplace Client. I had that considered a while back, but I was able to get and install my plugins without it. It might be that the client is not compatible somehow with the Eclipose version used? That sounds odd.
LikeLike
I understand, I just wanted to include eCalculator & Color theme plugins that’s way I have MPC.
LikeLike
Hi Erich,
Can please help me figure out how can i change MK40n512 controller Endian to BIG. I want to store the data comping from the buffer of UART in msb first format.
i seached everywhere …. some MQX logics are given but they didn’t help.
Can u please help me figure out how i can change Endian of my controller for Bareboard project.
IDE : Code warrior v10.3
Controller: MK40n512 Freescale
Regards,
Swapnil Katre
LikeLike
Hello,
you cannot change the controller to Big Endian. Freescale made the decision not to offer this. So if you need LE/BE in your software, then you need to do this on the application level, and you cannot do this on the hardware level.
LikeLike
Thanks for reply. you mean i can change it at complier level or i have to write a code to change LE/BE.
if i can select any option like a RTOS setting or in PE setting before built? do you know where can i do that?
LikeLike
No, you cannot change it at the compiler level (this would not make any sense, as the hardware is defining it).
Same thing on PE or RTOS level: the interpretation of bit ordering is up to the application, and it needs to match the hardware, or you need to convert it on the application level. See https://mcuoneclipse.com/2012/02/19/a-little-or-big-indian-a-plea-for-peace/
LikeLike
ok.
can i do some setting at driver level like in RTOS bsp where though the controller is LE but what we receive at API level would be BE.
have you done such similar thing with FreeRtos.
the reason i need to change this each time when i receive a 125 byte array through UART, i have to LE to BE conversion before storing in memory. which is reducing my speed due to conversion time.:-(
LikeLike
I have done similar things with an IEEE802.15.4 driver where I needed to care about LE/BE. As for your UART example, you need to perform this conversion in software inside your driver, there is probably no way around it. If you are concerned about the speed, consider to write the conversion in inline assembly.
I hope this helps.
LikeLike
thanks, i have implemented the same and it worked.
I think that is the only way to do it. 🙂
LikeLike
HI Erich
Is it possible to load and edit a component from https://mcuoneclipse.com/2013/05/20/how-to-use-mcuoneclipse-github-without-git/?
As I would like to import a component project so I can look through it to get a better understanding of how it was constructed and also look through the code used etc.
I tried the following File->Import->Import Component/Interface then I browsed for the following file “mcuoneclipse-master\mcuoneclipse-master\Beans\RingBufferUInt8\RingBufferUInt8.bean” and opened it to view the ring buffer project. But nothing is displayed.
LikeLike
Hi Andy,
yes. The *.PEupd files are kind of package/zip file, and it extracts the file into your Processor Expert component folder (check C:\ProgramData\Processor Expert\CWMCU_PE5_00, see https://mcuoneclipse.com/2012/06/30/cde-hacking-where-is-my-stuff-a-dissection/ for details.
LikeLike
Hello Erich,
thank you for great work that you have done.
I have a problem with SPI module, i want to communicate two kl25z boards with spi and I tried examples in “typical usages” in “help on component” for master and slave, but those examples doesn’t work.
p.s. I thing that I want to mention is that receive interrupt is triggering but I can’t read the data received.
LikeLike
Hello,
I suggest that you use a logic analyzer to see if the signals are working properly, just to be sure. Not sure which components you are using, but I would use the SynchroMaster and SynchroSerial.
I used it only so far to communicate with SPI devices, but not with another KL25Z.
And I suggest that you try things first without interrupts: this is typically simpler to start with.
LikeLike
Hi Erich, thank you for your reply.
I used SynchroMaster and SynchroSlave as you suggested, but still I’m not able to set communication between master and slave.
My master configure is:
Channel : SPI0
Interrupt service/event : Disabled
Width: 8 bits
InputPin: PTC7
OutputPin: PTC6
ClockPin: PTC5
Slave select pin: enabled
PIN: PTC4
Direction : output
ActiveLevel: Low
ClockEdge: rising or falling edge
ShiftClockRate : 374.491429 kHz
Empty character: 0
Ignore empty char: no
Send MSB first: no
Shift clock idle polarity: Low
Enabled in init. code: yes
My master code is:
byte ch;
byte err;
SM1_Init();
do {
SM2_SendChar(0); // Send zero
word chrx = 0;
while(chrx == 0){
chrx = SM2_GetCharsInRxBuf();};
// Get received char
err = SM2_RecvChar(&ch);
/* Do until it receives char with code 13 */
} while ( (err != ERR_OK) || (ch != 13) );
My slave configuration is:
Channel : SPI0
Interrupt service/event: Disabled
Width: 8 bits
InputPin: PTC6
OutputPin: PTC7
ClockPin: PTC5
Slave select pin: enabled
Pin: PTC4
ClockEdge: rising or falling edge
EmptyCharacter: 0
Ignore empty char: no
Send MSB first: no
Shift clock idle polarity: Low
Enabled in init. code: yes
My slave code is:
SS1_Init();
for (;;) {
word chinrx = 0;
//Wait for a character
while (chinrx == 0)
{
chinrx = SS1_GetCharsInRxBuf();
};
// Get received character
err = SS1_RecvChar(&ch);
if ((err == ERR_OK) || (err == ERR_OVERRUN)) {
// Prepare a character for transmision
SS1_SendChar(ch);
}
}
sometimes chinrx gets value 1 but ch gets value ‘ÿ’ . Why?
And do you think that communication is established?
p.s. if you have any example of communication between kl25z and flash memory (extern), help me, because I have that goal too.
LikeLike
Hi Peace World,
Unfortunately, your settings do not help me to find the problem. You really need a logic analyzer to inspect the signals generated to know what is going on. I hope you have this, otherwise dealing with things like this is really, really hard.
>>sometimes chinrx gets value 1 but ch gets value ‘ÿ’ . Why?
Cast that type to ‘unsigned’, as the debugger seems to interpretate it with a different type. Or inspect it as hexadecimal (see https://mcuoneclipse.com/2012/10/01/debugging-variables-in-hexadecimal-with-eclipse/).
>>And do you think that communication is established?
You need to check this with a logic analyzer.
>>p.s. if you have any example of communication between kl25z and flash memory (extern), help me, because I have that goal too.
Yes, I do, I2C to 24AA EEPROM.
LikeLike
I changed format of ch to hexadecimal and it has value 0xff.
For flash issue, I flash spi based.
So, do you have any spi project , if you have please post it.
Thank you
LikeLike
*For flash issue, I have only flash spi based.
LikeLike
Hi,
I only have a project on an S08 which is using the AT25HP512. For this one there is component availble on GitHub.
I hope this helps.
LikeLike
Hi Erich,
Now I’m able to communicate with two kl25, but now I want to communicate with flash memory (spi based). I wrote the code for it, and when I check MOSI with oscilloscop it seems that it isn’t sending all bytes, and it is sending only three bytes.
Do you have any idea why ?
The code i’m using:
void flash_write_byte(unsigned int address, byte data){
//write enable instruction
SM1_SendChar(0x06);
SM1_SendChar(0x02); // write byte
WAIT2_Waitus(1);
flash_set_address(address); // write address
SM1_SendChar(data); // send data
}
void flash_set_address(unsigned int addr){
// send 24 bits of address
int i = 0;
for(i = 2; i> -1; i–)
{
SM1_SendChar( (addr >> (8*i)) & 0xff );
}
}
When I call flash_write_byte, it sends only 0x06, 0x02, and data, not the address.
LikeLike
SPI is ‘communicating by shift register’. So if you shift-out (write) something, you need to shift-in (read) too. I’m using the following method:
static uint8_t SPI_WriteRead(uint8_t val) {
uint8_t ch;
while (SM1_GetCharsInTxBuf()!=0) {} /* wait until tx is empty */
while (SM1_SendChar(val)!=ERR_OK) {} /* send character */
while (SM1_GetCharsInTxBuf()!=0) {} /* wait until data has been sent */
while (SM1_GetCharsInRxBuf()==0) {} /* wait until we receive data */
while (SM1_RecvChar(&ch)!=ERR_OK) {} /* get data */
return ch;
}
I suggest the same for you. For reading (and writing) simply pass the value. For just reading simply pass a dummy value (0x00 or 0xFF). If you are not interested in the shifted in value, simply ignore the return value.
I hope this helps.
LikeLike
Hi Erich,
I tried that code as you suggested, and now it seems that bytes are sending correctly but the slave is returning only 0xff all time, even when I send dummy byte (0x00 or 0xff).
Here is what logic analyzer shows:
https://docs.google.com/file/d/0B49fhAdW4O1vQ3E3MDlFLUNZTTA/edit?usp=sharing
LikeLike
This either your MISO wire has a problem, or the device is not configured properly?
LikeLike
Oh, something else: carefully check the device SPI settings, e.g. at which clock phase the bits needs to be shifted in, and what’s the clock idle level.
LikeLike
Hi Erich,
I’m sorry that I’m troubling you with so many questions :S
I checked the wire and it was an error in that and I fixed it.
So, now I’m receiving only 0xff or 0x00.
Like here:
https://docs.google.com/file/d/0B49fhAdW4O1vc0I1bld6NTkwTkU/edit?usp=sharing
https://docs.google.com/file/d/0B49fhAdW4O1vUjEtYW1oV0xPbEE/edit?usp=sharing
Do you think that CS (Enable) is right ?
LikeLike
Your MISO line indeed looks strange. And I cannot tell if CS is correct or not: you need to check the device manual if it is low active or high active. You are using it as low active signal.
LikeLike
CS is active low, but I thought is it correct CS signal width ?
And do you think that maladjustment of voltages could cause that MISO bad signal ?
LikeLike
Well, if you have different voltage levels (e.g. your device is not a 3.3V one), then for sure you have a problem.
LikeLike
I’m sorry for too many questions, but I need to do this to work.
I tried with ATMEGA328 and it worked, but when I measured the output voltage of atmega, it was 4.11 V, but when I measured kl25z output voltage it seems that it is 2.94V .
Well, my device says that all accept entries are between -0.6 to 4.1 V .
Do you see any error ?
LikeLike
The normal logic level for FRDM-KL25Z is 3.3V. You say your device ‘accepts’ up ot 4.1V. You need to distinguish between input and output voltage, and check where the threshold values are.Your device needs to be 3.3V tolerant, and needs to provide 3.3V signal levels. Best if you measure the voltage level of the MISO signal: it shall be between 0 and 3.3V.
LikeLike
Well, now I supplied my device (flash memory) with P3V3 from kl25, and MISO is only 0xff (wires are fine connected) with voltage 2.8V .
what do you think that is going wrong ?
LikeLike
Sorry, I do not have that FLASH device, so I cannot try it out mayself. What I suggest is to carefully check and verify the communication protocol if it matches the specification of the device. Check especially the SPI settings (at which clock edge things are shifted, what is the level of the idle clock signal). And as well the speed of the SPI. It might be better to start with say 100 kHz clock before going faster.
LikeLike
I think that I configured those settings (about clock polarity, clock idle signal etc.), but I don’t know where is the problem.
here is my flash memory
http://www.datasheet4u.net/datasheet/A/T/2/AT25F512B_ATMELCorporation.pdf.html
LikeLike
Hi Erich,
do you still any idea or not ?
Did you read datasheet of the memory ?
LikeLike
I had a look at the data sheet. But witout having actually the device and having it hooked up with a logic analyzer, it is nearly impossible to help you on this one.
LikeLike
p.s. I tried to connect kl25z with arduino, via spi and same code, and it worked. But still it’s not working with flash memory :S
LikeLike
Hi,
I appologize, but I think I cannot help you with your problem, as I would need physical access to a device, having it on my bench. And it would take time to do this as well. Not much I can offer you here, except carefully checking the settings, carefully comparing the data sheet with the logic analyzer output, and a lot of debugging 😦
LikeLike
Ok Erich, I’m sorry for I troubled you.
And I’m very thankful to you for your helps and suggestions.
LikeLike
Erich, I just want to tell you that I fixed that connection, and now it’s working perfectly. The problem was that CS should be low during reading data, but Synchro set it high, I just get an BitIO and now it’s working well.
Thank you for helps
LikeLike
Congratulations, that’s good to hear. Solving this kind of problem is painful, and it happens to me many times too. Keep coding 😉
LikeLike
Hi Erich, I need your suggestion, as you teach in university i think u can help me.
I am doing my masters in “Embedded system and VLSI design” also working full time((:|). i have to give three topics to be selected by my faculty as my Post Graduation thesis. i wanted to use kinetics from freescale and do some project.
Can you suggest me few topics….as from your Blogs, your work is almost similar to mine… and i think we are in same shoe but you little ahead of me…
please help me….
LikeLike
Hi,
that’s a good and hard question. I think you need to come up with something which is in your interest, but out of your knowledge. I can tell you what one of my master students is researching starting next semester: IoT (Internet of Things): it is about how to enable ‘common’ things with networking capabilites and get it ‘accessible from the cloud’. A lot of problems to solve there: communication protocols, low power aspects, network topology, routing messages, how and where to store data, security, ….
LikeLike
Thanks Erich, you really gave me think food….suggested field is in my area of interest, let me search more before concluding….
LikeLike
Hey Erich,
have you any time worked on Over the air Firmware up gradation for KL25Z?
i have a bareboard project working with GPRS/GSM module. can i use the GPRS net to go a firmware update?
LikeLike
There is nothing which would prevent you to do a firmware upgrade over GPRS. It is not different from any kind of firmware upgrade e.g. with USB or RS-232. You get the new data and you flash it to your device. Of course with the needed precaution (checksums, failure recoverey, etc).
LikeLike
Hi Erich.
I have successfully implemented some of your Brilliant Processor expert USB packages.
I have updated my USB framework recently and your packages in hope of more functionality but there are compile errors with the USB_Framework.c.
How can I contact you to try debug the issue as I am not sure where to start looking?
LikeLike
Hi Rory,
you find my email address in the About page of this blog.
LikeLike
Hello Erich,
Thank you for this awesome blog.
After reading your post “DIY Free Toolchain for Kinetis”
as was able to setup Eclipse and compile code for Freedom board.
I was wondering now how to compile code for K60, K70 and also
compile MQX on this DIY toolchain.
Any post on how to modify make files?
Thank you.
LikeLike
I have not run it yet on K60/K70, but basically you need to change the CPU option from M0+ to M4, and adopt the memory map.
If you are using Eclipse, then there is no need to modify the make files, as ‘managed make’ in Eclipse takes care about this.
Otherwise, if you want to use make files, I have a post about that subject:
LikeLike
Eric,
I appreciate your work and look at your blog often. Thanks much.
I thought I could easily add a 24AA256 serial EEPROM to the FRDM-KL25Z board, but this proved not to be so. I decided to use the I2C1 channel. Installing the 24XX_EEPROM component also installs a I2C component. There is a Test function which I thought would be a good way to test the quickly test the functions and wiring. Only by selecting I2C1 to function as a slave would allow the Processor Expert, SendStop() and the test function to be compiled without errors. Timing was selected per your tutorial, Missing Repeated Start Condition”. The result is that there is no output at all from the I2C1_SDA or the I2C1_SCL pins. I note there is conditional compile code regarding SendStop() within the source code. Any idea on what could be wrong or if there is any example I could look at? A dedicated example would make the setup quick and easy.
LikeLike
Hi John,
good timing, I’m right now using the 24AA EEPROM component for a KL25Z project (I have not used it yet for Kinetis), and I’m making some adjustments. If I find time tonight, I’ll post a short article along with an example project for the FRDM-KL25Z. I hope this will help you.
LikeLike
Hi John,
I have commited an example project on GitHub (https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples).
I had to make many changes to have it working for Kinetis (I was using that component so far with an S08). So if you want to try out the example, then you need to update the components from GitHub too. I have not exported them as *.PEupd files yet, as still working on some details.
LikeLike
Updated components and example today. No selection of parameters compiles correctly. Will await your short article as it’s unclear how to set up the components for master, slave and correct channels. The EE241:24AA_EEPROM requires a different connection than the default of GI2C1 which creates another IC22:Internal2C component. Is this one generated suppose to be set up as the slave and the other the master?
LikeLike
Hi John,
did you update the components from the component sources (not *.PEupd)? You should have it updated from the sources. The microcontroller is the I2C master, and the EEPROM is the slave. GenericI2C is just a wrapper and simplifies interaction with the I2C LDD driver, so the relationship is 24AA_EEProm -> GenericI2C -> I2C_LDD.
LikeLike
HI Erich,
have you ever worked on 128 x 64 pixel graphical LCD, like JHD12864E commonly used LCD?Do we have any generic Embedded Component for the same…like LCDC_LDD component?
if so please guide me locate it….
LikeLike
I’m using several different graphical LCD displays, but I have not used that JHD12864E one. It seems similar to Hitachi (https://mcuoneclipse.com/2012/12/22/hd44780-2×16-character-display-for-kinetis-and-freedom-board/) ones, but just having graphics instead of character displays. The good things I have the graphic libraries (see https://mcuoneclipse.com/2012/12/16/zero-cost-84×48-graphical-lcd-for-the-freedom-board/), but I have not developed a low level driver for the JHD12864E. That low level driver should not be too much work.
LikeLike
ok no problem… i am working on the interface part… once i figure out, i will post it … let see if we can make a Embedded component for it….
this GLCD is same as Hitachi but we have here 128×64 pixel….hope i can use ur 2×16 character LCD component to interface it.
LikeLike
Hi I got an error and do not know what to do. I have the same error on every project.Not even 3 lines of code do not work, the LED lights and then stays on instead of off. Sorry for expression
,,Invalid project path: Include path not found (E:\FRDM\k20d50m_sc_baremetal\pwm_led\cw\Project_Headers).pwm_led pathentry Path Entry Problem
LikeLike
Hello,
maybe you have a patch/double quote problem in your settings, see https://mcuoneclipse.com/2013/03/09/the-quotation-problem/
Otherwise carefully check your compiler include path settings, maybe you have unbalanced quotes or parenthesis?
LikeLike
Hi Erich,
Thank you for sharing your brilliant expertise. I learn a lot from your blog and example code.
I want to use bluetooth dongle with KL46Z board. Is it possible and worth effort? Do you have any suggestion on how to start with?
When I try to compile freertos examples, I get error about missing RTOSTICKLDD1.h . I tried very very hard to find answer from your blog or google. I followed DIY tool chain. RTOS LDD Tick always is disabled and unchangeable.
It would be appriciated if I can get any feedback.
Warm regards, James
LikeLike
Hi James,
Thanks for your feedback, it is always encouraging if things are useful :-).
About Bluetooth: not sure what you mean with ‘Dongle’, but I’m using several bluetooth modules with the FRDM-KL25Z, and the same would work with the FRDM-KL46Z board (https://mcuoneclipse.com/2013/08/30/optimized-freertos-stack-check-and-systick-for-arm-cortex-cores/) (https://mcuoneclipse.com/2013/06/19/using-the-hc-06-bluetooth-module/).
About the RTOSTICKLDD1.h: that might be undesired side effect of my most recent change (https://mcuoneclipse.com/2013/08/30/optimized-freertos-stack-check-and-systick-for-arm-cortex-cores/)? Are you using that new component? I have to admit that right now I’m chasing a bug with my change about wrong tick timer prescaler :-(. If you are using the new component, then select ‘SysTick’ to ‘no’ (as explained in that recent blog post).
I hope this helps
LikeLike
Hi James,
if the error about missing RTOSTICKLDD1.h is in ProcessorExpert.c or Events.c/Events.h: somehow Processor Expert seems not to remove non-generated header files from the list of includes. In that case, simply remove the include. Looks like I need to remove it on my end in the examples too so users do not run into this problem.
LikeLike
Howdy, first off, thanks for all the awesome code base & documentation you have done for the kinetis processors! Much appreciated!
Been looking on your github and noticed a MSD example for the KL25 freedom board. Only problem is, you can’t load it on the free version of code warrior since its over 64kb. Any chance it would be possible for you to make a demo project under 64kb with fatfs,freertos, & USB MSD or is that simply not realistic? Been attempting to do so myself but i’m abit new to the code warrior..ect. Any consideration would be appreciated!
LikeLike
Already bogged my first post. After doing some more reading I realized your examples were for USB MSD host. My request would be for a USB MSD Slave. Granted, it would be a very tiny space that one could write to but it would be a very end-user friendly for setting up configurations…ect.
LikeLike
Hi Nathan,
so you ask for USB MSD Device support. I have not completed this for Kinetis, but I’m using this for a bootloader on JM128 (https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples).
Definitely something on my ‘bucket list’ I think to do for ARM.
LikeLike
Hi Nathan,
if you want a free and unlimited tool chain, then this might be of interest for you:
Some work required, but very doable.
As for the MSD Host example code size: Typically my projects on GitHub are compiled without optimizations. GNU gcc does not generate good code without optimizations, but it makes it easier to debug:
text data bss dec hex filename
75368 44 14356 89768 15ea8 Freedom_USBHostMSD.elf
I tried -Os (Optimize for size) compiler optimization, and it is down to:
text data bss dec hex filename
41024 44 14356 55424 d880 Freedom_USBHostMSD.elf
Additionally, you can use the CodeWarrior debugger to download the S19 file: this is not limited neither.
LikeLike
Hey Erich,
Thanks for your replies! I will certainly try that as well as your tool chain series. I’ve also been looking into KL25 USB MSD Device and it looks like the freescale USB stack gets you quite close. They have an example for it here “Freescale USB Stack v4.1.1\ProcessorExpert\Examples\Device\MSD\USB_MSD_DEVICE_MKL25Z128_PEx” . They use ~1kb of ram for mass storage capacity and the device does indeed enumerate. However, windows asks immediately to format disk. Regrettably, my W7 machine was not able to format it. I’m not sure if 1kb is simply to small for a fat(12,16..) file system or if the code didn’t compile correctly or is missing necessary functionality. Any ideas would be greatly appreciated!
LikeLike
I have not checked that example, but I doubt it implements a file system? 1 KByte would be indeed challenging as typically a Fat block is 512 bytes, and you need one for the root block already :-(. I think 1 KByte is simply not enough for this approach.
LikeLike
Hi Erich,
I am trying to figure out the LCD function on the KL46Z without the use of RTOS. I’ve copied the LCD folder into the Sources folder of my project and if I comment out the line that reads:
UTIL1_Num16uToStrFormated(lcdBuf, sizeof(lcdBuf), cntr, ‘0’, 4);
I can get the program to run and can write to the LCD with:
vfnLCD_Write_Msg(“3456”);
However, I haven’t figured out how to write a variable such as “cntr” which is used in the program.
I gather the line I commented out puts the value of cntr into lcdBuf, but I get an error when I try to build with that line active:
Undefined reference to ‘UTIL1_Num16uToStrFormated’
I have been unable to find where that function/method/variable is defined in your program.
What am I missing, please?
Thank you.
LikeLike
PS I am using your KL46Z magnetometer demo program as my starting point.
LikeLike
Hi Injun,
I’m looking into it right now…..
Erich
LikeLike
Hi Injun,
UTIL1_Num16uToStrFormated() is defined in the Utility Processor Expert component. You need this one in your project.
I hope this helps.
LikeLike
Yep. That is what I needed. Thank you for your help.
LikeLike
Hi Erich,
In order to do the “internet of things” you need connectivity. The FRDM boards are Arduino form factor compliant so you can use the Ethernet shields with the Wiznet chip. The Wiznet W5100 and soon to be W5500 include a processor, MAC, and PHY on a sinle chip for under $5. You get a TCP/IP coprocessor that supports up to 4 sockets (8 with the W5500), a simple SPI interface, and the ability to use FRDM boards with small FLASH sizes. Have you looked into a PE component for this interface? There is already a lot of open source code that might make the project easy ;-). Thanks
LikeLike
Yes, I have such a W5100 Arduino board on my desk for months, and it always looks at me and says “work with me!” ;-). But I have been burried so much in the last months with different work items that I never had a chance to use it. Yes, I think it would not be difficult, but it will be some work for sure.
LikeLike
Would like to know how to eliminate the passing of the null parameter to set or clear bits using Bitio_ldd as you alluded to in one of your posts. Thanks for writing these excellent articles.
LikeLike
Hi Jeff,
thanks for your feedback. And thanks for your request, as you are the first one taking that offer :-).
I’m very busy until the week-end, but let me see if I can post what I had in my mind when I wrote that article a while back 😉
LikeLike
Hi Jeff,
actually, I learned after that original post that the parameter shall not be NULL, but the device handle returned by the Init() function.
I have updated the original post (https://mcuoneclipse.com/2012/11/12/tutorial-bits-and-pins-with-kinetis/) to reflect this.
And as for your request: I have posted the follow-up article with an optimized version using macros:
LikeLike
Hi Erich!
First, I would congrats for ur website and ur project with Zumobot.
Second, I am also interest on start to work with it, but I am mainly specialized on software, rather than hardware, especially with computer vision…let me explain to u a bit better my idea. I want connect a low-res cam (QVGA shoud be enough) to zumobot then send data via wifi to a pc that compute it (OpenCV) and send back a command…or…us a webserver to see the data collect from the camera then send back a command to the robot.
Do u think it is possible do it with the default shield and arduino One or Leonardo board? if not, with the Freescale board?
Thanks in advance for ur answer and excuse me for my bad english.
Best regards,
AB
LikeLike
Hello,
First: thanks :-).
Second: Yes, that should be possible. The only concern is that you only could send pictures, but probably not a video stream. However, I would use a different approach: using a local second processor on the robot to perform the OpenCV calculation. Then you do not need to send things off the robot.
LikeLike
That’s great! I was a bit worried about computational coast for image elaboration, but a second proc could be the solution…but now i’m wondering about energy consumption 😀 but maybe without IR arrays, ultrasonic and other sensors it is feasible…
If u will be interesting in a project like that please let me know, we could keep in contact by e-mail 😉
PS
Anyway I think a video streaming by wifi could be also interesting with a proper app for iOS or Android.
LikeLike
Hi Erich,
how r u?
i was working with KL25Z and came across a error “No source available for “__aeabi_f2iz (0x000009DC)() ” ” while debuging a line dvar = data * (-1);
where long llvar; long dvar; and data have -5 as value.
can you please help me figure out the problem.
LikeLike
Hello,
this is a routine implemented in the EABI library. As far as I can see, the ARM gcc distribution does not contain the source file for it, only the library file.
LikeLike
Thanks Erich,
i converted the float in integer to work on it. basically i just wanted to convert the float to string now it is possible.
LikeLike
Hi Erich,
I want to work a project with ethernet module, so I need to send/receive some data with ethernet .
Can I do this with kl25 ?
If yes, how ?
Thanks for your work 🙂
LikeLike
The KL25 does not have an onchip ethernet module, so you need an external one. Something like the Wiznet 5100 (http://arduino.cc/en/Main/ArduinoEthernetShield).
LikeLike
Erich
I am moving a bare-metal K20 project over to a KL05. So I am interested in the similarities and differences between the K’s and the L’s, at the register level. That would make a good topic for an article.
LikeLike
Do you have or can you make an HCI Bluetooth Stack for a CC2564 ??
I use the PAN1326 (BT + BTLE) module.
I tryied using the BTStack from google code (https://code.google.com/p/btstack/) to transferred to FreeScale MKL25.
If I succeed, I’ll pass you to see if you can compact in a BEAN.
Thank you for your magnificent collaboration with this web.
LikeLike
Hi Sergi,
no, I do not have this. So if you could work on this and contribute it back, I think many will benefit from that. Looking forwared to the outcome :-).
LikeLike
Hi!!! I would like to see examples with my Kinetics TWR-K20D72M. Is it possible to adapte your examples in my development kit??
What do you suggest me??
Thanks a lot
Regards
LikeLike
Hi Luis,
as the projects are made with Processor Expert, they are easily portable to any other board or platform. I already have folder for the TWR-K20D72M on GitHub.
LikeLike
Hi Erich!!! Do you remember what was the folder’s name?
Thanks!!
LikeLike
sure: it is here:
https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/TWR-K20D72M
LikeLike
Don’t worry I found it!!!
Thanks a lot Erich!!!
LikeLike
Hi again Erich!!!
I hope you’re very well
Can you show me how can traslade your PWM example to my TWR-K20D72M please??
Thanks!
LikeLike
Hi Luis,
could you be more specific (which PWM example)? On the other side: as I’m using mostly Processor Expert, the examples apply to all other microcontrollers: only the pin names are different.
LikeLike
Hi Erich!!
I was talking about your Tutorial: PWM with Processor Expert
LikeLike
Hi Luis,
that tutorial should be applicable to other (ARM) processor too.
LikeLike
Hey Erich,
First off, I want to thank you so much for all that you have done on this site. Your work here is the reason we chose to use the K20DX50 board and K20DX72 chip for a project that we are currently working on. Speaking of, that brings me to my next point…
I am attempting to talk to an AD7194 ADC using SPI and the K20DX50 development board. However, I am having some trouble getting started with the SPI interface. I have followed a few guides that you have already posted but I haven’t been able to get a firm grasp on the basics of the SPI interface. Is there any way you could post a tutorial on getting started with SPI?
Thanks again for all your hard work.
LikeLike
Hi Sam,
thanks for that feedback :-).
I agree: SPI deserves a tutorial. Need to see when I can find time for this (I have been very busy lately).
You might have a look at these articles and example codes as they are using SPI components:
The fundamental concept behind SPI is that it is using two shift registers (one shifting in, one shifting out) with a clock. Typically I have the following three routines:
– SPIReadWrite(): shifts out and reads the shifted in value
– SPIWrite(): shifts out, and discards the shifted in value
– SPIRead(): shifts out a dummy value and reads the shifted in value
I hope this helps as a starter.
LikeLike
Hi erich, I’m back 🙂
I have a timer component, and a wait component, when I call waitms the timer interrupt doesn’t fire, why?
LikeLike
welcome back 🙂
Are you saying that without the Wait component, the interrupt works?
The Wait component does not use/need any interrupts. So if your timer component does not fire: have you interrupts enabled, and is the timer (interrupt) enabled too?
LikeLike
Hi Eric!! Do you know is possible use your LCDHTA library in this generic LCD:
Click to access NHD-0440WH-ATFH-JT.pdf
How can I adapt your LCD library for 40 caracters X 4 lines in my TWR-K70???
Thanks!!
LikeLike
Specially if I want to enable 4 lines instead 2!!
Regards
LikeLike
Hi Luis,
It looks like the Hitachi command set is used. I have implemented a 4 lines mode (see https://mcuoneclipse.com/2013/05/29/character-lcd-with-4-lines/). But the display you refer to is using an additional signal (E2) to switch between the lines, and I do not have this implemented. It should not be too complicated, but testing it without a real display in hand could be complicated.
LikeLike
Hi Eric!!
Thanks a lot for answer me….
I was seeing your link: https://mcuoneclipse.com/2013/05/29/character-lcd-with-4-lines/). But I don´t understand where dou you put the other 2 comands to enable 4 lines in the LCD. I went to the other link: https://github.com/ErichStyger/McuOnEclipse_PEx
to try to find out a updated LCDHTA library (included 4 lines) but there are many codes…… Also I didn´t see a file.PEupd to download it……..
Can you tell what code is it??
Regards
LikeLike
Hi Luis,
There are ‘combined’ *.PEupd files on GitHub, see https://mcuoneclipse.com/2013/05/09/processor-expert-component-peupd-files-on-github/
LikeLike
Hi Luis,
the driver code is here:
https://github.com/ErichStyger/mcuoneclipse/blob/master/Drivers/sw/LCDHTA.drv
Search for
%LCD_Nof_Lines
and you can see how the different lines are handled.
LikeLike
Hi Eric!!! Thank you again!!!
I was using your updated LCDTHA (from github), everything was good, but I have a new problem…..
1. I want my LCD shows: “Hola”, but when I debugged my program, it showed me: “Hl” “oa” “lH”
somethings like that but not “Hola” (completely), my code in Processor Expert is:
/* Write your code here */
/* For example: for(;;) { } */
LCD1_Clear();
for (;;) {
LCD1_WriteLineStr(1, “Hola”);
WAIT1_Waitms(500);
}
What is the problem???
I´m using TWR70KF120
Regards!!
LikeLike
Hi Luis,
are you using the ‘read’ pin of the LCD (if available?).
It could be that your display is too slow. Can you increase the Wait time (in the properties: Wait (us)) to a high value, say several hundreds of microseconds) to see if this helps?
LikeLike
as another idea: could you use Write() to write a few single characters and wait between it?
Like
LCD1_Write(‘h’); WAIT1_Waitms(10);
LCD1_Write(‘o’); WAIT1_Waitms(10);
LCD1_Write(‘l’); WAIT1_Waitms(10);
LCD1_Write(‘a’); WAIT1_Waitms(10);
?
LikeLike
Hi Eric!!!
Thanks again!
My LCD has R/W pin (ground). I used the LCD1_Write() it was ok (out of for(;;)). But when I use
LCD1_WriteString(); or LCD1_WriteLineStr() the string “hola” appears incompleted for example:
hla
oa
hl
Other strings like: LUIS, JORGE,DANIELA, apear:
Lus, Jog, DNEA , etc
What happen??
Is possible to fix something in your library??
Thanks!!!
LikeLike
Hi Luis,
what do you mean with R/W pin (ground)? You have connected it to ground and not to the microcontroller?
LikeLike
Hi Eric!!
Yeah!! The R/W (Read/Write) pin is connected it to ground, because I need write in my LCD (show the characters).
LikeLike
well, that would be wrong? Because you need to read the busy flag from the LCD, otherwise it is possible to write too fast to LCD. I think this is what is happening in your case: you write the data too fast. You need to use the R/W pin to avoid this. If you cannot change your hardware. Otherwise: set a wait value in the LCD component properties.
Have a look at https://mcuoneclipse.com/2012/12/22/hd44780-2×16-character-display-for-kinetis-and-freedom-board/
LikeLike
Hi Eric!
I’m new!
I’m working on a project, in wich I need to handle an LCD, intercommunicate 2 Kinetis, mine is a K70 and my friend’s is a K20, I’m thinking to use i2c to connect them, also I need to use ethernet protocol and a memory, It’s very important cause is part of my job’s projects and we will use Kinetis to make the control for a machine. I don’t know if you have code examples about ethernet, and how to handle a memory like a SD-Card. Also I need to use a keyboard and interruptions, so it will be great to see examples of how to use them. I know it’s a lot of things but I have seen your blog and I have found a lot of help!
thanks!!! thank you very much!
LikeLike
Hi Daniela,
welcome! 🙂
I hope I can help you out or at least give you some pointers.
As a general hint: you might google e.g. “mcuoneclipse LCD” and you should get an idea 😉
LCD: I’m using different LCD types, for some I wrote articles about:
I2C: I did similar things to interconnect two boards. I wrote a generic I2C driver, and it features a command line shell. So I can ‘read/write’ using a shell to the other board too if I want:
Ethernet: I have not done much (I wish I would find time), so a gap here.
SD Card: here I use FatFS with many boards:
Have a look as well at the examples I have published on GitHub here:
https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples
I hope this helps (at least as a starter)?
LikeLike
Thank you so much!!! I’m going to read the information of the links and if I’ve any question I’ll let you know 🙂
LikeLike