420 likes | 882 Views
WindRiver Hand-on seminar Migrating from VxWorks 5.5 to VxWorks 6.3. Agenda. • debug vxworks5.5 in workbench • BSP migration • kernel to RTP • virtual device driver. Installation and Preparation. - You should have Tornado 2.2.1 and GPP-VE 3.3 installed on your host
E N D
WindRiver Hand-on seminar Migrating from VxWorks 5.5 to VxWorks 6.3
Agenda • debug vxworks5.5 in workbench • BSP migration • kernel to RTP • virtual device driver
Installation and Preparation - You should have Tornado 2.2.1 and GPP-VE 3.3 installed on your host • Tornado2.2.1 under C:\T221 •GPP-VE 3.3 under C:\Vx5-to-Vx6 - Register T2.2.1 in Workbench 2.5 • Open a DOS Command Shell (or a wrenv shell) •Change directory to: Install_base\workbench-2.5 \x86-win32\bin •Excute wrregistert22x.bat •Point to the Tornado directory which you want make WB aware of - Prepare the board(Already done)
Register T2.2.1 in Workbench 2.5 (cont.) • Type wrregistert22x.batand hit enter • This will run an autdetect script for you. Within a couple seconds it will come back and tell you it found a Tornado installation on your host. • Make sure that this is the installation of c:/T221
Register T2.2.1 in Workbench 2.5 (cont.) • To double check on this – simply lauch Workbench via C:\vx5-to-vx6\workbench-2.5\wrwb\platform\eclipse\x86-win32\bin\wrwb.exe and go to the Target Manager and create a new connection – e.g. Click on the „Creat a new target connection“ button. • You do now have 2 new connections Available in the New Connections GUI Click on Cancel – you are now done with this part.
Debug a VxWorks 5.5 image in WB2.5 • You could launch Tornado 2.2.1 to build your own vxWorks 5.5 image. (browse down to c:\T221\host\x86-win32\bin and double click on Tornado.exe • For the purpose of this training – we have already build a VxWorks image project and a DKM (Downloadable Kernel Module) project. • Those 2 projects can be found at c:\T221\target\proj • They are named SBCPQ2 And DKM-T221
Debug a VxWorks 5.5 image in WB2.5 (cont.) • Connect a serial cable between the board (COM1) and your PC. • Connect a cross-over ethernet cable between your PC and MOTFCC0 • Launch a FTP server on your PC c:\WindRiver\vxworks-6.3\host\x86-win32\bin\wftpd32.exe • Make sure you have a FTP account properly set up(both account and passward:windriver) • Open a terminal view in Workbench (baudrate set to 9600) • Power cycle the board & stop the bootloader to configure it‘s parameters. • Make sure you setup the ip-addresses, the FTP user account and the path to the vxWorks file of c:\T221\target\proj\SBCPQ2\default\vxWorks
Debug a VxWorks 5.5 image in WB2.5 (cont.) • Boot the image – you should see a VxWorks 5.5.1 image getting launched
Debug a VxWorks 5.5 image in WB2.5 (cont.) • Select Target > New Connection from the menu bar of Wind River Workbench • In the Connection Type dialog select WindRiver VxWorks 5.5.x Target Server Connection • In the Target Server Options GUI enter the IP-Address of your board and make sure you specify the path to the kernel image: c:\T221\target\proj\SBCPQ2\default\vxWorks • Click Finish and let the target agent connect to the image on the board. • You will see the agent connect to your VxWorks 5.5.x image
Debug a VxWorks 5.5 image in WB2.5 (cont.) • Select File > New > VxWorks5.5Downloadable Application Project • Name it DKM-T221 • Click next, next, next till you see the Build Specs GUI • Press Deselect all and then select the PPC603gnu build spec only. • Click Finish • This way you created an empty VxWorks 5.5 DKM project • Now lets import source code into it: • Right mouse click on the project container and select Import… > File System • Browse to the Tornado Installation – into the DKM-T221 project and Checkbox the DKM-T221 Main project folder • Click Finish
Debug a VxWorks 5.5 image in WB2.5 (cont.) • You Project Navigator will now have a project view like this: • Right mouse click on the project container and select Build Project • Click Continue when you get prompted for the include path search. • Click Yes to All when you get prompted to overwrite the existing Makefile. • Double Check that your build spec is set to PPC603gnu
Debug a VxWorks 5.5 image in WB2.5 (cont.) • Right mouse click on the project container and select Run Kernel Task • In the Create, manage, and run configurations GUI, enter vStart as your Entry Point. • Then - click on Run
Debug a VxWorks 5.5 image in WB2.5 (cont.) • Your Application gets loaded and launched and you should see the producer-Consumer demo running in the terminal view. • From here it‘s up to you to dive into a debug session, to show Workbench 2.5 being capable of debugging VxWorks 5.5
Agenda • Porting by importing & recompiling • Make modifications to support ED&R
Porting by importing & recompiling • Use a Windows Explorer to create a new folder in c:\Vx5-to-Vx6\vxworks-6.3\target\config • Name this new BSP folder wrSBCPQ2 • This is going to be our new BSP folder for the porting scenario • Note that you have the original VxWorks 6.3 BSPs in there ! • Don’t overwrite those – This is why we choose the name wrSBCPQ2 for the BSP porting work !
Porting a BSP (cont.) • Select File > New > User-Defined Project • For the Target Operating System select Wind River VxWorks 6.3 • name it wrSBCPQ2 (must be identical to folder name from the previous slide!) • Create it in an external location • Browse to the folder that you just created on the previous slide • Click Finish
Porting a BSP (cont.) • Right mouse click on the project container and select Import… > File System • Browse to your Tornado BSP directory that you want to port. In our case this is C:\T221\target\config\wrSbcPowerQuiccII • Check box the wrSbcPowerQuiccII folder • Then, uncheck the build outputs in the right pane of the window • Click Finish • Click Yes to All when get prompted To overwrite the Makefile
Porting a BSP (cont.) • Your project got all the resources from the 5.5 BSP • Right mouse click on the project container and select Clean Project • Then – again right mouse click on the project container and select Build project • Your Build output will report errors – all those errors relate to the higher version of the GNU compiler that became more restrictive. Read more on the next slide.
Porting a BSP (cont.) • Double click on the line that reports the error to open the related file in the editor
Porting a BSP (cont.) • sysMotFccEnd.c will show up in the editor. • The newer GNU compiler complains about the default: section in the case rule • Simply add another break; command in the line below the default:
Porting a BSP (cont.) • Now, let‘s focus on the warinings that compain about the casting. • Double click on one of those warings to open the realated source code. • sysLic.c will show up in the editor
Porting a BSP (cont.) • Make the following changes: • Press CTRL+F or Edit->Find/Replace... to apply the same changes to all the other warings reported in this function block
Porting a BSP (cont.) • There is one more easy to fix waring in your build output... • Double click on the waring in the build output • This will open the sysCacheLockALibs.s • Simply place the curser at the end of the file (line) and hit return to get a new line at the end of the file
Porting a BSP (cont.) • Build your project and it should now build without any errors. • We sucessfully ported the BSP from 5.5 to 6.3 by simply recompiling it ! • Let‘s finish up building a vxWorks 6.3 bootloader with this new BSP
Building Bootloader • From your wrSBCPQ2 project, select File > New > Build Target • For the Build Target name enter bootrom.bin • Click Finish • Put the focus on the new build target, right mouse click and select Build Target. This way you going to build the bootloader.
Program VxWorks 6.x Bootloader • You can flash the the new bootrom.bin into your target board simply as following(in this training we won’t do it): • Connect the Wind River Probe to the SBCPQ2 board. Power ON the board. • Go to the Target Manager View. • Click on Create A New Target Connection button. • In the Connection Type GUI select the Wind River Probe entry • and click next
Build VxWorks image with new BSP • Select File > New > VxWorksImage Project • Name it vxWorks-image-6.3 • Click next • Base it on a board support package and pick our new BSP wrSBCPQ2 • Select the GNU compiler • Click Finish
Build VxWorks image with new BSP Porting a BSP (cont.) • Put the focus on the new VxWorks image project and select Build Project from the contect menu. • Your Build Output view should show you a sucessful vxWorks 6.3 build output • Now it‘s time to close the loop and use the new bootloader that we just build, to boot this new vxWorks image that we also just build.
Booting up the system • Make sure you have a FTP server running and proper FTP account set up. • Power cycle the board and stop the bootloader to configure its parameters. • Point to the new VxWorks 6.3 image in your vxWorks-image-6.3 project • In case you started with a vanilla board (all flash erased) – make sure you set up a MAC address before you boot your image.
Adding ED&R to your new BSP • It‘s very simple to add ED&R to your new BSP • All you have to do is to allocate a memory area in sysLib.c to enable the ED&R to store data there. • Open the file sysLib.c from your wrSBCPQ2 BSP project folder • Browse down to the function code of sysMemTop
Adding ED&R to your new BSP • Add those four lines to your BSP code:
Booting up the system • Build your vxWorks-image-6.3 project one more time and reboot it on your board • You will now have Support for the Kernel Shell • And you can see the ED&R being deployed to your system
Wind River, the global leader in device software optimization (DSO), enables companies to develop and run software faster, better, at lower cost, and more reliably.