Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LAN9252 slave cannot go OP under DC sync #824

Open
jingjm opened this issue Jun 17, 2024 · 3 comments
Open

LAN9252 slave cannot go OP under DC sync #824

jingjm opened this issue Jun 17, 2024 · 3 comments

Comments

@jingjm
Copy link

jingjm commented Jun 17, 2024

Hello everyone!

I have read following issues carefully, but maybe I still missed sth.
#520
#487

My slave is using LAN9252 (on a self made dev board), it can go SM-sync without any problem. But when I tried to use DC-sync, it only stay on SAFE_OP, can not goto OP state.
My question is whether my understanding of master side process is right (see code below) or I should check the slave side?

I was trying strategy b) (described in issue 520) as a) seems not work for LAN9252.
b) Do slave configuration and synchronisation both in pre-OP and work around some details.

My code flow as below (modified based on red_test.c):
image

The output just show as below.

Slave:1
 Name:SSC-Device
 Output size: 752bits
 Input size: 2bits
 State: 4
 Delay: 0[ns]
 Has DC: 1  DCactive: 1
 DCParentport:0
...
Not all slaves reached operational state.
Slave 1 State=0x04 StatusCode=0x0000 : No error

I print out the 0x1c32 and 0x1c33, the "Synchronization Type" seems right for DC sync.

0x1c32      "SM output parameter"                         [RECORD  maxsub(0x20 / 32)]
    0x00      "SubIndex 000"                                [UNSIGNED8        R_R_R_]      0x20 / 32
    0x01      "Synchronization Type"                        [UNSIGNED16       RWR_R_]      0x0002 / 2
    0x02      "Cycle Time"                                  [UNSIGNED32       R_R_R_]      0x000f4240 / 1000000
    0x04      "Synchronization Types supported"             [UNSIGNED16       R_R_R_]      0x401f / 16415
    0x05      "Minimum Cycle Time"                          [UNSIGNED32       R_R_R_]      0x0007a120 / 500000
    0x06      "Calc and Copy Time"                          [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x08      "Get Cycle Time"                              [UNSIGNED16       RWRWRW]      0x0000 / 0
    0x09      "Delay Time"                                  [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x0a      "Sync0 Cycle Time"                            [UNSIGNED32       RWRWRW]      0x000f4240 / 1000000
    0x0b      "SM-Event Missed"                             [UNSIGNED16       R_R_R_]      0x0006 / 6
    0x0c      "Cycle Time Too Small"                        [UNSIGNED16       R_R_R_]      0x0000 / 0
    0x20      "Sync Error"                                  [BOOLEAN          R_R_R_]      TRUE

0x1c33      "SM input parameter"                          [RECORD  maxsub(0x20 / 32)]
    0x00      "SubIndex 000"                                [UNSIGNED8        R_R_R_]      0x20 / 32
    0x01      "Synchronization Type"                        [UNSIGNED16       RWR_R_]      0x0002 / 2
    0x02      "Cycle Time"                                  [UNSIGNED32       R_R_R_]      0x000f4240 / 1000000
    0x04      "Synchronization Types supported"             [UNSIGNED16       R_R_R_]      0x401f / 16415
    0x05      "Minimum Cycle Time"                          [UNSIGNED32       R_R_R_]      0x0007a120 / 500000
    0x06      "Calc and Copy Time"                          [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x08      "Get Cycle Time"                              [UNSIGNED16       RWRWRW]      0x0000 / 0
    0x09      "Delay Time"                                  [UNSIGNED32       R_R_R_]      0x00000000 / 0
    0x0a      "Sync0 Cycle Time"                            [UNSIGNED32       RWRWRW]      0x000f4240 / 1000000
    0x0b      "SM-Event Missed"                             [UNSIGNED16       R_R_R_]      0x0000 / 0
    0x0c      "Cycle Time Too Small"                        [UNSIGNED16       R_R_R_]      0x0000 / 0
    0x20      "Sync Error"                                  [BOOLEAN          R_R_R_]      FALSE
@nakarlsson
Copy link
Contributor

A Wireshark of the start-up might help.

And if you wait a while longer the slave will probably present some SAFEOP + Error that might guide you, since it is a SSC Device you can seelk help in that documentation?

@ArthurKetels
Copy link
Contributor

And it helps when you actually enable sync0. Now the slave is waiting for the first sync pulse that never comes.

@jingjm
Copy link
Author

jingjm commented Jun 18, 2024

Thank for reply.
After I wait longer, it really goes to SAFE_OP + Error state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants