Lantronix Community Forums  

Go Back   Lantronix Community Forums > Development Tools > Linux SDK > Samples

Samples Use this forum for questions or comments regarding specific sample source code files in the Linux SDK.

Reply
 
Thread Tools Display Modes
  #11  
Old 03-12-2010, 06:28 PM
sensorsoft sensorsoft is offline
Junior Member
 
Join Date: Feb 2010
Posts: 7
Default

Quote:
Originally Posted by vlkd2009 View Post

In directory linux-2.6.x/arch/coldfire/platform/520x/ please locate file cpconfig-xport_pro.h.
Just to be clear, don't you mean "linux-2.6.x/arch/m68knommu/platform/520x/cpconfig-xport_pro.h" instead of "linux-2.6.x/arch/coldfire/platform/520x/cpconfig-xport_pro.h"?

--Mike
Reply With Quote
  #12  
Old 03-12-2010, 07:38 PM
vlkd2009 vlkd2009 is offline
Administrator
 
Join Date: Jun 2009
Posts: 15
Default

Yes.
It is linux-2.6.x/arch/m68knommu/platform/520x/cpconfig-xport_pro.h
Reply With Quote
  #13  
Old 03-24-2010, 03:22 PM
votug votug is offline
Junior Member
 
Join Date: Feb 2010
Posts: 8
Default still problems using SDK 2.0.0.0, XportPro, Application CPM

hello,

i'm using SDK 2.0.0.0, XPort Pro.

My configuration is:
KConfig->Processor type and features->[*] CP driver support
->Lantronix CP Man->[*] GPIO

cpm.conf has been adjusted to Xport Pro: CP1-CP3

my cpconfig-xport_pro.h:
===========================================
static struct cp_board_config xport_pro_cp_map[] = {
[0] = {
#ifdef CONFIG_LTRX_CPM_MANUALY_CP1_DEVICE
.func = (CPM_FUNC_SER_HWFLOW_OUT | PLATFORM_UART0),
.initval = 0,
.assertlow = CPM_ASSERT_DEFAULT,
#else
.func = CPM_FUNC_GEN_OUTPUT,
.initval = 0,
.assertlow = CPM_ASSERT_HIGH,
#endif
},
[1] = {
#ifdef CONFIG_LTRX_CPM_MANUALY_CP2_DEVICE
.func = CPM_FUNC_GEN_INPUT,
.initval = 0,
.assertlow = CPM_ASSERT_HIGH,
#else
.func = CPM_FUNC_GEN_OUTPUT,
.initval = 0,
.assertlow = CPM_ASSERT_HIGH,
#endif
},
[2] = {
#ifdef CONFIG_LTRX_CPM_MANUALY_CP3_DEVICE
.func = (CPM_FUNC_SER_HWFLOW_IN | PLATFORM_UART0),
.initval = 0,
.assertlow = CPM_ASSERT_DEFAULT,
#else
.func = CPM_FUNC_GEN_OUTPUT,
.initval = 0,
.assertlow = CPM_ASSERT_HIGH,
#endif
},
};

SAMPLE-APP 'LED' console-output with 'DEBUG':
===================================
cp_config_data_output(1,0) ... 0
cp_config_data_output(2,0) ... 0
cp_config_data_output(3,0) ... 0
...
cp_config_data_output(1,1) ... 0
cp_config_data_output(2,1) ... 0
cp_config_data_output(3,0) ... 0
...

SAMPLE-APP 'CPM' console output
=========================
/ # cpm -s -d -n 1 -v 1
cp_number=1
cp_value=1
flag=0x202
cp_config_init() ... 3 (0x7,4)
cp_config_validate(1) ... 0
cp_config_type_set(1,1) ... 0
cp_config_invert_set(1,0) ... 0
cp_config_state_set(1,1) ... 0
cp_config_validate(2) ... 0
cp_config_type_set(2,1) ... 0
cp_config_invert_set(2,0) ... 0
cp_config_state_set(2,1) ... 0
cp_config_validate(3) ... 0
cp_config_type_set(3,1) ... 0
cp_config_invert_set(3,0) ... 0
cp_config_state_set(3,1) ... 0
cp_group_create(LED) ... 0
cp_group_type_set(LED,1) ... 0
cp_config_validate(1) ... 0
cp_group_add(LED,0,1) ... 0
cp_config_validate(2) ... 0
cp_group_add(LED,1,2) ... 0
cp_config_validate(3) ... 0
cp_group_add(LED,2,3) ... 0
cp_config_type_set(1,1) ... 0
cp_config_state_set(1,1) ... 0
cp_config_type_set(2,1) ... 0
cp_config_state_set(2,1) ... 0
cp_config_type_set(3,1) ... 0
cp_config_state_set(3,1) ... 0
cp_group_state_set(LED,1) ... 0
cp_config_data_output(1,1) ... 0

* CP configuration status *

CP# Type State Invert Value
---- -------- -------- -------- -----
cp_config_read(1,0x4067be74) ... 0
cp_config_data_input(1,0) ... 0 <= why not '(1,1)'
CP1 Output Enabled Disabled 0
cp_config_read(2,0x4067be74) ... 0
cp_config_data_input(2,0) ... 0
CP2 Output Enabled Disabled 0
cp_config_read(3,0x4067be74) ... 0
cp_config_data_input(3,0) ... 0
CP3 Output Enabled Disabled 0
cp_config_read(4,0x4067be74) ... -1

* CP group status *
cp_group_read_by_index(0,0x4067be0a) ... 0
cp_config_level_input(1,0) ... 0
cp_config_level_input(2,0) ... 0
cp_config_level_input(3,0) ... 0
cp_group_level_input(LED,0) ... 0
cp_config_data_input(1,0) ... 0
cp_config_data_input(2,0) ... 0
cp_config_data_input(3,0) ... 0
cp_group_data_input(LED,0) ... 0
cp_config_read(1,0x4067bddc) ... 0
cp_config_read(2,0x4067bddc) ... 0
cp_config_read(3,0x4067bddc) ... 0

Name : LED
Type : Output
State : Enabled
Value : 0 (0x00000000)
Logic : xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Level : xxxxxxxxxxxxxxxxxxxxxxxxxxxxx---
Binary : xxxxxxxxxxxxxxxxxxxxxxxxxxxxx000
CP# : xxxxxxxxxxxxxxxxxxxxxxxxxxxxx321
cp_group_read_by_index(1,0x4067be0a) ... -1

and with '/ # cpm -s -d -n 2 -v 1'
==============================
...
CP# Type State Invert Value
---- -------- -------- -------- -----
cp_config_read(1,0x4067be74) ... 0
cp_config_data_input(1,0) ... 0
CP1 Output Enabled Disabled 0
cp_config_read(2,0x4067be74) ... 0
cp_config_data_input(2,1) ... 0 <= seems to work
CP2 Output Enabled Disabled 1
cp_config_read(3,0x4067be74) ... 0
cp_config_data_input(3,0) ... 0
CP3 Output Enabled Disabled 0
cp_config_read(4,0x4067be74) ... -1

=> the same output for CP3 like CP1;

Any help, why I'm not able to configure CP1/CP3, but CP2 does work correctly?

Best regards
votug
Reply With Quote
  #14  
Old 03-25-2010, 06:30 AM
tfujii tfujii is offline
Member
 
Join Date: Mar 2010
Posts: 14
Default

Hello,

CP1/CP3 were set to the signal for serial. Please try the following modification.

linux/linux-2.6.x/drivers/serial/mcf_cpm.c line 118

- if ((mcf_cpm[p].rtsctrl.owner == CPM_FUNC_OWNER_DEVICE) ||
- (mcf_cpm[p].rtsctrl.owner == CPM_FUNC_OWNER_UNUSED)) {
+ if (mcf_cpm[p].rtsctrl.owner == CPM_FUNC_OWNER_DEVICE) {



Best regards
Reply With Quote
  #15  
Old 03-25-2010, 07:45 AM
votug votug is offline
Junior Member
 
Join Date: Feb 2010
Posts: 8
Default @tfujii

many thanks for your help, it works fine!

greetings
Reply With Quote
  #16  
Old 04-14-2010, 11:48 AM
swebbten swebbten is offline
Junior Member
 
Join Date: Apr 2010
Posts: 3
Default

I got it working on SDK 2.0.0.0 beta following votug and applying tfujii's modifications. I'm quite impressed now.
Reply With Quote
  #17  
Old 05-02-2010, 06:42 PM
Draconi Draconi is offline
Junior Member
 
Join Date: Apr 2010
Posts: 2
Talking 3x I/Os working on V2.0 Beta SDK

tfujii's comment worked for me as well on the V2.0 Beta SDK.

THANKS!!!
Reply With Quote
  #18  
Old 08-16-2010, 11:46 AM
meloun meloun is offline
Member
 
Join Date: Aug 2010
Posts: 18
Default doesn work..

to Tfujii:

my <sdk>/linux/linux-2.6.x/drivers/serial/mcf_cpm.c
at line 118

Code:
/*    if ((mcf_cpm[p].rtsctrl.owner == CPM_FUNC_OWNER_DEVICE) ||
        (mcf_cpm[p].rtsctrl.owner == CPM_FUNC_OWNER_UNUSED)) {*/
      if (mcf_cpm[p].rtsctrl.owner == CPM_FUNC_OWNER_DEVICE) {
        unsigned short par;
make..
copy images to /tftpboot/

Code:
dnfl linux.bin 
dn rootfs.img
fl w 0x00400000 0x4001FF80 0x400000 
gfl
I created /etc/cpm.conf

Code:
config cp1 {
   type output
   state enable
   invert disable
}

group LED {
  type output
  state enable
  bit0 cp1
}

Code:
# cpm -N LED -V 1
Warning CP1 is invalid
Warning CP1 is invalid
with cp2 I have no troubles...


Thanks for your help.
Reply With Quote
  #19  
Old 08-17-2010, 02:03 PM
tfujii tfujii is offline
Member
 
Join Date: Mar 2010
Posts: 14
Default

Hello meloun,

Please confirm CP manager setup of kernel configuration.

Code:
Linux Kernel Configuration
  Processor type and features  ---> 
    Lantronix CP Manager (General Purpose I/O)
The default value is 'Device I/O'. If you are using the XPort Pro, CP1 and CP3 are reserved as to 'Device I/O' for the serial driver.
Then, please change value into 'General Purpose I/O' and retry it.

Regards,
Reply With Quote
  #20  
Old 08-18-2010, 10:07 AM
meloun meloun is offline
Member
 
Join Date: Aug 2010
Posts: 18
Default that's it!!

that's it!! thanks!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:17 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.