Kinetisソフトウェア開発キット・ナレッジベース

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Kinetis Software Development Kit Knowledge Base

ラベル

ディスカッション

ソート順:
The USB stack in ksdk 1.3 has provided a macro of “USBCFG_DEV_ADVANCED_SUSPEND_RESUME” , while the RM says “suspend/resume is not implemented yet.”, but if you looks into the source code, you may find APIs like USB_Suspend_Service() which is reserved for further implementation, so users may use these APIs as a starting point to add suspend and resume feature in ksdk 1.3. The test is based on FRDM-KL27Z, dev_hid_mouse_bm demo. And before we modify the device stack, we have to clone a copy of this demo. Set USBCFG_DEV_ADVANCED_SUSPEND_RESUME to 1 to releases APIs related with suspend and resume features. But we will have the following errors after compile, that is because remote resume function is not supported by KL27. so we should disable it for this device, with the help of #if USBCFG_DEV_ADVANCED_SUSPEND_RESUME == 1 && FSL_FEATURE_USB_KHCI_HOST_ENABLED == 1. For example, like below: 2.Further implement USB_Suspend_Service() and USB_Resume_Service() to let them notify the upper layer application on the event of suspend/resume. With reference of USB_Error_Service() and Don’t forget to add two more events for suspend and resume. 3.USB module has two types of resume interrupt , one is sync resume , issued by the bit of ISTAT[RESUME] bit, the other is async resume, issued by the bit of TRC0[USB_RESUME_INT], so we have to monitor these two interrupt status flag in the ISR, as below: And so we have modify the resume and sleep interrupt services for supporting the async resume interrupt as below: 4.Modify application and add code to handle suspend and resume event, in this case, such kind of events are handled in USB_App_Device_Callback() 5.Verify the hid_mouse demo with USB 2 CV tool from usb.org Select the FS device with VID 15a2 from the list. Test passed! if you print some messages on the event of suspend and resume, you will see something like below from the Terminal channel. 6. Now we can add low power mode switch function in the main application code to meet the suspend current limitation specified by USB spec, with reference of power_manager_hal_demo for frdmkl27z, and for this case, add code in USB_App_Device_Callback() of mouse.c to tell the main application when to enter low power mode. Please also note Don’t enter low power mode in this callback function, as it is called by the interrupt service, so if the device enter low power mode during interrupt, that would prevent the following resume interrupt happen, so the device never wake up! For more details on the implementation, please refer to the attached mouse.c 7.Test low power mode current:   Before test, please do the following modification to the FRDM-KL27Z board: Please note, if your board has the following jumpers, no need to remove R7,R21 and R83, just keep J19 and J22 open during the test. Select the low power mode you are going to test from the Ternimal: Leave KL27 USB port (J10) open and power the board with USB SDA port, that would make the device enter suspend interrupt out of reset. And you may also see the current vary with power mode switch with the help of USB 2 CV tool. I have tested wait, stop and vlps modes, the current measured under these modes are shown as below: Wait: Stop: VLPS: So it is recommend using VLPS mode during USB suspend mode as it far below the suspend current specified in USB spec (500uA). 8. Patch and demo code Please replace the following files with the attached one, as well as the mouse.c in dev_hid_mouse_bm demo. Recompile the stack and application code. C:\Freescale\KSDK_1.3.0\usb\usb_core\device\include\MKL27Z644 usb_device_config.h C:\Freescale\KSDK_1.3.0\usb\usb_core\device\sources\controller usb_dev.h usb_dev.c usb_framework.c C:\Freescale\KSDK_1.3.0\usb\usb_core\device\sources\controller\khci device_khci_interface.c khci_dev.c khci_dev.h C:\Freescale\KSDK_1.3.0\usb\usb_core\device\include usb_device_stack_interface.h C:\Freescale\KSDK_1.3.0\examples\frdmkl27z\demo_apps\usb\device\hid\hid_mouse mouse.c
記事全体を表示
Hello Kinetis users!   I thought this would be the best place to share this code.  Attached is an example of how to use the power manager in the 1.0.0 release of the Kinetis SDK.  It is essentially the legacy low power demo ported to the SDK.  Now, the SDK doesn't provide functions to de-initialize the pins so some of it is a little messy, but it should still help to show you how to use the power manager and how to get in and out of low power modes.    The supported platforms are:   FRDM-K22F FRDM-K64F TWR-K22F120M TWR-K64F120M TWR-KV31F120M   To install the demo, simply unzip the file to the "demos" folder of your SDK installation.  All of the links in the demo are relative so you shouldn't have any trouble.  However, if you do experience any issues, please let me know so that I can correct the issues.    To run the demo, simply build and download the application (a guide of how to do this is provided in the device specific User's Guide in your SDK installation).  Then perform a power-on reset (you always want to do that when working with low power applications) and connect a terminal utility with the following settings:   - 19200 baud rate - 8 data bits - No parity - 1 stop bit - No flow control   Then follow the on-screen instructions.    As a reminder to those wishing to understand low power operations and the Kinetis devices a little more, we do have an Application Note out there to help explain low power operations:  AN4503 Power Management for Kinetis and ColdFire+ MCUs.  This Application Note is in the process of being updated with Kinetis SDK information and is scheduled to be re-published sometime this year.    Enjoy! Chris
記事全体を表示
When you need to create copy/clone of i.g. web_hvac example for FreeRTOS as standalone project, you can face this issue. It is impossible to work with the copy. Why? There is missing folder for RTOS and LIB.   ISSUE: You start to clone example There is missing folder for RTOS Also missing library ksdk_freertos_lib which is needed for the example Impossible to compile the project, because folder mentioned above are missing in the project WORKAROUND: Just add the folder rtos from C:\Freescale\KSDK_1.3.0 The same for the library, you add to the folder from C:\Freescale\KSDK_1.3.0\lib Import .wsd file Wsd file was successfully imported, library is included Build successful finished   I hope this helps you. Iva
記事全体を表示
This demo is based on adc12_polling example , and so far I just tested it with FRDM-KE15Z, so please download SDK_2.0_FRDM-KE15Z.zip from Welcome to MCUXpresso | MCUXpresso Config Tools before you try that demo.   After opening the project, you have to import edma and dmamux driver code as below: then you may replace adc12_polling.c with the attached one.   compiling and run, you may see the console output ADC results like this.   Hope that helps, -Kan Original Attachment has been moved to: adc12_polling.c.zip
記事全体を表示
Because I receive feedback from customers, that it is sometimes complicated to execute this demo, I created short tutorial how to set it and execute it in KDS 3.0.0.   1. Physical connection In case of TWR-K64F, is needed TWR-SER and correctly set jumpers. and for TWR-K64F is needed to set jumper J6 to pins 1 and 2.   Be sure, that the TWR-SER and TWR-K64F is correctly connected (by white line) 2. Network configuration For changing IP address, please go to Network and Sharing Center, choose Change adapter settings Right click on Properties and change the IP address (TCP/IPv4) to 192.168.2.100   3.  Downloading the demo to TWR-K64F Go to KDS, File - Import and browse the demo, which is located at C:\Freescale\KSDK_1.2.0\examples\twrk64f120m\demo_apps\web_hvac\web_hvac_mqx\kds Import all libraries and the demo project and see imported sets in Project Explorer Debug the libraries first and then the project. Be sure, what debugger is used on the board and set the debugger. And now go to Resume!   4. Test the connection Go to cmd and ping to 192.168.2.102 (address of HVAC Server)   5. HVAC Web Server.Go to browser and type the address 192.168.2.102, you will see page for HVAC Web Server. Go to HVAC Demo - HVAC Status and now you can observe the temperatures by pressing button. There are set combinations which means see below. LED1: Simulate the Fan’s state LED2: System in the Heat mode LED3: System in the Cool mode LED4: Simulate the heart beat, increase real temperature (i.e., by hair dryer) to see the LED4 go faster and decrease temperature to see it slow down. So, if is needed increased temperature, push the first button (SW1) and Fan and Heat mode run. LED1 and LED2 will be light on and the temperature will increase.   Enjoy! Iva
記事全体を表示
I created easy tutorial for UART KSDK blocking demo which works as echo. The demo works with KSDK 1.1. and is created for KDS 2.0.   Because it could be problem if was used this pin by this reason was chosen UART 3, which is available to use and is routed to PTC16,PTC17 connection on Arduino header for this case is use ALT3 function (PTC16, PTC17)   Final output from terminal Physical connection between FRDM-K64F and USB to Serial Converter The unzipped folder must be located in example folder at C:\Freescale\KSDK_1.1.0\demos\
記事全体を表示
Hello to all,   This document explains how to drive a 16x2 LCD using the KSDK Drivers using the FRDM-KL25Z.     Project Generator, KSDK1.3 and KDS3.0 are used in this example.   I hope you find it useful. David
記事全体を表示