User manual
ST Assembler/Linker build tutorial UM0036
366/385 Doc ID 7705 Rev 11
13 ST Assembler/Linker build tutorial
This build tutorial takes you through the steps of setting up workspaces, creating projects
and building assembler source code into an application that can be debugged with STVD.
Your objective in this tutorial is to build the provided source code in assembler language into
an executable in Motorola S format for the ST72311N4.
To do this, we have provided you with the following files:
● tim_rtc.asm — the application source file in assembler language. This is a Real Time
Clock application that uses the Output Compare Interrupt software driver of the
ST72311xx Timer. With this application, a timer interrupt is generated every 100mS
when fCPU = 4MHz.
● tim_rtc.bat — this is the .bat file that is typically used when building with the ST
Assembler Linker.
● st72311n4.asm — a source file in assembler language that specifies the memory
mapping of the ST72311n4 peripheral registers, which is required for the application.
● st72311n4.inc — an include file that defines the addresses of the ST72311n4
peripheral registers, which is required for the application.
For standard installations of STVD, the files listed above are saved at the directory location:
C:\Program Files\STMicroelectronics\st_toolset\stvd\Examples\tutorial_asm
Note: The st72311n4.asm and st72311n4.inc have been copied to the examples directory,
however these included files are also provided in the directory ...\st_toolset\asm\include
for supported ST7 devices. For typical use you should use the provided ST7 include files
from their original location unless you want to modify them. If you want to modify an include
file for a specific application, first copy it to your working directory so as to preserve an
unmodified version of the original include file.
13.1 Create a new workspace with the New Workspace wizard
Before you can build or debug an application with STVD, you must create a workspace to
contain any projects and their source files.
1. In the main menu bar select File>New Workspace.
2. In the New Workspace window, click on the Create an Empty Workspace icon.
3. Click on OK, the view in the New Workspace window changes.
In the resulting view of the New Workspace window, you must enter a name for your
workspace and identify the directory pathname.
1. Enter the name my_workspace in the Workspace Filename field.
2. Enter the pathname to identify the directory where you want STVD to store your
workspace.
3. You can use the browse button to find the location
4. You can create a folder for your new workspace by clicking on the Create folder icon.
Enter the folder name my_workspace in the Create Folder window and click on OK.
5. Click on OK to create the workspace (.stw).
6. Before going any further, save your workspace. In the main menu bar, File>Save
Workspace.