This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Serial to Ethernet UART doesn't work

Other Parts Discussed in Thread: TIDA-00226, EK-TM4C1294XL, TM4C1294NCPDT, TM4C129XNCZAD

Hello,

I'm using the Reference design for the serial to Ethernet converter (32-bit ARM® Cortex™-M4F MCU based Small form factor Serial-to-Ethernet Converter TIDA-00226), with some slight modification for suiting in my box.

I have downloaded the firmware using the CCS6.1.2, and debug it. I faced one problem on the UART: when I launch the "MAP_UARTConfigSetExpClk" macro in the firmware, I get an error "Memory map prevented reading 0x0100A06E [code=0x20000]", as if the firmware tries to read beyond the data of the flash.

If I try to remove the instructions of the firmware related to the Uart, the Ethernet works well, I can send the packets sent and received via Wireshark. But, of course, I can't send those packet to the UART.

What could that error be related to? It seems related to project settings, but since I have never used TI CCS, I don't know what to do exactly.

  • Hello Mattia

    I have asked my colleague to help you out with the Design

    Regards
    Amit
  • Hello Mattia,

    Which version of Tivaware are you using?

    I tried with TivaWare 2.1.3 and CCS 6.1.2 and did not get any error when the MAP_UARTConfigSetExpClk API was executed. I don't have the exact hardware, but I ran the example on EK-TM4C1294XL Launchpad.

    Thanks,
    Sai
  • Mattia Berton1 said:
    I have downloaded the firmware using the CCS6.1.2, and debug it. I faced one problem on the UART: when I launch the "MAP_UARTConfigSetExpClk" macro in the firmware, I get an error "Memory map prevented reading 0x0100A06E [code=0x20000]", as if the firmware tries to read beyond the data of the flash.

    Using CCS 6.1.3 and a TM4C1294NCPDT I stepping into a MAP_UARTConfigSetExpClk call, the address changed to 0x0100A06E and also got the  "Memory map prevented reading 0x0100A06E [code=0x20000]" message in the CCS disassembly window. I was able to continue stepping until the MAP_UARTConfigSetExpClk returned to the calling C code and the UART is working correctly. In my program MAP_UARTConfigSetExpClk was set to use the ROM based ROM_UARTConfigSetExpClk function.

    Since the UART operates correctly after the ROM_UARTConfigSetExpClk call, I believe the problem is that the ccsv6\ccs_base\emulation\gel\tm4c1294ncpdt.gel GEL script in CCS 6.1.3 has incorrectly specified the size of the TM4C1294NCPDT ROM as 0x8c00 bytes, since the ROM_UARTConfigSetExpClk function starts at offset 0xA06E into the ROM:

        GEL_MapAddStr(0x01000000, 0, 0x00008c00, "R", 0);  /* ROM */
    

    Looking at the TM4C1294NCPDT datasheet SPMS433B I am not sure how large the ROM is, since Table 2-4. Memory Map shows the ROM starting at address 0x02000000 which differs from the GEL script and the actual functions in ROM:

    Mattia Berton1 said:
    What could that error be related to?

    Once CCS displays "Memory map prevented reading 0x0100A06E [code=0x20000]", if you continue stepping does control eventually return to your own code and does the UART work?

    Alternatively, does Step Over (F6) on the MAP_ function calls work, as that avoids trying to single step into the ROM functions for which CCS has no symbolic debug information?

  • I use Tivaware 2.1.2.111.

    It appears that the problem is elsewhere: the list of possible base addresses, interrupts for the console UART and the list of UART peripherals have been limited to three: UART0, UART1, UART2. But the reference design uses UART3 (and possibly UART4), so the call to MAP_UARTConfigSetExpClk has arguments that has no sense.

    I now have enabled UART3 and UART4, and the project compiles correctly. Also, I had to change the Ethernet Led pinout, because they were mapped to different pin respect to the Reference design. But this makes me think that the project I am using has not been tested for the reference board I'm using, also because I  don't see the Modbus message passing from the Ethernet to UART, perhaps it has different version. Can you confirm that the project and version in the website works correctly with the corresponding board TIDA-00226?

    Thanks

  • Mattia Berton1 said:
    Can you confirm that the project and version in the website works correctly with the corresponding board TIDA-00226?

    I don't have a TIDA-00226, but hopefully someone from TI can confirm that.

    Mattia Berton1 said:
    It appears that the problem is elsewhere: the list of possible base addresses, interrupts for the console UART and the list of UART peripherals have been limited to three: UART0, UART1, UART2.

    Can you confirm which Tiva part you are using, and where the list of UART peripherals have been limited to three?

    Since as far as I can tell from the parametric selection tool all TM4C12x MCUs have eight UARTs.

  • I'm using the TM4C129XNCZAD. I use Tivaware 2.1.2.111. The UartSTDio.c file I'm using that you can find in the /utils folder of the Tivaware doesn't make use of the eight UARTs, but only three of them. Should I download other Tivaware?
  • Hello Mattia,

    As you have noted, the API "UARTStdioConfig" only supports UART peripherals 0 to 2. Good find. When I ran the application, I did not encounter the error. It could be because the error is triggered only when run with Debug configuration.

    I am not sure why the application developer passed UART3 to this API. I have reached out to the developer who worked on this application to help answer your questions.

    FYI: There is another TI-Design (www.ti.com/.../TIDM-TM4C129XS2E), which is similar to TIDA-00226. This TI Design works on EK-TM4C1294XL board and uses FreeRTOS for Serial to Ethernet functionality. It does not support ModBus though.

    Thanks,
    Sai
  • Mattia Berton1 said:
    I use Tivaware 2.1.2.111. The UartSTDio.c file I'm using that you can find in the /utils folder of the Tivaware doesn't make use of the eight UARTs, but only three of them.

    Tivaware 2.1.2.111 is the latest release. You could add a modified copy of uartstdio.c to your project, and expand the arrays for all eight UARTs:

    //*****************************************************************************
    //
    // The list of possible base addresses for the console UART.
    //
    //*****************************************************************************
    static const uint32_t g_ui32UARTBase[8] =
    {
        UART0_BASE, UART1_BASE, UART2_BASE, UART3_BASE, UART4_BASE, UART5_BASE, UART6_BASE, UART7_BASE
    };
    
    #ifdef UART_BUFFERED
    //*****************************************************************************
    //
    // The list of possible interrupts for the console UART.
    //
    //*****************************************************************************
    static const uint32_t g_ui32UARTInt[8] =
    {
        INT_UART0, INT_UART1, INT_UART2, INT_UART3, INT_UART4, INT_UART5, INT_UART6, INT_UART7
    };
    
    //*****************************************************************************
    //
    // The port number in use.
    //
    //*****************************************************************************
    static uint32_t g_ui32PortNum;
    #endif
    
    //*****************************************************************************
    //
    // The list of UART peripherals.
    //
    //*****************************************************************************
    static const uint32_t g_ui32UARTPeriph[8] =
    {
        SYSCTL_PERIPH_UART0, SYSCTL_PERIPH_UART1, SYSCTL_PERIPH_UART2, SYSCTL_PERIPH_UART3,
        SYSCTL_PERIPH_UART4, SYSCTL_PERIPH_UART5, SYSCTL_PERIPH_UART6, SYSCTL_PERIPH_UART7
    };
    

    I only tested the above compiled, and and didn't test the changes on an actual device.

  • Yes, I've already have changed that file, and it works. However, I still can't run the application, because now the Uart works, but doesn't output anything to an external slave device. I need to have a more consistent debug, but that is strange, since the app note should work. I think that the version in the website is not the latest, or I don't know, perhaps I need some more things to do.

    Stellaris Sai: I noted that reference design, but for me Modbus is necessary. Also, I need not to have an OS in my application. Thank you the same!