显示  仅  | 搜索替代 

MQX Software Solutions Knowledge Base



Hi All, The new Freescale MQX™ 4.1.1 GA release is now available on ·         Files available           # Name Description 1 FSL_MQX_RELEASE_NOTES_4_1_1 Freescale   MQX™ RTOS 4.1.1 Release Notes 2 Freescale   MQX RTOS 4.1.1 for Linux This   release has the same basic code as the 4.1.1 version, with just the changes   needed to build and debug on Linux systems. 3 Freescale   MQX RTOS 4.1.1 MQX™    Source code. Includes an RTOS, File System, TCP/IP and USB host/device   software stacks. ·         What is New? ·         New Board Support Package o   FRDM-K64F o   TWR-K64F120M ·         New Features and Updates o   MQX RTOS 4.1.1 enables development on Linux machines o   MQX RTOS 4.1.1 supports the new Freescale IDE, Kinetis Design Studio o   Example ISR and related documentation is updated to give guidance on setting up a Kernel ISR (a.k.a Gorilla ISR) - extremely high priority ISR o   Power PC (PX) family support has been dropped o   Readme files are added to examples without a description o   Register definition header files for Kinetis MCUs are added for convenience when porting to an MCU sub-family device o   Both interrupt driven I2C master and slave mode drivers are changed to support synchronous blocking mode and share the same API with the polling driver variant.  Improves performance by eliminating the need to poll for data availability. ·         Known issues o   For known issues and limitations please consult the release notes
In this section, we will cover the light weight ADC driver, which enable you to read the ADC the output and raw form, and converted to scale form , or even as average level over a number of reads. The light weight ADC driver also allows you to configure a number of attributes of the converter.  So you can customize your application. Quick overview of ADC ADC is a system that converts an analog signal into digital signal. Simply put, Analog signals here means any variable voltage that is being monitored. It doesn’t matter what the signal is doing, it can remain the same level continuously, it can have slight wave to it, or it can be seemingly random. The analog to digital converter requires you to provide the reference voltage. That defines the maximum level that the input can be.  To determine the voltage level of the input the circular ADC generate a local voltage, and just this level until the same level as the input.   This can be done in different ways but the circuitry will adjust the level of the local signal until the comparator to detect the two inputs are the same or lease the same as the resolution of ADC, once the signal level is matched, the output generated.  Which can be read by your application.  To calculate the signal level the ADC defines the full range from the input into the three levels.  ADC typically have a resolution of 12 to 16 bits, so the 2 12   to 2 16 different levels. Whatever level input signals determined to be add , the reading from the ADC will be a digital representation of this value compare the  reference voltage. The digital output then represents what percentage of the allowed input range the input signal is currently add. Being at the minimum level will result an output of zero and being the max will resut in an output of 0xffff. And for inputs some in between the result is the output that represents the level measured. So if you are using a reference voltage of 3.3V for example, the reading will represent what flection the 3.3 v  the input voltage is .  If the input voltage is zero.  The reading will be 0 of course. And if the input is 3.3 v, the reading will be all FF, meaning 100 percent. So in between, if the input voltage is 1v, the result will be roughly 30.3%. And an input of 2v, will result the input roughly 60.6%, and 3v will be 90.9%. ADC Driver in MQX architecture Diagram The light weight ADC driver is considered a low level driver and is located alongside the LWGPIO driver. This is because we don’t trade the interfaces as a part of serial communication, they passing data back and forth in blocks or in bytes, also it doesn’t make sense to be accessing the drivers through the IO subsystem.   There is a section dedicated to ADC module in bsp files folder in project. (take twrk70f120m for example) The ADC priority is defined as 3, though ADC is typically not used with interrupts,  The default reference voltage and maximum voltage is 3300mV. The input setting of the potentiometer is connected to ADC1_SOURCE_AD20 in Twr-k70 board. The adc1 device is designated as the default ADC device ADC API    1 _lwadc_init() This function initializes the ADC module according to the parameters given in the platform specific initialization structure. Call to this function does not start any ADC conversion. This function is normally called in the BSP initialization code.   2  _lwadc_init_input () This function initializes the application allocated LWADC_STRUCT with all data needed later for quick control of particular input. This function sets the ADC input to continuous conversion mode if not already in this mode. 3 _lwadc_set_attribute / _lwadc_get_attribute :  both this functions receive a pointer to the LWADC_STRUCT_PRT ,  and the attributes you interested in. All the attributes are defined in an enum LWADC_ATTRIBUTE. 4 _lwadc_read_raw () Read the current value of the ADC input and return the result without applying any scaling. 5 _lwadc_read () This function reads the current value of the ADC input, applies scaling according to preset parameters. 6 _lwadc_read_average() This function reads num_sample samples from the specified input and returns the scaled average reading. 7  _lwadc_wait_next() This function waits for a new value to be available on the specified ADC input.
This is report from internal USB flash drive plugfest (tested with MQX 4.0). VID PID VID Manufacturer Photo Vendor info Product info 0x0dba 0x0120 Realtek Generic Card Reader 0x8564 0x1000 Transcend JetFlash Transcend 4GB 0x0951 0x1654 Kingston Technology Kingston DT R500 0x0951 0x1647 Kingston Technology Kingston DT Mini Fun G2 0x0204 0x6025 Chipsbank Microelectronics CMB USB2.0 0x1516 0x1213 Myson-Century Technology USB DISK 2.0 0x1b1c 0x1ab1 Corsair Technology Corsair Voyager 0x0001 0x7778 Fry's Electronics Generic Flash Disk 0x125f 0xc08a ADATA ADATA USB Flash Drive (C008/32GB) 0x0dda 0x2026 Apacer ICSI IC1210 CF 0x0ea0 0x6828 Ours Technology 32MB HardDrive 0x0781 0x5530 SanDisk SanDisk SanDisk Cruzer (SDCZ36-004G) 0x111d 0x0000 IDT CENTON Swivel 0x0781 0x5406 SanDisk SanDisk SanDisk Cruzer (SDZ6-8192RB) 0x8564 0x1000 Transcend JetFlash Transcend 16GB 0x0951 0x1642 Kingston Technology Kingston DT 101 G2
The Freescale MQX™ RTOS for Kinetis SDK FRDM-KL43Z Freescale Freedom Platform is now available on the ·         Release Files             # Name Description 1                                   Freescale_MQX_KSDK_1.0.0-KL43Z.exe Windows installer. Freescale MQX™ RTOS software   components fully pre-integrated with the Kinetis SDK. Includes the MQX   kernel, USB host and device stacks, MFS file system, and example   applications. Does not require prior installation of Kinetis SDK. 2                                   Freescale_MQX_KSDK_1.0.0-KL43Z.bin Linux installer. Freescale MQX™ RTOS software   components fully pre-integrated with the Kinetis SDK. Includes the MQX   kernel, USB host and device stacks, MFS file system, and example   applications. Does not require prior installation of Kinetis SDK. 3 MQXKSDKKL43Z.pdf Freescale MQX™ RTOS for Kinetis   SDK FRDM-KL43Z Freescale Freedom Platform Release Notes ·         Target HW boards: o   Freescale Freedom FRDM-KL43Z platform with a MKL43Z256VLH4 processor ·         Key features:  o   PSP support for the MKL43Z256VLH4 Microcontroller o   BSP for the Freescale Freedom FRDM-KL43Z platform with a MKL43Z256VLH4 processor o   MQX STDLIB o   nShell o   KSDK Support for the MKL43Z256VLH4 Microcontroller o   MFS file system ·         Known issues For known issues and limitations please consult the release
MQX 4.1.0 provides a USB Host CDC demo in the folder of "C:\Freescale\Freescale_MQX_4_1\usb\host\examples\cdc\cdc_serial", but to get it work, several steps need to be done: 1. Change CDC_EXAMPLE_USE_HW_FLOW in cdc_serial.h to 1. #define CDC_EXAMPLE_USE_HW_FLOW 1 2. In config\twrk70f120m\user_config.h, interrupt mode for UART should be set.//It depends on the platform, here given TWR-K70F120M is used. #define BSPCFG_ENABLE_TTYC 0 #define BSPCFG_ENABLE_ITTYC 1 In mqx\source\bsp\twrk70f120m\twrk70f120m.h, specify 'ittyc' instead of 'ttyc' #ifndef BSP_DEFAULT_IO_CHANNEL #if BSPCFG_ENABLE_ITTYC #define BSP_DEFAULT_IO_CHANNEL "ittyc:" /* OSJTAG-COM polled mode */ #define BSP_DEFAULT_IO_CHANNEL_DEFINED #else #define BSP_DEFAULT_IO_CHANNEL NULL #endif #else 3. In usb\host\source\classes\cdc\usb_host_cdc.c, pass fd_ptr instead of data_instance as the argument. a. Around line 977 //usb_hostdev_tr_init(&#38;tr, (tr_callback) usb_class_cdc_in_data_callback, (void *) data_instance); usb_hostdev_tr_init(&#38;tr, (tr_callback) usb_class_cdc_in_data_callback, (void *) fd_ptr); b. Around line 1116 //usb_hostdev_tr_init(&#38;tr, (tr_callback) usb_class_cdc_in_data_callback, (void *) data_instance); usb_hostdev_tr_init(&#38;tr, (tr_callback) usb_class_cdc_in_data_callback, (void *) fd_ptr); c. Around line 1226 //usb_hostdev_tr_init(&#38;tr, (tr_callback) usb_class_cdc_out_data_callback, (void *) data_instance); usb_hostdev_tr_init(&#38;tr, (tr_callback) usb_class_cdc_out_data_callback, (void *) fd_ptr); With above modification , the Host CDC demo can work with a Device CDC demo, such as the one in "C:\Freescale\Freescale_MQX_4_1\usb\device\examples\cdc\virtual_com", which is an echo demo, it would send back anything charactor that it receives. But to see the echo more clearly, I made it echo back the charactor that greater than what is received, for example, if you type A, and will see B from the HyperTerminal. To do that , you have to change Virtual_Com_App(void) in the virtual_com.c as below: void Virtual_Com_App(void) {     /* User Code */     if(g_recv_size)     {         _mqx_int i;                 /* Copy Buffer to Send Buff */         for (i = 0; i < g_recv_size; i++)         {             printf("Copied: %c\n", g_curr_recv_buf[i]);             g_curr_send_buf[g_send_size++] = g_curr_recv_buf[i]+1;         }         g_recv_size = 0;     }         if(g_send_size)     {         uint8_t error;         uint8_t size = g_send_size;         g_send_size = 0;         error = USB_Class_CDC_Send_Data(g_app_handle, DIC_BULK_IN_ENDPOINT,             g_curr_send_buf, size);         if (!error && !(size % DIC_BULK_IN_ENDP_PACKET_SIZE)) {             /* If the last packet is the size of endpoint, then send also zero-ended packet,             ** meaning that we want to inform the host that we do not have any additional             ** data, so it can flush the output.             */             error = USB_Class_CDC_Send_Data(g_app_handle, DIC_BULK_IN_ENDPOINT, NULL, 0);         }         if(error != USB_OK)         {             /* Failure to send Data Handling code here */         }     }     return; } After you download code into, for example, TWR-K70F120(Host) and TWR-K60D100M(Device), and assemble them with TWR-SER and TWR-ELEV, you may connect them via USB port as below: Please also pay attention to J10(USB VBUS Select) and J16(USB Mode Select) according to the function of each tower system. With HyperTerminal connected with TWR-K70F120M system, you may type in any charactor ended with ENTER, and you will see the charactor echoed back as the attached video. This issue would be fixed in the next release, and sorry for the inconvenience that has caused.