//============================================================================
// 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);
}
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 ***
@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");
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
[COLOR="#B22222"]FI1: 2 2 0 4(e)* 0 0 0[/COLOR]
******** 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
[COLOR="#B22222"]FI1: 3 2 0 4(n)* 1 0 0[/COLOR]
******** 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 ***
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.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...
/* Send data register empty and the interrupt is enabled. */
if ((kFLEXIO_UART_TxDataRegEmptyFlag & status) && (base->flexioBase->SHIFTSIEN & (1U << base->shifterIndex[0])))
Serial.printf(" (index %d, SDK flag %d)",_tx_shifter, (0x1 & p->SHIFTSTAT) && (p->SHIFTSIEN & (1U << _tx_shifter)));
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
*** Enter anything to run again ***
[COLOR="#FF0000"]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[/COLOR]
******** 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
[COLOR="#FF0000"]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[/COLOR]
******** 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
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...?
kFLEXIO_UART_TxDataRegEmptyFlag & status
kFLEXIO_UART_TxDataRegEmptyFlag = 0x1U, /*!< Transmit buffer empty flag. */
/*! @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. */
};
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.
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.
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
SerialFlex.printf("Flex1 ");
SerialFlex2.printf("Flex2 More");
…
SerialFlex.print(" second Flex output ");
SerialFlex2.print(" Flex 2 output again");
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
*** 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
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
p->SHIFTSDEN |= 1U << (SHIFTNUM-1);
flexDma.triggerAtHardwareEvent( DMAMUX_SOURCE_FLEXIO2_REQUEST0 );
Well aware of FlexIO 3 not supporting DMA, but its good to be explicit about it for others that might come across this thread/postKurtE said:Also note: That there are only two DMA Sources on FlexIO1 and 2 on Flex IO2 and none on FlexIO3
Which shifters can the sources handle? Is it shifters 0&1? The reference manual is not clear on the sources or the triggers.KurtE said:And that each of these sources handle two shifters, so you can use it on one or the other...