Home

Getting Started with Freescale MQX™ RTOS - Other

image

Contents

1. i fe lwdemo_twrk60n512_InI o E test3_twrk60n512_Int_F E testa twrksons12 Int E test3 twrk60n512 Int F Launch Group hl E Filter matched 10 of 10 items Se Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 4 All example applications coming with Freescale MQX RTOS are already configured for the MQX OS Awareness CodeWarrior 10 TAD Features The MQX plug in implements the System Browser window showing all running MQX tasks Open the Show View dialog by selecting the Window Show View Other menu In the Show View tree view select the System Browser item in the Debug tree Double click any task entry in this view to activate the task in the CodeWarrior 10 debugger E come 2 Tada vaere mete O Saabs Oana ECT MQX OS Coldfire intflash_d elf MQX KA Plug in Tasks HVAC ID 0x 10001 TD 0x2000 146c 0x10001 Suspended KHCI Task ID 0x 10004 TD 0x20003214 0x 10004 Running Shell ID 0x 10002 TD 0x2000 laac 0x10002 Running TCP IP ID 0x 10005 TD 0x20004238 0x10005 Running USB ID 0x 10003 TD 0x200026c8 0x10003 Running httpd server ID 0x 10006 TD 0x20009034 0x10006 Running fa writable Smart Insert 97 33 The MQX Task Summary screen is available in the MQX Task Summary menu MO DE E pe 0 EE EE r E HVAC 0x10001 0x2000 1368 Examine Task Task Identification Name HVAC Scheduling Flags Auto
2. For example when CodeWarrior 10 tool is used to build MQX PSP and BSP libraries for TWR K60D100M board in debug targets the libraries are built in the lib twrk60d100m cw10 debug psp and lib twrk60d100m cw10 debug bsp directories Note In the MQX 4 0 the library output paths were changed The target names are now part of a library output path while the name of the library file is the same for all targets The Debug versions of the libraries are no longer created with the _d suffix which makes it easier to create custom build targets and change different versions of libraries easily in the application projects e All public header files needed for the application are automatically copied from internal include folders to the same output directory as the library itself e During PSP or BSP build process the user config h file and other header files from the config lt board gt and config common directories are also copied into the lib lt board gt lt compiler gt lt target gt output directory Getting Started with Freescale MQX RTOS Rev 15 4 Freescale Semiconductor e After changing the config common user config h file recompile all MQX libraries e Important No changes should be made to header files in the output build directory 1ib The files are overwritten each time the libraries are built 2 3 Build targets 2 3 1 Library build targets Each build project in Freescale MQX RTOS contains multiple compiler linker
3. Board Specific Build Targets e Int Flash SramData Debug and Release This target enables building applications that execute code from the internal flash and use internal SRAM for application data e Int Flash DDRData Debug and Release This target enables building applications that execute code from the internal flash and use external DDR2 memory for application data After changing the config common user config h file recompile all MQX libraries Important Do not change header files in the output build directory lib The files are overwritten each time the libraries are built Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 59 8 2 12 KwikStik MK40X256 The KwikStik BSP is tested in these hardware configurations e KwikStik processor board tested with Rev 4 e TWR SER serial board e TWR ELEV Primary and Secondary four story elevator boards e TWR MEM memory extension board optional Core Clock 96 MHz Bus Clock 48 MHz Default Console iodebug Use the I O Debug as an output only Avoid using it as an input because reading from the Semihost port causes the microprocessor core to halt If the console input is required use the serial line channel ttyf n RS232 DB9 on the TWR SER board Power the board from the USB connected to the TWR ELEV card BSP Timer Systick Important Jumper Settings e For using RAM disk jumpers on position e TWR MEM board J16 remove e
4. the default console has to be changed to ttya Please note that ttya is available at TWRPI and cannot be used out of the box Other Notes The default console interface ttyb is routed to OSBDM COM USB mini connector Use the P amp E Microcomputer Systems OSJTAG terminal to access the board serial line Because SCI1 module and SPI1 module share a pin PTE1 useTTYA as a terminal for the SPI1 module Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 41 8 2 3 TWR K21D50M f Core Clock 48 MHz Bus Clock Default Console OSJTAG USB mini connector BSP Timer Systick Important Jumper Settings e For using Tower System USB e TWR_K21D50M board shoot 6 8 on J11 e Install R224 R226 on nets USBO DP and USBO DN and remove R225 R227 on K21 MICRO USB DP and K21 MICRO USB DN e For using Micro USB in K21 tower board e TWR_K21D50M board shoot 5 6 on J11 e Leave R225 and R227 on nets K21 MICRO USB DP and K21 MICRO USB DN and do not populate R224 and R226 on USBO DP and USBO_DN e For using USB Host mode jumpers on position e TWR SER board J16 on position 1 2 VB HOST e TWR SER board J10 on default position 1 2 USB host e For using USB Device mode jumpers on position e TWR SER board J16 on position 3 4 VB DEV e TWR SER board J10 on position 2 3 USB device Getting Started with Freescale MQX RTOS Rev 15 42 Freescale Semiconductor e For using UARTO with Pri
5. A5 DDR target target using DDR memory for both code and data Load this target by using either U Boot or MQX boot loader e A5 Int Ram target target using internal OCRAM SRAM memory for both code and data Load this target by using either U Boot or MQX boot loader e M4 Int Ram target Code is located in the lower part of OCRAM SRAM and the data is in the TCM memory Load this target by using either U Boot or MQX boot loader e See Chapter 2 3 Build Targets for more details about the standard build targets Known Issues e Both A5 and M4 Int Ram target code space is limited and most of the RTCS based applications are too large to fit to the memory Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 35 M4 Int Ram blue A5 DDR target green memory layout OCRAM SRAM DDR TCM ONE The yellow area is shared both by ARM Cortex A5 and ARM Cortex M4 and used for multicore communication Getting Started with Freescale MQX RTOS Rev 15 36 Freescale Semiconductor A5 Int Ram target memory layout OCRAM SRAM DDR TCM Not used in this target Not used in this Not used in this target target Not used in this target MQxX Boot loader reserved A5 Boot loader OCRAM SRAM DDR TCM Not used in this target used by BootROM Not used in this target Not used in this target Not used in this target Getting Started with Freescale MQX RTOS Rev 1
6. Flashing Procedure is as follows Connect the P amp E Microcomputer Systems BDM cable to the board and switch on the power Compile the PEBDM Ext Flash target in the selected CodeWarrior project Ensure you have SW1 DIP switch set correctly for the NAND booting see jumper setting above Locate lt output name gt rbin file which should be created in the application output directory Open Windows Command Line Prompt run cmd exe and change directory to lt install_dir gt tools flash_programmer CFFlashprog Use cf exe NAND erase M54418TWR_nand 0 200000 command to erase the first 2 MB of NAND Flash memory Use cf exe NAND write M54418TWR nand 0 200000 1 lt path to rbin file gt command to write the application code to the NAND Flash memory For a more detailed description of the NAND Flash tool see lt install dir gt tools flash programmer CFFlashprog ReadMe txt Known Issues Some Compact Flash cards do not work correctly with the TWR MEM and MQX CF Card driver There may be several reasons An issue in the TWR MEM CPLD code Rev A causes incorrect communication with certain types of cards e g Kingston A fixed CPLD firmware is available in install dir gt mqx source io pccardtwr mem pccard cpld folder The firmware can be loaded to the TWR MEM CPLD by using the Altera Quartus II design tool and a BLASTER connection cable M54418 MQX CF card driver incorrectly detects the card in the slot If you experienc
7. MHz Bus Clock Default Console OSJTAG USB mini connector BSP Timer Systick Important Jumper Settings e Onboard connector does not work as Host by default See known issues For using USB Host mode with TWR SER board set jumpers to this position e TWR SER board J16 on position 1 2 VB HOST e TWR SER board J10 on default position 1 2 USB host e Use on board connector by default To use the USB Device mode with TWR SER board set jumpers to this position e TWR SER board J16 on position 3 4 VB DEV e TWR SER board J10 on position 2 3 USB device e For SD card operation e TWR MEM board jumper J12 on position 3 4 IRQA Getting Started with Freescale MQX RTOS Rev 15 40 Freescale Semiconductor Known Issues IAR IDE version 6 40 has issues when connecting to the board by using the J Link probe To resolve this issue use OSBDM instead Example projects contain build configurations for code execution which are different than the Flash or RAM memory The RAM based execution may be faster to debug Not all examples however fit into RAM and may not link USB host cannot be used with onboard USB connection when led D9 is used A shared pin PTC9 is used to control the led and power supply for USB host on board Rev B The SCI1 module mapped to ttyb and SPI1 module used as SD card communication channel share a pin PTE1 which prevents the SD card from working properly For correct SD card driver operation
8. Manual Configuration Device Name Max Clock 1MH2 y Ad Delete Jpdate IR len Debug Connect amp Reset Options Cache Options r Download Options Connect Normal v Reset Autodetect y IV Cache Code I Verify Code Download Y Cache Memory I Download to Flash V Reset after Connect OK Cancel Getting Started with Freescale MQX RTOS Rev 15 18 Freescale Semiconductor Cortex M Target Driver Setup Debug Trace Flash Download Core Clock 10 000000 MHz IV Trace Enable I UnlimitedTrace ETM Ti 4 Timestamps gt Trace Events Serial Wire Output Manchester y MV Enable Prescaler 1 y I CPI Cycles per Instruction I EXC Exception overhead SWO Clock Prescaler PC Sampling T SLEEP Sleep Cycles IV Autodetect x ES ees 102416 Ee I LSU Load Store Unit Cycles SWO Clock 10 000000 MHz IV Periodic Period 1 638 ms I FOLD Folded Instructions Ton Data RAV Sample IV EXCTRC Exception Tracing ITM Stimulus Ports Port 24 23 Port 16 15 Port 8 7 Port 0 Enable 0xFFFFFFFF JE Wiviviviviviviv viviviviv iv Iv Iv WivivivivivMiv Privilege Ox00000008 Port 31 24 Iv Port 23 16 I Port 15 8 I Port 7 0 I OK Cancel To show the console view during the debug session go to menu View Serial Windows Debug printf Viewer For more information about Keil and ULINK settings navigate to this link arm com files pdf Kinetis_LAB pdf For
9. T2IN 7 8 Connect CTS to R2OUT e J24 no jumper USB Device Mode 1 2 Device Mode capable of powering Tower System e SW1 1 on 2 on MII MODE pull up RXDV 3 4 5 6 7 8 off e SW2 1 on 3 on MII MODE pull up 50MHz 2 4 5 6 7 8 off Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 69 TWR MEM Rev A TWR MEM can operate only with TWR SER2 card in a default setting Use TWR SER board for the SDHC operation For eSDHC operation e J12 SD SEL1 on position 1 2 to enable SD Card detect signal e J12 SD SEL1 on position 5 6 to enable SD Card data 1 signal e J12 SD SEL1 on position 7 8 to enable SD Card data 2 signal e J12 SD SEL1 on position 9 10 to enable SD Card cmd pull up e J12 SD SEL1 on position 11 12 to enable SD Card data 0 pull up e J2 SD SEL2 on position 2 3 to enable SD Card data 3 pull down e J3 SD CS on position 1 2 to enable SD Card data 3 signal e J13 on position 1 2 to enable SD Card write protect signal Board specific build targets e Ext Flash Debug and Release These targets enable building applications to boot the system from the external NAND Flash memory After the reset the initialization code of the application bootstrap is loaded from NAND Flash to SRAM This initialization code copies the rest of the application to the DDR RAM memory and executes the application there e Note that this could take a while especially if a large application is started e See NAND Fla
10. and Release this target enables to build applications that execute code from the internal flash and use the internal SRAM for application data Other Notes e The default console interface ttyf for RevB board is routed to both OSBDM COM USB mini connector J13 and TWR SER J8 RS232 Connectors Use the P amp E Microcomputer Systems OSJTAG terminal to access the board serial line Getting Started with Freescale MQX RTOS Rev 15 56 Freescale Semiconductor 8 2 11 TWR K70F120M Primary SWI1 Connector SW2 Infra red Touch SLCD General TWRPI Socket Purpose Tower Plug In TWRPI Accelerometer LED Touch SW3 Reset Buttons E1 E4 Power OSJTAG Mini B USB Connector PK70FN1MOVMJ12 Processor Secondary Connector Core Clock 120 MHz Bus Clock Default Console OSJTAG USB mini connector BSP Timer Systick Important Jumper Settings board Rev A e For standalone operation e TWR K70FN1M Jumper J18 on position 1 2 e To enable Ethernet communication use with TWR SER e TWR K70FN1M Jumper J18 on position 2 3 processor clock taken from the TWR SER board e TWR SER CLK_SEL 3 4 e TWR SER CLKIN SEL 2 3 processor clock is taken from PHY e TWR SER ETH CONFIG J12 9 10 to select RMII communication mode e Important Plug both the processor and the serial board TWR SER into the Tower The processor is using the external clock from the Ethernet PHY on the serial card e USB com
11. appropriate MQX libraries and create initial application project The project wizard is available in the File New MQX Projects menu in the CodeWarrior 10 IDE Follow the steps displayed by the Wizard specify application name and select the target evaluation board The wizard may create a new application or import one of the existing examples to your workspace Start with the New application wizard Select Application type and template Select example project or create a new one Select application type 9 New application Example application Select example application gt Basic examples gt Demos gt MFS examples gt RTCS examples gt USB Device examples gt USB Host examples Create new application according to selected options Select the MQX libraries to be included in your project Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 11 MQX options Select additional MQX libraries to add to the project Y Add MFS sup Add RTCS suppo Add USB Host support Add USB Device support The Wizard provides two types of project e Empty application a simple Hello world application with selected MQX libraries included e Basic application an application showing basic code to initialize selected MQX components Getting Started with Freescale MQX RTOS Rev 15 12 Freescale Semiconductor MQX project type Select empty application or bas
12. board TWR SER CLK_SEL 3 4 TWR SER CLKIN SEL 2 3 processor clock is taken from PHY TWR SER ETH CONFIG J12 9 10 to select RMII communication mode Important Plug both the processor and the serial board TWR SER into the Tower Processor is using external clock from Ethernet PHY on the serial card e To enable USB communication TWR SER2 J21 USB VBUS EN shunt for USBHS Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 55 Known Issues e Some Compact Flash cards do not work correctly with the TWR MEM and MQX CF Card driver An issue in the TWR MEM CPLD code Rev A causes incorrect communication with certain types of cards e g Kingston A fixed CPLD firmware is available in lt install dir gt mqx source io pccard twr mem pccard cpld folder Load the firmware to the TWR MEM CPLD by using the Altera Quartus II design tool and a BLASTER connection cable e The layout design of TWR_K60F120M Rev B board does not allow NAND flash module to run at 24 MHz clock To increase the working clock speed use the drive strength attribute for NAND flash pins In this package NAND flash module on Rev B board works properly at 20 MHz clock e Example projects contain build configurations for code execution different than the Flash or RAM memory The RAM based execution may be faster to debug but not all examples fit into RAM and may not link Board Specific Build Targets e Int Flash SramData Debug
13. board gt user config h This user configuration file is included internally by private configuration files in MQX PSP and BSP and other core components such as RTCS USB and Shell To share the configuration settings between different boards add header files to the user config h file with common settings The header files are located either in the same lt board gt directory or in the common directory install dir gt config common Note Prior to the MQX 4 0 the configuration header files were added from different locations when compiling the BSP PSP and other library projects The BSP and PSP code included the user config h file from the original config folder while other libraries such as RTCS or MFS were using a copied version of the this file from the 1ib folder This was changed in MQX 4 0 such that all libraries are using the user config h file from the config folder This change removes the requirement to build the libraries in a certain order Prior to MQX 4 0 the PSP and BSP libraries had to be built before the other libraries This is no longer required 2 2 Build process After either the compile time user configuration file or MQX kernel source files are changed re build the MQX libraries The build process is similar for all core components e The output directory is lt install_dir gt lib lt board gt lt compiler gt lt target gt lt component gt where lt compiler gt is a name of a build tool
14. configurations so called build targets Two different types of build targets exist for different compiler optimization settings Debug the compiler optimizations are turned off or set to low The compiled code is easy to debug but may be less effective and much larger than the release build Libraries are compiled into lib lt board gt lt compiler gt debug lt component gt directories Release the compiler optimizations are set to maximum The compiled code is very hard to debug and should be used for final applications only Libraries are compiled into lib lt board gt lt compiler gt release lt component gt directories Note The library path name pattern was changed in the MQX 4 0 The _d suffix for debug was removed from the library This change simplifies creating custom build targets and also enables changing different versions of libraries easily in the application projects In order for the application to use libraries compiled in a different build target set the proper library search paths in the application project settings The library names referred by the application project remain unchanged Different ABI options are no longer supported by MQX The user may add ABI builds as custom targets 2 3 2 Application build targets Build target names of MQX application projects reference either Debug or Release builds of the core libraries Additionally the target names also specify the built board memory configura
15. define USBCFG DEFAULT DEVICE CONTROLLER bsp usb dev ehcil if define USBCFG DEFAULT HOST CONTROLLER amp bsp usb host ehcil if in the lt mqx_install_dir gt mqx source bsp twrvf65gs10_ a5 twrvf65gs10_ a5 h e USB1 host mode e TWR VF65GS10 board J19 2 3 e TWR VF65GS10 board J21 1 2 and 3 4 Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 33 34 Known Issues e A freeze bit in the MCR register allows the PIT timers to stop when the device enters debug mode When either core is stopped by a debugger the PIT timer stops too For the multicore debugging this process may cause confusion e Both ARM Cortex A5 and ARM Cortex M4 Int_Ram target code space is limited and most of the RTCS based applications are too large to fit to the memory Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor Debugging and Tool Chain Related Information IAR J Link l Jet probe debugging Ensure that either the J Link or l Jet probe is updated to the latest firmware because older versions of firmware do not fully support the Vybrid multicore debugging See Getting Started with Freescale MQX RTOs and IAR Embedded Workbench document MQXGSIAR lt install dir gt doc tools iar MQX IAR Getting Started pdf for details about Vybrid and multicore debugging e The OpenSDA circuit is programmed to MSD CDC functionality by default This provides the se
16. gt Data Debug The name of each target defines a memory used as the default data storage For example the application built with target named Int Flash DDRData Debug executes code out of internal Flash memory and uses the DDR memory for data storage 2 3 3 Compiler and Linker Warning setting Several compiler and linker warnings are suppressed in MQX release iar kinetis vybrid a5 vybrid_m4 Pa082 e Pe186 e Pe177 e Pe550 e Pe174 undefined behavior the order of volatile accesses is undefined in this statement pointless comparison of unsigned integer with zero variable name was declared but never referenced variable name was set but never used expression has no effect ds5 vybrid_a5 vybrid_m4 1609 186 e 1296 uv4 kinetis 1609 186 e 1296 1581 instruction does not set bit zero so does not create a return address pointless comparison of unsigned integer with zero extended constant initializer used instruction does not set bit zero so does not create a return address pointless comparison of unsigned integer with zero extended constant initializer used added lt no_padbytes gt bytes of padding at address lt address gt Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor gcc kinetis vybrid a5 vybrid m4 Wno missing braces bug in gcc Wno switch Wno unused value Wno unused variable Wn
17. iar build libs eww The output directory is here lt mqx install dir gt lib lt board gt iar For detailed information about the MQX support in IAR tools see Getting Started with Freescale MQX RTOS and IAR Embedded Workbench document MQXGSIAR The document is included in the MQX installation in the lt mgx_install_dir gt doc tools iar MOX IAR Getting St rted pdf 2 6 ARM Keil uVision4 development environment support To rebuild the MQX libraries open and batch build this uVision4 Multi Project Workspace lt mqx install dir gt build lt board gt uv4 build libs uvmpw The output directory is here lt mqx install dir gt lib lt board gt uv4 For detailed information about the MQX support in ARM tools see Getting Started with Freescale MQX RTOS and MDK ARM Keil pVision4 document MQX GSKEIL The document is included in the MQX installation in the lt mqx_install_dir gt doc tools uv4 MQX uVision4 Getting Started pdf 2 7 ARM Development Studio 5 DS 5 environment support First install the MQX Eclipse plugin using Help nstall New SoftwarelAddlArchive menu Then select this archive lt mqx install dir gt tools ds5 ds5 update site zip To rebuild the MQX libraries first import the lt board gt wsd working set description file by using FilelImportiMQXlUmport Working Sets menu The MQX library projects will be imported to DS 5 working space together with build configurations settings Locatio
18. is a channel routed via combined OSBDM OSJTAG debugging and communication port directly to the board For microcontrollers the communication interface is connected to a serial SCI UART port For a PC Host you can use either a virtual USB serial port driver or a special USB communication terminal application See the development board documentation more details e Debugl O is a channel which connects the PC and a target processor by using the debugging probe O functionality For more information see Using the Debugl O driver as the default I O channel Default Serial I O Channel Settings e Baud Rate 115200 e Data bits 8 e No parity e 1 stop bit and no flow control Pre defined default I O channel setting is specified for each board in the mgx source bsp lt board name gt board_name h header file This setting can be overridden in the user config h file by adding this code and rebuilding the BSP library To set the default I O channel to the UART2 serial interface mapped to ttyc device in MQX use this define BSP DEFAULT IO CHANNEL MeEEyos Ensure that the serial channel ttyc in this case is in enabled in user config h file as follows define BSPCFG ENABLE TTYC 1 Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 15 5 2 Using the Debugl O driver as the default I O channel The standard input and output channel can be redirected to the Debugl O driver allowing the process
19. 0 rrrrrrnnnnnnnonnnnnvrrnnnnnnnnnrnnnnnrrrnnnnnnnennn 7 2 5 IAR Embedded Workbench for ARM and ColdFire ococioiononocococonocononononcnrororononininininonos 8 2 6 ARM Keil uVision4 development environment SUpPOlt occcccoconoccncnnnenonnonenencnrinenennorinenincnninos 8 2 7 ARM Development Studio 5 DS 5 environment SUPPOI cocccncocononinnnnonencnninencnnorinnnincnranos 8 2 8 Building MQX using MakefileS wcmirnda ra 8 3 Porting User Applications to MQX 4 1 0 rrrnnnnnnnnvvnnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnsnnnnnnnenennnnnnnnnnnn 10 3 C99 NE 10 3 2 Changes in host to network and network to host Macros rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrnnnnnnnnn 10 23 MOA startup Sloan a 10 4 Creating New MAX Project cit seede 11 4 1 Freescale CodeWarrior development studio version 10 rrnnrrrrrnnnnnnnnnnnnnvrrnnnnnnnnrnnnnnnrrrnnnn 11 4 2 Other development tools acantilado isla 14 5 MQX Board Support Package Configuration OptiONS cccccccccccccccccccccnnncncncncncnnnnnonononnnos 15 5 1 Standard input and output channel SettidgS ooooomoooocccccnnnccconncnnoncccnnnncnnnnnnnnnncnnnnnnnnnnnnnnnnnno 15 5 2 Using the Debugl O driver as the default I O channel oooooooooonoonooooononooooon cnn nono nonnnnnnnnnnnonononos 16 5 2 1 Freescale CodeWarrior development studio version 10 oooocccccnncconcccccnnncconanannnnccncnnnnns 16 5 2 2 IAR Embedded Workbench for ARM coomomrmirnrirar corr
20. 10111110 Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 45 e TWR K40X256 open J7 3 4 5 6 7 8 e TWR K40X256 open J14 15 16 e TWR K40X256 board to enable navigation buttons open J4 1 2 Known Issues e The FlexBus FB OE B signal is directly connected to OE pin of the address latch on the TWR MEM card This prevents using FlexBus for communication with MRAM and CF CARD on TWR MEM card e Example projects contain build configurations for code execution different than the Flash or RAM memory The RAM based execution may be faster to debug but not all examples fit into RAM and may not link Other Notes e The default console interface ttya is routed to OSBDM COM USB mini connector Use the P amp E Microcomputer Systems OSJTAG terminal to access the board serial line e To enable the TWR SER RS232 interface change the BSP DEFAULT IO CHANNEL configuration option to ttyd in the mgx source bsp twrk40x256 twrk40x256 h file Getting Started with Freescale MQX RTOS Rev 15 46 Freescale Semiconductor 8 2 6 TWR K40D100M THE TWR K40D100M STATUS pia er 13 we ir TDA4025 SECONDARY Core Clock Bus Clock Default Console BSP Timer OSJTAG USB mini connector Important Jumper Settings e For using USB Host mode jumpers on position e TWR SER board J16 on position 1 2 VB HOST e TWR SER board J10 on default position 1 2 USB host e For using USB Device
21. 15 66 Freescale Semiconductor 8 5 ColdFire V4 8 5 1 TWR MCF54418 KIT The MCF54418 Patch supports this hardware configuration e TWR MCF54418 Rev D processor board e TWR SER2 Rev C serial board e TWR ELEV Primary and Secondary four story elevator boards e TWR MEM Rev B memory extension board Core Clock 250 MHz Bus Clock 125 MHz Default Console ttyd RS232 BSP Timer PITO Important Plug both the processor and the serial board TWR SER2 into the Elevator bus The MCF54418 processor is using the external clock generated by the Ethernet PHY on the Serial card Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 67 Jumper Settings TWR MCF54418 Rev D board use the highlighted setting for a basic MQX operation J2 on position 1 2 J8 on position 1 2 J6 on position 1 2 J5 on position 3 4 J4 no jumper J10 no jumper J12 no jumper Sw SW1 Input Clock Selection 1 2 external clock RMII clock from TWR SER2 board 2 3 onboard 25MHz clock TCK PSTCLK Routing 1 2 PSCCLK routed to pin 24 of BDM header J11 2 3 PSTCLK routed to pin 6 of BDM header J11 To enable PE micro debugger Boot Mode Selection 1 2 amp 3 4 Internal RCON 3 4 External RCON No Jumper Serial Boot 8 Ohm speaker connector IRQ active at high level MCU Reset In Both off 1 on 2 off 3 on 4 off 5 off 6 on 7 on 8 on booting from NAND TWR SER2 Rev C Board use the highlighted setting for
22. 17 5 2 3 ARM Keil uVision4 IDE arta id 18 5 3 Setting default USB controller for host and device applications ooocoonnncononcccnnnnccnnnncaannnoos 19 6 Task aware debugging plug in rrrrrasanvvvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnenennnnnnnnnn 20 6 1 CodeWarrior development studio version 10 rnnrrrrnnnnnnnonnnnnnvrrrnnnnnnnerennnnnrrrnnnenenennnnnnnrrnnnnne 20 6 1 1 Debugging in CodeWarrior development studio version 10 rrrnnrrrrvnnnnnvrnnnnnvrrrnnnnnnnennn 20 6 1 2 CodeWarrior 10 task aware debugger plug in oocccccnncnccccccnnncccnoncnanaccccnnncnonannnnnnnccnnnnnos 21 6 2 IAR Embedded Workbench for ARM and ColdFire ccooccccccnncnnoccccccnccononcnananccononononanananononos 24 63 ARM Keil VISION Asco 25 ET Bs ia 25 7 Integrating Processor Expert Drivers into MQX BSP nssvvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnenenenennnnnnnn 26 nn e en 26 7 2 Processor Exp rt ready BSP Si 27 7 3 Processor Expert MQX demo application cooononccccconnnnnccnnononcncnonononcnnnanannnnncnn nano nanananencnos 27 7 4 Processor Expert and default clock settings in Kinetis BSPS 0ooooocccnnnnccnnicccoccccccncconananano nono 27 8 Board specific Information Related to MQX nnnnvvnnnnnnnnnnnnnnnnvnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnn 29 81 Vee 29 8 11 TS SK EE NE EN 29 JE GSE RE RE REE 32 ER Aa EEE RE ER EE A RE a ER 38 8 2 1 TWR K20D50M copii 38 Getting Started with Freescale M
23. 5 Freescale Semiconductor 37 8 2 Kinetis 8 2 1 TWR K20D50M Core Clock 48 MHz Bus Clock 48 MHz Default Console OSJTAG USB mini connector BSP Timer Systick Important Jumper Settings e For using USB Device mode jumpers on position e TWR K20D50M board J26 open e TWR K20D50M board J30 on position 5 6 VREGIN e For using USB Host mode jumpers on position e TWR K20D50M board J26 on position 1 2 e TWR K20D50M board J30 on position 5 6 VREGIN e For using RTC example without a battery e TWR K20D50M board J35 on position 1 2 Known Issues e The default console ttyb which is used by the OSJTAG is also routed to the RS232 TWR SER interface This sometimes leads to conflicts e Timer interrupt wakeup from LLS power mode leads to the chip reset with the reset cause set to core lockup Getting Started with Freescale MQX RTOS Rev 15 38 Freescale Semiconductor e The switch to VLPR power mode does not work The chip does not acknowledge the power mode change in the PMSTAT register Other Notes e USB is only available on the TWR K20D50M board It is not routed to the port on the TWR SER board e Example projects are provided only with configurations which have to be run from the Internal Flash Memory because of the small RAM size available on the K20D50 processor Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 39 8 2 2 TWR K20D72M Core Clock 72
24. Freescale Semiconductor Document Number MQXGSRTOS Getting Started Rev 15 02 2014 Getting Started with Freescale MQX RTOS PRODUCT Freescale MQX RTOS PRODUCT VERSION 4 1 0 DESCRIPTION Getting Started with the Freescale MQX RTOS version 4 1 0 2014 Freescale Semiconductor Inc All rights reserved o gt Lo gt freescale How to Reach Us Home Page www freescale com Web Support http www freescale com support Document Number MQXGSRTOS Rev 15 02 2014 Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document Freescale reserves the right to make changes without further notice to any products herein Freescale makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Freescale assume any liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability including without limitation consequential or incidental damages Typical parameters that may be provided in Freescale data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters incl
25. M Jit pup 2011 FREESCALE 25 TWR K60D100M gt w w2 niire JM60 BDM J188 SECONDARY Core Clock Bus Clock Default Console BSP Timer Systick OSJTAG USB mini connector Important Jumper Settings e For standalone operation e TWR K60D100M Jumper J10 on position 1 2 e For using USB Host mode jumpers on position e TWR SER board J16 on position 1 2 VB HOST e TWR SER board J10 on default position 1 2 USB host e For using USB Device mode jumpers on position e TWR SER board J16 on position 3 4 VB DEV e TWR SER board J10 on position 2 3 USB device e To enable Ethernet communication use with TWR SER e TWR K60D100M Jumper J10 on position 2 3 processor clock taken from the TWR SER board e TWR SER CLK SEL 3 4 e TWR SER CLKIN SEL 2 3 processor clock is taken from PHY e TWR SER ETH CONFIG J12 9 10 to select RMII communication mode Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 53 e Important Plug both the processor and the serial board TWR SER into the Tower The processor is using the external clock from the Ethernet PHY on the serial card Known Issues e Some Compact Flash cards do not work correctly with TWR MEM and MQX CF Card driver An issue in the TWR MEM CPLD code Rev A causes incorrect communication with certain types of cards e g Kingston A fixed CPLD firmware is available in this folder lt install_dir gt mqx source io pccard twr_m
26. Ps document MQXGSCLKBSP The document is included in the MQX installation as the max install dir gt doc tools cw Howto SetupKinetisClock UsingPE pdf Getting Started with Freescale MQX RTOS Rev 15 28 Freescale Semiconductor 8 Board specific Information Related to MQX This section provides more details about all boards and BSPs supported by the current MQX distribution All jumper and other hardware switches not specifically described below are assumed to be in factory default positions See board user guides for default settings 8 1 Vybrid 8 1 1 AutoEVB Vybrid SS TT ARM Cortex A5 core autoevb vybrid a5 BSP Core Clock 396 Mhz Bus Clock 132 Mhz Default Console RS232 BSP Timer Global Timer ARM Cortex M4 core autoevb vybrid m4 BSP Core Clock 132 Mhz Bus Clock Default Console RS232 BSP Timer Systick Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 29 Important Jumper Settings Rev C For boot from fuses J15 1 2 J18 1 2 For boot from RCON sw J15 2 3 J18 1 2 To use Ethernet on the AutoEVB board these settings are required for DIP switches SW12 switches 3 4 and 5 in ON position For Quad SPI Flash boot SW10 SW11 SW12 SW13 all in OFF positions J15 2 3 J18 1 2 For SD card boot SW12 SW13 all in OFF positions SW10 switches 6 and 7 in ON position SW11 switch 4 in ON position J15 2 3 J18 1 2 Known Issues The board does not hav
27. QX RTOS Rev 15 Freescale Semiconductor 822 TIRA LOMA oda 40 A AA i eA oe 42 824 SP eee eee aa eodts 44 82 5TWR K40X256 iia 45 8 2 6 TWR K40D100M incida 47 82 7 TWR K53N512 uses eee ete 49 828 MR KOOND A eee ltt ele 51 8 2 9 TW R K6OD A OOM ra a a dy a a a r a 53 8 2 10 TWR K60F120M aa s E a E aA EA e eN AA A Ea T ETA 55 82A LWR K70F 20M era n ea ate 57 8 2 12 KwikStik MK40X256 accesso csdc5 vx sated clea eae ae ent del 60 93 Goldie Ae el 61 8 3 1 TWR MGF51JF128 1nn sier a ads tt 61 8 4 GOldFIre A ek Jed oP De kutt 64 8 4 1 TWR MCF52259 KIT a a a a E A EE EAEE ATE 64 8 5 GoldFre Vd imita A ido iia 67 8 51 TWR MGES441 8 Klan a Ardea A 67 AN 72 8 61 TWR PXDA o e o oo 72 A A area eee 74 33 TWR PXS 0 a e a a a a a a a a a a a Ea 76 8 0 A TWR PAN O A E A A AE AAA 78 Getting Started with Freescale MQX RTOS Rev 15 2 Freescale Semiconductor 1 Read Me First This document describes steps required to configure the CodeWarrior IAR Embedded Workbench and KEIL development tool and use it to build run and debug applications of the Freescale MQX RTOS operating system This document also provides board specific information related to the MQX RTOS Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 3 2 Building the MQX Libraries 2 1 Compile time configuration Major compile time configuration options are grouped in a single user configuration file located in install dir gt config lt
28. Rev C e For standalone operation e TWR K60N512 Jumper J6 on position 1 2 e To enable Ethernet communication use with TWR SER e TWR K60N512 Jumper J6 on position 2 3 processor clock taken from the TWR SER board e TWR SER CLK SEL 3 4 e TWR SER CLKIN SEL 2 3 processor clock is taken from PHY e TWR SER ETH CONFIG J12 9 10 to select RMII communication mode e Important Plug both the processor and the serial board TWR SER into the Tower The processor is using the external clock from the Ethernet PHY on the serial card e To use TWR LCD board with eGUI e TWR LCD board SW5 all switches to ON enable touch screen e TWR LCD board SW1 switches depending on usage either SPI 01111110 or 16 bits FlexBus 10111110 e TWR K60N512 open J3 13 14 Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 51 Known Issues e The FlexBus FB AD9 PTC6 signal on the TWR K60N512 Rev C board is directly connected to the IRDA sensor This prevents using FlexBus to communicate with MRAM and CF CARD on the TWR MEM card e Example projects contain build configurations for code execution different than the Flash or RAM memory The RAM based execution may be faster to debug but not all examples fit into RAM and may not link e TWR LCD board doesn t work correctly when the navigation buttons are used e Usage of center navigation button on TWR LCD board conflicts with the LCD RESET signal Both sign
29. Semiconductor 25 7 Integrating Processor Expert Drivers into MQX BSP 7 1 Introduction The Processor Expert tool which is available in CodeWarrior 10 enables configuration and driver code generation by using a graphical user interface The special RTOS Adapter component in Processor Expert and updated BSP code enable integration of the Processor Expert drivers into the BSP library The Processor Expert drivers can be used by the MQX application in the same way as other BSP drivers Currently this integration is supported only for Freescale Kinetis platforms Processor Expert Logical Device Drivers LDD which is available for the Kinetis family can be added into PE ready BSPs and used in the end user application E 2 Debug amp Documentation Generated Code gt Generic IO Drivers gt Peripheral IO Drivers Sources gt twrk60n512 BSP Files gt twrk60n512 User Config i Ha ProcessorExpert pe 2 3 Configurations OG TWRK60NS12 Operating System MOXL MQX 3 Cpus E Cpu MKGONS1IZVMD100 5 Embedded Components GPIO1 GPIO LDD El TRG TimerUnit LDD DAL DAC_LDD WDogl WatchDog_LDD El Puma TimerUnit_LDD 5 pe_demo_twrk60n512 For more details about Processor Expert see Processor Expert User Manual which can be found in lt CW_MCU_10 Ins
30. Start Task Status State Active Messages Cur Msg 0x0 Shell 0x10002 0x200019a8 Ready USB 0x10003 0x200025c4 LW Event Blocked KHCI Task 0x10004 0x20003110 LW Event Blocked TCP IP 0x 10005 0x20004134 Rx Msg Blocked timeout httpd server 0x 10006 0x20008f30 Msg Send Blocked 1 ee The MQX Stack Usage screen is available in the MQX Stack Usage menu Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 23 ET Examine Task E Task Identification E Scheduling Task Status E Messages Shell USB KHCI Task TCP IP httpd server Interrupt Pool valid Address 0x200004c4 0x200008d4 0x200009c4 0x20000ab0 0x20000aec 0x20000b08 0x20000b44 0x20000b7c 0x20001998 Name Flags State Cur Msg 0x200025b4 0x20002f14 0x20003828 0x20004dc4 0x200099cc 0x20000ec0 0x200004c4 Ox 2000fFfO 0x0000fb2c 0x2000474c Yes Size Hex 0x410 Oxfd Oxec Dx3c Oxic Ox3c 0x38 0x90 0x20001420 HVAC AutoStart Active 0x0 0x2000 1a60 0x2000267c 0x200031e8 0x2000420c 0x20009008 0x20000ac0 16 0K 26 E 1690 0x2000230c 0x20002c5c 0x200036ec 0x20004b28 0x200095c4 0x20000de4 z The MQX Memory Block Summary screen is available in the MQX Lightweight Memory Blocks menu Type Interrupt Stack System Stack Ready Qs Interrupt Table Interru
31. TWR MEM board J11 remove default Board specific build targets Known Issues e RTC clock The VBAT pin is not powered R117 is DNP in the schematics on the KwikStik Rev 1 4 boards The issue is resolved on Rev 5 boards Enabling RTC in older revision boards prevents using the card a board is automatically rebooted during startup e SD Card driver The data pins of the SD card connector DATAO DATAS are connected to the incorrect processor pins SDHCO_D4 SDHCO_D7 The issue is present on KwikStik Rev 1 Rev 4 boards and resolved on Rev 5 boards Getting Started with Freescale MQX RTOS Rev 15 60 Freescale Semiconductor 8 3 ColdFire V1 8 3 1 TWR MCF51JF128 The MCF51JF128 BSP was tested for these hardware configurations e TWR MCF51JF128 Rev A processor board e TWR SER Rev C serial board e TWR ELEV Primary and Secondary four story elevator boards e TWR MEM Rev B memory extension board optional Core Clock 48 MHz Bus Clock 24 MHz Default Console RS232 on TWR SER board BSP Timer MTIM1 Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 61 Important Jumper Settings For basic operations ensure that these jumper settings are used 62 For using CHIP in normal mode e TWR MCF51JF board J17 no Shunt Disable Bootload For using CRC module e TWR SER board J3 on position 2 3 external clock 50MHz e TWR MCF51JF board J2 on default position 1 2 external cloc
32. a basic MQX operation 68 J1 on position 2 3 J2 on position 2 3 J4 no jumper RS232 485 RX Select UART1 1 2 RS485 Mode connects RX to RO 2 3 RS232 Mode connects RX to R10UT RS232 485 TX Select UART1 1 2 RS485 Mode connects TX to DI 2 3 RS232 Mode connects TX to T1IN Can Isolation 1 2 Connects CAN Sto S 3 4 Connects CAN TX to TXD 5 6 Connects CAN RX to RXD J7 on positions 1 2 3 4 JS16 RS232 Isolation UARTO J8 no jumper 1 2 Connects RX to S08JS16 RXD 3 4 Connects TX to S08JS16 TXD Power Down Port B 1 2 Disables Ethernet PHY B Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor e J9 no jumper Power Down Port A 1 2 Disables Ethernet PHY A e J11 no jumper RS485 Config UART1 1 2 Loopback Mode connects RE to DE 3 4 Loopback Mode connects TXO_P to RX0_P 5 6 Loopback Mode connects TXO_N to RXO N 78 NC 9 10 5V Supply to DB9 e J13 on position 1 2 RS232 485 Disable UART 1 1 2 Disables RS485 2 3 Disables RS232 e J16 no jumper VBUS OC Isolation 1 2 Connects USB VBUS OC to Elevator e J19 no jumper UART2 Connector e J20 no jumper UART3 Connector e J21 no jumper VBUS EN Isolation 1 2 Connects USB VBUS EN to Elevator e J22 no jumper RS232 UART Isolation 1 2 Connects TX to T1IN 3 4 Connects RX to RIOUT 5 6 Connects RTS to T2IN 7 8 Connect CTS to R2OUT e J23 no jumper RS232 UARTS Isolation 1 2 Connects TX to T1IN 3 4 Connects RX to RIOUT 5 6 Connects RTS to
33. als are shared on the main elevator A11 and A63 e Low power does not work VLLSx mode e An issue occurs with the VLLSx on Kinetis PK60N512VDM100 Mask 0M33Z See the Mask Set Errata for Mask OM33Z document KINETIS_0M332 in this location freescale com files microcontrollers doc errata KINETIS OM33Z pdf At Errata ID 2613 MCU may not exit properly from VLLS3 VLLS2 or VLLS1 modes either via pin reset or other wakeup sources Attempts to wake up or reset from VLLS modes may result in the MCU entering an unknown non responsive state In the non responsive state the MCU current will not match the RUN current prior to entering the low power mode e The current workaround is to decrease voltage supplied to VDD to less than 2 0 V by removing jumper J18 on the board and then connecting to the external bench supply e OSJTAG USB mini connector issue e Inthe MQX 4 1 0 version the default console is configured to the ttyd TWR SER RS232 connector This issue will be fixed in the next MQX release Other Notes e The default console interface ttyf is routed to OSBDM COM USB mini connector J13 Use the P amp E Microcomputer Systems OSJTAG terminal to access the board serial line e To enable TWR SER RS232 interface change the BSP_DEFAULT_IO_CHANNEL configuration option to ttyd in the mgx source bsp twrk60n512 twrk60n512 h file Getting Started with Freescale MQX RTOS Rev 15 52 Freescale Semiconductor 8 2 9 TWR K60D100
34. ample requires recompiling the BSP and this setup define USBCFG DEFAULT DEVICE CONTROLLER amp bsp usb dev ehci0 if define USBCFG DEFAULT HOST CONTROLLER bsp usb host khci0 if in the lt mqx install _dir gt mqx source bsp twrk70 120m twrk70 120m h iv Ensure that TWR SER2 J21 USB VBUS EN shunt is connected v Because of the Hardware limitation using USB HS to debug applications may cause errors vi Ensure that the TWR kit is powered from the TWR ELEV board and not from processor board Known Issues 58 FlexCAN1 pins PTC16 and PTC17 are shared with NAND flash memory pins on the TWR K70FN1M Rev A board These pins are correctly set for the FlexCAN1 functionality CAN1_RX CAN1_TX signals are not correctly routed to the TJA1050 High speed CAN transceiver on the TWR SER board This prevents a correct FlexCAN example functionality For a successful test of the FlexCAN example insert R22 and R23 on TWR_K70F 120M Because RTC and CTS signals are not routed correctly from the TWR K70FN1M Rev A board to the RS485 connector of the TWR SER board the RS485 demo application does not function correctly Example projects contain build configurations for code execution different than the Flash or RAM memory The RAM based execution may be faster to debug but not all examples fit into RAM and may not link Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor
35. ard Rev C e For standalone operation using clock from TWR K53N512 board To use 50MHz Jumper J11 on position 1 2 e To enable Ethernet communication use with TWR SER TWR K53N512 Jumper 11 on position 2 3 processor clock taken from the TWR SER board Jumper 32 on position 1 2 jumper 33 on position 1 2 TWR SER CLK_SEL 3 4 TWR SER CLKIN SEL 2 3 processor clock is taken from PHY TWR SER ETH CONFIG J12 9 10 to select RMII communication mode e Important Plug both the processor and the serial board TWR SER into the Tower The processor is using the external clock from the Ethernet PHY on the serial card e For using USB Host mode jumpers on position e TWR SER board J16 on position 1 2 VB HOST e TWR SER board J10 on default position 1 2 USB host Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 49 e For using USB Device mode jumpers on position e TWR SER board J16 on position 3 4 VB DEV e TWR SER board J10 on position 2 3 USB device e For using RAM disk jumpers on position e TWR MEM board J16 remove e TWR MEM board J11 remove default e For using TWRPI SLCD e TWR K53N512 jumper 32 on position 1 2 jumper 33 on position 1 2 Getting Started with Freescale MQX RTOS Rev 15 50 Freescale Semiconductor 8 2 8 TWR K60N512 Core Clock 96 MHz Bus Clock 48 MHz Default Console OSJTAG USB mini connector BSP Timer Systick Important Jumper Settings board
36. at the real address 0x60000000 The 48 KB on chip ECC protected SRAM is initialized by the BSP cleared on MCU startup Unsupported Peripherals and Features QuadSPI Winbond Dual QuadSPI memory W25Q64CV of the TWR PXD10 processor board is not supported by the TWRPXD10 BSP SPI SD card Because TWR PXD10 Rev B processor board doesn t connect the MCU to SPI SD card module of TWR MEM the TWRPXD10 BSP doesn t support the SD card The TWR MEM serial flash memory AT26DF081A SU is supported by the BSP Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 73 8 6 2 TWR PXS20 The TWRPXS20 BSP supports TWR PXS20 Rev A board 316 ie pero a i Os tact ute www Oxman CO de System Clock 80 MHz Crystal oscillator 40 MHz Default Console ttyb OSJTAG virtual serial port BSP Timer E200 decrementer Optionally PITO QPIT Important Jumper Settings e 5V power supply J16 e 1 2 powered from elevator e 3 4 default powered from onboard mini USB e 5 6 powered from onboard DC in connector e 3V3 power supply J5 e 1 2 powered from elevator e 2 3 default onboard 3V3 regulator e FlexCAN e By default FlexCAN 1 connected to TWR SER board is used e Touse FlexCAN 0 connected to J14 connector position J6 jumpers to 3 5 and 4 6 and set J5 as closed factory default positions Getting Started with Freescale MQX RTOS Rev 15 74 Freescale Semiconductor Microcontroller Mode The PXS20
37. by the LSM DPM bit in shadow FLASH area The factory setting is DPM Because mode cannot be changed in runtime set a correct mode prior to running the application on the MCU The microcontroller is expected to work in DPM when using the TWRPXS30 BSP Because this is the factory default there is no need for switching the microcontroller mode The TWRPXS30 BSP uses DPM by starting two instances of MQX one on each core from a single image Each instance of MQX may use a different set of drivers and execute a different set of tasks For details see Using Freescale MQX RTOS on Multicore Devices document MQXGSMULTICORE Unsupported Peripherals and Features Onboard 12C accelerometer does not need any extra support from the BSP with the exception of I2C However the accelerometer used is not currently covered by the accelerometer demo application Acard in SDCARD slot on TWR MEM cannot be detected because of the Hardware limitation on the TWR PXS30 board A current version of the BSP does not initialize the DRAM interface Therefore it does not use an external on board memory Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 77 8 6 4 TWR PXN20 The TWRPXN20 BSP supports TWR PXN20 Rev A board System Clock Crystal oscillator Default Console ttya J24 header ttyb default OSJTAG virtual serial port ttyc TWR SER BSP Timer E200 decrementer Optionally PIT timer QPIT Important Jumper Set
38. detailed information about setting up the debugger connection see Getting Started with Freescale MQX RTOS and MDK ARM Keil uVision4 document MQXGSKEIL The document is included in the MQX installation as the lt mqx install dir gt doc tools uv4 MQX uVision4 Getting Started pdf 5 3 Setting default USB controller for host and device applications Some microcontrollers have more USB controller units integrated on the chip For MQX the controllers are represented by structure instances exported from the BSP to the application For example bsp usb host ehci0 if bsp usb dev ehcil if The structure names are further abstracted by the USBCFG DEFAULT HOST CONTROLLER and USBCFG DEFAULT DEVICE CONTROLLER macros That allows the MQX example applications to use a generic approach for every processor and board setup To change the default USB controller in a BSP modify the appropriate macro in the BSP header file For example the Vybrid microprocessor integrates two USB controllers which are both EHCI compatible In the mqx source bsp twrvf65gsl10_a5 twrvf65gs10_a5 h file you can find define USBCFG DEFAULT HOST CONTROLLER amp bsp usb host ehciO0 if define USBCFG DEFAULT DEVICE CONTROLLER amp bsp usb dev ehci0 if To change the MQX default controller used by applications modify the commands as shown in this example define USBCFG DEFAULT HOST CONTROLLER amp bsp usb host ehcil if def
39. e that these settings are applied e TWR SER board J2 on default position 1 2 PHY CLK_SEL 25MHz e TWR SER board J3 shunt removed CLKIN SEL e TWR SER board J15 on default position 1 2 SER SEL enabling RS232 operation e TWR SER board J17 on default position 1 2 RXD SEL enabling RS232 operation e TWR SER board J18 shunt removed RTS SEL no RS232 flow control Getting Started with Freescale MQX RTOS Rev 15 64 Freescale Semiconductor e TWR SER board J19 on default position 1 2 TXD SEL enabling RS232 operation To enable external MRAM memory available on Memory Storyboard e TWR MEM board J10 on position 1 2 e TWR MEM board J11 shunt removed To enable Ethernet in addition to basic operation jumper setting above e TWR SER board J12 shunt on pins 15 16 for duplex operation To enable USB operation in HOST mode e TWR SER board J16 shunt on pins 1 2 e TWR SER board J10 shunt on pins 1 2 To enable USB operation in DEVICE mode e TWR SER board J16 shunt on pins 3 4 e TWR SER board J10 shunt on pins 2 3 To enable SD Card operation e TWR MEM Board J3 on position 1 2 to route QSPI_PCSO to SD Card Chip Select e TWR MEM Board J4 remove shunt on pins 1 2 to disable QSPI_PCSO routing to serial Flash e TWR MEM board J12 all jumpers except 3 4 populated To enable CompactFlash Card operation available on Memory Storyboard e TWR MEM board J16 on position 2 3 To use write protect detection sig
40. e the SPI connected out from the processor The SPI driver is not supported SAI driver example fails a few seconds after recording The problem will be fixed in the next MQX release SD Card detection is not supported on AutoEVB boards Rev C The board does not have a Hardware connection to detect the insertion of the SD card To properly run the SD card demo ensure that the card is in the slot before the program attempts to access it for example before power on reset Debugging and Tool Chain Related Information IAR J Link l Jet probe debugging Ensure that you have the J Link or I Jet probe updated to the latest firmware because the older versions of firmware do not fully support Vybrid multicore debugging See Getting Started with Freescale MQX RTOs and IAR Embedded Workbench document MQXGSIAR lt install_dir gt doc tools iar MQX IAR Getting Started pdf for details about Vybrid and multicore debugging Board Specific Build Targets A5 Boot Loader target target intended for application boot loader directly booted from BootROM Code and data are located in the OCRAM SRAM memory so that it does not clash with BootROM The target is used in the Vybrid dual core boot loader application mqx examples bootloader vybrid 30 A5 DDR target target using DDR memory for both code and data Load this target by using either U Boot or MQX boot loader A5 Int Ram target target using internal OCRAM SRAM memory for bot
41. e this behavior connect a two pull up resistors between the card detect pins CF CD1 CF CD2 and 3 3V VCC Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 71 8 6 PowerPC 8 6 1 TWR PXD10 The TWRPXD10 BSP supports TWR PXD10 Rev B board System Clock 64 MHz Crystal oscillator 8 MHz Default Console ttyb LINFlex 1 OSJTAG virtual serial port or TWR SER board BSP Timer PIT Channel 0 Important Jumper Settings e Note Board jumper labels errata e J17 and J18 are marked as J10 and J11 and vice versa on the board e OSJTAG virtual serial port console e TWR PXD10 board J17 on position 1 2 e TWR PXD10 board J18 on position 1 2 e TWR SER serial port console e TWR PXD10 board J17 on position 2 3 e TWR PXD10 board J17 on position 2 3 e TWR SER board J15 on position 1 2 e TWR SER board J19 on position 1 2 e TWR SER board J17 on position 1 2 e TWR SER CAN bus e TWR PXD10 board J13 on position 2 3 Getting Started with Freescale MQX RTOS Rev 15 72 Freescale Semiconductor e TWR PXD10 board J14 on position 2 3 e TWR SER board J5 as TWR SER defaults J5 shunts on 1 2 3 4 5 6 7 8 and 9 10 e TWR MEM SPI memory e TWR PXD10 board J10 open e TWR PXD10 board J11 open Microcontroller Memory Map TWRPXD10 BSP maps the initialized and non initialized data bss type sections including MQX system memory pool to the 160 KB on chip Graphics SRAM no ECC protection starting
42. em_pccard_cpld Load the firmware to the TWR MEM CPLD by using the Altera Quartus II design tool and a BLASTER connection cable e Example projects contain build configurations for code execution different than the Flash or RAM memory The RAM based execution may be faster to debug but not all examples fit into RAM and may not link Other Notes e The default console interface ttyf is routed to OSBDM COM USB mini connector J13 Use the P amp E Microcomputer Systems OSJTAG terminal to access board serial line e To enable TWR SER RS232 interface change the BSP_DEFAULT_IlIO_ CHANNEL configuration option to ttyd in the mgx source bsp twrk60n512 twrk60n512 h file Getting Started with Freescale MQX RTOS Rev 15 54 Freescale Semiconductor 8 2 10 TWR K60F120M Primary Connector Infra Red General Purpose Tower Plug In TWRPI Socket SW3 Reset Power OSJTAG Mini B USB Connector Secondary Connector Core Clock Bus Clock Default Console BSP Timer SW1 SW2 Touch TWRPI Socket z i AA SS sora He Buttons va E1 E4 FO AE E do gt MK60FN1MO0VLQ12 Microcontroller MMA8451 Accelerometer OSJTAG USB mini connector Systick Important Jumper Settings board Rev B e For standalone operation TWR K60FN1M Jumper J9 on position 1 2 e To enable Ethernet communication use with TWR SER TWR K60FN1M Jumper J6 on position 2 3 processor clock taken from the TWR SER
43. g Editor Freescale Licenses Help Install Update Processor Expert lol x Console KE ev Debug Conse ting I Fixed width console Maximum character width 80 IV Limit console output Console buffer size characters 80000 Displayed tab width 8 Remote Launch Remate Systems IV Show when program writes to standard out Run Debug IV Show when program writes to standard error External Tools Standard Qut text color 4 Launching Standard Error text color Perspectives String Substitution Standard In text color View Management Target Configurations Background color C Team Terminal Traditional Memory Rendering Restore Defaults Apply cm 5 2 2 IAR Embedded Workbench for ARM The IAR EWARM IDE supports the Semihost communication channel for both input and output directions Enable the Semihost options in project preferences Options for node hello twrk60n512 General Options C C Compiler Assembler Output Converter Custom Build Build Actions Linker Debugger Simulator Angel GDB Server IAR ROM monitor J Link J Trace TI Stellaris FTDI Macraigor PE micro RDI ST LINK Third Party Driver TI XDS100 Output Library Configuration Library Options MISRA C 2004 MISR gt Library Description Use the normal configuration of the C C runtime
44. g the Watchdog within a time out period at which the Watchdog can be refreshed For detailed information about demo application importing and building the MQX library projects and debugging MQX application in CodeWarrior 10 see the CW for Microcontrollers v10 and MQxX document MQXCWPP located doc tools cw FSL MQX in CW 10 x pdf Windows menu Tools Documentation CodeWarrior Getting Started CW for Microcontrollers v10 x and MQX 7 4 Processor Expert and default clock settings in Kinetis BSPs The MQX 3 8 introduces the low power management features on Kinetis platforms The main features of this solution are the Low Power Manager and Clock Manager modules The Clock Manager allows runtime switching between clock configurations statically defined at the BSP level Three predefined clock configurations are available for Kinetis based platforms as follows e 96MHz normal run mode MGG PEE mode e 12MHz normal run mode MCG PEE mode used also for auto trimming the internal oscillator e 2MHz low power run mode MCG BLPI mode Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 27 The code to set the clock configuration in the Kinetis BSPs is generated by the Processor Expert tool and it is not easy to change manually see bsp cm c and hfiles Use the Processor Expert to generate new or change existing clock configurations For more information see How to Change Default Clock Settings in Kinetis BS
45. h code and data Load this target by either U Boot or MQX boot loader M4 Int Ram target Code is located in the lower part of OCRAM SRAM and data is in the TCM memory Load this target either by U Boot or MQX boot loader Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor Known Issues e Both A5 and M4 Int Ram target code space is limited and most of the RTCS based applications are too large to fit to the memory Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 31 8 1 2 TWR VF65GS10 USB Standard A routed to EHCI1 USB1 USB Host functionality USB Micro AB routed to EHCIO USBO USB Host and Device functionality OpenSDA debug interface Power Supply ARM Cortex A5 core twrvf65gs10_a5 BSP Core Clock 396 Mhz Bus Clock 132 Mhz Default Console ttyb Default settings USB Virtual serial port on OpenSDA debug interface If the OpenSDA is programmed to CMSIS DAP functionality change the default channel to ttyc the RS 232 port on TWR SER board or change J23 and J24 jumper settings according to this information BSP Timer Global Timer ARM Cortex M4 core twrvf65gs10_m4 BSP Core Clock 132 Mhz Bus Clock Default Console RS 232 port on TWR SER or TWR SER2 boards BSP Timer Systick Important Jumper Settings Rev G e Ensure that board is powered on the processor board by using the Dual USB power cable Do not use power source from J5 of
46. ic application Application type Empty application Create application which contains additional code according to selected options e g MFS initialization e If the Basic application is selected the Wizard continues by several other steps to gather information about what initialization code to generate e RTCS option RTCS TCP IP stack is initialized and set to static or dynamic IP address based on user selection e USB Device or Host option Stack and selected class drivers are initialized based on user selection e MES option The RAM disk initialization code can be enabled e Shell option The shell command structure can be enabled Finally the debug connection can be selected before the new MQX project is created Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 13 Connections Choose the connection to use for this project 9 New Connection Connection to be used V P amp E USB MultiLink Universal FX USB MultiLink T P amp E Cyclone MAX USB P amp E Cyclone MAX Ethernet P amp E Cyclone MAX Serial E Open Source JTAG F P amp E TraceLink USB P amp E TraceLink Ethernet Wi Segger J Link J Trace SWO SWD Based Choose an Existing Connection Connect to Segger J Link 4 2 Other development tools Typically process of creating new projects mostly depends on the development environment being u
47. ine USBCFG DEFAULT DEVICE CONTROLLER amp bsp usb dev ehcil if Note After this change fully rebuild the BSP package Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 19 6 Task aware debugging plug in MQX Task Aware Debugging plug in TAD is an optional extension to a debugger tool which enables easy debugging for multi tasking applications It helps to visualize internal MQX data structures task specific information I O device drivers and other MQX context data The MQX TAD is available for these platforms e Eclipse based CodeWarrior Development Studio version 10 e IAR Embedded Workbench for ARM versions 5 and newer e ARM Keil uVision4 version 4 22 and newer e ARM DS 5 version 5 14 1 and newer e Lauterbach TAD plug in available directly from Lauterbach Note TAD plug in communicates with the debugger and works with MQX data obtained directly from the RAM memory A typical debugger session is configured in a way that the code execution stops at the first breakpoint in function main In this function MQX internal data structures are not yet fully initialized and the TAD functionality is significantly reduced All TAD features are available only when execution stops at a breakpoint in the application task code 6 1 CodeWarrior development studio version 10 6 1 1 Debugging in CodeWarrior development studio version 10 These steps describe how to debug an MQX applicatio
48. ion folder by default C Program Files Freescale Freescale MQX x y Navigate to lt M X install dir gt tools codewarrior extensions CW MCU v10 x directory Open the command like console and execute the command install ewlO plugin bat lt CW10 install dir gt Note that the typical CodeWarrior 10 installation folder is c Freescale CW MCU v10 x Re start the CodeWarrior 10 IDE Enabling the TAD Functionality When Debugging Your MQX Application Project 1 22 Open Debug Configurations settings of the application project by selecting the Run Debug Configurations menu In the Debugger Configuration panel select proper Launch Configuration For selected Launch Configuration go to the Debugger tab and activate the OS Awareness sub tab In the Target OS drop down list box select the MQX OS for the target platform Debug Configurations xi Create manage and run configurations Download an application to a target then debug or run the application Name lwdemo twrk60n512 Int Flash Debug PEOSJTAG Main 69 Arguments 35 Debugger Source PG Environment Common Trace and Profile E CodeWarrior Attach i E CodeWarrior Connect presario CodeWarrior Download Debug Exceptions Interrupts Download PIC Other Executables Symboligs 05 Awareness E lwdemo_twrk60n512_In i i n 2 i E Iwdemo_twrk60n512_InI 0 OS for Cortex
49. k 50MHz For using USB MICRO AB5 port for USB DCD module and connecting by supported cable e TWR MCF51JF board J13 on default position 1 2 P5V TRG USB e TWR MCF51JF board J13 on default position 5 6 P5V JF USB For using USB Device Charger Detection jumpers on position e TWR MCF51JF board J8 removed e Pini on J8 connect to position 5 6 on J13 PTD5 connect to JF VREGIN For using ADG connect to POTENTIOMETER jumpers on position e TWR MCF51JF board J8 on position 1 2 ADCO SE12 For using USB host or device jumpers on position e TWR MCF51JF board J6 on position 1 2 JF USB ENA e TWR MCF51JF board J7 on position 1 2 JF USB FLGA e TWR MCF51JF board J13 on position 1 2 and 6 8 For using USB Host mode jumpers on position e TWR SER board J16 on position 1 2 VB HOST e TWR SER board J10 on default position 1 2 USB host e TWR MCF51JF board J13 on position 1 2 and 6 8 For using USB Device mode jumpers on position e TWR SER board J16 on position 3 4 VB DEV e TWR SER board J10 on position 2 3 USB device e TWR MCF51JF board J13 on position 1 2 and 6 8 For using RAM disk jumpers on position e TWR MEM board J16 remove e TWR MEM board J11 remove default e TWR MEM board J12 1 2 remove For using USBDCD jumpers on position e Remove J8 jumper and short between pin 1 of J8 and pin 5 of J13 on TWR MCF51JF board For using SD Card Getting Started with Freescale MQX RTOS Rev 15 Freescale Semic
50. library No locale interface C locale no file descriptor support no multibytes in printf and scanf and no hex floats in strtod Normal Mi Configuration file TOOLKIT DIR VNCYCYDLIb Config Normal h Library low level interface implementation CMSIS O None stdout stderr Semihosted I R breakpoint O Via SWD Use CMSIS DSP library Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 17 Open the console from the View Terminal I O IAR menu For detailed information about setting up the debugger connection see the Getting Started with Freescale MQX RTOS and IAR Embedded Workbench document MQXGSIAR The document is included in the MQX installation as the lt mqx install dir gt doc tools iar MQX IAR Getting Started pdf 5 2 3 ARM Keil uVision4 IDE Because ARM Keil uVision4 IDE does not support the Semihost output use the ITM mode instead The ITM communication channel for both input and output directions is supported These images show how to set up ITM when using the ULINKpro programmer Cortex M Target Driver Setup Debug Trace Flash Download ULINK USB JTAG SW Adapter r SW Device Serial No Pos481 06 v IDCODE Device Name Move SWDIO 0428401477 ARM CoreSight Sw DP i ULINK Version ULINKpro ox Meg Up Device Family ao M Firmware Version Ms 50 Automatic Detects ID CODE CEN SWJ F sws Par sw
51. mary Elevator PTA14 and PTA15 jumper J13 on position 2 3 e For SD card operation e TWR MEM board J2 SD_SEL2 set to position 1 2 e TWR MEM board J3 SD CS set to position 1 2 e TWR MEM board J12 SD SEL1 jumper on position 3 4 IRQA e TWR MEM board J13 jumper installed Known Issues e Example projects contain build configurations for code execution different than the Flash or RAM memory The RAM based execution may be faster to debug but not all examples fit into RAM and may not link e K21D50M has issues flashing by using J Link in CW 10 2 e ADC and LWADC examples are not working properly because of a hardware design The ADCO_DPM3 is connected to a potentiometer and used for a different mode only To run these demos ADCO_DP3 needs to be connected to the GND Other Notes e For KEIL ARM compiler the libraries are pre compiled for Release target only Compile the Debug target before the first use Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 43 8 2 4 TWR K21F120M Core Clock Bus Clock Default Console BSP Timer Systick RS 232 port on TWR SER or OSJTAG Micro USB connector Important Jumper Settings For basic operations ensure that these jumper settings are applied e For USB Device mode use onboard J19 micro USB connector and jumpers on position e WR K21F120M System module J24 on position 1 2 e TWR K21F120M System module J22 open e TWR K21F120M Sy
52. microcontroller may operate either in a lock step mode LSM or a decoupled parallel mode DPM In LSM both cores execute the same code at the same time for safety applications In DPM cores execute code independently of each other Therefore in effect there are two processors available Mode is selected by the LSM DPM bit in the shadow FLASH area The factory setting is LSM Mode cannot be changed in runtime Therefore set a proper mode prior to running the application on the MCU A microcontroller is expected to work in LSM when using the TWRPXS20 BSP Because this is the factory default there is no need for switching the microcontroller mode Unsupported Peripherals The current BSP does not support analog peripherals no ADC support Onboard SPI accelerometer does not need any extra support from the BSP except for SPI However the accelerometer used is not currently covered by the accelerometer demo application Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 75 8 6 3 TWR PXS30 The TWRPXS30 BSP supports TWR PXS30 Rev B board ADELER ALLE PX P te W f V 7 freescale T U Ukas System Clock 180 MHz Crystal oscillator 40 MHz Default Console ttyb core 0 OSJTAG virtual serial port ttyd core 1 TWR SER2 J20 or J23 header BSP Timer E200 decrementer Optionally PITO QPIT Important Jumper Settings e Crystal oscillator J19 e 3 5 and 4 6 default connect 40 MH
53. mode jumpers on position e TWR SER board J16 on position 3 4 VB DEV e TWR SER board J10 on position 2 3 USB device Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 47 Known Issues e Example projects contain build configurations for code execution different than the Flash or RAM memory The RAM based execution may be faster to debug but not all examples fit into RAM and may not link Other Notes e The default console interface ttya is routed to OSBDM COM USB mini connector Use the P amp E Microcomputer Systems OSJTAG terminal to access the board serial line e To enable the TWR SER RS232 interface change the BSP DEFAULT IO CHANNEL configuration option to ttyd in the mgx source bsp twrk40x256 twrk40x256 h file e To enable the audio example set J4 to 5 6 on the TWR K40D100M System module SAI channel 0 TWR AUDIO board used Getting Started with Freescale MQX RTOS Rev 15 48 Freescale Semiconductor 8 2 7 TWR K53N512 Primary Connector Infra Red General Purpose Tower Plug In TWRPI Socket SW3 Reset Power OSJTAG Mini B USB Connector Secondary Connector Core Clock Bus Clock Default Console BSP Timer SW1 SW2 Touch SLCD TWRPI Socket LED Touch Buttons E1 E2 PK53N512CMD100 Microcontroller Medical Connector MMA7660 Accelerometer OSJTAG USB mini connector Systick Important Jumper Settings bo
54. munication TWR SER setup e USBFS KHCIO module The BSP is pre configured to use USBFS module KHCIO by default Try various USB Host and Device example applications and use USB MINIAB connector on TWR SER board as the USB communication channel Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 57 e USBHS EHCIO module TWR SER does not allow the use of the USBHS module USB communication TWR SER2 setup e USBFS KHCIO module The BSP is pre configured to use USBFS module by default The USBFS is connected to USB HOST USB A connector only USB device functionality is not available as a result of Hardware limitations e USBHS EHCIO module To enable USBHS EHCI0 change BSP settings as follows and recompile BSP The USBHS EHCIO is connected to USB OTG USB mini AB connector define USBCFG DEFAULT DEVICE CONTROLLER bsp usb dev ehci0 if define USBCFG DEFAULT HOST CONTROLLER bsp usb host ehci0 if in the lt mqx_install_dir gt mqx source bsp twrk70 120m twrk70 120m h i Ensure that TWR SER2 J21 USB VBUS EN shunt is connected ii Because of the Hardware limitation using USB HS to debug applications may cause errors iii Ensure that TWR kit is powered from the TWR ELEV board not from the processor board The keyboard2mouse example application demonstrates the usage of the KHCI Host and EHCI Device module in one demo The ex
55. n 1 Import open the application project in to CodeWarrior workspace by using the File Import General Existing Project menu Build project using the Project Build Project menu Open Debug Configurations settings using the Run Debug Configurations menu and select target you want to debug in the CodeWarrior Download tree Getting Started with Freescale MQX RTOS Rev 15 20 Freescale Semiconductor Debug Configurations S x Create manage and run configurations The file associated with this launch configuration is read only and cannot be modified 7 I ES J3 gt Ula x SE Name hello twrk40x256 Int Flash Debug PEOSJTAG type filter text B Main 69 Arguments 5 Debugger E Source PS Environment E Common Trace and Profile CodeWarrior Attach ETNE E CodeWarrior Connect M CiC application fE CodeWarrior Download Project hello_twrk40x256 BE c hello twrk40x256 Int Flash Debug PEOSJTAG a hello twrk40x256_Int Flash Release PEOSJTAG Application int Flash Debug intflash d afx Search Project Browse Variables i E hello twrk40x256 Int Ram Debug PEOSJTAG IV Connect process input output to a terminal Launch Group Remote system Bedia Sat wie TWRK40 256 OSBDM OSITAG Apply Reyert Filter matched 7 of 7 items a o 4 Select connection type in the Remote s
56. n of working set description wsd file is here lt mgx install dir gt build lt board gt ds5 lt board gt wsd The output directory is here lt mgx install dir gt lib lt board gt ds5 For detailed information about the MQX support in ARM tools see Getting Started with ARM Design Studio 5 DS 5 with Freescale MQX RTOS document MAXGSDS5 The document is included in the MQX installation in the lt max install dir gt doc tools uv4 MQX DS5 Getting Started pdf 2 8 Building MQX using makefiles The MQX version 4 1 contains the Makefiles to build libraries and applications for selected platforms by using the command line Getting Started with Freescale MQX RTOS Rev 15 8 Freescale Semiconductor The support for Makefile command line builds will be expanded to cover all boards and BSPs in the later MQX versions Please use the mingw32 make version 3 8 2 or higher Download the latest version from sourceforge net projects mingw To rebuild the MQX libraries navigate to the lt mgx install dir gt build lt board gt make directory and run this command building MQX using the GCC from CW10 3 and later version of the toolchain C MinGW bin mingw32 make exe build TOOL cwl0gcc CONFIG debug Note Prior to the build specify the path TooLCHAIN ROOTDIR variable for your build tools in the lt mqx_install_dir gt build common make global mak Getting Started with Freescale MQX RTOS Rev 15 Freescale Semicond
57. nals with SD Card on the Memory Storyboard e TWR MCF52259 board turn off switch 3 on SW2 dip switch To select either CSO or CS1 for SPI Flash e TWR MEM board J14 on position 1 2 CSO To use TWR LCD board with eGUI e TWR LCD board SW5 all switches to ON enable touch screen e TWR LCD board SW1 switches depending on usage either SPI 01111110 or 16 bits FlexBus 10111110 e TWR MCF52259 board to enable navigation buttons set SW2 dip 2 and SW2 dip 3 to OFF Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 65 Board Specific Build Targets e None Recompile all MQX libraries after changing config common user config h file e Important Do not change header files in the output build directory lib The files are overwritten each time the libraries are built After changing the config common user_config h file recompile all MQX libraries e Important No changes should be made to header files in the output build directory lib The files are overwritten each time the libraries are built e See Chapter 2 3 Build Targets for more details about the standard build targets The Ext MRAM Debug target can be used only with Memory Storyboard Other Notes e The OSBDM Firmware compatibility issue may affect application debugging See Freescale MQX RTOS Release Notes document MQXRN for more details about the OSBDM Firmware Compatibility Getting Started with Freescale MQX RTOS Rev
58. o unused but set variable e Wno pointer to int cast Wno unused function Wno unused label Wno char subscripts Wno int to pointer cast 2 4 Freescale CodeWarrior development studio version 10 To rebuild the MQX libraries navigate to an appropriate folder in the Windows Explorer drag the lt board gt wsd file and drop it into the CodeWarrior project view The MQX library projects and build configurations settings are imported to CodeWarrior working space Location of working set description wsd file is here lt mqx install dir gt build lt board gt cwlOgcc lt board gt wsd The output directory is here lt mqx install dir gt lib lt board gt cwl0gcc For detailed information about importing and building MQX libraries and debugging MQX application in CodeWarrior 10 see the CW for Microcontrollers v10 and MQX document MQXCWPP This document is part of the MQX installation package Note The wsd file import requires the installation of the MQX CodeWarrior plugins The functionality is supported for CodeWarrior version 10 2 or newer and requires the MQX CW plugin installed For installation description see Chapter CodeWarrior 10 Task Aware Debugger Plug in Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 7 2 5 IAR Embedded Workbench for ARM and ColdFire To rebuild the MQX libraries open and batch build this IAR EWARM workspace lt mqx install dir gt build lt board gt
59. onductor e TWR MEM board J3 SD CS jumper on position 1 2 to enable SD Card CS signal e TWR MEM board J12 SD SEL1 remove jumper from 1 2 and insert jumper on 3 4 Board Specific Build Targets e Internal Flash Debug and Release these targets enable building applications which are suitable for booting the system from the Internal Flash memory After the reset the code is executed from the Internal Flash e After changing the config common user config h file recompile all MQX libraries e Important Do not make any changes to header files in the output build directory 1ib The files are overwritten each time the libraries are built e After changing the config common user config h file recompile all MQX libraries e Important No changes should be made to header files in the output build directory 1ib The files are overwritten each time the libraries are built e See Chapter 2 3 Build Targets for more details Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 63 8 4 ColdFire V2 8 4 1 TWR MCF52259 KIT TWR MCF52259 KIT Rev A consists of this e MCF52259 microcontroller module board e TWR ELEV four story elevator boards e TWR SER serial board e optional TWR MEM memory extension board e optional TWR LCD display board a 2 ae Core Clock 80 MHz Bus Clock Default Console RS232 BSP Timer PITO Important Jumper Settings e For the basic operation ensur
60. or to communicate with the computer via the debugger probe The MQX RTOS currently supports ARM Cortex M Semihost and ITM technologies On the PC host side the communication has to be properly set up in the debugger To set up the Debugl O as the default I O channel add this code to the user _ config h file define BSP DEFAULT IO CHANNEL iodebug Enable the Debugl O driver as follows define BSPCFG ENABLE IODEBUG 1 See the Freescale MQX I O User Guide document MQXIOUG for more information on the Debugl O driver setting ITM vs semihost mode buffer setting The tool related setting is described in the subsequent chapters Note Avoid Using the I O Debug as an input because reading from the Semihost port causes the microprocessor core to halt 5 2 1 Freescale CodeWarrior development studio version 10 The CodeWarrior 10 IDE supports the Semihost communication channel for the output direction only input is not supported by CW10 1 Use the internal Debugl O buffer to speed up communication See the Freescale MQX I O User Guide document MQXIOUG for detailed description Open the console from the Window Show View Console CW10 menu Note Uncheck the Fixed width console option in the Run Debug Console preferences in CW10 1 Getting Started with Freescale MQX RTOS Rev 15 16 Freescale Semiconductor Preferences m General Analysis C C ep el ee Colorin
61. pt Vector I O Serial polled device struct 1 0 Device 6 2 IAR Embedded Workbench for ARM and ColdFire TAD is currently available for these IAR Embedded Workbench CSpy Debugger versions e AR EWARM version 6 x e AREWCF version 5 3 For detailed information about setting u up the TAD see Getting Started with Freescale MQXT RTOS and IAR Embedded Workbench document MQXGSIAR The document is included in the MQX installation as the lt mqx install dir gt doc tools iar MQX IAR Getting Started pdf Getting Started with Freescale MQX RTOS Rev 15 24 Freescale Semiconductor 6 3 ARM Keil uVision4 TAD viewer is currently available for ARM Keil uVision4 Debugger For detailed information about setting up TAD see Getting Started with Freescale MQX RTOS and MDK ARM Keil u Vision4 document MQXGSKEIL The document is included in the MQX installation as the lt mqx install dir gt doc tools uv4 MQX uVision4 Getting Started pdf 6 4 ARM DS 5 TAD plug in is distributed separately from MQX release and is available directly from ARM Ltd For detailed documentation contact your ARM distributor For more information about setting up the DS 5 IDE see Getting Started with Freescale MQXT RTOS and Development Studio 5 DS 5 document MQXGSDS5 The document is included in the MQX installation as the lt max install dir gt doc tools ds5 MQX DS5 Getting Started pdf Getting Started with Freescale MQX RTOS Rev 15 Freescale
62. r memory management etc The bsp pre init function is called in the MQX initialization time before any user task is created and the scheduler is not started e The second part of the startup is done in a separate max 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 _max_init_task is destroyed All BSPs are adjusted to this concept All I O drivers are installed in the context of the _mgqx_init_task after the MQX scheduler is started This concept also allows a complex driver installation handling ISRs during the driver initialization drivers could use blocking functionality like _time_delay etc When porting your BSP to the MQX 4 1 0 split the bsp enable card function init_bsp c into the bsp pre init and the _bsp_init functions All bsp enable card code up to the I O subsystem initialization are part of the new bsp pre init function The rest of the _bsp_enable_card code is part of the new bsp init function Getting Started with Freescale MQX RTOS Rev 15 10 Freescale Semiconductor 4 Creating New MQX Project 4 1 Freescale CodeWarrior development studio version 10 The Freescale MQX RTOS setup installs the MQX New Project Wizard plug in into CodeWarrior 10 installation directory The Project Wizard helps to select one of the supported evaluation boards include
63. rial to USB conversion on UART 1 ttyb and other functionalities The circuit can be also used as the debugging probe CMSIS DAP for ARM DS5 IDE Contact your ARM distributor for more details e This release was tested with TWR VF65GS10 Rev G The older revisions of the boards have different default console setting If using older board revisions adjust the configuration according to the Hardware requirements e Note that CMSIS DAP firmware does not support serial to USB conversion Change the default serial channel to TWR SER board ttyc in Cortex A5 BSP Avoid using both cores simultaneously in this setting because both cores share the same serial channel Default MMU Settings e MMU A5 core only is enabled with Level 1 translation after initialization The entire memory area is set to read write access policy with virtual addresses equal to physical addresses Cache is enabled and turned on for the DDR region with the write back cache policy After initialization you can change or create new regions with 1MB or 4kB region granularity and with different types of access policy cache policy or memory type by using the _mmu_add_vregion function Board Specific Build Targets A5 Boot Loader target target intended for application boot loader directly booted from BootROM Both code and data are located in the OCRAM SRAM memory The target is used in the Vybrid dual core boot loader application mgx examples bootloader vybrid e
64. sed Describing this process for tools other than Freescale CodeWarrior is out of scope of this document For more information see the documentation provided by the tool vendor A general recommendation for starting a new MQX project in any IDE environment is to clone one of the existing example applications save it under a custom name and modify it to meet your specific needs In this case please be aware that there may be relative paths to support files referred to in the project This may apply to search paths linker command files debugger configuration files etc Make sure that you update the relative paths in the new clone of the project Getting Started with Freescale MQX RTOS Rev 15 14 Freescale Semiconductor 5 MQX Board Support Package Configuration Options 5 1 Standard input and output channel settings An I O communication device installed by MQX BSP can be used as the standard IO channel e g Serial line IO Debug telnet USB CDC The default console setting for each supported development board is specified in chapter 8 Board specific Information Related to MQX Freescale Tower evaluation kits offer several ways to connect the I O console The most common options are listed below e Serial I O is a channel routed via TWR SER or TWR SER2 boards by using the RS232 connector This port can be connected directly to the PC serial interface and used with a suitable terminal program e g Hyper Terminal e Serial I O
65. shing procedure bellow There are two variants of Ext Flash target in the application projects one for external P amp E Microcomputer Systems BDM interface PEBDM Ext Flash and the other for on board OSBDM interface OSBDM Ext Flash The OSBDM debugging connection does not work correctly with the old version of the OSBDM firmware Please update the OSBDM firmware before using this target When using the OSBDM interface power the TWR MCF54418 KIT by using the USB attached to the primary elevator e Recompile all MQX libraries after changing the config common user_config h file e Important Do not change header files in the output build directory lib The files are overwritten each time the libraries are built After changing the config common user_config h file recompile all MQX libraries e Important No changes should be made to header files in the output build directory lib The files are overwritten each time the libraries are built e See Chapter 2 3 Build Targets for more details Getting Started with Freescale MQX RTOS Rev 15 70 Freescale Semiconductor NAND Flashing Procedure The CodeWarrior Development Studios for ColdFire V7 2 2 and for MCU v10 do not provide NAND Flashing functionality This functionality is planned for future releases The MQX release contains a standalone CFFlashprog utility which enables NAND Flashing by using P amp E Microcomputer Systems BDM interface OSBDM is not supported The NAND
66. stem module J11 on position 5 6 VREGIN e For USB Host mode use onboard J19 micro USB connector and jumpers on position e TWR K21F120M System module J24 on position 1 2 e TWR K21F120M System module J22 on position 1 2 Enable USB Power e TWR K21F120M System module J11 on position 5 6 VREGIN e For IPC example e TWR K21F120M board J13 open e For RAM Disc Example e TWR MEM System module J12 open 3 4 Getting Started with Freescale MQX RTOS Rev 15 44 Freescale Semiconductor Known Issues e USB Host CDC Serial USB no longer functions after the CDC device is re attached e J Link cannot be used to flash CW V10 4GCC to chip Instead OS JTAG must be used e FlexBus shares pins with the SPI module To run the demo by using FlexBus Ramdisk disable the SPI module in user_config h e tis impossible to configure SPI1 and SPI2 for the DMA mode on this platform due to RX TX sharing the same DMA channel See the Reference Manual for the K21F120M Other Notes e Because the FlexBus pin conflicts with SPIO and SAI when running the Ramdisk example SPIO and SAI must be disabled in user config h 8 2 5 TWR K40X256 Core Clock Bus Clock Default Console BSP Timer Systick OSJTAG USB mini connector Important Jumper Settings e To use TWR LCD board with eGUI e TWR LCD board SW5 all switches to ON enable touch screen e TWR LCD board SW1 switches depending on usage either SPI 01111110 or 16 bits FlexBus
67. tall Directory gt MCU Help PDF Processorl 26 ExpertHelp pdf Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 7 2 Processor Expert ready BSPs All Kinetis BSPs can host the Processor Expert components For MQX version 3 8 1 and later the special Processor Expert versions of the BSPs were removed and the functionality made available in the standard BSP projects The BSP projects have the ProcessorExpert pe file which contains this e Pre configured CPU component e MQX RTOS Adapter component e Set of peripheral components needed by the pe_demo example application Other components may be added to the BSP project as needed 7 3 Processor Expert MQX demo application The Demo application which describes the integration of Processor Expert drivers is available here lt install dir gt demo pe demo cwl0 pe demo lt board gt project The application executes these tasks 1 The sine signal of specified period is generated on DACO pin The signal amplitude sweeps from minimum to maximum value It can be observed by the scope on DACO_OUT A32 pin on TWR ELEV FUNCTIONAL or TWR PROTO board 2 The PWM signal is generated by using the FlexTimer FTMO Channel 0 It can be observed by scope on PWMO A40 pin on TWR ELEV FUNCTIONAL or TWR PROTO board 3 To signal that the application is running it toggles LEDs D9 D11 on the board by using the GPIO driver 4 The ewm_task task is periodically refreshin
68. the primary elevator board Getting Started with Freescale MQX RTOS Rev 15 32 Freescale Semiconductor Serial Port Settings e Default J23 1 3 amp 2 4 and J24 1 3 amp 2 4 e Vybrid SCI1 ttyb to OpenSDA K20 e Vybrid SCI2 ttyc to Elev UART1 TWR SER e Alternative 1 J23 1 2 amp 3 4 and J24 1 2 amp 3 4 e Vybrid SCI1 ttyb to Elev UART1 TWR SER e Vybrid SCI2 ttyc to OpenSDA K20 e Alternative 2 J23 2 4 and J24 2 4 e Vybrid SCI1 ttyb to Elev UARTO ORs connected e Vybrid SCI2 ttyc to Elev UART1 TWR SER USBO EHCIO Module e Default BSP setting use USBO port define USBCFG DEFAULT DEVICE CONTROLLER amp bsp usb dev ehci0 if define USBCFG DEFAULT HOST CONTROLLER amp bsp usb host Eheid If in the lt max install dir gt InqxVsourceVbsplYtwrvf65gs10 a5SVtwrvf65gs10 a5 h e USBO connector setting TWR SER USB Mini AB vs on board USB Micro AB connector e TWR VF65GS10 board J22 11 12 open for external TWR SER USB Mini AB port e TWR VF65GS10 board J22 11 12 closed for on board Micro B J8 USB connector e USBO host mode e TWR VF65GS10 board J19 2 3 e TWR VF65GS10 board J20 1 2 and 3 4 e USBO device mode e TWR VF65GS10 board J20 2 3 e TWR VF65GS10 board J21 2 3 USB1 EHCI1 Module e To enable USB1 EHCI1 change the BSP settings as follows and recompile BSP The USB1 EHCI1 is connected to USB Standard A
69. tings e Crystal oscillator J8 J9 e J8 and JQ in 1 2 position connect 40 MHz crystal to the CPU e UART A J18 J21 e Jumpers J18 and J21 in positions 1 3 and 2 4 connect UART A to RS 485 e Jumpers J18 and J21 in positions 3 5 and 4 6 connect UART A to J24 header e UART B J23 e Jumpers in 3 5 and 4 6 position connect UART B to OSJTAG virtual serial port e Switches and LEDs J3 install jumper to indicated position to use a switch or LED e SW1 3 4 e SW2 1 2 e D1 5 6 Getting Started with Freescale MQX RTOS Rev 15 78 Freescale Semiconductor e D2 7 8 TWR SER Jumper Settings e Ethernet e J12 ETH CONFIG all positions open e J2 CLK_SEL set to position 1 2 e J3 CLKIN_SEL open TWR MEM Jumper Settings e SDCARD slot e J12 SD SEL1 position 1 2 has to be closed for card detection e J2 SD SEL2 setto position 1 2 e J3 SD CS setto position 1 2 Known Issues e The Release target build configuration does not work properly because of a bug in the CodeWarrior 10 4 compiler lever 3 optimization only Workaround for this issue is to switch off load store elimination optimization adding the pragma load store elimination off to all MQX library and application projects settings Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 79
70. tion For example e Devices with internal Flash memory e g K60D100M e Int Flash Release This target is suitable for final application deployment When programmed to Flash the application starts immediately after reset Variables are allocated in the internal SRAM memory e Int Flash Debug Same as above with the exception that only the Debug compiled libraries are used This target is suitable for debugging before deployment This is the only target suitable for debugging larger applications for boards without external memory e Boards with external MRAM memory TWRMCF52259 etc e Ext MRAM Debug Used solely for debugging purposes with code located in external MRAM memory available e g on the TWRMCF52259 Variables are located in the internal SRAM A part of the external MRAM memory may also be used for additional RAM memory pools An application executable is loaded to MRAM automatically by the debugger e Boards with external RAM memory e Ext Ram Debug Used solely for debugging purposes with code located in the external RAM memory available as SDRAM e g on the M54455EVB Both code Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor and variables are located in the external memory An application executable is loaded to RAM automatically by the debugger e Boards and devices with internal Flash memory and additional external RAM for data TWR K70F120M Int Flash lt mem
71. uctor 9 3 Porting User Applications to MQX 4 1 0 3 1 C99 types Starting with the MQX version 4 1 0 the standard C99 integer and boolean types from stdlib h and stdbool h are used instead of the proprietary MQX types When porting the application to the MQX version 4 1 0 compilation issues could occur The psptypes legacy h header file is available and contains the definition of the MQX legacy types This file can be included in the MQX application to overcome most of the compilation problems caused by the change of types To avoid potential problems adopt the C99 types in your application 3 2 Changes in host to network and network to host macros The htonl htons ntohl and ntohs macros which are used for converting values between the host and the network byte order are modified to conform to the POSIX standard in the MQX 4 1 0 The old implementation of these macros is moved from the pcb h to mqx h file and renamed with the mqx_ prefix mqx_htonl mqx_htons etc The change is relevant for these functions uint32 t htonl uint32 t uint16 t htons uint16 t uint32 t ntohl uint32 t uint16_t ntohs uint16_t 3 3 MQX startup split To avoid a crash risk if an interrupt occurs during the startup the MQX startup is split in two parts e 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 controlle
72. uding typicals must be validated for each customer application by customer s technical experts Freescale does not convey any license under its patent rights nor the rights of others Freescale sells products pursuant to standard terms and conditions of sale which can be found at the following address freescale com SalesTermsandConditions Freescale the Freescale logo Kinetis CodeWarrior and Processor Expert are trademarks of Freescale Semiconductor Inc Reg U S Pat amp Tm Off Vybrid and Tower are trademarks of Freescale Semiconductor Inc All other product or service names are the property of their respective owners ARM ARM Cortex M4 and ARM Cortex A5 are registered trademarks of ARM Limited The Power Architecture and Power org word marks and the Power and Power org logos and related marks are trademarks and service marks licensed by Power org 2008 2014 Freescale Semiconductor Inc SS gt freescale Table of Contents Getting Started with Freescale MQX RTOS rsnnrnnvnnnvnnnrnnvrnnvnnnvnnnvnnnrnnnnnnennnennnvnnnnnnnnnnennnennnennnennn i 1 Redd MO FEL ane 3 2 Building the MQX Libraries 00 ana 4 2 1 Compile time configuration instar ps 4 22 B ild A RE EN 4 29 Build TANG gt EE EE EE EN 5 2 3 1 Library build targets RE EE EE NE NE ee italia els eens 5 2 3 2 Application build argelino iii ci 5 2 3 3 Compiler and Linker Warning setting ae 6 2 4 Freescale CodeWarrior development studio version 1
73. ystem list If your connection is not available in the list define a new one by using New menu e Select Hardware and Simulator Connection name and System type In System tab specify Initialize target as lib lt board gt cwl10 bsp lt target gt dbg init_kinetis tcl and Memory configuration as lib lt board gt cw1 0 bsp lt target gt dbg lt board gt mem 5 Click the Debug button in Debug Configurations Window The CodeWarrior is switched to a debug perspective and stops the program in the main function 6 1 2 CodeWarrior 10 task aware debugger plug in Freescale MQX RTOS introduces a new version of Task Aware Debugger Plug in TAD for CodeWarrior 10 Development Studio Installing CodeWarrior 10 3 and newer TAD and New Project Wizard Plug ins Both TAD and New Project Wizard plug ins can be installed directly from CW10 3 IDE by using HelplInstall New Software menu Installing CodeWarrior 10 1 amp 10 2 TAD and New Project Wizard Plug ins TAD plug in DLL is installed into the selected CodeWarrior tool automatically during Freescale MQX RTOS setup process If the plug in is not properly installed for example to a newly installed CodeWarrior studio perform these steps to install TAD manually Getting Started with Freescale MQX RTOS Rev 15 Freescale Semiconductor 21 5 6 Close The CodeWarrior 10 IDE Locate the tools codewarrior extensions CW MCU v10 x directory in the Freescale MQX RTOS installat
74. z crystal to the CPU CPU reset J7 e 1 2 default connects reset to on board push button and debug connectors e 2 3 connects reset signal to common ground holds CPU in reset 3V3 power supply J5 e 1 2 powered from elevator e 2 3 default onboard 3V3 regulator e 1V2 power supply for CPU core J15 e 1 2 default connects on board 1V2 power supply to the CPU e 2 3 selects external supply from J14 e VREG_INT_ENABLE J17 e 1 2 disables internal VREG of the CPU Getting Started with Freescale MQX RTOS Rev 15 76 Freescale Semiconductor e 2 3 default enables internal VREG of the CPU e FlexCANO J6 e 1 3 and 2 4 connect CAN though elevator to TWR SER board e 3 5 and 4 6 default to connect on board CAN transceiver TWR SER Jumper Settings e FlexCAN1 through TWR SER board e JS CAN SEL all jumpers closed e Ethernet e J12 ETH CONFIG all positions open e J2 CLK_SEL set to position 1 2 e J3 CLKIN SEL set to position 2 3 TWR MEM Jumper Settings e SDCARD slot e J12 SD_SEL1 position 1 2 and 2 3 has to be open e J2 SD SEL2 set to position 1 2 e J3 SD_CS set to position 1 2 Microcontroller Mode The PXS30 microcontroller operates either in a lock step mode LSM or a decoupled parallel mode DPM In LSM both cores execute the same code at the same time for safety applications In DPM cores execute code independently of each other Therefore in effect there are two processors available Mode is selected

Download Pdf Manuals

image

Related Search

Related Contents

Antec TWOCOOL 140  SUUNTO MOSQUITO  Juniper Networks ISG 2000 User's Manual  GAMING CHAIR  Sagem AF5107PS  SMC Networks GP-3010 User's Manual  Panasonic TC-L37U3 LED TV  Dev Kit User`s Guide_book.book  DV-RP100 取扱説明書  DOSSIER TECHNIQUE LEVAGE SOLLAC  

Copyright © All rights reserved.
Failed to retrieve file