<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>MPC5xxxのトピックRe: eSCI not working in MPC5777c, need some application note</title>
    <link>https://community.nxp.com/t5/MPC5xxx/eSCI-not-working-in-MPC5777c-need-some-application-note/m-p/730117#M9909</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, just to be sure - are you aware that eSCI is connected to UART-USB bridge and it is supposed to be used with virtual terminal on PC side?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/30368iB20873E8E97416BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Someone would expect it is UART connector on motherboard, but it is not. It is connected to USB connector J21.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Dec 2017 08:35:08 GMT</pubDate>
    <dc:creator>davidtosenovjan</dc:creator>
    <dc:date>2017-12-19T08:35:08Z</dc:date>
    <item>
      <title>eSCI not working in MPC5777c, need some application note</title>
      <link>https://community.nxp.com/t5/MPC5xxx/eSCI-not-working-in-MPC5777c-need-some-application-note/m-p/730116#M9908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am using MPC5777c with Lauterbach, trace32, EVB board. I am writing&amp;nbsp;bootloader code, in that, i want to update my firmware using eSCI in Internal Flash mode.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current problem is eSCI is not working correctly, it is just sending 00 and stops working, while i am sending more bytes.&lt;/P&gt;&lt;P&gt;I had gone through the example is given&amp;nbsp;"Example_MPC5777C-PinToggleStationery_v0_4-GHS714", even i had ported same code to my workspace. few of the main code i used is here below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#define APC 0x2000&lt;BR /&gt;#define OBE 0x0200&lt;BR /&gt;#define IBE 0x0100&lt;BR /&gt;#define ODE 0x0020&lt;BR /&gt;#define SRC 0x0004&lt;BR /&gt;#define WPE 0x0002&lt;BR /&gt;#define WPS 0x0001&lt;BR /&gt;#define ALT0 0x0000&lt;BR /&gt;#define ALT1 0x0400&lt;BR /&gt;#define ALT2 0x0800&lt;BR /&gt;#define ALT3 0x0C00&lt;/P&gt;&lt;P&gt;#define ETPUA30_pin 144 // PCR number&lt;BR /&gt;#define ETPUA31_pin 145&lt;/P&gt;&lt;P&gt;#define LED1_pin ETPUA30_pin&lt;BR /&gt;#define LED2_pin ETPUA31_pin&lt;/P&gt;&lt;P&gt;#define PRC_SEL_CPU0 0x00&lt;BR /&gt;#define PRC_SEL_both 0x40&lt;BR /&gt;#define PRC_SEL_CPU1 0xC0&lt;/P&gt;&lt;P&gt;#define PRC_PRI(x) ((x)&amp;amp;0x0F)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;volatile T_U32 GlobalCounter;&lt;BR /&gt;T_U8 T1_running = 0;&lt;BR /&gt;T_U16 background_running = 0;&lt;/P&gt;&lt;P&gt;int UART_initialized = 0;&lt;/P&gt;&lt;P&gt;void hw_init(void) {&lt;BR /&gt;#if defined(TURN_ON_CPU1)&lt;BR /&gt;#if defined(START_FROM_FLASH)&lt;BR /&gt; SIU.RSTVEC1.R = (unsigned long) 0xc00400 | 0x00000001;&lt;BR /&gt;#else&lt;BR /&gt; SIU.RSTVEC1.R = (unsigned long)0x40040000 | 0x00000001;&lt;BR /&gt;#endif /* defined(START_FROM_FLASH) */&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;void Init_eSCI_A (void)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;SIU.PCR[89].R = 0x400; // Configure pad for primary func: TxDA&lt;BR /&gt; SIU.PCR[90].R = 0x400; // Configure pad for primary func: RxDA&lt;/P&gt;&lt;P&gt;/* note: SBR = fsys/(16 * desired baudrate) &amp;lt; 8191 */&lt;/P&gt;&lt;P&gt;eSCI_A.CR2.R = 0x2000; // module is enabled (default setting)&lt;/P&gt;&lt;P&gt;/* per_clk = 96MHz */&lt;BR /&gt; eSCI_A.BRR.B.SBR = 313; // 19200 baud, 8 bits, no parity&lt;BR /&gt; eSCI_A.CR1.B.TE = 1; // Tx enabled&lt;BR /&gt; eSCI_A.CR1.B.RE = 1; // Rx enabled&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;void TransmitData(const char * const pBuf, T_U32 cnt)&lt;BR /&gt;{&lt;BR /&gt; T_U8 j = 0; /* Dummy variable */&lt;BR /&gt; for (j=0; j&amp;lt; cnt; j++)&lt;BR /&gt; { /* Loop for character string */&lt;/P&gt;&lt;P&gt;/* Wait for transmit data reg empty = 1 */&lt;BR /&gt; while (eSCI_A.IFSR1.B.TDRE == 0) {}&lt;BR /&gt; eSCI_A.IFSR1.R = 0x8000; /* Clear TDRE flag */&lt;BR /&gt; eSCI_A.SDR.B.RDTD = *(pBuf+j); /* Transmit 8 bits Data */&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void ReceiveData(char *pBuf)&lt;BR /&gt;{&lt;BR /&gt; while (eSCI_A.IFSR1.B.RDRF == 0) {} /* Wait for receive data reg full = 1 */&lt;BR /&gt; eSCI_A.IFSR1.R = 0x2000; /* Clear RDRF flag */&lt;BR /&gt; *pBuf = (char)eSCI_A.SDR.B.RDTD; /* Read byte of Data*/&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;int read (int fno, void *buf, int size)&lt;BR /&gt;{&lt;BR /&gt; int count;&lt;/P&gt;&lt;P&gt;if (UART_initialized == 0)&lt;BR /&gt; {&lt;BR /&gt; Init_eSCI_A();&lt;BR /&gt; UART_initialized = 1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;for (count = 0; count &amp;lt; size; count++)&lt;BR /&gt; {&lt;BR /&gt; ReceiveData( (char *)buf + count );&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;return size;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;int write (const void *buf, int size)&lt;BR /&gt;{&lt;BR /&gt; if (UART_initialized == 0)&lt;BR /&gt; {&lt;BR /&gt; Init_eSCI_A();&lt;BR /&gt; UART_initialized = 1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;TransmitData ((const char *)buf,size);&lt;BR /&gt; return size;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void SIU_Init(void)&lt;BR /&gt;{&lt;BR /&gt; SIU.PCR[LED1_pin].R = ALT0 | OBE; // general purpose output&lt;BR /&gt; SIU.PCR[LED2_pin].R = ALT0 | OBE; // general purpose output&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void PIT0_Init(void)&lt;BR /&gt;{&lt;BR /&gt; /* 30: MDIS = 0 to enable clock for PITs. */&lt;BR /&gt; /* 31: FRZ = 1 for Timers stopped in debug mode */&lt;BR /&gt; PIT.MCR.R = 0x00000001;&lt;BR /&gt; PIT.TIMER[0].LDVAL.R = 18000000 - 1;&lt;/P&gt;&lt;P&gt;/* clear the TIF flag */&lt;BR /&gt; PIT.TIMER[0].TFLG.R = 0x00000001;&lt;/P&gt;&lt;P&gt;/* 30: TIE = 1 for interrupt request enabled */&lt;BR /&gt; /* 31: TEN = 1 for timer active */&lt;BR /&gt; PIT.TIMER[0].TCTRL.R = 0x00000003;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void PIT0_ISR(void)&lt;BR /&gt;{&lt;BR /&gt; SIU.GPDO[LED1_pin].R ^= 1;&lt;/P&gt;&lt;P&gt;PIT.TIMER[0].TFLG.R = 0x00000001;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void printff(char *buf, int size){&lt;/P&gt;&lt;P&gt;write ((const void *)buf,size);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;static void Terminal_ECHO(void)&lt;BR /&gt;{&lt;BR /&gt; char ch;&lt;/P&gt;&lt;P&gt;if (eSCI_A.IFSR1.B.RDRF == 0)&lt;BR /&gt; return;&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; eSCI_A.IFSR1.R = 0x2000; // clear RDRF flag&lt;BR /&gt; ch =(unsigned char) eSCI_A.SDR.B.RDTD; // read byte of Data&lt;BR /&gt; switch(ch)&lt;BR /&gt; {&lt;BR /&gt; // enter&lt;BR /&gt; case '\n':&lt;BR /&gt; case '\r':&lt;BR /&gt; printff("\r\n",2);&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;// other symbols&lt;BR /&gt; default:&lt;BR /&gt; printff("%c",1);&lt;BR /&gt; //fflush(stdout);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;static void HW_init(void)&lt;BR /&gt;{&lt;BR /&gt; /* set round robin for all slaves */&lt;BR /&gt; XBAR.PORT[0].CRS.B.ARB = 1;&lt;BR /&gt; XBAR.PORT[1].CRS.B.ARB = 1;&lt;BR /&gt; XBAR.PORT[2].CRS.B.ARB = 1;&lt;BR /&gt; XBAR.PORT[3].CRS.B.ARB = 1;&lt;BR /&gt; XBAR.PORT[4].CRS.B.ARB = 1;&lt;BR /&gt; XBAR.PORT[6].CRS.B.ARB = 1;&lt;BR /&gt; XBAR.PORT[7].CRS.B.ARB = 1;&lt;/P&gt;&lt;P&gt;/* initialize GPIOs */&lt;BR /&gt; SIU_Init();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void Interrupts_enable_Core0(void)&lt;BR /&gt;{&lt;BR /&gt; /* lower current INTC priority to start INTC interrupts */&lt;BR /&gt; INTC.CPR_PRC[0].B.PRI = 0;&lt;/P&gt;&lt;P&gt;/* enable interrupts */&lt;BR /&gt; asm(" wrteei 1");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void Interrupts_init(void)&lt;BR /&gt;{&lt;BR /&gt; /* Initialize INTC for software vector mode */&lt;BR /&gt; INTC.MCR.R = 0x00000000;&lt;/P&gt;&lt;P&gt;/* configure IVPR and IVORx offsets, also includes a trap for all core&lt;BR /&gt; exceptions, excluding IVOR4 exceptions which have seperate handler */&lt;BR /&gt; // e200zX_Interrupt_Setup();&lt;/P&gt;&lt;P&gt;/* Set INTC ISR vector table base address */&lt;BR /&gt; // INTC.IACKR_PRC[0].R = (T_U32) &amp;amp;IntcIsrVectorTable[0];&lt;BR /&gt; // INTC.IACKR_PRC[1].R = (T_U32) &amp;amp;IntcIsrVectorTable[0];&lt;/P&gt;&lt;P&gt;/* assing required peripheral priorities */&lt;BR /&gt; INTC.PSR[301].R = PRC_SEL_CPU0 | PRC_PRI(1); // PIT0&lt;BR /&gt; // INTC.PSR[303].R = PRC_SEL_CPU1 | PRC_PRI(2); // PIT2&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;int main(void) {&lt;/P&gt;&lt;P&gt;T_U16 counter = 0;&lt;/P&gt;&lt;P&gt;/* MCAL Initialization */&lt;/P&gt;&lt;P&gt;HW_init();&lt;/P&gt;&lt;P&gt;/* 1 sec periodical interrupt */&lt;BR /&gt; PIT0_Init();&lt;/P&gt;&lt;P&gt;Interrupts_init();&lt;BR /&gt; Interrupts_enable_Core0();&lt;/P&gt;&lt;P&gt;printff("This is Pi\r\n",12);&lt;BR /&gt;------------------------&lt;/P&gt;&lt;P&gt;had i made any mistak? or can i get some application note which will discribe how to use eSCI in MPC5777c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;yogesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2017 13:04:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/eSCI-not-working-in-MPC5777c-need-some-application-note/m-p/730116#M9908</guid>
      <dc:creator>yogeshsharma</dc:creator>
      <dc:date>2017-12-18T13:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: eSCI not working in MPC5777c, need some application note</title>
      <link>https://community.nxp.com/t5/MPC5xxx/eSCI-not-working-in-MPC5777c-need-some-application-note/m-p/730117#M9909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, just to be sure - are you aware that eSCI is connected to UART-USB bridge and it is supposed to be used with virtual terminal on PC side?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/30368iB20873E8E97416BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Someone would expect it is UART connector on motherboard, but it is not. It is connected to USB connector J21.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2017 08:35:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/eSCI-not-working-in-MPC5777c-need-some-application-note/m-p/730117#M9909</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2017-12-19T08:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: eSCI not working in MPC5777c, need some application note</title>
      <link>https://community.nxp.com/t5/MPC5xxx/eSCI-not-working-in-MPC5777c-need-some-application-note/m-p/730118#M9910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks it is working now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am checking Receiver, it is not working. Any suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2017 12:12:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/eSCI-not-working-in-MPC5777c-need-some-application-note/m-p/730118#M9910</guid>
      <dc:creator>yogeshsharma</dc:creator>
      <dc:date>2017-12-19T12:12:56Z</dc:date>
    </item>
  </channel>
</rss>

