Getting Started CW 10.3 and MQX

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

Getting Started CW 10.3 and MQX

Jump to solution
1,676 Views
Richly
Contributor III

So far as I can tell, all the getting started documents for MQX depend on CW 6.x or CW 7.x and MQX 3.x.  I can't figure out how to get started with what I have on hand: CW 10.3 and MQX 4.0.  The board I happen to have is the M52233DEMO board, and I'd like to figure out how to just turn its four LEDs on and off and then read the switches on the board.  Should be a piece of cake, but I'm stymied.

I thought I managed to build the m52259 libraries, but when I tried to compile the m52259DEMO gpio program, nothing worked, starting with <bsp.h> not being found and e.g. TASK_TEMPLATE_STRUCT not being defined.

The Commander Project Creation list does not list MQX options, but File|New lists MQX 4.0 Project.

Where should I look for help?

Thanks,

   - R

0 Kudos
1 Solution
835 Views
Martin_
NXP Employee
NXP Employee

Hi Richard,

I would recommend "lwgpio". The "gpio" driver uses MQX I/O fopen/fread/fwrite to access GPIO pins, which gives some unnecessary overhead and also can be used only when MQX runs and not during startup code (before MQX starts).

Look at this example:

c:\Freescale\Freescale MQX 3.8\mqx\examples\lwgpio\

View solution in original post

0 Kudos
4 Replies
835 Views
c0170
Senior Contributor III

Hello richard tenney,

What is the product version of Getting started pdf? IS it really 4.0.0 ? There's no support below CW 10.x. (neither any reference to those Codewarriors - found only one creating new mqx project ). Please read Getting started document, check if paths are correct in projects you are working with (they should be by default :smileywink: ), build libraries are located MQX folder/lib/m52259demo.cw/debug or release. Are files there?

Start with your first error , could be bsp.h not found. Did you build psp and bsp successfully? I have just built bsp,psp and gpio example for m52259, without any error in CW10.3.

Regards,

MartinK

835 Views
Richly
Contributor III

Hi to both of you.  Sorry for the delay, but I'm suddenly dealing with a family situation that will slow progress for some weeks.

In response to Martin Latal's comments:

I've uninstalled MQX 4.0 and installed 3.8.1.  There are some issues between CW10.2 and CW10.3.  I found that CW10.3 and MQX 4.0 cannot live in C:\Program Files\... because of the space in "Program Files" (something complains about Program not being an executable file), but MQX seems to have attached itself to CW10.2, not CW10.3.  In any case, I managed to get the gpio project (seems to be its name even in 3.8.1) to compile and complain through the RS-232 connection "Opening file1 GPIO for pins1 failed."  That's certainly progress, but I've failed to locate any documentation about the project that would help me figure out how fopen() is the right way to read and write GPIO ports.

In answer to Kojto's question:  The document I keep finding when I search is Writing Your First MQX Application, AN3905, from 11/2009, which talks about CW 6.2.2 and CW 7.1.2.  The other choice seems to be an MQX-Lite document (Writing your First MQX-Lite Application, AN4610) that is based on a Kinetis processor.  Without support for that processor installed, the Commander window doesn't even present MQX and MQX-Lite options.

Paths are a bit of a problem.  As noted above, installing CW10.3 in C:\Program Files\... didn't work, so I put it in its default C:\Freescale\....  This leads to a bit of a quandary for MQX...whether to install it in C:\Program Files\... or C:\Freescale\....  I chose the latter, because I wanted it to work with CW10.3, but it seems to be wired to work with CW10.2.  As MQX 3.8.1 is simply a stepping stone for me, I'll go with this until I get around to installing MQX 4.0.  However, I did find m52233demo.wsd in C:\Freescale\Freescale MQX 3.8\config\m52233demo\cw10, and dragging that to the projects window seems to have effected the required rebuild of the library.


Sorry for the rambling response: I'm still in the woods but seem to be moving forward a bit.  Thanks for the tips.

    - R

0 Kudos
836 Views
Martin_
NXP Employee
NXP Employee

Hi Richard,

I would recommend "lwgpio". The "gpio" driver uses MQX I/O fopen/fread/fwrite to access GPIO pins, which gives some unnecessary overhead and also can be used only when MQX runs and not during startup code (before MQX starts).

Look at this example:

c:\Freescale\Freescale MQX 3.8\mqx\examples\lwgpio\

0 Kudos
834 Views
Martin_
NXP Employee
NXP Employee

Hi Richard,

The board support for M52233DEMO was removed from MQX 4.0. I think easiest to start with this board would be MQX 3.8.1 release. M52233DEMO board is supported by MQX 3.8.1 version and so there are many example projects already available that you can run.


If you wish later to use MQX 4.0 (which I would personally recommend due to enahncements and bug fixes over MQX 3.8.1) you can create/migrate board support for M52233DEMO into MQX 4.0 as you would for any custom designed board.


With the CodeWarrior 10.x New Project Wizard plugin, create a new MQX project for your board and select the option to use one of the provided examples. Select hello2, this is a simple serial console output and will give you good starting point. If you wish to control LEDs, then look for lwgpio example (MQX 3.8.1 name is lwgpio, in MQX 4.0 the same driver and example are renamed to gpio).