foxsi / foxsi-4matter

Code for FOXSI-4 telemetry formatter.
https://foxsi.umn.edu/
1 stars 3 forks source link

Uplink command SpaceWire reply handling (CMOS) #58

Open thanasipantazides opened 9 months ago

thanasipantazides commented 9 months ago

The trouble

Applies to v0.1.0.

When applying uplink commands to CMOS, the reply is not read (it remains in the Eth receive buffer) until the next write pointer request. This breaks parsing of the write pointer. This would be fine (as a 1-off error after every uplink command), but it ends in an exception. I don't think this occurs for CdTe.

managing cmos2
in sync_send_buffer_commands_to_system()
no commands in queue
in sync_remote_buffer_transaction() for cmos2
    can access ring buffer parameters
    write pointer width: 4
    sending read command: 000000000000000000000015 09 68 01 4d 02 00000003 fe 0000 00 00000240 000004 9e 
    requested remote write pointer
    got remote write pointer, reply length 29
000000000000000000000000 00 00 00 00 00 0000 00 000000 00 00000000 b0 
    last header access: 24
    vector data length field result: 
        0
        0
        0
        0

    converted data length field result: 
        0
got bad write pointer length!
    extracted write pointer from reply: 0x
vector::_M_range_check: __n (which is 3) >= this->size() (which is 0)
thanasipantazides commented 9 months ago

There are other issues for CdTe though. See here:

managing cdte4 system
in sync_send_buffer_commands_to_system()
no commands in queue
in sync_send_buffer_commands_to_system()
no commands in queue
in sync_remote_buffer_transaction() for cdte4
    can access ring buffer parameters
    write pointer width: 4
    sending read command: 000000000000000000000016 0102 fe 01 4d 02 00000103 fe 0000 00 07fb0314 000004 72 
    requested remote write pointer
    got remote write pointer, reply length 29
got malformed SpaceWire Ethernet header!
0x55 55 17 11 55 55 47 57 55 55 55 57 75 55 55 55 55 55 57 55 55 55 71 55 55 55 55 55 51 
    last header access: 24
    vector data length field result: 
        0
        85
        85
        113

    converted data length field result: 
        5592433
Segmentation fault

Believe this occurred after sending an HV -> 60 V canister broadcast command, but I have no idea what would cause all those 5s.