These are the examples provided for [[/users/frank26080115/libraries/LPC1700CMSIS_Lib/]] Note, the entire "program" is not compilable!
EMAC/EmacRaw/abstract.h@0:bf7b9fba3924, 2011-03-20 (annotated)
- Committer:
- frank26080115
- Date:
- Sun Mar 20 05:38:56 2011 +0000
- Revision:
- 0:bf7b9fba3924
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
frank26080115 | 0:bf7b9fba3924 | 1 | ******************** (C) COPYRIGHT 2010 NXPSemiconductors ******************* |
frank26080115 | 0:bf7b9fba3924 | 2 | * @file EMAC\EmacRaw\abstract.txt |
frank26080115 | 0:bf7b9fba3924 | 3 | * @author NXP MCU SW Application Team |
frank26080115 | 0:bf7b9fba3924 | 4 | * @version 2.0 |
frank26080115 | 0:bf7b9fba3924 | 5 | * @date |
frank26080115 | 0:bf7b9fba3924 | 6 | * @brief Description of the EMAC EmacRaw example. |
frank26080115 | 0:bf7b9fba3924 | 7 | ****************************************************************************** |
frank26080115 | 0:bf7b9fba3924 | 8 | * Software that is described herein is for illustrative purposes only |
frank26080115 | 0:bf7b9fba3924 | 9 | * which provides customers with programming information regarding the |
frank26080115 | 0:bf7b9fba3924 | 10 | * products. This software is supplied "AS IS" without any warranties. |
frank26080115 | 0:bf7b9fba3924 | 11 | * NXP Semiconductors assumes no responsibility or liability for the |
frank26080115 | 0:bf7b9fba3924 | 12 | * use of the software, conveys no license or title under any patent, |
frank26080115 | 0:bf7b9fba3924 | 13 | * copyright, or mask work right to the product. NXP Semiconductors |
frank26080115 | 0:bf7b9fba3924 | 14 | * reserves the right to make changes in the software without |
frank26080115 | 0:bf7b9fba3924 | 15 | * notification. NXP Semiconductors also make no representation or |
frank26080115 | 0:bf7b9fba3924 | 16 | * warranty that such application will be suitable for the specified |
frank26080115 | 0:bf7b9fba3924 | 17 | * use without further testing or modification. |
frank26080115 | 0:bf7b9fba3924 | 18 | ****************************************************************************** |
frank26080115 | 0:bf7b9fba3924 | 19 | |
frank26080115 | 0:bf7b9fba3924 | 20 | @Example description: |
frank26080115 | 0:bf7b9fba3924 | 21 | Purpose: |
frank26080115 | 0:bf7b9fba3924 | 22 | This example describes how to test EMAC driver with raw packet frame format |
frank26080115 | 0:bf7b9fba3924 | 23 | that is not related with any upper-layer (i.e. TCP/IP...). |
frank26080115 | 0:bf7b9fba3924 | 24 | Process: |
frank26080115 | 0:bf7b9fba3924 | 25 | There are two ways to test: |
frank26080115 | 0:bf7b9fba3924 | 26 | - TX_ONLY and BOUNCE_RX flags can be set one at a time, not both. |
frank26080115 | 0:bf7b9fba3924 | 27 | When TX_ONLY is set to 1, it's a TX_ONLY packet from the MCB1700 |
frank26080115 | 0:bf7b9fba3924 | 28 | board to the LAN. Use the traffic analyzer such as ethereal, once |
frank26080115 | 0:bf7b9fba3924 | 29 | the program is running, the packets can be monitored on the traffic |
frank26080115 | 0:bf7b9fba3924 | 30 | analyzer. |
frank26080115 | 0:bf7b9fba3924 | 31 | - When BOUNCE_RX is set to 1 (TX_ONLY needs to reset to 0), it's a |
frank26080115 | 0:bf7b9fba3924 | 32 | test to test both TX and RX, use the traffic generator/analyzer, |
frank26080115 | 0:bf7b9fba3924 | 33 | you can creat a packet with the destination address as that on the |
frank26080115 | 0:bf7b9fba3924 | 34 | MCB1700 board, use the traffic generator to send packets, as long |
frank26080115 | 0:bf7b9fba3924 | 35 | as the destination address matches, MCB1700 will reverse the source |
frank26080115 | 0:bf7b9fba3924 | 36 | and destination address and send the packets back on the network. |
frank26080115 | 0:bf7b9fba3924 | 37 | ENABLE_WOL flag is used to test power down and WOL functionality. |
frank26080115 | 0:bf7b9fba3924 | 38 | BOUNCE_RX flag needs to be set to 1 when WOL is being tested. |
frank26080115 | 0:bf7b9fba3924 | 39 | |
frank26080115 | 0:bf7b9fba3924 | 40 | @Directory contents: |
frank26080115 | 0:bf7b9fba3924 | 41 | \EWARM: includes EWARM (IAR) project and configuration files |
frank26080115 | 0:bf7b9fba3924 | 42 | \Keil: includes RVMDK (Keil)project and configuration files |
frank26080115 | 0:bf7b9fba3924 | 43 | |
frank26080115 | 0:bf7b9fba3924 | 44 | crc32c.h/.c: Ethernet CRC module |
frank26080115 | 0:bf7b9fba3924 | 45 | emactest.c: main program |
frank26080115 | 0:bf7b9fba3924 | 46 | libnosys_gnu.c: Definitions for OS interface, stub function required by newlibc |
frank26080115 | 0:bf7b9fba3924 | 47 | used by Codesourcery GNU compiler. |
frank26080115 | 0:bf7b9fba3924 | 48 | lpc17xx_libcfg.h: Library configuration file - include needed driver library for this example |
frank26080115 | 0:bf7b9fba3924 | 49 | makefile: Example's makefile (to build with GNU toolchain) |
frank26080115 | 0:bf7b9fba3924 | 50 | |
frank26080115 | 0:bf7b9fba3924 | 51 | @How to run: |
frank26080115 | 0:bf7b9fba3924 | 52 | Hardware configuration: |
frank26080115 | 0:bf7b9fba3924 | 53 | This example is tested on: |
frank26080115 | 0:bf7b9fba3924 | 54 | Keil MCB1700 vers.1 |
frank26080115 | 0:bf7b9fba3924 | 55 | These jumpers must be configured as following: |
frank26080115 | 0:bf7b9fba3924 | 56 | - VDDIO: ON |
frank26080115 | 0:bf7b9fba3924 | 57 | - VDDREGS: ON |
frank26080115 | 0:bf7b9fba3924 | 58 | - VBUS: ON |
frank26080115 | 0:bf7b9fba3924 | 59 | - LED: ON |
frank26080115 | 0:bf7b9fba3924 | 60 | - E/C: 2-3 (Ethernet) |
frank26080115 | 0:bf7b9fba3924 | 61 | - E/U: 2-3 (Ethernet) |
frank26080115 | 0:bf7b9fba3924 | 62 | - Remain jumpers: OFF |
frank26080115 | 0:bf7b9fba3924 | 63 | IAR LPC1768 vers.A |
frank26080115 | 0:bf7b9fba3924 | 64 | These jumpers must be configured as following: |
frank26080115 | 0:bf7b9fba3924 | 65 | - PWR_SEL: depending of power source |
frank26080115 | 0:bf7b9fba3924 | 66 | - DBG_EN : ON |
frank26080115 | 0:bf7b9fba3924 | 67 | - ACC_IRQ/LED2: 2-3 (LED2) |
frank26080115 | 0:bf7b9fba3924 | 68 | - Remain jumpers: OFF |
frank26080115 | 0:bf7b9fba3924 | 69 | |
frank26080115 | 0:bf7b9fba3924 | 70 | Serial display configuration: (e.g: TeraTerm, Hyperterminal, Flash Magic...) |
frank26080115 | 0:bf7b9fba3924 | 71 | 115200bps |
frank26080115 | 0:bf7b9fba3924 | 72 | 8 data bit |
frank26080115 | 0:bf7b9fba3924 | 73 | No parity |
frank26080115 | 0:bf7b9fba3924 | 74 | 1 stop bit |
frank26080115 | 0:bf7b9fba3924 | 75 | No flow control |
frank26080115 | 0:bf7b9fba3924 | 76 | |
frank26080115 | 0:bf7b9fba3924 | 77 | Running mode: |
frank26080115 | 0:bf7b9fba3924 | 78 | This example can run only on RAM/ROM mode. |
frank26080115 | 0:bf7b9fba3924 | 79 | |
frank26080115 | 0:bf7b9fba3924 | 80 | Note: If want to burn hex file to board by using Flash Magic, these jumpers need |
frank26080115 | 0:bf7b9fba3924 | 81 | to be connected: |
frank26080115 | 0:bf7b9fba3924 | 82 | - MCB1700 with LPC1768 ver.1: |
frank26080115 | 0:bf7b9fba3924 | 83 | + RST: ON |
frank26080115 | 0:bf7b9fba3924 | 84 | + ISP: ON |
frank26080115 | 0:bf7b9fba3924 | 85 | - IAR LPC1768 KickStart vers.A: |
frank26080115 | 0:bf7b9fba3924 | 86 | + RST_E: ON |
frank26080115 | 0:bf7b9fba3924 | 87 | + ISP_E: ON |
frank26080115 | 0:bf7b9fba3924 | 88 | |
frank26080115 | 0:bf7b9fba3924 | 89 | (Please reference "LPC1000 Software Development Toolchain" - chapter 4 "Creating and working with |
frank26080115 | 0:bf7b9fba3924 | 90 | LPC1000CMSIS project" for more information) |
frank26080115 | 0:bf7b9fba3924 | 91 | |
frank26080115 | 0:bf7b9fba3924 | 92 | Step to run: |
frank26080115 | 0:bf7b9fba3924 | 93 | - Step 1: Choose correct working board by uncomment correct defined board in lpc17xx_emac.h file |
frank26080115 | 0:bf7b9fba3924 | 94 | + If using MCB1700 board, uncomment "#define MCB_LPC_1768" |
frank26080115 | 0:bf7b9fba3924 | 95 | + If using IAR-LPC1768-KS board, uncomment "#define MCB_LPC_1768" |
frank26080115 | 0:bf7b9fba3924 | 96 | (Should not uncomment both symbols at the same time) |
frank26080115 | 0:bf7b9fba3924 | 97 | - Step 2: setting flag (in emactest.c): |
frank26080115 | 0:bf7b9fba3924 | 98 | - TX_ONLY = 1 |
frank26080115 | 0:bf7b9fba3924 | 99 | - BOUNCE_RX = 0 |
frank26080115 | 0:bf7b9fba3924 | 100 | Build example and burn into first board. |
frank26080115 | 0:bf7b9fba3924 | 101 | - Step 3: setting flag: |
frank26080115 | 0:bf7b9fba3924 | 102 | - TX_ONLY = 0 |
frank26080115 | 0:bf7b9fba3924 | 103 | - BOUNCE_RX = 1 |
frank26080115 | 0:bf7b9fba3924 | 104 | Build example and burn into second board. |
frank26080115 | 0:bf7b9fba3924 | 105 | - Step 4: Use CrossOver cable to connect two boards. |
frank26080115 | 0:bf7b9fba3924 | 106 | - Step 5: Connect UART0 on two boards to COM ports on your computer. |
frank26080115 | 0:bf7b9fba3924 | 107 | - Step 6: Configure hardware and serial display as above instruction. |
frank26080115 | 0:bf7b9fba3924 | 108 | - Step 7: Hit reset button on two boards. |
frank26080115 | 0:bf7b9fba3924 | 109 | - Step 8: Wait for EMAC initilization completes on two board. |
frank26080115 | 0:bf7b9fba3924 | 110 | - Step 9: If ENABLE_WOL is enabled on board 'BOUNCE_RX' side, after initializing EMAC, |
frank26080115 | 0:bf7b9fba3924 | 111 | it will enter sleep mode to be waked-up on LAN (WoL). |
frank26080115 | 0:bf7b9fba3924 | 112 | - Step 10: On 'TX_ONLY' side, hit INT0 button to send a frame. |
frank26080115 | 0:bf7b9fba3924 | 113 | - Step 11: After receiving frame, 'BOUNCE_RX' side will be waked-up and operates |
frank26080115 | 0:bf7b9fba3924 | 114 | properly. |
frank26080115 | 0:bf7b9fba3924 | 115 | |
frank26080115 | 0:bf7b9fba3924 | 116 | (Pls reference "LPC17xx Example Description" document - chapter "Examples > EMAC > EmacRaw" |
frank26080115 | 0:bf7b9fba3924 | 117 | for more details) |
frank26080115 | 0:bf7b9fba3924 | 118 | @Tip: |
frank26080115 | 0:bf7b9fba3924 | 119 | - Open \EWARM\*.eww project file to run example on IAR |
frank26080115 | 0:bf7b9fba3924 | 120 | - Open \RVMDK\*.uvproj project file to run example on Keil |
frank26080115 | 0:bf7b9fba3924 | 121 | |
frank26080115 | 0:bf7b9fba3924 | 122 |