NOTICE: The Processors Wiki will End-of-Life in December of 2020. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
LAUNCHXL2 570LC43: lwIP Demo
This wiki is open and can be edited by all!
More information available @ www.ti.com/launchpad
By following these instructions you can modify the HALCoGen Ethernet Driver and lwIP Integration Demonstration to work on the TMS570LC4357 Launchpad.
- Make sure you have HALCoGen Installed and Updated.
- Download lwIP_Demo_v03
- Run the installation program, noting your installation folder. We'll call this '<install_dir>' in the following steps.
- Navigate to the folder '<install_dir>/HALCoGen EMAC Driver with lwIP Demonstration/v00.03.00'
- Copy the TMS570LC43x folder to a folder named '<install_dir>/HALCoGen EMAC Driver with lwIP Demonstration/v00.03.00/LAUNCHXL2-570LC43'
- Start a HALCoGen session.
- From HALCoGen, open the project '<install_dir>/HALCoGen EMAC Driver with lwIP Demonstration/v00.03.00/LAUNCHXL2-570LC43/HALCoGen-TMS570LC43x/HalCoGen-TMS570LC43x.hcg'
- Make the following changes to the HALCoGen Project:
- TMS570LC4357ZWT / Driver Enable Tab
We need to enable the GIO Driver
- Check "Enable GIO Driver".
- Confirm GIO, SCI1, and EMAC drivers are enabled.
We need to provide a 25MHz Clock to the Phy
- In the ECLK Pin Mode Group - Change the ECLK pin Mode to ECLK
- In the ECLK pin Group - make sure DIR is checked
- In the ECLK Functional Configuration group, change Divider to 3 so that ECPCLK is 25MHz
- Also check the "Continue on suspend" button.
We need change the MII and MDIO interface pins to their default locations
- 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 we will have to undo manually.
- 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 instead.
- 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.
- We need to change all of the input MII and MDIO signals to the Default (left Column) states:
- MDIO=F4, MII_COL=W4, MII_CRS=V4, MII_RX_DV=U6, MII_RX_ER=U5, MII_RXCLK=T4, MII_RXD=U4, MII_RXD=T3, MII_RXD=U3, MII_RXD=V3, MII_TX_CLK=U7
- We need GIOA and GIOA to be driven high, to release the phy from reset and power down.
- Check the "DIR" box for Bit 3 and Bit 4
- Change DOUT to '1' for Bit 3 and Bit 4
- From the Project Menu, choose "Import CCS Projects"
- Select 'search-directory'
- Browse to the folder '<install_dir>/HALCoGen EMAC Driver with lwIP Demonstration/v00.03.00/'
- From the list of projects available to import - select "Build-TMS570LC43x"
- In CCS's Project Explorer, select the project "Build-TMS570LC43x"
- Use CTRL-C, CTRL-V or the context menu to copy / paste the project
- For the new project use the name "Build-LAUNCHXL2-570LC43".
- Select your new project, 'Build-LAUNCHXL2-570LC43', in CCS's Project Explorer
- If not expanded, expand the tree under this project
- Select the folder "HALCoGen-TMS570LC43x". The folder icon should indicate that it is a linked resource.
- From the context-menu, select "Properties" for the folder "HALCoGen-TMS570LC43x".
- With "Resource" selected, press "Edit" and change the Location to: ORIGINAL_PROJECT_ROOT\..\..\LAUNCHXL2-570LC43\HALCoGen-TMS570LC43x
- Make sure the Resolved Location displayed matches the HALCoGen project that you edited in step 7.
- From your "Build-LAUNCHXL2-570LC43" CCS project, navigate to and open for editing "HALCoGen-TMS570LC43x\include\HL_phy_dp83640.h"
- Change the last "USER CODE" block in the header file, so that it reads:
/* 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 */
- From your "Build-LAUNCHXL2-570LC43" CCS project, navigate to and open for editing "HALCoGen-TMS570LC43x\source\HL_sys_main.c"
- Add an include directive for "HL_gio.h", so that the first USER CODE block reads:
- Add a call to gioInit() to main() so that the third user block reads:
/* USER CODE BEGIN (1) */ #include "HL_gio.h" extern void EMAC_LwIP_Main (uint8_t * emacAddress); /* USER CODE END */
/* USER CODE BEGIN (3) */ gioInit(); EMAC_LwIP_Main(emacAddress); /* USER CODE END */
- Open the target configuration file targetConfigs\TMS570LC43xx.ccxml from your project by double clicking it.
- On the BASIC tab, under General Setup, change the Connection to: Texas Instruments XDS110 USB Debug Probe
- Confirm that the Board or Device is still set to "TMS570LC43xx"
- Save the Configuration