Problems creating the "my_null_io" driver from AN3902 with CW10 and MQX 3.6

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

Problems creating the "my_null_io" driver from AN3902 with CW10 and MQX 3.6

Jump to solution
814 Views
mykepredko
Contributor IV

Hi,

 

I'm trying to go through building the sample device drivers in AN3902 but I'm running into a few snags that I don't understand. 

 

1.  I created "my_null_io.c" and "my_null_io.h" as listed in the AppNote in a new folder under "C:\Freescale MQX 3.6\mqx\source\io\" ("C:\Freescale MQX 3.6\mqx\source\io\my_null_io") which should be the correct folder (I have installed MQX in "C:\Freescale MQX 3.6" and not under "Program Files" so I can update/rebuild the BSP). 

2.  Next I created a "Group" under "Generic IO Drivers" of the bsp project (I'm using bsp_m52223evb).  This gives me the same icon as the other groups in the BSP. 

3.  I then added "New Files" using the "Link to the File System" option which gives me a link to the files in the "C:\Freescale MQX 3.6\mqx\source\io\my_null_io" folder (and giving me the same icons as the other "Generic IO Drivers"). 

 

When I build the BSP, I get:"make *** [Generic IO Drivers/my_null_io/my_null_io.obj] Error 1" which I believe is a result of the two warnings I get (which prevents the .c file from compiling):

"function has no prototype" - which points to the line in the .c file: "_mqx_uint _io_my_null_install" which has a corresponding line in the .h file (which I copied and pasted to ensure there were no differences). 

"Invalid project path: Duplicate path entries." which is given the Location "pathentry" and doesn't make any sense. 

 

When I delete the group I added and rebuild the project, everything works fine. 

 

Does anybody have any idea what I'm doing wrong?

 

Thanx,

 

myke

0 Kudos
1 Solution
361 Views
mykepredko
Contributor IV

Hi Petr,

 

Thanx - I've got the first example working now (sending the message "Null driver working" out of UART0).  I've added "my_null_io.h" to "bsp.h" as you suggested along with following the instructions in AN3902 as well as worked through the issues noted below. 

 

A couple of notes:

1.  The batch file in AN3902 is wrong for CW10/MQX 3.6.  It should be "<MQX_FOLDER>\mqx\build\bsp---.bat".  This will probably cause somebody about 10 seconds of confusion before they figure out the correct path, but I just wanted to mention it. 

2.  To get the new device driver to build, you have to add the path for its directory in Project "Properties" -> "C/C++ General" -> "Paths and Symbols" -> "C Source".  I added "${MQX_PATH}\mqx\source\io\my_null_io" and things started to work. 

 

Thanx for your help - now I'll see if I can get the other two sample device drivers in AN3902 before going off on my own. 

 

myke

View solution in original post

0 Kudos
3 Replies
361 Views
mykepredko
Contributor IV

Sorry, I should have added the "my_null_io" .c and .h before this. 

 

Thanx for any help,

 

myke

0 Kudos
361 Views
PetrM
Senior Contributor I

Add a line

 

#include <my_null_io.h>

 

into to bsp.h file, which is included by all other files, so your function will be known everywhere.

Don't forget to update the BSP batch file to copy this header file into lib directory too.

 

PetrM

 

0 Kudos
362 Views
mykepredko
Contributor IV

Hi Petr,

 

Thanx - I've got the first example working now (sending the message "Null driver working" out of UART0).  I've added "my_null_io.h" to "bsp.h" as you suggested along with following the instructions in AN3902 as well as worked through the issues noted below. 

 

A couple of notes:

1.  The batch file in AN3902 is wrong for CW10/MQX 3.6.  It should be "<MQX_FOLDER>\mqx\build\bsp---.bat".  This will probably cause somebody about 10 seconds of confusion before they figure out the correct path, but I just wanted to mention it. 

2.  To get the new device driver to build, you have to add the path for its directory in Project "Properties" -> "C/C++ General" -> "Paths and Symbols" -> "C Source".  I added "${MQX_PATH}\mqx\source\io\my_null_io" and things started to work. 

 

Thanx for your help - now I'll see if I can get the other two sample device drivers in AN3902 before going off on my own. 

 

myke

0 Kudos