1 / 48

STMP37xx Wince5 training

July, 2008. STMP37xx Wince5 training. Topics. BSP, bootloader, and image WinCE Setup and hardware WinCE tools, build, and debugging Create an application/device Update image. BSP, bootloader, and image.

kemal
Download Presentation

STMP37xx Wince5 training

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. July, 2008 STMP37xx Wince5 training

  2. Topics • BSP, bootloader, and image • WinCE Setup and hardware • WinCE tools, build, and debugging • Create an application/device • Update image

  3. BSP, bootloader, and image • BSP----A board support package is the common name for all of the hardware specific code required to load and run the OS. It includes: • The boot loader • The OEM adaptation layer (OAL)----is the layer of software that establishes the communication between the Windows Embedded CE kernel and the hardware of the target device. • Board-specific device drivers. • Bootloader --- is generally used to place the OS image into memory and jump to the OS startup routine. • Many device will utilize a boot loader to provide upgrade capabilities. • STMP37xx uses an PC application to download firmware image.

  4. WinCE Setup and hardware • Get the Windows CE5 Platform Builder Evaluation copy from Microsoft. Install it on C:\WinCE500, and C:\Program Files\Windows CE Platform Builder • 120 days evaluation copy link: http://www.microsoft.com/downloads/details.aspx?familyid=486E8250-D311-4F67-9FB3-23E8B8944F3E&displaylang=en • Select Tool and OS installation • Add ARMV4I to the installation • Run Windows CE 5.0 Platform Builder - Cumulative Product Update Rollup Package (through 12/31/2007) • http://www.microsoft.com/downloads/details.aspx?FamilyID=a54779d5-f4a5-49f0-9e36-979d461f536c&DisplayLang=en • Select and install ARMV4I.msi • Select and install X86.msi (optional)

  5. WinCE Setup and hardware (internal users only) • Refer to “Getting Started with Subversion.doc” for set SVN software application to get BSP and Platform source code • Get the STMP37xx board support package from SVN: • Create the directory C:\WINCE500\PLATFORM\STMP37xx_BSP • Run "svn checkout” http://wince50.svn.sgtl.sigmatel.com/svn/wince50/wince/trunk/STMP37xx_BSP” • Or get from BSP zip file . Unzip the file STMP37xx_BSP_P2005v257.zip under C:\WINCE500\PLATFORM\

  6. WinCE Setup and hardware • Get the platform from the SVN • Create C:\WINCE500\PBWorkspaces\STMP37xx_PDA_TST • Run "svn checkout” http://wince50.svn.sgtl.sigmatel.com/svn/wince50/trunk/STMP37xx_PDA_TST” • Or get from BSP zip file. Unzip STMP37xx_PDA_TST_P2005v257.zip into C:\WINCE500\PBWorkspaces\ • If applications/components are needed in OS image, please open PB and add the applications/components by right clicking components in Catalog window and select Add to OS Design. • Example: adding WMP.

  7. WinCE Setup and hardware • Run PB and select Release build on tool bar. • Build image firmware by clicking on Build OS->Build and Sysgen. • After successful build, OS image firmware.sb is placed in "C:\WINCE500\PLATFORM\STMP37xx_BSP\tools\winCENANDBoot\updater\" Check the date and time of "firmware.sb" for the correct date.  • Run the updater on PC to download the firmware. Will show later.

  8. WinCE Setup and hardware • Run Wince OS image with Tera Term or Hyper Terminal • Run at 115K baud • 8:N:1, NO flow control • Connect the debug port to com1 • Power up the device and press PSWITCH, and observe the Tera Term/Hyper Terminal output.

  9. WinCE Setup and hardware • Run an existing application. • Use ActiveSync to download applications • Sync device with PC running ActiveSync • Find the Nand Flash/Storage Card(SD) card in My Device, and copy applications or files to • On STMP37xx device, find the applications on Nand or SD card, and run the applications. • Note that file size may be changed after copied from PC to device. This is because ActiveSync compresses files before transforming. • Use SD card • Put applications on SD from PC and then insert the card on STMP37xx device, and choose an application and run

  10. WinCE Setup and hardware • LCD panel for STMP37xx----STMP37xx supports three types of LCD interface: • 8bit CPU/MCU • 16bit CPU/MCU • 8bit serial RGB • CPLD + parallel RGB panel • The default build LCD is 3.5”. If other LCD, please make changes in file \PLATFORM\STMP37xx_BSP\STMP37xx_BSP.bat.

  11. WinCE Setup and hardware • Nand Flash • Use device(s) from supported list • Occasionally, an error occurs while doing updater. A clean nand is required (available internal only) • With nand clean tool in SDK5xxx full build • Connect slingshot box to board and put in debug mode • Debug switch on • DIP Boot Mode switch SW3=0110. • Power on board • In DOS window on PC, run “nand.bat erase –x” from SOCFirmware\2008_x_x_x_x\utilities\nand\ • Use deviceapi.exe to clean. • On board DRAM (mDDR, SDRAM or mSDRAM) requires at least 64MB

  12. WinCE Setup and hardware • STMP37xx BSP installation package and Create and Edit Catalog item (.cec) (this process is not available now) • A .cec file contains the information of BSP and other components in the Catalog. • A .cec file can be created by BSP Wizard or CEC Editor. • Import .cec into PB catalog and make it a third party BSP • Find STMP37xx_BSP.cec file in directory PLATFORM\STMP37xx_BSP. • Double click to start CEC Editor. • From Catalog menu, choose Add to Catalog. • Start PB and check Third Party BSP in Catalog window. • Export STMP37xx BSP from PB into .msi file --- installation package. • From Platform menu, choose Export Wizard. • Install .msi file on other PC with PB.

  13. WinCE Setup and hardware • Bootloader and Kernel Utility (includes UUID & splash screen support) • SDHC driver • SDIO driver • Rotary Driver • USB device (MSC) • Power Management • Battery Driver • Suspend/Wakeup • Clock configuration control • MLC/SLC NAND • USB KITL • STMP37xx driver list and features in BSP • Kernel (OAL)File System • Audio Driver • Video Driver/LCD/Display Driver – 2.8”, 3.5”,and 4.3” • USB device (ActiveSync) • SD Memory • Backlight Driver • RTC Driver • LED Driver • Keypad Driver • Touch Driver • UART Driver • GPIO Driver

  14. WinCE tools, build, and debugging • Configuration Files (BiB, REG, DAT, and DB) • Binary Image Builder (BIB): The .bib file details the memory layout that the boot loader will use. • Config.bib: contains the Memory and Config sections for the run-time image. The Memory section of the file defines the memory table for the run-time image by specifying the name, address, size, and type of Memory regions. • Platform.bib: defines • The hardware modules and files, such as driver files, for the target device • The modules and file entries for the run-time image. Such as .exe files and waveform audio (.wav) files. • Common file types in WinCE • NK.nb0 / NK.bin: OS Run-time image. The actual WinCE OS with all the device drivers. • NK.exe: core kernel process and is always present in Windows CE based systems. Nk provides the core Win32 APIs for process loading, thread scheduling, and memory management.

  15. WinCE tools, build, and debugging • To build a run-time image • From the Build OS menu, choose Set Active Configuration. • Select an active configuration, and then choose OK. • Do one of the following to create a run-time image:

  16. WinCE tools, build, and debugging • Terra Term Pro ver. 2.3 or newer or Hyper Terminal available on PC • Run terra term at 115K baud • Data bits:8, Parity: None, Stop bits:1, Flow control: None • Use com1

  17. WinCE tools, build, and debugging • Application Development Tools • Platform Builder is focused on building the OS and developing drivers. Developing applications is only a secondary focus, so it is not as well supported as other tools • eMbedded Visual C++ together with an imported SDK • Visual Studio .Net 2003 with an imported SDK

  18. WinCE tools, build, and debugging • WinCE5.0 build example: Adding Windows Media Player • In Platform Builder IDE, expend the Catalog tree as picture and add all components in red box into STMP37xx catalog items window by right click each of them and select Add to OS Design • Make sure the items added in STMP37xx catalog items window

  19. WinCE tools, build, and debugging • WinCE5.0 build example ---- Adding Windows Media Player • Click ParameterView in 37xx catalog items window. Under Hardware Specific Files, double click config.bib file. Adjust the Rom and RAM size: • #define ROM_IMAGE_SIZE     00F00000#define RAM_IMAGE_START   81500000#define RAM_IMAGE_SIZE     02A00000 • Save the file. Note:above value is for 64MB SDRAM. • In menu, select Build OS->Build and Sysgen with Clean Before Building checked. • After build, find firmware.sb at WINCE50\PLATFORM\STMP37xx_BSP\tools\winceCENANDBoot\updater

  20. WinCE tools, build, and debugging • WinCE5.0 build example ---- Adding Windows Media Player • Update flash with SigmaTel updater. • Power on your STMP37xx WinCE board. WMP should be seen on desktop. • Connect USB to a PC with ActiveSync, and download songs with Explore in ActiveSync. • On your STMP37xx WinCE board, run WMP and select File on menu bar to browse songs and play. • Putting song files on SD cards is another way to get song files.

  21. WinCE tools, build, and debugging • Kernel Independent Transport Layer: KITL debugging • KITL is a debug tool which comes with Wince 5.0. KITL is supported and the debugging environment needed for WinCE Platform Builder. • From the main menu in Platform Builder, choose Platform->Settings. This will bring up the setting dialog. • On Configuration, select SigmaTel STMP37XX Platform: ARMV4I_Release. • From the Build Options tab, select "Enable Full Kernel Mode" and "Enable KITL".

  22. WinCE tools, build, and debugging • KITL debugging • In Platform builder choose the parameter view, and expand the tree view to expose config.bib.  Then double click this file to open • This file is used to tell Windows how the memory of the target is laid out.  There are four #define options that we need to modify when enabling KITL so that our image will fit into the system. #define ROM_IMAGE_START   80100000 #define ROM_IMAGE_SIZE     00D00000 #define RAM_IMAGE_START   80F00000 #define RAM_IMAGE_SIZE     03000000 • More accrue numbers may be decided after build is done by check build log.

  23. WinCE tools, build, and debugging • KITL debugging • After successful build, use updater to download firmware.sb to target device. In the Platform Builder program, from the Target menu choose "Connectivity Options". • Click on "Add Device" link and enter a name as the Device Name, and click Add button. • In other text boxes, enter the selections as shown in picutre.

  24. WinCE tools, build, and debugging • KITL debugging • Click Core Service Settings. • Check Never (jump to image only) in Download Image box and make the other selections as shown in picture. • Click Apply and then Close.

  25. WinCE tools, build, and debugging • KITL debugging • If you have ActiveSync installed on the same PC, please open ActiveSync . File->Connection Settings…, and uncheck Allow USB connections. • After you finish this step, the red circle X will shown on ActiveSync icon. • Note that you do not do this, PB will not connect to your Wince device.

  26. WinCE tools, build, and debugging • KITL debugging • Running the Debugger • WinCE Image with KITL support is burned into NAND flash. • USB cable is attached to PC. • Platform Builder is open and the WinCE kernel (sysgen) and BSP have been built. • Set NAND boot mode (0100): • BM0 - Down • BM1 - Down • BM2 - Up • BM3 - Down • USB (SW2) is in on/up position.

  27. WinCE tools, build, and debugging • KITL debugging • Running the Debugger • In the Platform Builder choose Target->Target/Attach device. In the debug pane of Platform Builder you will see the message "The Kernel Debugger is waiting to connect with target.” • Power on STMP37xx Board (may not be necessary; just USB 5V).

  28. WinCE tools, build, and debugging • KITL debugging • Running the Debugger • The Processes example of KITL Windows .

  29. WinCE tools, build, and debugging • KITL debugging • Running the Debugger • The Thread example of KITL Windows .

  30. WinCE tools, build, and debugging • KITL debugging • Running the Debugger • The Memory example of KITL Windows.

  31. WinCE tools, build, and debugging • KITL debugging • Running the Debugger • The example of KITL Windows. • The full list of available windows can be found by right click tool bar

  32. WinCE tools, build, and debugging • Set breakpoint and single step • After successful build of OS image (including your application if any in PB), update the image on Nand flash. This step is a must, otherwise debug will not work. • Open the source file which you are debugging. • Right click the location where breakpoint will be and select Insert/Remove Breakpoint. • Connect STMP37xx board with PB as described in previous slides.

  33. WinCE tools, build, and debugging • Set breakpoint and single step • During initialization, it will stop at the location of your breakpoints, or you will manually make that application with breakpoints running. Then you can do single step and debug source code. • If you are debugging your own application, make sure your application is in the Windows folder. To verify (it may be a hidden .exe file), go to View->Options and make all types of files displayed. • On tool bar select Target->Run Program, find your application, and run it. KITL will stop at the breakpoint location.

  34. WinCE tools, build, and debugging • CETK ---- WinCE 5.0 Test Kit (CETK) • CETK is a set of tools that provides a framework for testing device drivers. It also contains a set of tests to run to verify correct behavior of common drivers and the OAL. • The CETK tool consists of a server application that runs on your development PC and client software that runs on each target device. • The CETK uses the Tux test harness and Tux extender technologies to create and run test cases • Connecting the STMP37xx to the HOST and running the CETK Tests.

  35. Create an application/device • Microsoft ActiveSync • Install ActiveSync for device management • http://www.microsoft.com/windowsmobile/activesync/default.mspx • ActiveSync acts as the gateway between your PC and Windows Mobile powered device and allows you to synchronize applications to and from your device. • On Windows XP, ActiveSync will synchronize your board with PC. • You can develop an application/device under Windows CE environment. The application developed on PC will run on your board.

  36. Create an application/device • Run Activesync. Not connected is shown. • Connect USB to PC. • Power on board and a pop-up message is shown on host PC. And then select “No” and click “Next”

  37. Create an application/device • Device is connected to host PC • Click the “Explore” to browse the files system on target device

  38. Create an application/device • Create a console application with WinCE Platform Builder • Start PB • Make sure the Console Window is in BSP catalog items. • However, if it is not in, please add it as shown in picture, and then build the OS image. Update the image on STMP37xx board.

  39. Create an application/device • Create the project by clicking File->New Project or File. • Click the Project tab, and then select WCE Console Application. • In the Project name field, enter HelloWorld for the project name. By default, the project folder is placed in WINCE500\Pbworkspaces\<workspace_name>\ HelloWorld. • Select Workspace project. • Click OK.

  40. Create an application/device • The next screen is the New Project Wizard general information configuration screen. This information is optional and can be bypassed. You may enter information in the fields you want, or leave the fields blank. • Click Next. The Console Application selection window is displayed • For this demo, select A typical “Hello World!” application, and then click Finish. • The new project is added to the workspace. To confirm the project, expand the Projects tree and view the added project name • The wizard creates all of the necessary files to compile the application, and also sets the .exe file to run under Windows CE.

  41. Create an application/device • Go to FileView tab and open file HelloWorld.cpp file and modify as in shown picture. • This change will make the application show “Hello World” and wait input a number and then end.

  42. Create an application/device • To compile and create the .exe file for the application, right-click on the project folder at the workspace’s File ->View. • Select Make Run-Time Image After Build, and then select Build Current Project. This check box will create HelloWorld.exe after OS image is built. Note: to select Build Current Project will not build OS image libraries. Build OS image before this project is built. • When the application is compiled, Platform Builder creates a new run-time image with the HelloWorld.exe. To verify on PC, please go to folder \STMP37xx_PDA_TST\RelDir\STMP37XX_BSP_ARMV4I_Release\

  43. Create an application/device • Rebuilding OS image will make HelloWorld.exe included in the OS image. To verify on STMP37xx board, please browse to Windows folder and change view options to display all types of files. • To debug the application, please refer to previous section to set breakpoints and watch system parameters.

  44. Create an application/device • Create an application with MS Visual Studio 2005 (Will be add soon)

  45. Update image • In order to update the NAND with the WinCE image a delicate process must be performed.   There are several files produced during the build of the WinCE image that are of no concern for us, but one file in particular is very important (nk.nb0---OS Run-time image). • This nk.nb0, eBoot, and nk.exe files will be converted to firmware.sb by tools embedded in build process. This firmware.sb will be the final file to download onto the Nand flash. • The download tool is stupdaterapp.exe and located in Wince500\Platform\STMP37xx_BSP\Tools\winCENANBoot\updater\.

  46. Update image • Make sure following files are in the directory before downloading: • firmware.rsc---resource file • Firmware.sb---OS image • Updater.sb---is used on PC to flash the WinCE image to a NAND while updating • Stupdaterapp.exe---is an PC application to download WinCE image • Downloading firmware by USB • Connect STMP37xx WinCE board to PC with USB cable • Put STMP37xx WinCE board in Recovery mode (SW3=0000) • Switch on USB switch (SW2)

  47. Update image • Downloading firmware by USB • Run stupdaterapp.exe • Wait until Start button is enabled, and click Start • Check Full Media Erase option • Wait until progress finishes • Click Close

More Related