實驗方法:
1、將跳線冒跳至USB_UART,通過Micro USB 線將iCore4 USB-UART介面與電腦相連。
2、開啟PUTTY軟體。
3、通過讀U盤轉接線將U盤(或者讀卡器)與iCore4 USB-OTG介面相連。大容量儲存器為FAT32格式。
實驗現象:
核心程式碼:
int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration----------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_USB_HOST_Init(); MX_USART6_UART_Init(); MX_FATFS_Init(); /* USER CODE BEGIN 2 */ usart6.printf("\x0c"); usart6.printf("\033[1;32;40m"); usart6.printf("\r\nHello, I am iCore4.\r\n"); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ MX_USB_HOST_Process(); /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ }
原始碼下載連結:
連結:http://pan.baidu.com/s/1skOtJh7 密碼:ttme
iCore4連結: