This is a follow-up article of my earlier project presented in “FatFS, MinIni, Shell and FreeRTOS for the NXP K22FN512“. I wanted to extend it with a USB MSD (memory stick) device: The USB storage device gets automatically mounted, and depending on a configuration (.ini) file on the memory device I can perform various actions, for example automatically copy data from the SD card to the USB device. For example the system logs data, and to get the data I insert the memory stick, it copies the data on it and automatically unmounts it, and I can remove the memory stick.
I’m using the NXP Kinetis K22FN512 in many projects, either with the FRDM-K22F or on the tinyK22: with 120 MHz, 512 KByte FLASH and 128 KByte it has plenty of horsepower for many projects. The other positive thing is that it is supported by the NXP MCUXpresso IDE and SDK. I have now created an example which can be used as base for your own project, featuring FreeRTOS, FatFS, MinIni and a command line shell.
Breakout boards are great: they allow me to explore functions quickly, without to build my custom board: all what I need is some wires and ideally a bread board.
Major changes in this new release:
- FreeRTOS V9.0.0 with static memory allocation.
- Shell with single character I/O function.
- FatFS File System with extra shell commands for memory dump and file creation.
- Segger SystemViewer library updated to V2.36a
There is a new release of the McuOnEclipse components available on SourceForge, with the following main changes:
- Shell: Fixed and improved history handling.
- MinIni: Option to select local/stack or global memory for buffers
- FreeRTOS: Ability to use the tick counter instead of dedicated timer for performance measurement.
- FSL_USB_Stack: Added deinitialization for USB stack.
- FatFsMemSDHC: added custom card detection and write protection pin handling.
- Multiple Bug Fixes
I want to make some noise with this post!!! This tutorial is about adding music and sound capabilities to the Freescale Freedom board, and to have a lot of fun with it :-). I need this ability for a larger project working on for a while. But I thought I share that sub-part how to play sound files. So with this tutorial I can turn my Freescale Freedom board into a music or sound player :-). And adding sounds is a cool way for any project, and as the music is stored on an SD card it fits easily hours of music or sounds.
I have received several requests to post a quick note when there is a new release (16-Nov-2014) of the McuOnEclipse components on SourceForge (see “McuOnEclipse Releases on SourceForge“). I have published today a new release, and with following major improvements:
- USB support for Kinetis KL24Z
- FatFs now features the latest Elm-Chan v0.10c release
- Backspace support in Shell
- Configuration item in FreeRTOS for Percepio Trace Hooks
I admit: I’m sometimes a lazy person. In my projects, I only needed one ‘disk drive’ with the FatFS Processor Expert component: either a SD card or a USB MSD drive. But a reader of this blog wanted to use FatFS with multiple drives: using it with an SD card and a USB MSD drive. And actually FatFS does support this, I just had no need for it, thus I did not add anything special for it. But that reader let me think that I better add Multi-Drive support. Even if I do not need it now, that could be very handy in the future 🙂
The Freescale FRDM-K64F is a great board for data logger applications: it has a powerful ARM Cortex M4F with 120 MHz, 1 MB Flash and 256 KByte RAM. Best of all: it already has a micro SD card socket on the board :-).
I admit: my Ethernet Shield project got stuck because of too many urgent other priorities. I was not happy with the way the project was using configuration data from FLASH memory: I have now multiple ethernet shields in use, and configuring the IP address for each shield is a pain. I have not got DHCP working (yet), so why not using the SD card on the shield for configuration data? And right on time I received a tip from Marc about MinIni: perfect, exactly what I need!
Sometimes it takes a very long time to realize a project. Adding the Arduino Ethernet Shield R3 to one of my Freescale FRDM boards is one of it: it took me a year until I have found a few days to work on using the Ethernet Shield with my FRDM-KL25Z.
I have not everything in place yet, so I decided to publish things in parts. So this is about part one: using the Micro SD Card on the Shield.
Summer finally has arrived in Switzerland. Yes, I live in a moderate climate zone, but if the outside temperature goes above 28-30° Celsius as these days, then sleeping at night is not that comfortable as it should be in my view. Luckily, I’m in a good constructed house with good insulation, so it takes a few days until it heats up. But I love to keep the temperature below 25° Celsius, especially at night. I do have a heating system which combines geothermal and solar heating. The question is: how can I use it for cooling during hot summer days? The solution: some extra plumbing, a Freescale Tower system and the Freescale FRDM-KL25Z board 🙂
The Freedom boards FRDM-KL25Z RevE and FRDM-K20D50M make it easier to use it as USB Host device, as they come with a special jumper to provide 5V to the USB device, so my earlier ‘hack’ is not needed any more :-). After I had USB MSD Host working for the FRDM-KL25Z, it was much harder to get the USB stack working for the FRDM-K20D50M board, because somehow the example Freescale provided with their USB stack refused to work properly on my board. After debugging it for several nightly hours, I decided to take my working Processor Expert project for KL25Z and added support for the K20. And the good news is: since tonight this is working :-).
What was missing in the FatFsMemSDHC component presented here is support for a ‘write protection’ pin. Well, that write protection is not present on micro-SD cards, and on normal SD cards it is a simple plastic thing with no real hardware meaning: it is all up to the software to respect it. While my other SD card components have support for such a write protection detection, it was lacking for the FatFsMemSDHC (for Kinetis) component. Time to fix this!
One success factor of the Arduino platform is the broad availability so-called ‘shields’: hardware plugin-modules which extend the capability of platform. Shieldlist.org currently lists 288 different shields available! Clearly, Freescale wants to benefit from that ecosystem with the Freedom FRDM-KL25Z board which features Arduino compatible headers. Time to use the Freedom board with an Arduino shield :-).
An SD (Secure Digital) Card interface is kind of standard for many applications today: it provides a lot of memory at a reasonable cost. Still, I need a software stack for it, up to the level of a file system. So far I was really happy with using FatFs: an open source FAT file system provided by Elm-Chan. I’m using the FatFs Processor Expert component already in multiple designs. What was missing: a port to the Freescale Kinetis ARM Cortex-M4 family of processors.