MQXソフトウェアソリューションナレッジベース

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

MQX Software Solutions Knowledge Base

ディスカッション

ソート順:
The Kinetis Software Development Kit (KSDK) is a software framework for developing applications on Kinetis MCUs. The software components in the framework include peripheral drivers, middleware and real time operating systems. KSDK provides FreeRTOS OS, selected drivers provide FreeRTOS support in form of an additional layer. This solution enables simple driver integration in RTOS-based applications. Drivers with FreeRTOS layers are: • UART / LPUART / LPSCI • I2C / LPI2C • SPI / LPSPI The drivers for FreeRTOS OS is a layer built on top of standard KSDK peripheral drivers to achieve multithread (RTOS) awareness. The wrappers provide an API which blocks the calling task until the I/O operation completes and allows other tasks to run in the background. This is achieved by using the asynchronous API of the underlying driver along with RTOS task synchronization objects. Underlying drivers require enabled interrupts for proper operation. In addition, it is possible to use the KSDK bare metal drivers. This document shows how to use the LPTMR Driver in a FreeRTOS and SDK 2.0 project. For this example it is used SDK 2.0, FRDMK64F and FreeRTOS. If you want to know how to create a new SDK 2.0 with FreeRTOS project please check the below link: https://community.freescale.com/docs/DOC-330183 GPIO AND LPTMR EXAMPLE: Introduction This example toggle the Blue LED every 1 second. This example check the Timer Compare Flag bit, when this flag is set blue LED changes status. Writing the example code First it is necessary to create a new SDK 2.0 with FreeRTOS project, please check the below link for do that.      https://community.freescale.com/docs/DOC-330183    2. After create a new project, open the pin_mux.c file in order to enable the port clock and configure the necessary pins as GPIO (for FRDM-K64F the RGB LED is connected   through GPIO signals: RED to PTB22, BLUE to PTB21 and GREEN to PTE26).   3. In addition, it is necessary to enable the clock for the lptmr module, in the pin_mux.c file.   4. In main.c file it is necessary to include the fsl_lptmr.h and fsl_gpio.h.   5. In main function, create a new task. This task will initialize the LPTMR and GPIO drivers. For this example the new task function was named task_init. /* Create RTOS task */    xTaskCreate(                  task_init,                  "Task_Init",                  configMINIMAL_STACK_SIZE,                  NULL,                  task_PRIORITY,                  NULL);     6. Write the task_init function code.                   a. Using the KSDK GPIO driver: To initialize the GPIO, define a pin configuration, either input or output, in the user file. Then, call the GPIO_PinInit() function. In this case the pin PTB21 where blue LED is connected was configured as output. gpio_pin_config_t ledB_config = {kGPIO_DigitalOutput, 0,}; GPIO_PinInit(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_GPIO_PIN, &ledB_config); After configure the GPIO pins, it is possible to use the below GPIO operations: GPIO OUTPUT OPERATIONS. GPIO_WritePinOutput  (GPIO_Type *base, uint32_t pin, uint8_t output) GPIO_SetPinsOutput (GPIO_Type *base, uint32_t mask) GPIO_ClearPinsOutput (GPIO_Type *base, uint32_t mask) GPIO_TogglePinsOutput (GPIO_Type *base, uint32_t mask) GPIO INPUT OPERATIONS. GPIO_ReadPinInput (GPIO_Type *base, uint32_t pin) The board.h file contains definitions for this operations. For example: /*!< Toggle on target LED_BLUE */ #define LED_BLUE_TOGGLE() \ GPIO_TogglePinsOutput(BOARD_LED_BLUE_GPIO, 1U << BOARD_LED_BLUE_GPIO_PIN)                   b. Using the KSDK LPTMR driver: The LPTMR_Init () should be called at the beginning of the application using the LPTMR driver. This function initializes the lptmr_config_t structure, this structure holds the configuration settings for the LPTMR peripheral. To initialize this structure to reasonable defaults, call the LPTMR_GetDefaultConfig () function and pass a pointer to your config structure instance. The config struct can be made const so it resides in flash. The default values are: config->timerMode = kLPTMR_TimerModeTimeCounter; config->pinSelect = kLPTMR_PinSelectInput_0; config->pinPolarity = kLPTMR_PinPolarityActiveHigh; config->enableFreeRunning = false; config->bypassPrescaler = true; config->prescalerClockSource = kLPTMR_PrescalerClock_1; config->value = kLPTMR_Prescale_Glitch_0; After configure the LPTMR, it is necessary to set the timer period. The LPTMR_SetTimerPeriod(), the timer counts from 0 till it equals the count value set here. The count value is written to the CMR register. Finally start the timer using the LPTMR_StarTimer (). After calling this function, the timer counts up to the CMR register value. Each time the timer reaches CMR value and then increments, it generates a trigger pulse and sets the timeout interrupt flag. An interrupt will also be triggered if the timer interrupt is enabled. For this example the below lines configure and start the LPTMR. /* Configure LPTMR */ LPTMR_GetDefaultConfig(&lptmrConfig); /* Initialize the LPTMR */ LPTMR_Init(LPTMR0, &lptmrConfig); /* Set timer period */ LPTMR_SetTimerPeriod(LPTMR0, USEC_TO_COUNT(1000000U, LPTMR_SOURCE_CLOCK)); /* Start counting */ LPTMR_StartTimer(LPTMR0);                   c. This example check the Timer Compare Flag bit, when this flag is set blue LED changes status. So in an infinity loop the LPTMR_GetStatusFlags() function check                       the status flag, if this flag is set then toggle the LED and clear the flag using the the LPTMR_ClearStatusFlags() function. while (1)    {    if (LPTMR_GetStatusFlags(LPTMR0) )           { LED_BLUE_TOGGLE();                       LPTMR_ClearStatusFlags(LPTMR0, kLPTMR_TimerCompareFlag);                } }   7. At this point you can build and debug the example. Complete Code GPIO and LPTMR Example #include <string.h> #include "board.h" #include "pin_mux.h" #include "clock_config.h" #include "fsl_debug_console.h" #include "fsl_device_registers.h" #include "fsl_lptmr.h" #include "fsl_gpio.h" /* FreeRTOS kernel includes. */ #include "FreeRTOS.h" #include "task.h" #include "queue.h" #include "timers.h" /* Task priorities. */ #define task_PRIORITY (configMAX_PRIORITIES - 1) /******************************************************************************* * Definitions ******************************************************************************/ /* Get source clock for LPTMR driver */ #define LPTMR_SOURCE_CLOCK CLOCK_GetFreq(kCLOCK_LpoClk) static void task_init(void *pvParameters); /******************************************************************************* * Variables ******************************************************************************/ volatile uint32_t lptmrCounter = 0U; int main(void) {        /* Init board hardware. */        BOARD_InitPins();        BOARD_BootClockRUN();        BOARD_InitDebugConsole();        /* Add your code here */        /* Create RTOS task */        xTaskCreate(                      task_init,                      "Task_Init",                      configMINIMAL_STACK_SIZE,                      NULL,                      task_PRIORITY,                      NULL);        vTaskStartScheduler();        for(;;) { /* Infinite loop to avoid leaving the main function */               __asm("NOP"); /* something to use as a breakpoint stop while looping */        } } static void task_init(void *pvParameters) {        for (;;) {               lptmr_config_t lptmrConfig;               PRINTF("You are running the initialization task.\r\n");               /* Init output LED GPIO. */               gpio_pin_config_t ledB_config = {kGPIO_DigitalOutput, 0,};               GPIO_PinInit(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_GPIO_PIN, &ledB_config);               PRINTF("LED BLUE initialized \r\n");               /* Configure LPTMR */               /*                * lptmrConfig.timerMode = kLPTMR_TimerModeTimeCounter;                * lptmrConfig.pinSelect = kLPTMR_PinSelectInput_0;                * lptmrConfig.pinPolarity = kLPTMR_PinPolarityActiveHigh;                * lptmrConfig.enableFreeRunning = false;                * lptmrConfig.bypassPrescaler = true;                * lptmrConfig.prescalerClockSource = kLPTMR_PrescalerClock_1;                * lptmrConfig.value = kLPTMR_Prescale_Glitch_0;                */               LPTMR_GetDefaultConfig(&lptmrConfig);               /* Initialize the LPTMR */               LPTMR_Init(LPTMR0, &lptmrConfig);               /* Set timer period */               LPTMR_SetTimerPeriod(LPTMR0, USEC_TO_COUNT(1000000U, LPTMR_SOURCE_CLOCK));               PRINTF("Low Power Timer module initialized \r\n");               /* Start counting */               LPTMR_StartTimer(LPTMR0);               while (1)               {                      if (LPTMR_GetStatusFlags(LPTMR0) )                      {                            lptmrCounter++;                            LED_BLUE_TOGGLE();                            LPTMR_ClearStatusFlags(LPTMR0, kLPTMR_TimerCompareFlag);                      }               }        } }
記事全体を表示
Essentials of MQX RTOS Application Development Free Online Training Series with Videos, Tutorials, and Example Software! 10-Part Series - even more coming later [Scroll down to see all Sessions] Session 1: MQX Architecture and Initialization (20 min) Creating tasks Setting priorities Scheduling Synchronization concepts Introduction to drivers Session 2: Designing for a Multi-Tasking Environment (15 min) Writing applications in a Multi-Tasking Environment Super Loop Programming Limitations, Task Coding Structure Task States What is a blocking call? Task Context Switching Session 3: Task Management and the Scheduler (21 min) How does the MQX scheduler work? Scheduling Policies Priority-based, Time-slice (Round Robin) Selecting Priority Levels for Tasks What is the Task Template List? Using Tasks in your Application Session 4: Synchronization and Message Passing (17 min) What is Synchronization?  What is it used for? Data Flow, Control Flow, Mutual Exclusion Synchronization Options Events, Semaphores, Mutexes, Message Passing Message Passing Types of Message Pools, Message Pool Creation, Sending and Receiving, Light-weight Message Passing Session 5: Introduction to Drivers (28 min) Driver Architecture and options Block vs. Byte modes, POSIX drivers, Low level drivers, Polled vs. Interrupt modes Driver Initialization I/O Subsystem (POSIX) Serial Driver Details Light-weight GPIO Driver Details Session 6: Interrupts (15 min) Interrupts and the scheduler Techniques for writing an ISR Hardware Vector Table Nested Interrupts MQX Interrupt ISR Table Installing ISRs Default Interrupt handler Session 7: Light Weight Events (15 min) Overview of events Working with light-weight & full-featured events Ways to wait on an event Session 8: Light Weight Timers (17 min) One shot vs periodic timers Use cases for timers Working with correlated timers Writing timer Interrupt Service Routines (ISRs) Light weight timers & timer queues Timers and the timer task Session 9: Light Weight ADC Driver (18 min) Light-weight ADC driver (LWADC) Details Attributes of ADCs Configuring and reading ADCs Scaling the ADC output Session 10: Logging (23 min) What is logging?  Why use logs? Working with light-weight logs Working with kernel logging Logging MQX function and ISR entries and exits, task and stack usage Working with full-featured logs
記事全体を表示
Hi, I want to share a document, the purpose of this document is to indicate step by step how to get the memory footprint of a MQX project. The Freescale MQX RTOS includes the tool Codesize.exe, this document is a guide for people who want to use this tool in order to know the memory RAM/ROM utilization of a MQX project. Regards Soledad
記事全体を表示
Hello All, This document explains how to add GPIO pins to the default BSP configurations. This example shows how add a LED pin for the BSP TWR-K70FN1M board. The procedure is the same for other ports and peripherals, using Kinetis devices. MODIFY THE TWRK70F120M.h FILE The TWR-K70F120M Tower Module contains two pushbutton switches connected to GPIO/interrupt signals, one pushbutton connected to the master reset signal, four capacitive touch pad electrodes, four user controllable LEDs, and a potentiometer connected to an ADC input signal. The following table provides details on which K70FN1M0 pins are used to communicate with the LEDs and switches onboard the TWR-K70F120M.  Feature Connection Port Pin Pin Function Pushbuttons SW1 (IRQ0) PTD0 PTD0 SW2 (IRQ1) PTE26 PTE26 SW3 (RESET) RESET_b RESET_b LEDs E1 / Orange LED PTA11 PTA11 E2 / Yellow LED PTA28 PTA28 E3 / Green LED PTA29 PTA29 E4 / Blue LED PTA10 PTA10 Touch Pads E1 / Touch PTA4 TSI0_CH5 E2 / Touch PTB3 TSI0_CH8 E3 / Touch PTB2 TSI0_CH7 E4 / Touch PTB16 TSI0_CH9 Table 1. I/O Connectors and Pin Usage Table NOTE: Some port pins are used in multiple interfaces on-board and many are potentially connected to off-board resources via the Primary and Secondary Connectors. Take care to avoid attempted simultaneous usage of mutually exclusive features. For more information please consult the “TWR-K70F120M Tower Module User's Manual”. http://cache.freescale.com/files/microcontrollers/doc/user_guide/TWRK70F120MUM.pdf?fpsp=1&WT_TYPE=Users%20Guides&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation The <board>.h file is used to provide information needed by an application program using the kernel running on the Freescale Evaluation board. This file contains the GPIO board specifications.  It is located at the next path: <Freescale_MQX_4_x_install_path>\mqx\source\bsp\<name_board> Figure 1. GPIO board specifications for the TWR-K70F120M. The twrk70f120m.h file contains the GPIO board definition for the TWR-K70F120M, however if customer creates his own board and he needs to connect LEDs in deferent pins to the TWR-K70F120M, it is necessary to modify this file. Suppose a custom_board where is connected a LED to PTE18 pin, in order to add this pin definition it is necessary to follow the below steps, the pin will be called BSP_LEDCustom. 1. Define the pin name and assign the port and pin number. #define BSP_LEDCustom               (GPIO_PORT_E | GPIO_PIN18) 2. Assigning the requested functionality to the pin for the GPIO mode or any other peripheral mode. #define BSP_LEDCustom_MUX_GPIO (LWGPIO_MUX_E18_GPIO) 3. Save and close the twrk70f120m.h file. USE THE NEW LED IN A PROJECT   The following example shows one task named LEDCustom_TASK, where the LEDCustom is used. 1. Open a new MQX project. 2. In the main.h module replace the following lines: #define MAIN_TASK 1 extern void Main_task(uint_32); With the next lines: #define LEDCustom_TASK 5 extern void ledCustom_task(uint_32); 3. In main.c, modify the MQX_template_list entry for the Main_Task. Replace the following line: {MAIN_TASK, Main_task, 1500, 9, "main", MQX_AUTO_START_TASK}, With the next line: { LEDCustom_TASK, ledCustom_task, 1500, 9, "init", MQX_AUTO_START_TASK, 0, 0}, NOTE The last entry in the MQX_template_list must be all zeros. 4. In main.c, comment out the Main_task. /*void Main_task(uint_32 initial_data) { print(“/n Hello World /n”); _mqx_exit(0); } */ 5. It is necessary to write the tasks code. This task uses LWGPIO driver in order to toggle a pin. The lwgpio_init() function has to be called prior to calling any other API function of the LWGPIO driver. This function initializes the LWGPIO_STRUCT structure. The pointer to the LWGPIO_STRUCT is passed as a handle parameter. To identify the pin, platform-specific LWGPIO_PIN_ID number is used. It is necessary to have a variable to assign the pointer to the LWGPIO_STRUCT, for do that it is required to add the following line: LWGPIO_STRUCT ledC; The following lines initialize lwgpio handle for LWGPIO_MUX_E18_GPIO pin. The BSP already knows the address and the pin number for each GPIO PORT and each PIN. This is defined in mqx/source/bsp/<bsp_name>/<bsp_name>.h file. That is the reason the twrk70f120m.h file was modified. if (!lwgpio_init(&ledC, BSP_LEDCustom, LWGPIO_DIR_OUTPUT, LWGPIO_VALUE_NOCHANGE))   {             printf("Initializing Port TE pin18 GPIO of the K70 as output failed.\n");     _task_block();   } 6. Once it is initialized, it is necessary to assign the requested functionality to the pin like GPIO mode or any other peripheral mode. The lwgpio_set_functionality() function sets the functionality of the pin. The value of the functionality parameter represents the number stored in the multiplexer register field which selects the desired functionality. For the GPIO mode, you can use the pre-defined macros which can be found in the lwgpio_ <mcu>.h file. Add the following lines switch pin functionality to GPIO mode: lwgpio_set_functionality(&ledC, BSP_LEDCustom_MUX_GPIO); The lwgpio_set_value() function sets the pin state (low or high) of the specified pin. In order to toggle the pin value write the following code: while (TRUE)   {     _time_delay(1000);     lwgpio_set_value(&ledC, value); /* toggle pin value */     value = value^1;   } 7. Create the other three functions. The name of each function, delay, and the first parameter must be different in LWGPIO functions use (lwgpio_init(), lwgpio_set_functionality(), lwgpio_set_value()). 8. At this point it is possible to build the project, flash it to the board and run the project; for more details about building, flashing and running please refer to the compiler documentation of your choice, that is located at the next path:  C:\Freescale\Freescale_MQX_4_x\doc\tools\cw  Thanks!!!!     a. main.c /**************************************************************************** * *   This file contains MQX only stationery code. * ****************************************************************************/ #include "main.h" #if !BSPCFG_ENABLE_IO_SUBSYSTEM #error This application requires BSPCFG_ENABLE_IO_SUBSYSTEM defined non-zero in user_config.h. Please recompile BSP with this option. #endif #ifndef BSP_DEFAULT_IO_CHANNEL_DEFINED #error This application requires BSP_DEFAULT_IO_CHANNEL to be not NULL. Please set corresponding BSPCFG_ENABLE_TTYx to non-zero in user_config.h and recompile BSP with this option. #endif TASK_TEMPLATE_STRUCT MQX_template_list[] = { /*  Task number, Entry point, Stack, Pri, String, Auto? */   {LEDCUSTOM_TASK, ledCustom_task, 1500, 9, "init", MQX_AUTO_START_TASK, 0, 0}, {0,         0,         0, 0,   0,     0,                  0, 0} }; /*TASK*----------------------------------------------------- * * Task Name    : Main_task * Comments     : *    This task prints " Hello World " * *END*-----------------------------------------------------*/ void ledCustom_task(uint_32 initial_data) {       int value = 0;       LWGPIO_STRUCT ledC;                 printf("\n LedCustom task \n");                 /* initialize lwgpio handle for LWGPIO_MUX_TC0_GPIO pin (defined in mqx/source/bsp/<bsp_name>/<bsp_name>.h file) */         if (!lwgpio_init(&ledC, BSP_LEDCustom, LWGPIO_DIR_OUTPUT, LWGPIO_VALUE_NOCHANGE))           {             printf("Initializing Port TE pin18 GPIO of the K70 as output failed.\n");           _task_block();         }                 /* swich pin functionality to GPIO mode */         lwgpio_set_functionality(&ledC, BSP_LEDCustom_MUX_GPIO);                  while (TRUE)           {             _time_delay(5000);             lwgpio_set_value(&ledC, value); /* toggle pin value */             value = value^1;           }       } /* EOF */     b. main.h #ifndef __main_h_ #define __main_h_ #include <mqx.h> #include <bsp.h>   #define LEDCUSTOM_TASK 5   extern void ledCustom_task(uint_32);    /* PPP device must be set manually and ** must be different from the default IO channel (BSP_DEFAULT_IO_CHANNEL) */ #define PPP_DEVICE      "ittyb:" /* ** Define PPP_DEVICE_DUN only when using PPP to communicate ** to Win9x Dial-Up Networking over a null-modem ** This is ignored if PPP_DEVICE is not #define'd */ #define PPP_DEVICE_DUN  1 /* ** Define the local and remote IP addresses for the PPP link ** These are ignored if PPP_DEVICE is not #define'd */ #define PPP_LOCADDR     IPADDR(192,168,0,216) #define PPP_PEERADDR    IPADDR(192,168,0,217) /* ** Define a default gateway */ #define GATE_ADDR       IPADDR(192,168,0,1) #endif /* __main_h_ */
記事全体を表示
I have just implemented an I2C demo for my customer, he found no demo for MMA8451Q based on MQX 4.1, so I personally wrote one for him based on the I2C EEPROM demo, as well as the driver code for MMA8451Q supporting both polled and interrupt mode. I think maybe it would be interesting for someone else, so I posted it here. The demo is for TWR-K60D100M, but I think it should be easy to port to some platform else, for example , TWR-K21F120M, all you have to do is creating a new MQX project and replace the source code with the attached one, Please also note the I2C device address might be different in tower boards. You may change the deifintion of I2C_MMA8451_BUS_ADDRESS in MMA8451.h according to the schematics. Please kindly refer to the attached result.txt for more details. Hope that helps, B.R Kan
記事全体を表示
Introduction Official support for MQX in KDS is slated for August of this year (2014), but what if you want to start building up your libraries now? Through Mingw and the files included in MQX 4.1, we can compile libraries and programs using KDS’ gcc_arm compiler. This is essentially a modification of the process used to compile MQX on a generic gcc_arm compiler. Original documentation can be found in: <MQX_ROOT_DIR> \doc\tools\gnu\MQX_GNU_Getting_Started.pdf I will try to explain a bit more of the setup process and the file changes that must be made to correctly compile, along with debugging your executable in processor expert. This guide is written for Windows and a version of the guide including a few screenshots of important screens is attached. Setup You will need: Mingw installed, along with mingsys-SED. This can be found at http://sourceforge.net/projects/mingw/ Make sure ‘c:\MinGW\bin’ has been added to system ‘PATH’ variable SED is part of a cmd improvement suite called mingsys. You can install the whole suite, but we only need SED KDS installed A suitable text editor that allows find and replace of text in all files of a selected directory. I recommend Notepad++ and it is what I will use in the tutorial. MQX file changes The original makefiles and batch scripts were created for gcc_arm v4.7.4, but KDS 1.0.1 is using 4.8.0. This means some directory paths have changed and these changes must be updated within MQX’s files. First, let us define the toolchain for the builder to use, in <MQX_ROOT_DIR> \build\common\make\global.mak, modify the following definition: ifeq ($(TOOL),gcc_arm)      TOOLCHAIN_ROOTDIR = <KDS_INSTALLION_DIR>\toolchain Endif Next we need to update the directory listings for gcc_arm components within its root directory. This comes down to replacing all instances of “/4.7.4/” with “/4.8.0/” in all ‘gcc_arm.mak’ files (you could choose to only edit the .mak files of boards you intend to use,  but it’s just as easy to replace all instances). In notepad++, this is simple process of running a “Find in Files”. The files themselves will be located in directories associated with building mqx for each platform: <MQX_ROOT_DIR> \mqx\build\make\<SPECIFIC_PLATFORM>\tools\gcc_arm.mak Along with some entries within application builds: <MQX_ROOT_DIR> \mqx\examples\<project>\build\make\<project>_<platform>\tools\gcc_arm.mak Lastly, specifically for demo application builds, there is one more directory change and one exclusion to make: remove ‘armv7e-m/’ from directory paths and comment out ‘libnosys.a’ (I must clarify I don’t understand the importance of libnosys and couldn’t find a suitable replacement with KDS’ gcc_arm toolchain. I have build hello2 successfully without it, but maybe other projects will require it) Again, this is a simple ‘Find in Files’, replacing “armv7e-m/” with no characters, then replacing the line: RT_LIBRARIES += $(TOOLCHAIN_ROOTDIR)/arm-none-eabi/lib/armv7e-m/softfp/libnosys.a With #RT_LIBRARIES += $(TOOLCHAIN_ROOTDIR)/arm-none-eabi/lib/armv7e-m/softfp/libnosys.a to comment it out. Building Libraries The build process is now incredible easy, as we can use the batch scripts provided in MQX to build our libraries. Either use “<MQX_ROOT_DIR> \build\<BOARD>\make\ build_gcc_arm.bat” to create the full set of libraries for the chosen board (bsp, psp, usb, shell, mfs,rtcs), or use any “build_gcc_arm.bat” found in the component and board area of your choice. These will automatically build the libraries and move the created libraries and code to ““<MQX_ROOT_DIR> \lib\<BOARD>.gcc_arm\” Note: when building full libraries the system will sometimes throw up errors when calling ‘mkdir’, saying that the folder structure already exists.  I have found if you re-run the script again it will not complain the second time and behaves fine. Building Examples So far only tested ‘hello2’on twrk60n512, but principles should apply to all boards and projects Again, we use the batch scripts provided in MQX, found in locations such as: <MQX_ROOT_DIR>\mqx\examples\<PROJECT>\build\make\<BOARD>\build_gcc_arm.bat Running these batch scripts will create another folder within the directory, called “gcc_arm”, in which you can find “initflash_debug” and “initflash_release”.  Inside each of these folders is your compiled application. Debugging your examples Now let’s actually do something in KDS: debugging the examples and showing that they work. For this you need to have a workspace (otherwise KDS won’t run), but you can close any open projects if you wish.  Then Click on the debug menu and select “Debug Configurations...” Double click on your chosen debug interface and under the option for “C/C++ Application”, choose browse and select the ‘.elf’ file from the ‘initFlashdebug’ folder of your application. I hope this helps some people who need to get MQX running through KDS before the official support becomes available. For information on when MQX will be supported on KDS, see https://community.freescale.com/docs/DOC-95477
記事全体を表示
The new Freescale MQX™ 4.1 GA release is now available on the www.freescale.com/MQX ·         Files available # Name Description 1 FSL_MQX_RELEASE_NOTES_4_1_0 Freescale   MQX™ RTOS 4.1 Release Notes 2 Freescale   MQX RTOS 4.1 MQX™    Source code. Includes an RTOS, File System, TCP/IP and USB host/device   software stacks. ·         What is New? o   New Board Support Package added §  TWR-K21F120M o   Vybrid-based board support packages for TWR-VF65GS10 and AutoEVB updated §  Support of audio-related drivers extended--SAI, eSAI, and ASRC. Device driver for DSP Codec CS422888 added (AutoEVB only). §  Support the Quadrature Decoder functionality in the FTM peripheral §  Added eDMA driver §  UART driver updated to use the eDMA §  Clock management component ported §  Added DCU driver §  QSPI driver updated to support the FlashX framework §  NAND FFS support added o   DMA support in device drivers has been extended §  Introduced new DMA device driver, supporting eDMA peripheral on Kinetis and Vybrid processor families §  The SPI device driver was updated to support the new DMA driver §  The SAI and eSAI audio drivers support DMA §  eSDHC drivers were reworked to fully leverage the ADMA peripheral module o   Driver updates §  The LWADC driver has been ported to all supported board support packages. The support of the legacy ADC driver was discontinued. §  The RTC driver was updated on all supported platforms. Provided generic, POSIX compatible API for time conversion functionality. §  FlashX driver extended by handling Flash Swap functionality on Kinetis processors. §  LP Timer module was added to the HW Timer framework. Its usage is demonstrated in the Low Power and HW Timer example applications o   Standardization effort §  Legacy MQX custom integer types were replaced by the Standard C99 set (int_32 -> int32_t, boolean -> bool, etc). A header file is provided with the set of backward compatible type definitions to make the transition to the new types easier. For more details, see Section 3.1 “C99 Types” in the Getting Started with Freescale MQX™ RTOS (document MQXGSRTOS). §  The endian conversion macros were consolidated inside MQX. The htons, ntons and similar conversion functions were renamed to mqx_htons, mqx_nton to avoid a conflict with the standard. o   NAND FFS library is no longer provided as a separate add in package but it is directly included as a part of MQX main package o   RTCS new features and enhancements §  The MQX TCP/IP stack is now available with an optional package to enable the IPv6 protocol support. For more information visit freescale.com/mqx. §  The FTP server was redesigned to provide faster and more stable implementation. §  The DNS resolver was updated. o   USB §  Fixed several EHCI related bugs (HUB, pipe close, audio example) o   MQX startup is now split in two parts to avoid a crash risk if an interrupt occurs during the startup. §  _bsp_enable_card() function has been replaced by the _bsp_pre_init() function that handles initialization of the OS vital functions, such as the timer (system tick), interrupt controller, memory management, etc. The _bsp_pre_init() function is called during the MQX initialization time, before any user task is created and the scheduler is not started. §  The second part of the startup is done in a separate _mqx_init_task that executes _bsp_init() function for I/O drivers or stacks initialization and _bsp_post_init() function for possible post-init operations. After the _bsp_post_init() function execution, the _mqx_init_task is destroyed. o   All BSPs are now adjusted to this concept. All I/O drivers are installed in the context of the _mqx_init_task after the MQX scheduler is started. This concept also allows a complex driver installation (handling ISRs during the driver initialization, drivers can use blocking functionality like _time_delay, etc.). ·         Known issues o   For known issues and limitations please consult the release notes.
記事全体を表示
The new Freescale MQX™ 4.0.2  release is now available on the www.freescale.com/MQX ·         Files available                    # Name Description 1 FSL_MQX_RELEASE_NOTES_4_0_2 Freescale   MQX™ RTOS 4.0.2 Release Notes 2 FSL_MQX__FFS_RELEASE_NOTES_4_0_2 Freescale   MQX™ FFS package 4.0.2 Release Notes 3 FSL_MQX_ATHEROS_RELEASE_NOTES_4_0_2   Freescale   MQX™ Atheros Wifi package 4.0.2 Release Notes 4 Freescale   MQX RTOS 4.0.2 Atheros Wifi package Atheros   Wifi solution for MQX™ 4.0.2 5 Freescale   MQX RTOS 4.0.2 FFS package NAND   Flash File System solution for MQX™ 4.0.2 6 Freescale   MQX RTOS 4.0.2 MQX™   Source code. Includes an RTOS, File   System, TCP/IP and USB host/device software stacks. Does not require MQX™ 4.0   installation. ·         What is New? o   AutoEVB Vybrid A5 and M4 Board support packages §  Support for CortexA5 and CortexM cores of dual core Vybrid processor §  Supporting standard set of IO drivers o   Vybrid BSP extensions §  RTC and NAND flash driver ported to Vybrid platform §  MMU support extended by handling of 4KB memory block §  Introduced new QuadSPI driver §  CortexM4 boot option enabled. §  Direct code execution from QuadSPI flash – XIP provided. Feature demonstrated in Vybrid QuadSPI bootloader. Introduced the first version of eDMA driver – the driver is experimental and will be further extended in the next MQX version. Documentation is not provided. o   Kinetis SPI driver was updated to use the eDMA driver. o   Hardware timer driver support extended to Systick and GPT HW modules. Kinetis and Vybrid BSPs updated to leverage the Hardware timer to provide MQX tick time. o   RTCS Hardware checksum acceleration enabled in ENET driver (for TCP and UDP); the benefits are the increased throughput and a reduced processor loading. This option is enabled by default for the K60N512 platform. o   HTTP server redesigned to provide a faster and more robust solution. The server API is simplified and changed to correspond to the RTCS standard. o   New SMTP client functionality provided as a part of the RTCS network suite. The client offers a simple API for e-mail handling. The new RTCS Shell command “email” demonstrates its functionality. o   The security_email, security_webserver, and security_telnet demo applications are removed from this release. Networking functionality is demonstrated in RTCS shell and httpsrv example applications. o   Multicore Communication (MCC) library updated to version 1.1. Fixed the incorrect usage of cache macros in the mcc_send() function. ·         Known issues o   For known issues and limitations please consult the release notes.
記事全体を表示
This is a friendly guide to install MQX.
記事全体を表示
The new Freescale MQX™ 4.1.2 GA for Vybrid release is now available on www.freescale.com/mqxrtos ·      Files available                   # Name Description 1 Freescale MQX RTOS 4.1.2 for Vybrid Linux Base This   release has the same basic code as the 4.1.2 version, with just the changes   needed to build and debug on Linux systems. 2 Freescale MQX RTOS 4.1.2 for Vybrid MQX™ Source   code. Includes an RTOS, File System, TCP/IP and USB host/device software   stacks. Does not require MQX™ 4.1.1 installation. ·         What is New? ·         New Board Support Package ·         X-SVF522R-EVB Vybrid Evaluation Board Rev. B with the SVF522R3MK4 processor. ·         TWR-VF65GS10 Development Kit Rev. H with the MVF61NS10MK50 processor. ·         New Features and Updates ·         BSP package for TWR-VF600 was replaced by new TWR-VF65GS10 ·         Vybrid Auto EVB board was replaced by new X-SVF522R-EVB board ·         MFS library was updated ·         New USB stack was added ·         Exception support for cortex A kernel ·         Video ADC + VIU example application ·         RTCS package was updated ·         Known issues ·         For known issues and limitations please consult the release notes
記事全体を表示
MQX RTOS developers can now build and debug MQX RTOS on Linux computers right out-of-the-box without extensive setup steps.  Linux support is provided in a separate version of MQX 4.1.0, repackaged for use on Linux systems.  Kinetis & Vybrid BSPs from MQX 4.1.0 are supported.  The new package is in beta stage.  It includes the same basic code as the previous 4.1.0 version, with just the changes needed to build and debug on Linux systems. Download Freescale MQX RTOS 4.1.0 for Linux Beta Depending on the popularity of this release, Freescale may extend Linux support to future MQX RTOS mainline releases.  Stay tuned. Give us your feedback!  Post to the MQX community.  Let us know what you think. Development tools Supported: DS-5 Vybrid Controller Edition 5.16.0  (Vybrid) GNU Tools for ARM Embedded Processors version 4.7-2013-q3  (Kinetis & Vybrid) Here are some brief instructions I put together when using with Ubuntu 12.04: - Download and install gcc for arm (comes with gdb for debugging)   See other post:  gcc compiling + gdb debugging on Kinetis on a Linux host - Kinetis L Examples available - Download and extract the .tar.gz file to a location of your choice    mac@mac-VirtualBox:/$  tar -zxvf Freescale_MQX_4_1_LINUX_beta.tar.gz - Edit global.mk to tell it where your gcc toolchain is located.    mac@mac-VirtualBox:/$ cd <directory where you extracted mqx>/Freescale_MQX_4_1_LINUX_beta/build/common/make/    mac@mac-VirtualBox:/$ vi global.mak    un-comment the section on gcc_arm and set the TOOLCHAIN_ROOTDIR.  For my toolchain gcc is installed to the path /usr/    ifreq ($(TOOL),gcc_arm)        TOOLCHAIN_ROOTDIR  =  /usr/   endif - See  MQX GNU Getting Started Guide for instructions on how to build and debug.     This document is located at /Freescale_MQX_4_1_LINUX_beta/doc/tools/gnu/ Good luck with your next project.  Happy developing!
記事全体を表示
by: Luis Garabito Applications Engineer TICS, Mexico The time invested to develop applications for the first time in a new environment can be significant. It is necessary to understand how the environment works and then be able to generate applications for this environment. The purpose of this application note is to provide the knowledge that enables developers to start quickly and easily with the development of their first application on Freescale MQXLite RTOS. This document provides the bases that developers will need to understand to create basic Freescale MQXLite applications. This Application Note is based on the Kinetis KL2 USB MCUs Family, specifically, the KL25Z128VLK4 micro controller. The Freescale Freedom development platform board (FRDM–KL25Z) is also used for this example. The full application note is attached.
記事全体を表示
The links below provide useful design resources for MQX Software Solutions product developers. Products Latest Releases and Patches Announcements & Information Training MQX Classic​ MQX v4.2.0.2 Patch MQX RTOS Announcements MQX RTOS Training Space MQX v5​ MQX RTOS v4.2 General MQX FAQs​ MQX Essentials - Training Videos​ CyaSSL for MQX RTOS MQX Roadmap
記事全体を表示
The MQX 4.0.2 BSP doesn't support VLPS mode out of box, and RXEDGE interrupt is not enabled either, so there are several steps to do before implementing the demo. modify user_config.h #define BSPCFG_ENABLE_TTYB                        0 #define BSPCFG_ENABLE_ITTYB                       1 MQX enables UART in polled mode by default, and here we enable the UART1 interrupt mode, the TTY port may vary depending on the platform. modify BSP_DEFAULT_IO_CHANNEL in twrk20d72,.h as below: #ifndef BSP_DEFAULT_IO_CHANNEL #if BSPCFG_ENABLE_ITTYB #define BSP_DEFAULT_IO_CHANNEL                      "ittyb:"    /* OSJTAG-COM   interrupt mode */ #define BSP_DEFAULT_IO_CHANNEL_DEFINED #else #define BSP_DEFAULT_IO_CHANNEL                      NULL #endif modify LPM_CPU_OPERATION_MODES[] in init_lpm.c as below: const LPM_CPU_OPERATION_MODE LPM_CPU_OPERATION_MODES[LPM_OPERATION_MODES] = { // LPM_OPERATION_MODE_RUN { LPM_CPU_POWER_MODE_RUN,                     // Index of predefined mode 0,                                          // Additional mode flags 0,                                          // Mode wake up events from pins 0..3 0,                                          // Mode wake up events from pins 4..7 0,                                          // Mode wake up events from pins 8..11 0,                                          // Mode wake up events from pins 12..15 0                                           // Mode wake up events from internal input sources }, // LPM_OPERATION_MODE_WAIT { LPM_CPU_POWER_MODE_VLPS,//LPM_CPU_POWER_MODE_VLPR,                    // Index of predefined mode 0,                                          // Additional mode flags 0,                                          // Mode wake up events from pins 0..3 0,                                          // Mode wake up events from pins 4..7 0,                                          // Mode wake up events from pins 8..11 0,                                          // Mode wake up events from pins 12..15 0                                           // Mode wake up events from internal input sources }, // LPM_OPERATION_MODE_SLEEP { LPM_CPU_POWER_MODE_WAIT,                    // Index of predefined mode LPM_CPU_POWER_MODE_FLAG_SLEEP_ON_EXIT,      // Additional mode flags 0,                                          // Mode wake up events from pins 0..3 0,                                          // Mode wake up events from pins 4..7 0,                                          // Mode wake up events from pins 8..11 0,                                          // Mode wake up events from pins 12..15 0                                           // Mode wake up events from internal input sources }, // LPM_OPERATION_MODE_STOP { LPM_CPU_POWER_MODE_LLS,                     // Index of predefined mode 0,                                          // Additional mode flags 0,                                          // Mode wake up events from pins 0..3 0,                                          // Mode wake up events from pins 4..7 0,                                          // Mode wake up events from pins 8..11 0,                                          // Mode wake up events from pins 12..15 LLWU_ME_WUME0_MASK                          // Mode wake up events from internal input sources - LPT } }; Here we map LPM_OPERATION_MODE_WAIT to VLPS mode add following code in _kuart_int_rx_tx_isr() from serl_int_kuart.c   if (sci_ptr->S2 & UART_S2_RXEDGIF_MASK)          {                     sci_ptr->S2 = UART_S2_RXEDGIF_MASK;                     sci_ptr->BDH &= 0xBF; /* clear RXEDGIE */          } so that RXEDG event is checked in _kuart_int_rx_tx_isr() for low power mode. replace main.c in "C:\Program Files\Freescale\MQX_4_0_2\mqx\examples\lowpower" with the attached one. After recompiling MQX libs as well as the low power demo, you may test the VLPS mode just as shown in the attached video.   Hope that helps, B.R Kan Original Attachment has been moved to: VLPS-test.7z.zip Original Attachment has been moved to: main.c.zip Original Attachment has been moved to: serl_int_kuart.c.zip Original Attachment has been moved to: user_config.h.zip Original Attachment has been moved to: init_lpm.c.zip
記事全体を表示
MQXv5 is Coming! NXP has teamed up with Embedded Access to continue active development of MQX software solutions, providing regular updates, enhancements and ports to new processors. With the introduction of MQX v5, an extension to MQX Classic v4.2, and with new commercial licensing, developers can continue to use MQX with the latest Kinetis, i.MX, and other processors. Compare MQX Classic and MQX v5 by visiting nxp.com/MQX. Then, give us your feedback on which devices and features you’d like supported in this newest addition, MQX v5. Note, the first MQX v5 products are expected to be available near the end of Q3, 2016. MQX v5 products will be purchasable at nxp.com/mqxv5 and through distribution partners.
記事全体を表示
MQX includes a great demo for the web server in \<MQX_Path>\demo\web_hvac.  The web pages in this demo show how MQX can serve up data through the web server, and dynamically update the web page, for example the thermostat hvac properties are updated every second.  Also, the user can use a web page form to submit data to the server and update the application, like changing the temperature set point.  This is done with HTML forms, javascript, and CGI running in the MQX application. However, the web_pages directory in the web_hvac demo is missing the actual source files for the web pages.  Starting with MQX v4.0.2, they disappeared from the MQX release.  And since then, the web server APIs and CGI functionality has changed.  Posted here is the web_page directory for web_hvac, including the source code for the web pages.
記事全体を表示
Hi All, The new Freescale MQX™ 4.0.2.2 patch release is now available on the www.freescale.com. ·         Files available # Name Description 1 Freescale   MQX RTOS 4.0.2.2 Patch This   patch release is based on the MQX™ RTOS 4.0.2 release and provides the   solutions to software issues identified in the released version. This patch   release applies to all the BSPs. ·         Patch Description This patch provides the software workarounds for the following issues identified in MQX 4.0.2 release: o   ENGR00278434 §  Vybrid ARM Cortex®-A5: The float context is not properly saved when a task is blocked. §  Affected BSPs: TWR-VF65GS10, AutoEVB Vybrid o   ENGR00273581 §  A memory allocation problem occurs when the system is out of memory. §  Affected all BSPs o   ENGR00276466 §  Events are sometimes triggered immediately after they are added. §  Affected all BSPs o   ENGR00279275 §  RTCS connect failures via Dell router §  Affected all BSPs ·         Known issues o   For known issues and limitations please consult the release notes document.
記事全体を表示
The new Freescale MQX™ 4.1.1 Cloning Wizard patch is now available on the www.freescale.com/mqxrtos ·         Patch Description o   BSP Cloning Wizard is now based on Eclipse 4.4 o   Kinetis Design Studio support for generating projects (libraries, examples) and working sets (.wsd files for Project of Projects plug-in) o   Remembering opened boards (cloned or opened by user) from previous application run o   BSP Cloning Wizard saves users selection of IDEs, Libraries and Examples in project generator section for all currently opened boards o   Fix the issue of the BSP Cloning Wizard not working in MQX 4.1.1 To get the patch follow the next instructions: Go to www.freescale.com/mqxrtos Click on the big Download Button.  - You will have to log in if you aren’t already.  Click on MQX RTOS for Kinetis, Vybrid, Coldfire v4.1.1….. The patch for the cloning wizard is on the list of files.
記事全体を表示
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
記事全体を表示
INTRODUCTION Have you posted a question and it has been unanswered? It could be because of couple of reasons. I would like to highlight few of them. Because posts like "it does not work" have a real chance to be ignored. More you share, easier for others to reproduce it. USE SEARCH FUNCTIONALITY Before you even start creating your own post, use search functionality here in the community. Lot of questions have been answered already, do not please duplicate posts. DOCUMENTATION Available documentation is located inside MQX installation folder: <MQX_INSTALL_DIR>\doc. There are two most important documents: MQX User Guide and MQX Reference Manual. You might find your answer there. HOW WOULD AN IDEAL POST LOOK LIKE It should contain: 1. product version (MQX version) 2. platform (MCU) 3. compiler (IDE) 4. target (release/debug and flash/ram) 5. detailed description 6. code snippet (if not the exact code, at least literally what it does and where it fails) The best is to post a code or at least a snippet of what fails. Try to minimize the software, create a small application which you can share to prove it is not functional properly. The code most of the time help us to reproduce a problem and make it fail in the same way. Otherwise we can only guess what it could be which makes entire process harder and longer. Please use C++ highlight (available in Advanced editor, last symbol (>>) ). It makes code easier to read with visual splitting a code from a text. /* code example (C++ higlight) */ int main(void) {   return 1; } If you tackle with any problem, please specify what you have done so far, read or tried anyhow. State what you expected to happen. Write down an error which has occur, if any. Does current version of MQX break the code which has been running on previous release? Diff files to find out differences. Does documentation not provide enough details? Does the code look obfuscated? Let us know! SHARING IS CARING We would like to hear your feedback! Share a result with us. Helps us to improve user experience! If you get an answer which has helped you, please reply and share the outcome, how did you solve it. Any user can encounter similar or even the same problem. Be part of the community. Regards, c0170 I'll post here some references which are valuable to the topic and I suggest everybody read them. References: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html http://www.softwaretestinghelp.com/how-to-write-good-bug-report/
記事全体を表示