What would be involved in porting the SAI demo over to the FRDM-K22F platform?

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

What would be involved in porting the SAI demo over to the FRDM-K22F platform?

1,592 Views
davepfaltzgraff
Senior Contributor I

I like the FRDM-K22F  as it has all the bits and pieces for a project. I've already taken the first step and installed all of the "do not install" parts. (Yes, it still works.)

What would I need to do to port the SAI demo from the TWR 22 platform over to the FRDM board?

Note: Ultimately I'd like to get this operating under MQX, but that can wait until later if it helps this step.

Thanks

0 Kudos
10 Replies

725 Views
soledad
NXP Employee
NXP Employee

Hello David,

Which MQX version are you using??

Regards

Sol

0 Kudos

725 Views
davepfaltzgraff
Senior Contributor I

Since I ultimately plan to implement a filesystem and the USB stack, I am trying to build this up on MQX_Standard. (See the discussion over at Defining tasks using Processor Expert.)

0 Kudos

725 Views
soledad
NXP Employee
NXP Employee

Hello David,

You can use Freescale MQX RTOS 4.1 for the FRDM-K22F, you can download from the below link:

FRDM-K22F|Freedom Development Board|Kinetis|Freescale

After install it, you can find a SAI example located at the path: C:\Freescale\Freescale_MQX_4_1_FRDMK22F120M\mqx\examples\sai_dma_demo

In addition you can find the application note "MQX_Writing_Your_First_Application"  at the path: C:\Freescale\Freescale_MQX_4_1_FRDMK22F120M\doc\mqx  the purpose of this Application Note is to provide:

  • Information that enables developers to start developing their first application on Freescale MQX RTOS quickly and easily.
  • Basic understanding how to develop Freescale MQX applications.


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

725 Views
davepfaltzgraff
Senior Contributor I

So, I was finally able to get a clean compile under IAR. However, with a compiled size of over 100K, I can't use the free version of IAR to go any further.

Following the thread at Creating a New MQX RTOS for KSDK Project in KDS , I was able to get the example MQX project to compile and run.

The next step was to copy the source code from C:\Freescale\Freescale_MQX_4_1_FRDMK22F120M\mqx\examples\sai_dma_demo over into this new project. At first tings looked promising as the task definition and and instantiation looked the same.

On compiling, there were several header files not found. I was able to locate all of the except <fio.h> in the KSDK structure. At this point I started getting errors that pointed back to user_config.h. So, I copied that over from the original project as well.

At this point I started getting messages that I was unable to pursue. It appears that the method of defining the processor is different between MQX4.1 and the KSDK.

At this point I have hit a dead end. When is an update to KSDK expected that would give me the functionality that demonstrated in the MQX4.1 for FRDM-K22F package?

0 Kudos

725 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello David:

Just my two cents. There is a sai demo installed with KSDK itself:

C:\Freescale\KSDK_1.1.0\demos\sai_demo\kds\twrk22f120m

Sorry for asking, I am not expert in SAI, but is that demo not enough for you? or why do you want to port the one from classic MQX?

The KSDK demo is for TWR-K22, but it should be simple to adapt it for FRDM-K22F, just remove the board specific files and add the ones for FRDM-K22F. These files will require some light changes to configure the pins and make use of the on-board audio codec.

Regards!

Jorge Gonzalez

0 Kudos

725 Views
davepfaltzgraff
Senior Contributor I

This is a learning experience for me - Kinetis, KDS, KSDK, MQX and PE. So, to say that "it would be simple" is based on knowledge of where you've been (TWR-K22 system) and where you're going (FRDM-K22F). This includes knowing which "board specific files" need to be replaced, etc.

What I have learned is that the combination of KDS, KSDK, PE and MQX are not as integrated as one is lead to believe.

So, if you would be kind enough to point me to the relevant files, I will learn some more.

Thanks.

One and half hours later:

Just as an FYI, I did import the project and was able to compile and link it. Since I don't like changing the original files, I export the project to an archive file. This was then unzipped to C:\Projects\sai_demo_twrk22f120m and then imported into KDS. Almost none of the include links were correct and after I corrected these in the Project==>Properties, KDS was "unable to find" the source files. Something is really screwed up with this project. (I had no trouble doing this with some of the other projects.)

0 Kudos

725 Views
davepfaltzgraff
Senior Contributor I

Hi Sol,

I downloaded the MQX RTOS 4.1 for the FRDM-K22F package and installed it in the C:\Freescale location only to find that it requires a different IDE. So, I downloaded IAR and tried to bring up the suggested demo application.

When I attempt to compile, all I get is "#error directive: Your application project uses incorrect paths and libraries" This seems to be coded into the mqx.h files that's referenced.

How can I get past this one? I don't necessarily have to be able to compile, but it's important that I be able to find all the necessary files in order to get any further.

I should note that I followed the instructions in the referenced mqx.h file and it appears that these changes were already made in the IAR project.

So, just to get some action, I am going through the steps of compile, find the missing file, add the path to the project, repeat. Painfully slow and it only tells me that this is not the way to do it!

Thanks

0 Kudos

725 Views
davepfaltzgraff
Senior Contributor I

Ho Sol,

I'll certainly download the file and go through it, but this leads to two questions:

1. I thought that the KSDK includes MQX for the Kiinetis processors. How is this different from what's included in the KSDK?

2. As I mentioned in the other post on MQX tasks, my interest is in having the KDS, PE and MQX fully integrated. Do the applications in this download use the PE?

I noted that you posted this in the other thread as well. Basically, I'm considering that thread closed. So, I'll continue the discussion here.

Thanks

Later...

Having perused the documentation, I find that it will be of marginal help. The key issue being that KSD is not in the supported development platforms. So, maybe my question  should have been: What would be involved in porting the SAI demo over to the FRDM-K22F platform in KSD using PE and KDSK?

Another issue is that I have been trying to follow KSD with the integration of MQX and find that a lot has changed since 7/14 when this documentation was released. I feel that the time I spent on it would be wasted.

I'm sure that the code itself will be of help, but it will take time to work through it.

0 Kudos

725 Views
soledad
NXP Employee
NXP Employee

Hello David,

First all I need to mention that there are some MQX releases:

1. MQX RTOS (I want to call it, MQX classic)

Freescale MQX™ RTOS a full-featured complimentary real-time operating system including the MQX™ Kernel, TCP/IP stack (RTCS), embedded MS-DOS file system (MFS), USB host/device stack, and more. The MQX™ multitasking kernel provides pre-emptive scheduling, fast interrupt response, extensive inter-process communication and synchronization facilities. MQX RTOS includes its own peripheral drivers.

MQX RTOS

2. MQX Lite RTOS

Freescale MQX™ Lite RTOS is a very light MQX™ kernel for resource-limited MCUs. Initially developed for the Kinetis L series family, it allows applications to run with less than 4 KB RAM. It is a true subset of the proven and professionally developed Freescale MQX™ Software Solutions, allowing for easy upward code migration. It is easily configurable within Processor Expert Software to be used with the tool chain of your choice.

MQX Lite RTOS

3. MQX RTOS for Kinetis SDK

Freescale MQX RTOS for Kinetis SDK is the latest evolution of the proven and professionally developed Freescale MQX™ Software Solutions for Kinetis MCUs. It is built on top of the software development kit (SDK) for Kinetis MCUs, leveraging the flexible and extendable peripheral drivers found within the SDK. MQX Lite configuration option is now available for enhanced scalability, allowing developers the option to use the same light weight kernel API found within MQX Lite RTOS.

MQX RTOS for Kinetis SDK

In my last answer, I suggested to use MQX RTOS 4.1 for the FRDM-K22F, this is a MQX classic release (NOT KSDK) and I suggested it because there is a SAI example for FRDM-K22F (without any changes) that you can use as reference.

If you want to use MQX RTOS for Kinetis SDK and processor expert, then I suggest to check the below threads:

MQX with KSDK and Processor Expert

How To: Create an MQX RTOS project with Processor Expert in Kinetis Design Studio IDE

Creating a New MQX RTOS for KSDK Project in KDS


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

725 Views
davepfaltzgraff
Senior Contributor I

Hi Sol,

This is just to bring you up to date on my efforts. First, concerning the IAR project, after MUCH editing I did get a clean compile. There was no way that the demo would run "out of the box".

At the end of your message above, you mention three references. Of these, the first is dated and caused me much confusion, see Defining tasks using Processor Expert. This is outdated and should either be updated to correspond to the latest releases of KSD and KSDK or at least removed from the handy reference list.

The second is OK, but it's part of what lead me to the problems in defining the MQX tasks in the previous thread.

The third looks more promising. I noted that the creation date is 1/20/2015 so it should be more relevant. I will be going through this in detail in the next few days as I try to migrate the SAI demo from IAR to KSD.

Thanks.

0 Kudos