版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、STM3240G-EVAL_OS3-USBH-No-SrcSTM3240G-EVAL Example Project Read-MeThe provided example project for which this Read-Me was made utilizes the ST STM3240G-EVAL (STM32F407IG) evaluation board from the STM32F4x Family. The MCU found on this development board conforms with the ARM_Cortex_M4 architecture.P
2、roject Download Toolchain IDE Versions Micrim Product Versions Hardware SetupLoading & Running The Project on the Board IAR Embedded WorkbenchC/OS-IIIC/USB-HostSerial Port Connection SetupCommunication Device Class (CDC) Abstract Control Model (ACM) Subclass Demo Human Interface Device (HID) Class D
3、emoMass Storage Class (MSC) DemoFuture Technology Devices International (FTDI) Class Demo C/ProbeRunning with J-LinkProject DownloadToolchain IDE VersionsMicrim Product VersionsProductVersionC/CPU1.30.02C/LIB1.38.01C/OS-III3.04.05C/Clk3.09.03C/Serial2.00.01C/FS4.07.00C/USB-Host3.41.03IDE/ToolchainVe
4、rsionIAR EW for ARM7.40.2STM32CubeF4 Libraries1.5.0Download LinkMicrium_STM3240G-EVAL_OS3-USBH-No-Src.zipLicensing is required when using any Micrim software, regardless of the state of the software (Library or Full Source). This project is only meant for example purposes. For projects using Library
5、 versions of the software, please contact ourSales office to obtain the Full Source version at +1 (954) 217-2036.Hardware Setup1. Have the board connected via the J-Link into the board debugging input (CN14).2. Power will be provided by an external power supply of 5V.3. Make sure that JP18 is set to
6、 PSU.Loading & Running The Project on the BoardIAR Embedded Workbench1. Click on FileOpenWorkspace.2. Navigate to the directory where the workspace is located: $MicriumExamplesSTSTM3240G-EVALOS3-USBHIAR-No-SrcOS3-U SBH-No-Src.eww3. Click Open.4. For safety, clean the project by clicking on ProjectCl
7、ean (if available).5. Compile the project by clicking on ProjectMake.6. Make sure your hardware setup (as previously described) is correct.7. Download the code to the board by clicking on ProjectDownload and Debug.8. Run the project by clicking on DebugGo. To stop the project from running, click on
8、DebugStop Debugging.C/OS-IIIMake sure to open the example project workspace using the mentioned IDE(s) version or newer.C/Probe3.5Listing - app.c (1)OSInit() initializes uC/OS-III and must be called prior to calling OSStart(), which actually starts multitasking.(2)OSTaskCreate() creates a task to be
9、 managed by uC/OS-III. Tasks can be created either prior to the start of multitasking or by a running task. In this case, the task AppStartTask gets created.(3)OSStart() starts multitasking under uC/OS-III. This function is typically called from the startup code but after calling OSInit().(4)AppTask
10、Start is the startup task created in (2).(5)A task must be written as an infinite loop and must not return.voidmain (void).OSInit(&os_err);/* Initialize uC/OS-III*/(1).OSTaskCreate(&AppTaskStartTCB,/* Create the start task*/(2)App Task Start, AppTaskStart, 0,APP_CFG_TASK_START_PRIO,&AppTaskStartStk0
11、, APP_CFG_TASK_START_STK_SIZE / 10u, APP_CFG_TASK_START_STK_SIZE,0u,0u,0,(OS_OPT_TASK_STK_CHK | OS_OPT_TASK_STK_CLR),&os_err);OSStart(&os_err);/* Start multitasking*/(3)staticvoidAppTaskStart (void *p_arg) (4).while (DEF_TRUE) /* Task body, always as an infinite loop.*/(5).(6)OSTimeDlyHMSM( 0u, 0u,
12、0u, 500u,(7)OS_OPT_TIME_HMSM_STRICT,&os_err);(6)In most examples, there is hardware dependent code such as LED blink, etc.(7)OSTimeDlyHMSM() allows AppTaskStart to delay itself for a user-specified amount of time (500ms in this case). Rescheduling always occurs when at least one of the parameters is
13、 nonzero. Placing a break-point here can ensure that uC/OS-III is running, it should get hit periodically every 500 milliseconds.For more information please refer to uC/OS-III Users Guide.C/USB-HostIn order to run any of the class demos, C/USB-Host must be enabled by setting APP_CFG_USBH_EN to DEF_E
14、NABLED.Serial Port Connection SetupPrior to running any of the C/USB-Host demo(s), a serial port connection should be established to view the output messages through a program capable of viewing Serial Data (such as PuTTY, HyperTerminal, etc.), through the IDEs Terminal I/O Window (if applicable).If
15、 establishing serial output via a program capable of viewing serial data or through the IDEs Terminal I/O window, the following must be configured:Serial Port Connection:1. Setup the serial port connection and connect the serial port to the appropriate serial port on the STM3240G-EVAL.2. Use PuTTY,
16、HyperTerminal, or any other program with the ability to display serial port communication with the following data:a. COM # Channel / Serial Line: Based on Host Computer Channel Assignment.i. The COM # channel can be found using the Device Manager in Windows.b. Baud Rate: Based on Project Settings.i.
17、 This value can be usually found in app.c inside the serial initialization function.c. Data Bits: 8d. Parity: Nonee. Stop Bits: 1f. Flow Control: NoneTerminal I/O Connection:For some IDEs, the use of the Terminal I/O connection is available if no serial port is present or configured with the project
18、. Usually, the Terminal I/O is found in the View menu of the IDE. If not, refer to the IDEs documentation for more information.Communication Device Class (CDC) Abstract Control Model (ACM) Subclass DemoThis demo is intended to be used with a USB modem that supports AT commands. Upon connection of th
19、e USB modem to the board, the demo application will initiate a few AT commands and wait for the modems response.1. To run the CDC-ACM class demo, make sure the following definitions found in app_cfg.h are set as follow:ListinC demo(1) In order for the CDC-ACM class demo to run, APP_CFG_USBH_CDC_EN m
20、ust be enabled by setting it to DEF_ENABLED2. After confirming that the definitions are set as in the previous step, compile the project and download it to the target (as described earlier in this document).3. Once the demo is running, connect a USB Modem (or other CDC device) to the USB-Host port o
21、n the STM3240G-EVAL. An output similar to the following should be expected:#defineAPP_CFG_USBH_CDC_ENDEF_ENABLED(1)ListinC Demo OutputFor more information regarding the CDC-ACM demo, refer to section 6-4-3 Demo Application in the uC/USB-Host user manual downloadable PDF at: C/USB-Host Documentation
22、HomeHuman Interface Device (HID) Class DemoThis demo tests the Mouse and Keyboard demo for the HID class, where the application expects a certain report format that is compatible with the majority of mice and keyboards using the U.S. Layout available on the market. However, there might be a device t
23、hat uses a slightly different report, so the user will have to parse the report differently as well as write it. The HID demo displays activity created by either the USB Mouse or Keyboard when connected to the STM3240G-EVAL.=USB HOST INITIALIZATION=. Initiliazing HOST Communication Device Class . CD
24、C ACM Demo: Device Connected= AT CMD = ATQ0V1E0= STATUS / DATA = ATQ0V1E0OK= AT CMD = ATI0= STATUS / DATA = 5601OK= AT CMD = ATI1= STATUS / DATA = 5588OK= AT CMD = ATI2= STATUS / DATA = OK= AT CMD = ATI3= STATUS / DATA =U.S. Robotics 56K FAX USB V1.2.23 OK= AT CMD = ATI7= STATUS / DATA =Configuratio
25、n Profile.Product TypeCanada USBProduct ID:USR5637OptionsV32bis,V.80,V.34+,V.90,V.92Error CorrectionMNP,V.42Data CompressionMNP5,V.42bis,V.44 Fax OptionsClass 1CDC ACM Demo: Device Removed1. To run the HID class demo, make sure the following definitions found in app_cfg.h are set as follow:Listing -
26、 HID demo(1) In order for the HID class demo to run, APP_CFG_USBH_HID_EN must be enabled by setting it to DEF_ENABLED2. After confirming that the definitions are set as in the previous step, compile the project and download it to the target (as described earlier in this document).3. Once the demo is
27、 running, connect a USB Mouse or Keyboard to the USB-Host port on the STM3240G-EVAL. An output similar to the following should be expected:Listing - HID Demo OutputFor more information regarding the HID demo, refer to section 8-4 Demo Application in the uC/USB-Host user manual downloadable PDF at: C
28、/USB-Host Documentation HomeMass Storage Class (MSC) DemoThis demo tests a storage media (Mass Storage Device) for the MSC class, where the application opens a file in the Mass Storage Device, performs a write/read operation, then closes the file.1. To run the HID class demo, make sure the following
29、 definitions found in app_cfg.h are set as follow:Listing - MSC demo(1) In order for the MSC class demo to run, APP_CFG_USBH_MSC_EN must be enabled by setting it to DEF_ENABLED2. After confirming that the definitions are set as in the previous step, compile the project and download it to the target
30、(as described earlier in this document).3. Once the demo is running, connect a USB Mass Storage Device (such as a USB Flash Drive) to the STM3240G-EVAL.4. The application should perform the following operations: Create and open a file and name it MSPrint.txt.Write the following content in the file:
31、This is the USB Mass Storage Demo Sample Output File. Read back the data contained in the file.Compare and validate that the data written is identical to the data read.5. An output similar to the following should be expected:#defineAPP_CFG_USBH_MSC_ENDEF_ENABLED(1)=USB HOST INITIALIZATION=. Initilia
32、zing HOST Human Interface Device class . HID Demo: Device ConnectedHID Demo: Mouse Connected Pointer at (x, y) = (-3, -17) Pointer at (x, y) = (85, 39) Leftbutton pressedLeftbutton released Rightbutton pressed Rightbutton released Middle button pressed Middle button releasedPointer at (x, y) = (249,
33、 -41) Pointer at (x, y) = (278, 71)#defineAPP_CFG_USBH_HID_ENDEF_ENABLED(1)Listing - MSC Demo OutputFor more information regarding the HID demo, refer to section 9-4 Demo Application in the uC/USB-Host user manual downloadable PDF at: C/USB-Host Documentation HomeFuture Technology Devices Internatio
34、nal (FTDI) Class DemoThis demo is intended to be used with an FTDI device such as a Serial-to-USB adapter. Upon connection of the device to theSTM3240G-EVAL, the demo application sets up a modem connection. After, the reception task receives data periodically and displays the status (if different fr
35、om the last status) and the received data in the output terminal.1. To run the FTDI class demo, make sure the following definitions found in app_cfg.h are set as follow:Listing - FTDI demo(1) In order for the FTDI class demo to run, APP_CFG_USBH_FTDI_EN must be enabled by setting it to DEF_ENABLED2.
36、 After confirming that the definitions are set as in the previous step, compile the project and download it to the target (as described earlier in this document).3. Once the demo is running, connect an FTDI device such as a Serial-to-USB adapter to the STM3240G-EVAL. An output similar to the followi
37、ng should be expected:=USB HOST INITIALIZATION=. Initiliazing HOST FTDI class . SERIAL STATUS Handle : 2 MODEM STATUS Full-speed: 1High-speed: 0Clear to Send: 0Data Set Ready: 0Ring Indicator: 0 Receive Line Signal Detect: 0 LINE STATUS Overrun Error: 0Parity Error: 0Framing Error: 0Break Interrupt:
38、 0 Transmitter Holding Register : 1 Transmitter Empty: 1#defineAPP_CFG_USBH_FTDI_ENDEF_ENABLED(1)=USB HOST INITIALIZATION=. Initiliazing HOST Mass Storage class .MSC Demo: Device with unit #0 connected Writing msc:x:MSPrint.txt to USB drive.OKReading msc:x:MSPrint.txt from USB drive.OKComparing orig
39、inal data and data read from USB drive. PassedListing - FTDI Demo OutputFor more information regarding the FTDI demo, refer to section 7-4 Demo Application in the uC/USB-Host user manual downloadable PDF at: C/USB-Host Documentation HomeC/ProbeC/Probe, is a Micrim Windows application to graphically view the internals of any embedded system. This example project includes a pre-configured C/Probe workspace that can be found at:$MicriumExamplesSTSTM3240G-EVALOS3-USBH-No-SrcOS
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026变量相加面试题及答案
- 2026滨江学校面试题目及答案
- 2026播音社团面试题及答案
- 2026部队留队面试题及答案
- 2026黑龙江黑河市五大连池市公安局招聘政府编外用工人员2人参考题库含完整答案详解(网校专用)
- 2026四川大学华西厦门医院急缺岗位招聘模拟试卷附参考答案详解【研优卷】
- 2026年6月福建厦门市发展和改革委员会招聘非在编辅助岗人员1人备考题库及完整答案详解【名师系列】
- 2026广东揭阳市直学校赴外地院校招聘教师11人(编制)备考题库(有一套)附答案详解
- 届广州市天河区八年级地理生物学业水平考试原创仿真模拟卷含答案详解评分标准学生作答区黑白可打印版
- 2026陕西安康市遴选大学生到市政府机关见习80人笔试题库含答案详解【黄金题型】
- 《谢晶日教授治疗慢性胰腺炎的临床经验总结》
- 教育局关于双减工作的实施方案
- 三年级下册道德与法治教学工作总结
- 口腔科用牙科数字化口腔扫描精度考核试卷
- 勘察报告(尾矿库)
- 动力管道设计手册-第2版
- 电梯术语中英文对照表
- 【课件】半偏法测量电表内阻(课件)
- 干部人事档案专项审核工作
- 《美国1787年宪法》实用的教学设计
- GB 29837-2013火灾探测报警产品的维修保养与报废
评论
0/150
提交评论