Porting AN3905 ("Writing your First MQX Application) to an M52223EVB

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

Porting AN3905 ("Writing your First MQX Application) to an M52223EVB

Jump to solution
1,878 Views
mykepredko
Contributor IV

Hiya,

 

I'm working through AN3905 on an M52223EVB and running into a strange problem - when I try to execute the

 

"output_port = fopen("gpio:write", (char_ptr) &output_set);"

statement in ioDrivers.c, it returns output_port as NULL (0). 

I have copied the code exactly as is shown in AN3905 pages 18-19 *Appendix C  ioDriver.c Module for M52259DEMO_MQX_RTOS Project" after reviewing the GPIO pin addresses between the '52259 and '52223 User Guides (and finding them to seem to be identical). 

Looking at the actual addresses for the bits generated in "output_set" (ie 0x80000038 for LED_1), I'm not 100% sure if they're right. 

When adding the ioDrivers.c (and "tasks.c"), I used the CW10 "New" and "C Source File" option and then entered the code in here - I could not find an option to specify that the code executes in a supervisor mode. 

Can anybody comment?  The software is CW10 and MQX 3.6. 

Thanx muchly,

myke

0 Kudos
Reply
1 Solution
1,036 Views
mykepredko
Contributor IV

Hi Petr,

 

Setting BSPCFG_ENABLE_GPIODEV to 1 and rebuilding the BSP did the trick. 

 

Thanx!

 

myke

View solution in original post

0 Kudos
Reply
3 Replies
1,036 Views
PetrL
NXP Employee
NXP Employee

Hi myke,

 

Please check if you have GPIO enabled in your user_config.g (BSPCFG_ENABLE_GPIODEV should be set to 1).

 

Also I would suggest you to have a look on GPIO example and description provided with MQX installation (C:\Program Files\Freescale\Freescale MQX 3.6\mqx\examples\gpio\..). The example is showing the basic GPIO functionality quite nicely.

 

PetrL

0 Kudos
Reply
1,036 Views
mykepredko
Contributor IV

Hi Petr,

 

Thanx for the pointer - I think we're getting there. 

 

I presume that you meant "user_config.h" - in it, BSPCFG_ENABLE_GPIODEV is set to 0. 

 

The user_config.h I am looking at is in C:\Freescale MQX 3.6\config\m52223evb (I put MQX in "C:\Freescale MQX 3.6", not in the default "Program Files"). 

 

I presume that this will require a rebuild of the BSP?  Or can I change this bit and rebuild my code?

 

Thanx,

 

myke

0 Kudos
Reply
1,037 Views
mykepredko
Contributor IV

Hi Petr,

 

Setting BSPCFG_ENABLE_GPIODEV to 1 and rebuilding the BSP did the trick. 

 

Thanx!

 

myke

0 Kudos
Reply