Are TWR-k40 examples on MQX tested?

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

Are TWR-k40 examples on MQX tested?

Jump to solution
1,101 Views
stav
Contributor II

I am trying to get into MQX 3.7   for k40 using a k40 tower dev system with IAR.  I compiled and ran the LWGPIO example.

 

The LED switches off as intended, but the button press is not detected - neither when interrupt driven, nor when polled.

 

On the other hand when I ran the bare-metal gpio project it works ok, so hardwar eis not the issue.

 

I also could not see the uart output as it is sent to ttya which is the osjtag and that is in use for debugging. I tried to

change the config to default to ttyd  and recompile everything (as per the starters guide), but I did not get output from the serial port either.

 

Any Ideas ? Has anyone else had these issues?

 

I am womdering what the learning curve for MQX is going to be like ...

Thanks

0 Kudos
1 Solution
654 Views
DavidS
NXP Employee
NXP Employee

Hi Stav,

I think there is an error with how the PORTC PCR5 register is getting configured.

I will notify our MQX development team.

In the mean time I've attached my hack in the source.  Look for "//DES-hack".

Thanks for posting and sorry for the hassle.

Regards,

David

View solution in original post

0 Kudos
5 Replies
654 Views
c0170
Senior Contributor III

Hello stav,

 

we are aware of the button problems with kinetis, the issue there are pull ups which are not set and not present on the board neither. It's already fixed.

 

All you have to do now is to set pull up enable for the pin:

 

PORTC_PCR5  |= 0x03       //button 1 PCR

PORTC_PCR13  |= 0x03    //button 2 PRC

This enables pullup/down and select pull up. Or you can use Davids hack, that should work as well.

 

You can use  ttya for debugging and also as an output but you have to use P&E kinetis terminal utility to get an output. It's explained in Getting started in section 6.2.

 

Best regards,

MartinK

654 Views
stav
Contributor II

Thanks David, Martin for the feedback.

 

I tried the mods - Davids works.

 

I did not get Martins to, but I may be abusing it - I just dumped in the same place as Davids hack and tried it once, maybe with a bit more patience it will work correctly.

 

The ttya works as you said.

 

What I am really trying to figure out is if its a shorter route to get an app running on an RTOS to

a) learn MQX or

b) useFreertos and generate drivers/ init files from processor expert.

 

Any thoughts on this would be greatly appreciated.

 

 

 

 

0 Kudos
654 Views
DavidS
NXP Employee
NXP Employee

Hi Stav,

Glad "hack" worked.  MartinK had good explanation of what the root cause is.  Thanks MartinK!

There is a really good PDF (of a PPT) that covers all of your questions:

C:\Program Files\Freescale\Freescale MQX 3.7\doc\FSL_MQX_3_7_in_CW_10_1.pdf

Please review it and yell (or type) if you have questions.

Hope this helps.

Regards,

David

 

0 Kudos
654 Views
stav
Contributor II

Hi David

 

I spent some time trying to get a simple no-os project to run for the k40 tower with the PE from scratch for the IAR compiler. 

(BTW there is no example project visible even though the release notes for the standalone pe plugin talk about one)

 

The project I generated (after adding linker files etc) did not even get to variable initialization when executed.

 

After looking at the file you refer to in your last post it seems that the CW is better supported than the IAR - I guess I should move over to that - maybe (hopefully)  it will be a less rough ride even with the CW learning curve

 

thanks for the input.

 

 

 

 

0 Kudos
655 Views
DavidS
NXP Employee
NXP Employee

Hi Stav,

I think there is an error with how the PORTC PCR5 register is getting configured.

I will notify our MQX development team.

In the mean time I've attached my hack in the source.  Look for "//DES-hack".

Thanks for posting and sorry for the hassle.

Regards,

David

0 Kudos