引用: 引用 14 楼 gooogleman 的回复:
引用 13 楼 codewarrior 的回复:
没有网卡可以用mass storage的方式下载,即选择下载后,插上USB,让nand flash识别成一个u盘,把nk.bin拷上去,然后内部在进行解析,写入。
这个要wince起来后才行吧,我就是这么做的。关键楼主现在想启动wince吧。第一次烧写还是要的。
可以的。270可以设定GPIO为USB。
void InitUsb(void)
{
unsigned udc_crA_val, udc_crB_val;
g_pClockRegs = (volatile CLKMAN_REGS *)CLK_BASE_U_VIRTUAL;
g_pUDCRegs = (volatile UDC_REGS *)UDC_BASE_U_VIRTUAL;
startusb();
dConfIdx=0;
dAddress=0;
dInterface=0;
dSetting=0;
g_pClockRegs->cken |= XLLP_CLKEN_USBCLIENT ;
UDCCR_UDE_DISABLE( g_pUDCRegs->udc_cr );
udc_crA_val = ( XLLP_UDC_UDCCRZ_EE | MAX_PKT_BULK_64 | EP_DIRECTION_IN
| EP_TYPE_BULK | EP_NUM_1 | ALTERNATE_INTERFACE_SETTING_0
| INTERFACE_SETTING_0 | CONFIG_NUM_1 | XLLP_UDC_UDCCRZ_DE) ;
//Configure Endpoint A
g_pUDCRegs->udc_crA = udc_crA_val;
//Configuring Endpoint B
//BULK OUT with max pkt size 64
udc_crB_val = ( XLLP_UDC_UDCCRZ_EE | MAX_PKT_BULK_64 | EP_DIRECTION_OUT
| EP_TYPE_BULK | EP_NUM_2 | ALTERNATE_INTERFACE_SETTING_0
| INTERFACE_SETTING_0 | CONFIG_NUM_1 | XLLP_UDC_UDCCRZ_DE);
//Configure Endpoint B
g_pUDCRegs->udc_crB = udc_crB_val;
//Enable UDE
UDCCR_UDE_ENABLE( g_pUDCRegs->udc_cr );
//Check for Endpoint Memory configuration error
if (g_pUDCRegs->udc_cr & XLLP_UDC_UDCCR_EMCE)
EdbgOutputDebugString("** UDC Endpoint Memory configuration error **\n");
//Enable endpoint interrupts
//For endpoint 0, enable Packet Complete intr request and FIFO error intr request
//For endpoints A and B, enable Packet Complete intr request.
UDCICR0_INT_EN( g_pUDCRegs->udc_icr0, XLLP_UDC_UDCICR0_IE0_0 |
XLLP_UDC_UDCICR0_IEA_0 |
XLLP_UDC_UDCICR0_IEB_0);
//Enable Reset interrupt
UDCICR1_INT_EN( g_pUDCRegs->udc_icr1, XLLP_UDC_UDCICR1_IERS);
//Enable Config change intr
ENABLE_CONFIG_CHANGE_INTR(g_pUDCRegs->udc_icr1);
// Setup default state info.
g_EP0Status = WAIT_FOR_SETUP;
}