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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,875 次查看
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 项奖励
回复
1 解答
1,033 次查看
mykepredko
Contributor IV

Hi Petr,

 

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

 

Thanx!

 

myke

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,033 次查看
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 项奖励
回复
1,033 次查看
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 项奖励
回复
1,034 次查看
mykepredko
Contributor IV

Hi Petr,

 

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

 

Thanx!

 

myke

0 项奖励
回复