|
The STFAE source tree is a version of the STAPI tree used by ST FAEs, application groups and customers. Import the kernel and tree into STWorkbenchTo work with STFAE for STLinux, two projects have to be created - the STLinux kernel and the STFAE tree. Contact your FAE for details on how to get these two trees.
This builds the test application each time a file is saved, which is quite quick. To build the driver tree also, change the build targets from all to apilib all in the Behaviour tab. Note: the apilib build is slow, even when nothing has changed. The build speed is due to the underlying STAPI Make system, not STWorkbench. Booting the kernelThe kernel can be booted using the normal STWorkbench mechanism. However, there is one complication. The "Board Type" field requires that a gdb connect procedure is defined for the board you wish to use which only connects to the board, without downloading an application. The standard connect procedures supplied with the ST toolsets for ST-designed boards are suitable, and can be used directly. To use a board for which no such procedure exists (the connection scripts provided in the STFAE tree are not currently suitable), the following workaround is needed. In this example, we wrap the STFAE connection scripts with a gdb procedure of the required form. Throughout, <board> should be replaced with a board type (e.g. "mb411"), and <soc> should be replaced by an soc type (e.g. "7100"). Step 1: Create the <board>_<soc>_start_file.cmd script, using
Step 2: Extract the main connect line from that file.
Step 3: Add the following new connect procedures to the .shgdbinit file in your home directory:
Note: The final line of the procedure should be the connect line extracted in step 2, but with the second field changed from an IP address to "$arg0". Step 4: Test it! You should then be able to connect to the board successfully with the new procedure:
The procedure "<board>_setup" can now be used in the "Board Type" field in STWorkbench. You can view the kernel boot as normal from an embedded kermit instance. From this terminal, you can run the load_*.sh scripts and the test application. Edit, rebuild and launch a test applicationEditing, rebuilding and navigating the test applications uses standard Eclipse/STWorkbench mechanisms. You can boot the kernel using the standard STWorkbench launch configuration. Set up running load_modules.sh as an external tool where /usr/bin/ssh is the external tool, with the following arguments.
For more information see Running external tools in the STWorkbench user guide online help. To set up the environment when launching through kermit, run load_env.sh in the terminal where the test application is started. To set up the environment when launching through STWorkbench, insert the line source /root/modules/load_env.sh into the file ~/.stworkbenchrc on the target before launch and debug. This file is sourced in the new terminal that STWorkbench creates to launch the application. Edit, rebuild and and use one of the driversWhen the source for the STAPI drivers has changed, you can rebuild the kernel modules using the Make Targets view. The kernel modules can also be rebuilt using Build Automatically or Build Project but it can be slow if there is nothing to rebuild, so some users may prefer to invoke the build only after a long set of changes. Once built, the Make system copies the kernel modules to the target and they are used by the next boot of the kernel. Debug a test applicationThe test application is named for example main_mb411_7100.out. To debug the test application using gdbserver, follow the usual steps for debugging a usermode application. No additional options are required but on the Debugger tab, remember to set the correct path to the target root filesystem. By default the output from the test application goes to the STWorkbench Console view. This does not support all the advanced terminal features of STAPI TestTool (in particular tab completion), so in the Main tab you may wish to uncheck the Connect process I/O to an STWorkbench console option. STWorkbench then launches an rxvt terminal on the target and launches the test application within it. This terminal does support tab completion. However, you may need to check that the settings of your X server allow the target board to display X applications on your host. This is often not the default. Debug a DriverTo debug the drivers you must debug the kernel itself. Each of the STAPI drivers is implemented as a kernel module.
For further details on debugging the kernel and kernel modules see: You can simultaneously debug the kernel-level drivers, and the test application that uses those drivers.
|
||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||