In this section, we shall describe the way to build, download and execute SH7264 M3A-HS64G50 solution available in the porting kit with NOR Flash Memory and SDRAM.
1) Using Command-line prompt, change the directory to “Solutions\SH7264_M3A_HS64” C:\MicroFrameworkPK_v4_1>cd solutions\SH7264_M3A_HS64
Msbuild dotnetmf.proj /t:build /p:flavor=debug;SERIALFLASH=false
Flavor: <debug|release|rtm> SERIALFLASH : <ture|false>
If you want to debug your program using E10A-USB Emulator, please specify “debug” for “flavor” option.
In this case, specify SERIALFLASH to “false”.
There are two DIP switches located on the CPU board. The function of each switch and its connection are shown below:
Set SW5 of the M3A-HS64G50 board as below to startup from NOR Flash.
Figure 4.1 SW5 settings
Regarding to the SW6, set all switches should be OFF.
1) Setup the E10A-USB Emulator
Install the E10A-USB Emulator software into your PC.
During install, you should select the device group for E10A-USB then specify “Super H RISC engine family SH-2A device group”
2) How to start downloading using E10A-USB
Extract the HEW workspace for SH7264 M3A-HS64G50 Porting Kit from file SH7264M3AHS64.zip at any place in your PC.
In the following instructions, we will assume it is installed in “c:\workspace”
Start the Hew with choosing below menu
Figure 4.1 Hew menu
Then Hew will be show up and you can see below dialog box.
Specify the workspace as below, and press OK button.
Figure 4.2 Welcome dialog box
In below dialog box, set options like below.
Figure 4.3 Select Emulator mode dialog box
When below message shows up, reset the target board by pressing the reset button on the board and then press OK button.
Figure 4.4 Heush2acustom1 dialog box
Then Hew/E10A-USB will finish connection with SH7264.
Figure 4.5 Hew window
3) How to download the program to the flash memory
i) Prepare the download module.
Select the [Debug] -> [Debug Settings…] from the menu bar of Hew then below dialog box will show up.
Figure 4.6 Debug Settings dialog box
Here is the definition of download modules. Please change the Path setting for each download module by clicking “Modify” button.
ii) Prepare for downloading to Flash Memory.
Select the [Setup] -> [Emulator] -> [System…] from the menu bar of Hew then “Configuration” dialog box will show up.
Select “Loading flash memory” tab. Then, specify as same as below figure.
For “File name”, please specify <Workspace folder>\SH7264M3AHS64\fmtool_hs64\fmtool_hs64.mot.
Figure 4.7 Configuration dialog box
iii) CPU and memory initialization
In order to download data to flash properly, CPU and memory should be initialized as following.
- CPU : Cache must be disabled.
- Memory : Port controller must be initialized.
In order to initialize them, run the batch file as below,
· Specify the batch file
Figure 4.8 Popup menu on Command Line window
On the command line window, do the right clicking so that the popup menu shows up.
Select “Set Batch file…” and specify the batch file name like the figure in next page,
Figure 4.9 Select Batch File
· Run the batch file
After specify the batch file, please press “Play” button so that batch file starts to run.
iv) Download module to Flash
In order to download, double click on the name of the download module which you want to download to flash.
Figure 4.10 Hew window
Below message should display during download.
Figure 4.11 Downloading Program dialog box
In the case of downloading NativeSample, please select nativesample.abs instead of tinyclr.abs.