Requests


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:

1,035 thoughts on “Requests

  1. 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?

    Like

      • 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.

        Like

        • 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?

          Like

  2. 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.

    Like

      • 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.

        Like

        • 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….

          Like

  3. 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).

    Like

    • 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.

      Like

      • 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.

        Like

        • 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.

          Like

  4. 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

    Like

    • 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.

      Like

  5. 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.

    Like

  6. 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!!

    Like

  7. 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.

    Like

  8. 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

    Like

  9. 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

    Like

    • 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.

      Like

      • 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 😉

        Like

  10. 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

    Like

    • 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.

      Like

  11. 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

    Like

  12. 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.

    Like

  13. 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!

    Like

  14. 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

    Like

  15. 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

    Like

      • 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.

        Like

        • 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.

          Like

  16. 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

    Like

  17. 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.

    Like

    • 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.

      Like

  18. 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).

    Like

  19. 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!

    Like

  20. 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

    Like

  21. 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.

    Like

  22. 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.

    Like

  23. 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?

    Like

  24. 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,

    Like

  25. 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?

    Like

  26. Hi Erich,
    It would be great if you could do some tutorials in using the ADC (single & differential mode), and the DAC.
    Thank You !

    Like

      • 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.

        Like

      • I have one project for the ADC in single mode for 3 channels. If you are intersted, this is my mail (julioefajardo@gmail.com)

        Like

  27. 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 !

    Like

  28. 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

    Like

    • 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?

      Like

  29. 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.

    Like

  30. 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 !

    Like

  31. 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

    Like

  32. 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?

    Like

    • 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.

      Like

      • 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.

        🙂

        Like

        • 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. 🙂

          Like

  33. 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.

    Like

  34. 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

    Like

  35. 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

    Like

      • 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.

        Like

  36. 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

    Like

  37. 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

    Like

    • 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+.

      Like

  38. 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.

    Like

  39. 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

    Like

      • 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.

        Like

  40. 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?

    Like

  41. 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

    Like

    • 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?

      Like

      • 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

        Like

  42. 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

    Like

  43. 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

    Like

  44. 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

    Like

  45. 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

    Like

  46. 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.

    Like

  47. 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

    Like

    • 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

      Like

      • 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

        Like

  48. 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

    Like

    • 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.

      Like

      • 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

        Like

  49. 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.

    Like

  50. 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 🙂

    Like

    • 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.

      Like

      • 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

        Like

  51. Hi,

    I would also be very interested a bootloader article, particularly the flash block memory swap application note.

    Thanks,
    Andy

    Like

    • 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?

      Like

  52. 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.

    Like

  53. 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!

    Like

    • 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/

      Like

  54. 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

    Like

    • 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!

      Like

      • 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.

        Like

  55. 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

    Like

    • 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 😉

      Like

  56. 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

    Like

    • 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?

      Like

  57. 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?

    Like

  58. 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.

    Like

  59. 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.

    Like

  60. 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

    Like

  61. 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! 😀

    Like

    • 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 🙂

      Like

  62. 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.

    Like

  63. 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

    Like

  64. 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.

    Like

    • 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.

      Like

  65. 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

    Like

    • 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.

      Like

  66. 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

    Like

    • 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.

      Like

      • 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?

        Like

      • 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.:-(

        Like

        • 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.

          Like

  67. 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.

    Like

  68. 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.

    Like

    • 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.

      Like

      • 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.

        Like

        • 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.

          Like

  69. 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

    Like

      • 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.

        Like

        • 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.

          Like

        • 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.

          Like

      • 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 ?

        Like

      • 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 ?

        Like

        • 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.

          Like

    • 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 ?

      Like

      • 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.

        Like

        • 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.

          Like

      • 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

        Like

        • 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 😦

          Like

      • 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

        Like

  70. 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….

    Like

    • 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, ….

      Like

  71. 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?

    Like

    • 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).

      Like

  72. 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?

    Like

  73. 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.

    Like

    • 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:

      Make my Make with Eclipse and MCU10

      Like

  74. 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.

    Like

    • 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.

      Like

      • 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?

        Like

        • 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.

          Like

  75. 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….

    Like

  76. 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

    Like

  77. 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

    Like

  78. 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!

    Like

    • 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.

      Like

    • Hi Nathan,
      if you want a free and unlimited tool chain, then this might be of interest for you:

      DIY Free Toolchain for Kinetis: Part 1 – GNU ARM Build Tools


      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.

      Like

      • 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!

        Like

        • 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.

          Like

  79. 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.

    Like

  80. 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

    Like

    • 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.

      Like

  81. 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.

    Like

  82. 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

    Like

    • 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.

      Like

      • 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.

        Like

  83. 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.

    Like

  84. 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 🙂

    Like

  85. 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.

    Like

  86. 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.

    Like

  87. 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

    Like

  88. 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.

    Like

  89. 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?

    Like

    • 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?

      Like

  90. 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

    Like

  91. 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!!!

    Like

  92. 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!

    Like

Leave a reply to BertOne Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.