SPNA239 September   2019 RM46L440 , RM46L450 , RM46L830 , RM46L840 , RM46L850 , RM46L852 , RM48L530 , RM48L540 , RM48L730 , RM48L740 , RM48L940 , RM48L950 , RM48L952 , RM57L843 , TMS570LC4357 , TMS570LC4357-EP , TMS570LC4357-SEP , TMS570LS0232 , TMS570LS0332 , TMS570LS0432 , TMS570LS10106 , TMS570LS10116 , TMS570LS10206 , TMS570LS1114 , TMS570LS1115 , TMS570LS1224 , TMS570LS1225 , TMS570LS1227 , TMS570LS20206 , TMS570LS20206-EP , TMS570LS20216 , TMS570LS20216-EP , TMS570LS2124 , TMS570LS2125 , TMS570LS2134 , TMS570LS2135 , TMS570LS3134 , TMS570LS3135 , TMS570LS3137 , TMS570LS3137-EP

 

  1.   HALCoGen Ethernet Driver With lwIP Integration Demo and Active Web Server Demo
    1.     Trademarks
    2. 1 Introduction
    3. 2 Supported Features
    4. 3 Get the Software
    5. 4 Configuring EMAC and MDIO Using HALCoGen GUI for the lwIP Demo
      1. 4.1 RM46x, RM48x and TMS570LSx HDK
      2. 4.2 TMS570LC43x and RM57x HDK
      3. 4.3 RM57x Launchpad (LAUNCHXL2 RM57x)
      4. 4.4 TMS570LC43 Launchpad (LAUNCHXL2 570LC43x)
    6. 5 Additional Changes for Active Web Server Demo
      1. 5.1 HALCoGen Configuration Changes
      2. 5.2 lwIP Port Changes
      3. 5.3 CCS Project Structure
      4. 5.4 Changing the Web Pages Rendered by Web Server
    7. 6 Programming Sequence Using HALCoGen Generated Drivers
    8. 7 Design of lwIP Integration
      1. 7.1 Hardware Abstraction Layer
      2. 7.2 lwIP Interface Layer
      3. 7.3 Hercules Development Network Interface Layer
        1. 7.3.1 Network Device Initialization
        2. 7.3.2 Packet Data Transmission
        3. 7.3.3 Packet Data Reception
      4. 7.4 lwIP Application Layer
      5. 7.5 System Application Layer
    9. 8 Release Folder Structure
    10. 9 Run the Test
      1. 9.1 Hardware Setup
      2. 9.2 Building and Executing the lwIP Demo
      3. 9.3 Building and Executing the Active Web Server Demo
        1. 9.3.1 I/O Control Demo 1
        2. 9.3.2 I/O Control Demo 2

RM57x Launchpad (LAUNCHXL2 RM57x)

  1. Navigate to the folder '<install_dir>'. Copy the RM57x folder to a folder named '<install_dir>/LAUNCHXL2-RM57'.
  2. Start a HALCoGen session.
  3. From HALCoGen, open the project '<install_dir>/LAUNCHXL2-RM57/HALCoGen-RM57x/HALCoGen-RM57x.hcg'.
  4. Make the following changes to the HALCoGen Project:
    1. RM57L843ZWT/Driver Enable Tab. Enable the GIO Driver:
      1. Check "Enable GIO Driver".
      2. Confirm GIO, SCI1, and EMAC drivers are enabled.
    2. RM57L843ZWT/ECLK Tab. Provide a 25 MHz Clock to the PHY:
      1. In the ECLK Pin Mode Group, change the ECLK pin Mode to ECLK.
      2. In the ECLK pin Group, make sure DIR is checked.
      3. In the ECLK Functional Configuration group, change Divider to 3 so that ECPCLK is 25 MHz.
      4. Also check the "Continue on suspend" button.
    3. PINMUX/Pin Muxing Tab. Change the MII and MDIO interface pins to their default locations:
      1. Make sure MII is checked in the Enable/Disable Peripherals Group at the top of the PINMUX. This is necessary to put the MAC in MII mode, even though it will also move the MII pins to their alternate location, which have to be undone manually.
      2. Uncheck the MII and MDIO signals on Balls A14, B4, B11, D19, E18, F3, G3, G19, H18, H19, J18, J19, K19, N19, P1, R2 and V5. These rows should now be blank, although you can select non-Ethernet functions, if desired.
      3. Change the selection on balls T4, U7 to the default functions (from MII_RX_AVCLK4 to MII_RXCLK, and from MII_TX_AVCLK4 to MII_TX_CLK). The PHY will provide these clocks to the MAC on the launchpad.
      4. NOTE

        List Conflicts show total conflicts 2 for Ball T4 and U7 - just ignore this.

    4. PINMUX/Input Pin Muxing Tab. Change all of the input MII and MDIO signals to the Default (left Column) states:
      1. MDIO=F4, MII_COL=W4, MII_CRS=V4, MII_RX_DV=U6, MII_RX_ER=U5, MII_RXCLK=T4, MII_RXD[0]=U4, MII_RXD[1]=T3, MII_RXD[2]=U3, MII_RXD[3]=V3, MII_TX_CLK=U7
    5. GIO/Port A Tab. GIOA[3] and GIOA[4] need to be driven high, to release the PHY from reset and power down.
      1. Check the "DIR" box for Bit 3 and Bit 4.
      2. Change DOUT to '1' for Bit 3 and Bit 4.
    6. Save your modified HALCoGen Project.
    7. Press "F5" or Choose File → Generate Code from The HALCoGen menu.
    8. Exit HALCoGen.
  5. Launch Code Composer Studio.
  6. Import the project you just modified:
    1. From the Project Menu, choose "Import CCS Projects".
    2. Select 'search-directory'.
    3. Browse to the folder '<install_dir>'.
    4. From the list of projects available to import - select "Build-RM57x".
  7. Make a copy of the original project, naming it "Build-LAUNCHXL2-RM57x":
    1. In CCS's Project Explorer, select the project "Build-RM57x".
    2. Use CTRL-C, CTRL-V or the context menu to copy/paste the project.
    3. For the new project, use the name "Build-LAUNCHXL2-RM57x". You can create a new folder '<install_dir>/LAUNCHXL2-RM57/Build-LAUNCHXL2-RM57x' for this.
  8. Change the HALCoGen Project included by your new project:
    1. Select your new project, 'Build-LAUNCHXL2-RM57x', in CCS's Project Explorer.
    2. If not expanded, expand the tree under this project.
    3. Select the folder "HALCoGen-RM57x". The folder icon should indicate that it is a linked resource.
    4. From the context-menu, select "Properties" for the folder "HALCoGen-RM57x".
    5. With "Resource" selected, press "Edit" and change the location to: PROJECT_LOC\..\HALCoGen-RM57x.
    6. Make sure the Resolved Location displayed matches the HALCoGen project that you edited in step 7.
    7. You can do the same steps to resolve the locations for the "example" and "lwIP-1.4.1" folders if your CCS project was created in a different location.
  9. Change the PHY Id to match the DP83630 Precision PHYTER on the Launchpad:
    1. From your "Build-LAUNCHXL2-RM57L" CCS project, navigate to and open for editing "HALCoGen-RM57x\include\HL_phy_dp83640.h".
    2. Change the last "USER CODE" block in the header file, so that it reads:
    3. /* USER CODE BEGIN (2) */ /* @todo @fixme: This is a dirty hack, but it minimizes changes for now */ #undef DP83640_PHY_ID #define DP83640_PHY_ID (0x20005CE1u) /* USER CODE END */
  10. Add Code to initialize GIOA[3] and GIOA[4] (To release the PHY):
    1. From your "Build-LAUNCHXL2-RM57L" CCS project, navigate to and open for editing "HALCoGen-RM57x\source\HL_sys_main.c".
    2. Add an include directive for "HL_gio.h", so that the first USER CODE block reads:
    3. /* USER CODE BEGIN (1) */ #include "HL_gio.h" extern void EMAC_lwIP_Main (uint8_t * emacAddress); /* USER CODE END */
    4. Add a call to gioInit() from main() so that the third user block reads:
    5. /* USER CODE BEGIN (3) */ gioInit(); EMAC_lwIP_Main(emacAddress); /* USER CODE END */
  11. Update PINMUX file:
    1. From your "Build-LAUNCHXL2-RM57L" CCS project, navigate to and open for editing "HALCoGen-RM57x\source\HL_pinmux.c".
    2. Change PINMUX_BALL_R4_ to PINMUX_BALL_R4_GIOB_3
    3. pinMuxReg->PINMUX[9] = PINMUX_BALL_R4_GIOB_3 | PINMUX_BALL_N17_EMIF_nCS_0 | PINMUX_BALL_L17_EMIF_nCS_2;
  12. Rebuild your project.
  13. Load your project onto the Launchpad and test it out.