Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 43 of 43

Thread: T4 FlexIO - Looking back at my T4 beta testing library FlexIO_t4

  1. #26
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,272
    @KurtE
    Have to go do a couple of errands - didn't get a chance to test if the same thing happens on other pins as well. I assume you did though knowing you.

  2. #27
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,690
    @mjs513 - I hacked up another sketch that has to FlexSerial objects and just does output. Did not bother to echo (also posted this one to NXP).

    Code:
    //============================================================================
    // Simple output only test for Flex Serial pin defined on Pin 2
    // Idea is to connect pin 0 (Serail1 RX pin) to Pin2 (Flex IO output)
    // 
    // And the program will hopefully echo the stuff to The serial output
    //============================================================================
    
    #include <FlexIO_t4.h>
    #include <FlexSerial.h>
    
    #define TX_PIN 3
    #define TX_FLEX_IO_INDEX 0
    #define TX_FLEX_IO_TIMER 0
    #define TX_FLEX_IO_SHIFTER 0
    #define TX_PIN2 4
    #define TX_FLEX_IO_INDEX2 0
    #define TX_FLEX_IO_TIMER2 1
    #define TX_FLEX_IO_SHIFTER2 1
    FlexSerial SerialFlex(-1, TX_PIN, -1, -1, -1, TX_FLEX_IO_INDEX, TX_FLEX_IO_TIMER, TX_FLEX_IO_SHIFTER);
    FlexSerial SerialFlex2(-1, TX_PIN2, -1, -1, -1, TX_FLEX_IO_INDEX2, TX_FLEX_IO_TIMER2, TX_FLEX_IO_SHIFTER2);
    
    void setup() {
      pinMode(13, OUTPUT);
      while (!Serial && millis() < 4000);
      Serial.begin(115200);
      Serial1.begin(115200);  // lets start up Serial1, to see if we can receive anything from our FlexSerial
      delay(500);
      SerialFlex.begin(115200);
      SerialFlex2.begin(115200);
    }
    
    // Real simple for now
    void loop() {
      SerialFlex.print("Flex1");
      SerialFlex2.print("Flex2 More");
      delay(2);
      Serial.println("******** After first output ************");
      Serial.printf("CCM_CDCDR: %x\n", CCM_CDCDR);
      Serial.printf("VERID:%x PARAM:%x CTRL:%x PIN: %x\n", IMXRT_FLEXIO1_S.VERID, IMXRT_FLEXIO1_S.PARAM, IMXRT_FLEXIO1_S.CTRL, IMXRT_FLEXIO1_S.PIN);
      Serial.printf("SHIFTSTAT:%x SHIFTERR=%x TIMSTAT=%x\n", IMXRT_FLEXIO1_S.SHIFTSTAT, IMXRT_FLEXIO1_S.SHIFTERR, IMXRT_FLEXIO1_S.TIMSTAT);
      Serial.printf("SHIFTSIEN:%x SHIFTEIEN=%x TIMIEN=%x\n", IMXRT_FLEXIO1_S.SHIFTSIEN, IMXRT_FLEXIO1_S.SHIFTEIEN, IMXRT_FLEXIO1_S.TIMIEN);
      Serial.printf("SHIFTSDEN:%x SHIFTSTATE=%x\n", IMXRT_FLEXIO1_S.SHIFTSDEN, IMXRT_FLEXIO1_S.SHIFTSTATE);
      Serial.printf("SHIFTCTL:%x %x %x %x\n", IMXRT_FLEXIO1_S.SHIFTCTL[0], IMXRT_FLEXIO1_S.SHIFTCTL[1], IMXRT_FLEXIO1_S.SHIFTCTL[2], IMXRT_FLEXIO1_S.SHIFTCTL[3]);
      Serial.printf("SHIFTCFG:%x %x %x %x\n", IMXRT_FLEXIO1_S.SHIFTCFG[0], IMXRT_FLEXIO1_S.SHIFTCFG[1], IMXRT_FLEXIO1_S.SHIFTCFG[2], IMXRT_FLEXIO1_S.SHIFTCFG[3]);
      Serial.printf("TIMCTL:%x %x %x %x\n", IMXRT_FLEXIO1_S.TIMCTL[0], IMXRT_FLEXIO1_S.TIMCTL[1], IMXRT_FLEXIO1_S.TIMCTL[2], IMXRT_FLEXIO1_S.TIMCTL[3]);
      Serial.printf("TIMCFG:%x %x %x %x\n", IMXRT_FLEXIO1_S.TIMCFG[0], IMXRT_FLEXIO1_S.TIMCFG[1], IMXRT_FLEXIO1_S.TIMCFG[2], IMXRT_FLEXIO1_S.TIMCFG[3]);
      Serial.printf("TIMCMP:%x %x %x %x\n", IMXRT_FLEXIO1_S.TIMCMP[0], IMXRT_FLEXIO1_S.TIMCMP[1], IMXRT_FLEXIO1_S.TIMCMP[2], IMXRT_FLEXIO1_S.TIMCMP[3]);
      
      SerialFlex.print(" second Flex output");
      SerialFlex2.print(" Flex 2 output again");
    
      delay(10);
      Serial.println("******** After Second output ************");
      Serial.printf("CCM_CDCDR: %x\n", CCM_CDCDR);
      Serial.printf("VERID:%x PARAM:%x CTRL:%x PIN: %x\n", IMXRT_FLEXIO1_S.VERID, IMXRT_FLEXIO1_S.PARAM, IMXRT_FLEXIO1_S.CTRL, IMXRT_FLEXIO1_S.PIN);
      Serial.printf("SHIFTSTAT:%x SHIFTERR=%x TIMSTAT=%x\n", IMXRT_FLEXIO1_S.SHIFTSTAT, IMXRT_FLEXIO1_S.SHIFTERR, IMXRT_FLEXIO1_S.TIMSTAT);
      Serial.printf("SHIFTSIEN:%x SHIFTEIEN=%x TIMIEN=%x\n", IMXRT_FLEXIO1_S.SHIFTSIEN, IMXRT_FLEXIO1_S.SHIFTEIEN, IMXRT_FLEXIO1_S.TIMIEN);
      Serial.printf("SHIFTSDEN:%x SHIFTSTATE=%x\n", IMXRT_FLEXIO1_S.SHIFTSDEN, IMXRT_FLEXIO1_S.SHIFTSTATE);
      Serial.printf("SHIFTCTL:%x %x %x %x\n", IMXRT_FLEXIO1_S.SHIFTCTL[0], IMXRT_FLEXIO1_S.SHIFTCTL[1], IMXRT_FLEXIO1_S.SHIFTCTL[2], IMXRT_FLEXIO1_S.SHIFTCTL[3]);
      Serial.printf("SHIFTCFG:%x %x %x %x\n", IMXRT_FLEXIO1_S.SHIFTCFG[0], IMXRT_FLEXIO1_S.SHIFTCFG[1], IMXRT_FLEXIO1_S.SHIFTCFG[2], IMXRT_FLEXIO1_S.SHIFTCFG[3]);
      Serial.printf("TIMCTL:%x %x %x %x\n", IMXRT_FLEXIO1_S.TIMCTL[0], IMXRT_FLEXIO1_S.TIMCTL[1], IMXRT_FLEXIO1_S.TIMCTL[2], IMXRT_FLEXIO1_S.TIMCTL[3]);
      Serial.printf("TIMCFG:%x %x %x %x\n", IMXRT_FLEXIO1_S.TIMCFG[0], IMXRT_FLEXIO1_S.TIMCFG[1], IMXRT_FLEXIO1_S.TIMCFG[2], IMXRT_FLEXIO1_S.TIMCFG[3]);
      Serial.printf("TIMCMP:%x %x %x %x\n", IMXRT_FLEXIO1_S.TIMCMP[0], IMXRT_FLEXIO1_S.TIMCMP[1], IMXRT_FLEXIO1_S.TIMCMP[2], IMXRT_FLEXIO1_S.TIMCMP[3]);
    
      Serial.println("\n *** Enter anything to run again ***");
      while (Serial.read() == -1) ;
      while (Serial.read() != -1);
      
    }
    Sample output:
    Code:
    pin 3 maps to: 20000bb8, port: 401ac000(FLEXIO1) pin 5
    timer index: 0 shifter index: 0 mask: 1
    Before configure flexio
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 0
    SHIFTSTAT:0 SHIFTERR=0 TIMSTAT=0
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 0 0 0
    SHIFTCFG:32 0 0 0
    TIMCTL:1c00501 0 0 0
    TIMCFG:2222 0 0 0
    TIMCMP:f81 0 0 0
    pin 4 maps to: 20000bb8, port: 401ac000(FLEXIO1) pin 6
    timer index: 1 shifter index: 1 mask: 2
    Before configure flexio
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 40
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=0
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    FI1: 1 1 0 3(F) 0 1 0
    FI1: 2 3 0 4(F) 0 3 0
    FI1: 1 3 0 3(l) 0 3 0
    FI1: 2 3 0 4(l) 0 3 0
    FI1: 1 3 0 3(e) 0 3 0
    FI1: 2 3 0 4(e) 0 3 0
    FI1: 1 3 0 3(x) 0 3 0
    FI1: 2 3 0 4(x) 0 3 0
    FI1: 1 3 0 3(1)* 0 2 0
    FI1: 2 2 0 4(2) 0 2 0
    ******** After first output ************
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 60
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=3
    SHIFTSIEN:2 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    FI1: 1 3 0 3( ) 0 3 0
    FI1: 3 3 0 3(s)4( ) 0 3 0
    FI1: 3 3 0 3(e)4(M) 0 3 0
    FI1: 3 3 0 3(c)4(o) 0 3 0
    FI1: 3 3 0 3(o)4(r) 0 3 0
    FI1: 3 3 0 3(n)4(e) 0 3 0
    FI1: 3 3 0 3(d)4( ) 0 3 0
    FI1: 3 3 0 3( )4(F) 0 3 0
    FI1: 3 3 0 3(F)4(l) 0 3 0
    FI1: 3 3 0 3(l)4(e) 0 3 0
    FI1: 3 3 0 3(e)4(x) 0 3 0
    FI1: 3 3 0 3(x)4( ) 0 3 0
    FI1: 3 3 0 3( )4(2) 0 3 0
    FI1: 3 3 0 3(o)4( ) 0 3 0
    FI1: 3 3 0 3(u)4(o) 0 3 0
    FI1: 3 3 0 3(t)4(u) 0 3 0
    FI1: 3 3 0 3(p)4(t) 0 3 0
    FI1: 3 3 0 3(u)4(p) 0 3 0
    FI1: 3 3 0 3(t)*4(u) 0 2 0
    FI1: 3 2 0 4(t) 1 2 0
    ******** After Second output ************
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 60
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=3
    SHIFTSIEN:2 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    
     *** Enter anything to run again ***
    This one shows the issue that with 2 Shifters 0 and 1, when 0 finishes 1 does not output anymore...
    Click image for larger version. 

Name:	screenshot.jpg 
Views:	2 
Size:	41.2 KB 
ID:	18125

    Probably all for now. May do some other diversion

  3. #28
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,272
    @KurtE
    Know this is going to sound strange but could you put you LA on it again using these prints:
    Code:
      SerialFlex.print ("Flex112345");
      SerialFlex2.print("Flex2 More");
     …...
      
      SerialFlex.print (" second Flex output1");
      SerialFlex2.print(" Flex 2 output again");

  4. #29
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,690
    Quote Originally Posted by mjs513 View Post
    @KurtE
    Know this is going to sound strange but could you put you LA on it again using these prints:
    Code:
      SerialFlex.print ("Flex112345");
      SerialFlex2.print("Flex2 More");
     …...
      
      SerialFlex.print (" second Flex output1");
      SerialFlex2.print(" Flex 2 output again");
    Yep - But all of this is strange....

    Here is debug output:
    Code:
    pin 3 maps to: 20000bc0, port: 401ac000(FLEXIO1) pin 5
    timer index: 0 shifter index: 0 mask: 1
    Before configure flexio
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 0
    SHIFTSTAT:0 SHIFTERR=0 TIMSTAT=0
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 0 0 0
    SHIFTCFG:32 0 0 0
    TIMCTL:1c00501 0 0 0
    TIMCFG:2222 0 0 0
    TIMCMP:f81 0 0 0
    pin 4 maps to: 20000bc0, port: 401ac000(FLEXIO1) pin 6
    timer index: 1 shifter index: 1 mask: 2
    Before configure flexio
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 40
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=0
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    FI1: 1 1 0 3(F)* 0 0 0
    FI1: 2 3 0 4(F) 0 3 0
    FI1: 1 3 0 3(l) 0 3 0
    FI1: 2 3 0 4(l) 0 3 0
    FI1: 1 3 0 3(e) 0 3 0
    FI1: 2 3 0 4(e) 0 3 0
    FI1: 1 3 0 3(x) 0 3 0
    FI1: 2 3 0 4(x) 0 3 0
    FI1: 1 3 0 3(1) 0 3 0
    FI1: 2 3 0 4(2) 0 3 0
    FI1: 1 3 0 3(1) 0 3 0
    FI1: 2 3 0 4( ) 0 3 0
    FI1: 1 3 0 3(2) 0 3 0
    FI1: 2 3 0 4(M) 0 3 0
    FI1: 1 3 0 3(3) 0 3 0
    FI1: 2 3 0 4(o) 0 3 0
    FI1: 1 3 0 3(4) 0 3 0
    FI1: 2 3 0 4(r) 0 3 0
    FI1: 1 3 0 3(5)* 0 2 0
    FI1: 2 2 0 4(e)* 0 0 0
    ******** After first output ************
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 60
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=3
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    FI1: 1 1 0 3( ) 0 1 0
    FI1: 3 3 0 3(s)4( ) 0 3 0
    FI1: 3 3 0 3(e)4(F) 0 3 0
    FI1: 3 3 0 3(c)4(l) 0 3 0
    FI1: 3 3 0 3(o)4(e) 0 3 0
    FI1: 3 3 0 3(n)4(x) 0 3 0
    FI1: 3 3 0 3(d)4( ) 0 3 0
    FI1: 3 3 0 3( )4(2) 0 3 0
    FI1: 3 3 0 3(F)4( ) 0 3 0
    FI1: 3 3 0 3(l)4(o) 0 3 0
    FI1: 3 3 0 3(e)4(u) 0 3 0
    FI1: 3 3 0 3(x)4(t) 0 3 0
    FI1: 3 3 0 3( )4(p) 0 3 0
    FI1: 3 3 0 3(o)4(u) 0 3 0
    FI1: 3 3 0 3(u)4(t) 0 3 0
    FI1: 3 3 0 3(t)4( ) 0 3 0
    FI1: 3 3 0 3(p)4(a) 0 3 0
    FI1: 3 3 0 3(u)4(g) 0 3 0
    FI1: 3 3 0 3(t)4(a) 0 3 0
    FI1: 3 3 0 3(1)*4(i) 0 2 0
    FI1: 3 2 0 4(n)* 1 0 0
    ******** After Second output ************
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 60
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=3
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    
     *** Enter anything to run again ***
    So you are going to say it looks like maybe it output the last stuff? BUT again the odd part...
    Click image for larger version. 

Name:	screenshot.jpg 
Views:	4 
Size:	37.0 KB 
ID:	18135
    In each case it looks like the last character is output (as shown in RED, but in both cases the character is not shifted out. In the first set of outputs, it does get shifted out when the first byte is output of the next sequence...

  5. #30
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,272
    So you are going to say it looks like maybe it output the last stuff? BUT again the odd part...

    In each case it looks like the last character is output (as shown in RED, but in both cases the character is not shifted out. In the first set of outputs, it does get shifted out when the first byte is output of the next sequence...
    Yeah, that's kind of what I wanted to check. It is strange. Its almost like you have to flush the last character or send a 0xff or 0x00 just to complete the sequence - think I saw that someplace but I cant remember what it was referring too.

  6. #31
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,272
    @KurtE
    Started playing again this morning and I did add a couple more debug prints to your callback function. In the SDK it has this as a test:
    Code:
        /* Send data register empty and the interrupt is enabled. */
        if ((kFLEXIO_UART_TxDataRegEmptyFlag & status) && (base->flexioBase->SHIFTSIEN & (1U << base->shifterIndex[0])))
    so I changed it to print this which I think is the same or equivalent:
    Code:
    Serial.printf(" (index %d, SDK flag %d)",_tx_shifter, (0x1 & p->SHIFTSTAT) && (p->SHIFTSIEN & (1U << _tx_shifter)));
    Now when I run the example in post #27.

    Code:
    pin 3 maps to: 20000be0, port: 401ac000(FLEXIO1) pin 5
    timer index: 0 shifter index: 0 mask: 1
    Before configure flexio
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 0
    SHIFTSTAT:0 SHIFTERR=0 TIMSTAT=0
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 0 0 0
    SHIFTCFG:32 0 0 0
    TIMCTL:1c00501 0 0 0
    TIMCFG:2222 0 0 0
    TIMCMP:f81 0 0 0
    pin 4 maps to: 20000be0, port: 401ac000(FLEXIO1) pin 6
    timer index: 1 shifter index: 1 mask: 2
    Before configure flexio
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 40
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=0
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    FI1: 1 1 0 3 (index 0, SDK flag 1)(h!t1: F)* 0 0 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1: F) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1: l) 0 3 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1: l) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1: e) 0 3 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1: e) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1: x) 0 3 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1: x) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1: 1)* 0 2 0
    FI1: 2 2 0 4 (index 1, SDK flag 0)(h!t1: 2) 0 2 0
    ******** After first output ************
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 60
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=3
    SHIFTSIEN:2 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: s)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: e)4 (index 1, SDK flag 0)(h!t1: M) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: c)4 (index 1, SDK flag 0)(h!t1: o) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: o)4 (index 1, SDK flag 0)(h!t1: r) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: n)4 (index 1, SDK flag 0)(h!t1: e) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: d)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: F) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: F)4 (index 1, SDK flag 0)(h!t1: l) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: l)4 (index 1, SDK flag 0)(h!t1: e) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: e)4 (index 1, SDK flag 0)(h!t1: x) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: x)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: 2) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: o)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: u)4 (index 1, SDK flag 0)(h!t1: o) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: t)4 (index 1, SDK flag 0)(h!t1: u) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: p)4 (index 1, SDK flag 0)(h!t1: t) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: u)4 (index 1, SDK flag 0)(h!t1: p) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: t)*4 (index 1, SDK flag 0)(h!t1: u) 0 2 0
    FI1: 3 2 0 4 (index 1, SDK flag 1)(h!t1: t) 1 2 0
    ******** After Second output ************
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 60
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=3
    SHIFTSIEN:2 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    that flag seems to be set only for index 0? And if I hit return:
    Code:
     *** Enter anything to run again ***
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1: F) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: l)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: e)4 (index 1, SDK flag 0)(h!t1: a) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: x)4 (index 1, SDK flag 0)(h!t1: g) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: 1)*4 (index 1, SDK flag 0)(h!t1: a) 0 2 0
    FI1: 3 2 0 4 (index 1, SDK flag 1)(h!t1: i) 1 2 0
    ******** After first output ************
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 60
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=3
    SHIFTSIEN:2 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: s)4 (index 1, SDK flag 0)(h!t1: n) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: e)4 (index 1, SDK flag 0)(h!t1: F) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: c)4 (index 1, SDK flag 0)(h!t1: l) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: o)4 (index 1, SDK flag 0)(h!t1: e) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: n)4 (index 1, SDK flag 0)(h!t1: x) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: d)4 (index 1, SDK flag 0)(h!t1: 2) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: F)4 (index 1, SDK flag 0)(h!t1: M) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: l)4 (index 1, SDK flag 0)(h!t1: o) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: e)4 (index 1, SDK flag 0)(h!t1: r) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: x)4 (index 1, SDK flag 0)(h!t1: e) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: o)4 (index 1, SDK flag 0)(h!t1: F) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: u)4 (index 1, SDK flag 0)(h!t1: l) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: t)4 (index 1, SDK flag 0)(h!t1: e) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: p)4 (index 1, SDK flag 0)(h!t1: x) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: u)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: t)*4 (index 1, SDK flag 0)(h!t1: 2) 0 2 0
    FI1: 3 2 0 4 (index 1, SDK flag 1)(h!t1:  ) 1 2 0
    ******** After Second output ************
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 60
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=3
    SHIFTSIEN:2 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    
     *** Enter anything to run again ***
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1: F)* 0 2 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: l)4 (index 1, SDK flag 0)(h!t1: o) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: e)4 (index 1, SDK flag 0)(h!t1: u) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: x)4 (index 1, SDK flag 0)(h!t1: t) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: 1)*4 (index 1, SDK flag 0)(h!t1: p) 0 2 0
    FI1: 3 2 0 4 (index 1, SDK flag 1)(h!t1: u) 1 2 0
    Is it possible the index is getting messed some how?

    PS: yes I changed a couple of the other prints just because.....

  7. #32
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,690
    Hi @mjs513....

    Not sure about the line: Serial.printf(" (index %d, SDK flag %d)",_tx_shifter, (0x1 & p->SHIFTSTAT) && (p->SHIFTSIEN & (1U << _tx_shifter)));

    In particular the part in RED. Looks like it will only be TRUE if Index is 1...?

  8. #33
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,272
    Quote Originally Posted by KurtE View Post
    Hi @mjs513....

    Not sure about the line: Serial.printf(" (index %d, SDK flag %d)",_tx_shifter, (0x1 & p->SHIFTSTAT) && (p->SHIFTSIEN & (1U << _tx_shifter)));

    In particular the part in RED. Looks like it will only be TRUE if Index is 1...?
    I converted that piece from the SDK code frag I posted:
    Code:
    kFLEXIO_UART_TxDataRegEmptyFlag & status
    . In the SDK its was specified as
    Code:
        kFLEXIO_UART_TxDataRegEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */
    just as an aside I extracted from here:
    Code:
    /*! @brief Define FlexIO UART status mask. */
    enum _flexio_uart_status_flags
    {
        kFLEXIO_UART_TxDataRegEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */
        kFLEXIO_UART_RxDataRegFullFlag = 0x2U,  /*!< Receive buffer full flag. */
        kFLEXIO_UART_RxOverRunFlag = 0x4U,      /*!< Receive buffer over run flag. */
    };
    As I said just took a guess that was the right conversion.\

    EDIT: Looking back at the output it does show for index 0, the SDK flag 1 which is from that serial output. Think I am interpreting right. Still playing and figuring things out. Index is _tx_shifter.

  9. #34
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,690
    Hi @mjs513 - Still does not make sense to me... Maybe I am just being dense.

    For example:
    If you look at the SHIFTSEIN register P3049, the bits are defined for Transmit:
    Code:
    bits 3-0
    SSIE
    Shifter Status Interrupt Enable
    Enables interrupt generation when corresponding SSF is set.
    0b - Shifter Status Flag interrupt disabled.
    1b - Shifter Status Flag interrupt enabled.
    And SSF is defined in SHIFTSTAT: (P3046) -
    Code:
    3-0
    SSF
    Shifter Status Flag
    The shifter status flag is updated when one of the following events occurs:
    For SMOD=Receive, the status flag is set when SHIFTBUF has been loaded with data from Shifter
    (SHIFTBUF is full), and the status flag is cleared when SHIFTBUF register is read.
    For SMOD=Transmit, the status flag is set when SHIFTBUF data has been transferred to the Shifter
    (SHIFTBUF is empty) or when initially configured for SMOD=Transmit, and the status flag is cleared
    when the SHIFTBUF register is written.
    For SMOD=Match Store, the status flag is set when a match has occured between SHIFTBUF and
    Shifter, and the status flag is cleared when the SHIFTBUF register is read.
    For SMOD=Match Continuous, returns the current match result between the SHIFTBUF and Shifter.
    For SMOD=State, the status flag for a shifter will set when it is selected by the current state pointer.
    For SMOD=Logic, returns the current value of the programmable logic block output.
    The status flag can also be cleared by writing a logic one to the flag for all modes except Match
    Continuous/State/Logic.
    0b - Status flag is clear.
    1b - Status flag is set.
    Note: These bits are W1C where as the SHIFTSEIN they are simply READ/WRITE...

    Again

  10. #35
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,272
    @KurtE
    Confused is the normal state for me Guess I will have to go back to the manual and bounce the two off each other. Either that or I can run the SDK interrupt example on the 1062EVKB and try to duplicate what is being done in the sketch to see what happens Waiting for wife at Dr's now so may be awhile....

  11. #36
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,272
    @KurtE
    I loaded up the interrupt SDK example on the 1062EVKB and saw a couple of things. First, the way the sdk is set up is it transmits on one pin and recieives on another. So I hooked up the USB converter to the pc and opened the serial monitor. Sent it a input string of "12345678":
    Code:
    12345  (CR/NL) 1st send 12345678
    678    (CR/NL) 2nd send 12345678
    123
    
    45678  (NL)  3rd send 12345678
    1
    
    Do a reset and select no line ending
    12345678
    not sure it means anything for us or just a quirk with the SDK.

    But played some more with padding the shorter prints with spacers instead of number, i.e.,
    Code:
      SerialFlex.printf("Flex1     ");
      SerialFlex2.printf("Flex2 More");
    …
      SerialFlex.print(" second Flex output     ");
      SerialFlex2.print(" Flex 2 output again");
    and I think it worked this time>>>>> heres the output:
    Code:
    pin 3 maps to: 20000bf0, port: 401ac000(FLEXIO1) pin 5
    timer index: 0 shifter index: 0 mask: 1
    Before configure flexio
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 0
    SHIFTSTAT:0 SHIFTERR=0 TIMSTAT=0
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 0 0 0
    SHIFTCFG:32 0 0 0
    TIMCTL:1c00501 0 0 0
    TIMCFG:2222 0 0 0
    TIMCMP:f81 0 0 0
    pin 4 maps to: 20000bf0, port: 401ac000(FLEXIO1) pin 6
    timer index: 1 shifter index: 1 mask: 2
    Before configure flexio
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 40
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=0
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    FI1: 1 1 0 3 (index 0, SDK flag 1)(h!t1: F) 0 1 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1: F) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1: l) 0 3 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1: l) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1: e) 0 3 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1: e) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1: x) 0 3 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1: x) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1: 1) 0 3 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1: 2) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1:  ) 0 3 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1:  ) 0 3 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1: M) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1:  ) 0 3 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1: o) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1:  ) 0 3 0
    FI1: 2 3 0 4 (index 1, SDK flag 0)(h!t1: r) 0 3 0
    FI1: 1 3 0 3 (index 0, SDK flag 1)(h!t1:  )* 0 2 0
    FI1: 2 2 0 4 (index 1, SDK flag 0)(h!t1: e)* 0 0 0
    ******** After first output ************
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 60
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=3
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    FI1: 1 1 0 3 (index 0, SDK flag 1)(h!t1:  )* 0 0 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: s)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: e)4 (index 1, SDK flag 0)(h!t1: F) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: c)4 (index 1, SDK flag 0)(h!t1: l) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: o)4 (index 1, SDK flag 0)(h!t1: e) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: n)4 (index 1, SDK flag 0)(h!t1: x) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: d)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: 2) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: F)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: l)4 (index 1, SDK flag 0)(h!t1: o) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: e)4 (index 1, SDK flag 0)(h!t1: u) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: x)4 (index 1, SDK flag 0)(h!t1: t) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: p) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: o)4 (index 1, SDK flag 0)(h!t1: u) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: u)4 (index 1, SDK flag 0)(h!t1: t) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: t)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: p)4 (index 1, SDK flag 0)(h!t1: a) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: u)4 (index 1, SDK flag 0)(h!t1: g) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: t)4 (index 1, SDK flag 0)(h!t1: a) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: i) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: n)* 0 1 0
    FI1: 3 1 0 3 (index 0, SDK flag 1)(h!t1:  ) 2 1 0
    FI1: 3 1 2 3 (index 0, SDK flag 1)(h!t1:  )(err) 4$ 0 1 0
    FI1: 3 1 0 3 (index 0, SDK flag 1)(h!t1:  )* 2 0 0
    on second output:
    Code:
     *** Enter anything to run again ***
    FI1: 3 1 2 3 (index 0, SDK flag 1)(h!t1: F)(err) 4$ 0 1 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: l)4 (index 1, SDK flag 0)(h!t1: F) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: e)4 (index 1, SDK flag 0)(h!t1: l) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: x)4 (index 1, SDK flag 0)(h!t1: e) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: 1)4 (index 1, SDK flag 0)(h!t1: x) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: 2) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: M) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: o) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )*4 (index 1, SDK flag 0)(h!t1: r) 0 2 0
    FI1: 3 2 0 4 (index 1, SDK flag 1)(h!t1: e)* 1 0 0
    ******** After first output ************
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 60
    SHIFTSTAT:1 SHIFTERR=0 TIMSTAT=3
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    FI1: 1 1 0 3 (index 0, SDK flag 1)(h!t1:  )* 0 0 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: s)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: e)4 (index 1, SDK flag 0)(h!t1: F) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: c)4 (index 1, SDK flag 0)(h!t1: l) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: o)4 (index 1, SDK flag 0)(h!t1: e) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: n)4 (index 1, SDK flag 0)(h!t1: x) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: d)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: 2) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: F)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: l)4 (index 1, SDK flag 0)(h!t1: o) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: e)4 (index 1, SDK flag 0)(h!t1: u) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: x)4 (index 1, SDK flag 0)(h!t1: t) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: p) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: o)4 (index 1, SDK flag 0)(h!t1: u) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: u)4 (index 1, SDK flag 0)(h!t1: t) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: t)4 (index 1, SDK flag 0)(h!t1:  ) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: p)4 (index 1, SDK flag 0)(h!t1: a) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: u)4 (index 1, SDK flag 0)(h!t1: g) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1: t)4 (index 1, SDK flag 0)(h!t1: a) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: i) 0 3 0
    FI1: 3 3 0 3 (index 0, SDK flag 1)(h!t1:  )4 (index 1, SDK flag 0)(h!t1: n)* 0 1 0
    FI1: 3 1 0 3 (index 0, SDK flag 1)(h!t1:  ) 2 1 0
    FI1: 3 1 2 3 (index 0, SDK flag 1)(h!t1:  )(err) 4$ 0 1 0
    FI1: 3 1 0 3 (index 0, SDK flag 1)(h!t1:  )* 2 0 0
    ******** After Second output ************
    CCM_CDCDR: 33f71f92
    VERID:1010001 PARAM:2100808 CTRL:1 PIN: 60
    SHIFTSTAT:3 SHIFTERR=2 TIMSTAT=3
    SHIFTSIEN:0 SHIFTEIEN=0 TIMIEN=0
    SHIFTSDEN:0 SHIFTSTATE=0
    SHIFTCTL:30502 1030602 0 0
    SHIFTCFG:32 32 0 0
    TIMCTL:1c00501 1c00601 0 0
    TIMCFG:2222 2222 0 0
    TIMCMP:f81 f81 0 0
    Don't know just throwing things out there and seeing if something clicks..... Now to read the manual.

  12. #37
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,690
    @mjs513 (and others) - I may have fixed my multiple FlexSerial transmit issue...

    I believe: The TIMCTL register did not have the right TRGSEL value (I think).
    I think it needs to 4* Shifter number + 1 (was hard coded to 1) so was specific to shifter 0...

    The documentation for this at times is a bit confusing.
    Code:
    Trigger Select
    The valid values for TRGSEL will depend on the FLEXIO_PARAM register.
    • When TRGSRC = 1, the valid values for N will depend on PIN, TIMER, SHIFTER fields in the
    FLEXIO_PARAM register.
    • When TRGSRC = 0, the valid values for N will depend on TRIGGER field in FLEXIO_PARAM
    register.
    Refer to the chip configuration section for external trigger selection.
    NOTE: For a pin, N=0 to 31. For a Shifter/Timer, N=0 to 3.
    The internal trigger selection is configured as follows:
    • 4*N - Pin 2*N input
    • 4*N+1 - Shifter N status flag
    • 4*N+2 - Pin 2*N+1 input
    • 4*N+3 - Timer N trigger output
    At least I think my two FlexSerial on pins 3 and 4 appears to be working now. Will try the big one next

  13. #38
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,690
    - looks like the big test may be working now...
    Click image for larger version. 

Name:	screenshot.jpg 
Views:	9 
Size:	123.1 KB 
ID:	18156

    EDIT: Although turning off debug appears to cause things to not work right??? So still debugging

  14. #39
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,133
    The debug prints? If so, try enabling the lpuart clock, CANFD wont work without lpuart clock enabled....

  15. #40
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,690
    Thanks @tonton81 - CANFD - needs LUPUART... Looks like they are pretty similar in the clock tree...

    As for this one, I isolated down which set of Serial.printf(...) statements when disabled caused things to screw up.
    At first I thought maybe it was because these prints, were outputting most of the FlexIO registers, so maybe one or more of them needed to be read... So I put code in to read all of them, and still failed. However if I add a delay(1) it works, which is how I left it. As this is done on the FlexSerial::begin() method, not worried about a 1ms delay...

    So hopefully things are now working OK (fingers crossed)

  16. #41
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,272
    @KurtE
    Cool that you got FlexIO Serial working. I read that section a couple of times and still gets me confused. Nothing new

    Yeah - FlexCAN seems to need LPUART enabled to work for some reason. If we don't enable it just hangs on initialization. Worked before in testing because it was enabled in startup.c because debug.prints were turned on.

  17. #42
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,690
    I know what you mean, some of these descriptions are not very obvious. And their examples are like here is it working on Pin X timer0 shifter 0... No where to they explain how each of the fields in their example would change if they changed one of those parameters...

    Next hurtle, is so far I have not done SerialFlex.flush()... I had a version for awhile that was hanging.

    I can easily (in theory) get flush to go until the queue is empty, but not sure yet on how to get it to wait until the last byte transferred. I am going to try to hack in maybe setting a timer interrupt at this point and see what it does... But that is just a guess!

  18. #43
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,690
    Just an FYI - I just pushed up an update, that I believe makes flush work reasonably well.

    The simple version that simply waits for us to output the last byte in the queue into the shift buffer is not sufficient. It would end up returning from flush() with part of two characters left to be output.

    So this version enables the Timer interrupt to happen when we sense that our queue is empty, and then we need to process two of these timer interrupts. On the second one we disable it and set the flag that says that we are no longer transmitting. If we do another write after we start up the trigger, we reset the timer status and again turn off the ISR...

    I added a one second timeout into flush() in case it totally hangs.

    Again depending on if anyone is going to use this, I could add in the Transmitter Enable pin code...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •