Software Development Kit for iQue NetCard (version
1.11)
$Revision: 1.47 $
$Date: 2006/08/31 00:01:58 $
Purpose
The iQue NetCard Software Development Kit provides all the tools and
libraries necessary to develop applications that will run on the
Nintendo GBA family of platforms using the iQue NetCard.
Development System Requirements
- A PC with at least 256MB of RAM, 200MB of free disk space and a
CDROM drive
- At least one USB port and a USB cable with Cat-A and 5-pin Mini-B
connectors.
- A GBA/SP/DS/Micro
- A NetCard
- Windows XP with SP1 or SP2
- Cygwin linux compatibility package installed
Installation Instructions
The SDK includes the following items:
- Cross compiler suite for building ARM binaries for the GBA and
NetCard (no longer packaged with SDK, see below for download instructions)
- Header files and libraries required to build games using the
NetCard facilities, including online gaming and audio
- Tools for creating game executables
- Online documentation
- Sample source code for a "viewer" application on the GBA
- Sample source code for an MP3 player application on the GBA
- Sample source code for MP3 player resource manager on the NetCard
- VNG header files and libraries.
Cygwin
The SDK uses the CYGWIN unix compatibility environment on windows. If
you do not have cygwin on your PC you should go to the CYGWIN site (www.cygwin.com) and
install it. Other than the default packages, you should also select the
following:
- Make (under Devel)
- Python (under Interpreters)
It is also a good idea to choose one of the available text editors to
use for software development on CYGWIN (for example: VIM or
EMACS). The SDK has been tested against the latest CYGWIN release (as
of 2/20/06).
Installing the SDK Software
In order to install the SDK, please use the following procedures:
Installing the Compilers
For NetCard SDK release 1.1 and later, the compilation toolchain is
packaged separately from the rest of the SDK.
The toolchain image can be downloaded from the following URL:
http://172.16.10.99/nc_sdk1.11/arm-tools-cygwin-20060318.tar.bz2
Save the toolchain file to disk and download the corresponding installation script
into the same directory:
http://172.16.10.99/nc_sdk1.11/install_tools.sh
Run the installation script from a CYGWIN shell window to install the toolchain.
The binaries will be installed in the directory /opt/crosstool/bin.
Installing the USB Driver
The SDK provides a set of tools which allow you to download
applications onto the NetCard over USB. Before using these tools you
must install the USB driver onto the PC. For the early SDK releases, we have
not included an install script for this driver, so some manual setup is
necessary.
Note that USB Vendor ID of the NetCard has changed in release 1.2 and later to use
the official iQue USB Vendor ID.
This means that a new USB driver is required even on a PC that already
has been used with SDK release 1.0 or 1.1.
If your system is currently running SDK 1.2 or later, then
the reinstallation of USB drivers is not necessary.
If your system is running an earlier release of the SDK or has not yet had the
SDK installed,
please install the new USB driver by following these steps before proceeding:
Setting your PATH
Tools necessary to use the SDK are installed in two places, which
should be added to your PATH:
- $ROOT/usr/bin/x86
- $ROOT/usr/bin/win32
If you are using Bash, type:
export PATH=$PATH:$ROOT/usr/bin/x86:$ROOT/usr/bin/win32
To make development easy, it is best
to add the following lines to your shell init file (.bash_profile if
you are using bash):
export ROOT=~/SDK_ROOT (or wherever you put the SDK)
export PATH=$PATH:$ROOT/usr/bin/x86:$ROOT/usr/bin/win32
Upgrading the SDK Image on a NetCard from v1.10 to v1.11
By default, NetCards come with test software installed and they need
to be upgraded with the SDK image.
If the card has been installed with SDK version 1.3 or later, then this
procedure should be used to upgrade to SDK version 1.11.
If your card has the original test software or SDK 1.0 or 1.1 or 1.2, then
please update to 1.3 first before doing this upgrade procedure.
Fetch the starting cert.sys file from the NC SDK website:
http://172.16.10.99/nc_sdk1.11/cert.sys
To upgrade your NetCard image you should start a cygwin shell and
start ncproxy by typing:
ncproxy -p
NOTE: you must have $ROOT/usr/bin/win32 in your $PATH.
Start an ncshell process with the -b option:
cd $ROOT/usr/bin/sc
ncshell -b
wb 1 boot1.aes
wb 2 devmon.bwf
ls
format
quit
Do not interrupt this sequence of commands by powercycling the NetCard.
Please note that after the "wb 2" command, you must wait for the "ls"
command to finish to make sure that the write is complete.
The prompt in ncshell comes back before the "wb 2" command is actually
completed.
Please do not proceed with the next step until the output of "ls" has
appeared in the ncshell window or until you see the message "import boot2
successful" appear in the ncproxy window.
For the 1.11 upgrade, it is advisable to reformat the file system twice:
once on the old IOS and again after the upgrade.
This is to prevent compatibility problems with the old version
of the viewer when you reboot on the 1.11 OS for the first time.
Powercycle the GBA after the successful completion of the previous step.
The 1.11 upgrade requires that the flash file system (SFFS) be reformatted.
Note this second format command is necessary since it happens after
the reboot on the 1.11 OS.
The layout of the redundant copy of devmon.bwf is different after
the upgrade to 1.11, so it is recommended to reinstall devmon.bwf
after the reboot.
As with the previous upgrade of devmon.bwf, don't proceed to powercycle
until the "ls" command completes successfully.
ncshell -b
format
wb 2 devmon.bwf
ls
quit
... powercycle the GBA ...
After the format, the /sys/cert.sys
file must be initialized with the version downloaded previously.
cd to location of downloaded cert.sys
ncshell
put cert.sys /sys/cert.sys
mkdir /media
mkdir /media/music
quit
Now the viewer can be imported:
cd $ROOT/usr/bin/gba
ncshell
import viewer.bwf
quit
The installation should now be complete. Use ncshell to import any
additional games and data files onto the NetCard.
Note that if your NetCard has a personalized ID, you will need to
publish games specifically for the device ID.
The viewer is published with a non-personalized ticket, so one version
of the bwf file will run on any NetCard.
In order to publish games for a personalized card, retrieve the device
certificate by booting the Netcard and doing the following commands:
ncshell
get /tmp/devcert.sys devcert.sys
quit
Then specify the device certificate file using the -D option to the publishing
script:
publish.py -n dolphin -S -l dolphin.mrg -D devcert.sys
Documentation
Basic documentation on how to use the SDK and tools, with pointers to
the main API documents is here.
Filing Bugs
Bugs can be filed using the existing iQue bug database http://172.16.10.99/bugzilla
A new product category "NetCard" has been created with 2 new components:
- SDK - file all bugs related to the SDK and software
- Hardware - file all hardware problems
Please file bugs in English and provide a detailed explanation of
the conditions which caused the bug and how it can be reproduced.
Changes and Bug Fixes in SDK version 1.1
Here is a list of the differences between SDK 1.0 and SDK 1.1:
-
Game state saving now works. GBA games should be able to use SRAM, Flash or EEROM state
saving, although only a limited number of each type have been tested by BroadOn.
-
An MP3 player has been added, including the source:
see $ROOT/usr/src/gba/apps/mplayer.
-
The PKI used for publishing games has been changed. This means that
all games will need to be republished after upgrading from SDK 1.0 to
SDK 1.1.
-
Several bugs that caused GBA communication with the NC to be unreliable
have been fixed.
-
Several problems with Link Cable Emulation have been fixed in version 1.1.
-
In SDK 1.0, install a viewer containing an ELF segment of 0 length would cause
the system to hang and not respond to USB, thus disabling the NetCard.
This bug has been fixed in SDK 1.1.
-
Source for diagnostics running on the NetCard are provided
in the directory $ROOT/usr/src/gba/manufacture.
Changes and Bug Fixes in SDK version 1.2
Here is a list of the differences between SDK 1.1 and SDK 1.2:
-
Ecommerce libraries are provided for the first time in SDK 1.2.
See VNG online documentation for details.
-
The USB vendor ID and product ID for the NetCard have been changed to use iQue's
official Vendor ID.
This requires new USB drivers to be installed on the PC (included with the SDK images).
-
The booting software for NetCard is converted to be authenticated. This has no direct
impact on NetCard developers other than requiring a careful upgrade process from previous
SDK releases to release 1.2.
-
A media file library is provided that allows access from the PC to the file
system on the NetCard over USB. This library is intended to be used in building
an application on the PC that manages unlicensed media content on the NetCard.
Sample source code for a PC application using this library is provided in SDK 1.2
under $ROOT/usr/src/tools/mdshell.
-
The directory structure used to store game executables has been changed in SDK 1.2.
All games and data files need to be reloaded on the NetCard after the 1.2 upgrade.
It is recommended that the card be formatted before reloading the games and data files.
-
The identity of the GBA game process is now set to allow access to the
game's data directory (bug 1625).
Changes and Bug Fixes in SDK version 1.3
Here is a list of the differences between SDK 1.2 and SDK 1.3:
-
eTicket support for the subscription model.
-
eCommerce library provides interface to PC proxy and server modules.
-
Support for integration between Viewer and LCE library for passing active VN session from the
Viewer to a game.
-
The Link Cable Emulation (LCE) support now works at full speed for Mario Kart.
-
The authentication algorithm used by the Secure Flash File System has been changed
and this requires all SFFS file systems to be rebuilt after the 1.3 upgrade.
The upgrade process will automatically reformat the file system and all data must
be reloaded.
-
The NC support for the Media FS library is now included in the devmon.wad, so
no special action is required in order to use the NC Media Library from the PC.
-
The mp3 player has been changed to look for mp3 files under /media/music,
instead of /music.
-
A bug in NC IOS software was fixed that was causing the iQue viewer to kill
the NetCard (bug 1672).
Changes and Bug Fixes in SDK version 1.4
Here is a list of the differences between SDK 1.3 and SDK 1.4:
-
The voice chat functionality is included for the first time.
-
The Virtual Network (VN) has been converted to use encryption.
-
The mp3 player has been converted to use a different MP3 decoder library.
Changes and Bug Fixes in SDK version 1.5
Here is a list of the differences between SDK 1.4 and SDK 1.5:
-
Support for subscription ecards and personalized subscription
eTickets has been added. Note that in order to use these features,
the NetCard must have been preprogrammed with a personalized ID.
The original hardware release of NetCards are not capable of being
programmed with a personalized ID.
Only the cards produced in April 2006 and beyond have this capability.
-
Forward error correction has been implemented for Link Cable Emulation (LCE).
-
The problems with Mario Kart and LCE have been resolved in this release.
-
Voice chat now works.
-
The mp3 player module now has the "launch" logic added so that it can
be directly linked to the iQue Viewer in binary form instead of requiring
iQue to modify the source to the MP3 player.
The iQue Viewer can use $ROOT/usr/bin/sc/mp3.elf as the NC side of
the Viewer (the -n option to arm-elf-merge) to create a Viewer that
contains MP3 playback capability.
Note that mp3.elf is now located at address 0x900000, which should
not conflict with the addresses used by the iQue Viewer.
Changes and Bug Fixes in SDK version 1.6
Here is a list of the differences between SDK 1.5 and SDK 1.6:
-
USB Mass Storage Device support has been added to
NetCard IOS.
This allows automatic installation of PC software when first connecting
the NetCard without depending on external media (e.g. CDROM).
Please see $ROOT/usr/src/sc/pkg for sample code and documentation.
-
The MP3 player Resource Manager has been restructured as a library to make
it easier to integrate with the iQue Viewer without needing to generate the
entire MP3 player from source.
Source code is provided for a new "main" routine that links with both
the MP3 RM library and the Voice RM library and also includes the
logic for starting the GBA side of the Viewer.
Please see the source file $ROOT/usr/src/sc/mp3/mp3_main.c.
This main routine provides a RM interface (/dev/media/control) to the GBA to allow the
Viewer to start and stop both the Voice and MP3 player RMs.
Before launching a game, the Viewer should stop both RMs.
The mp3.elf file is still provided as before, but it now includes the
/dev/media/control resource manager as described above.
-
The viewer will now load correctly on a DS configured in manual mode.
Changes and Bug Fixes in SDK version 1.7
Here is a list of the differences between SDK 1.6 and SDK 1.7:
-
Several VNG related executables were missing in 1.6.
-
A bug was fixed in boot1.aes that caused personalized NetCards to fail in 1.6.
Changes and Bug Fixes in SDK version 1.8
Here is a list of the differences between SDK 1.7 and SDK 1.8:
Changes and Bug Fixes in SDK version 1.9
Here is a list of the differences between SDK 1.8 and SDK 1.9:
-
The header file and library for libaudbuf are now included in the SDK (audbuf.h and libaudbuf.a).
-
A bug in the Flash File System (SFFS) was fixed which could cause corrupted files to be created.
-
A new API was added to the ES shim library to return the size of a TMD data structure (variable size).
The call is ES_GetTmdSize.
See $ROOT/usr/include/es.h for the function prototype.
-
Support was added for NAND flash parts up to 512MB in size.
-
The USB driver no longer pulls up on the D+ line unless the device is
actively connected to the PC or is being enumerated.
-
The USB driver supports a choice of USB MSD "fixed disk" or "removable disk".
This feature allows software installation from the NetCard on a Windows
2003 Server machine.
Example source code is provided
showing how to change the NetCard's USB personality
between normal bulk mode (for use with VNG or ncshell) and the two
possible USB MSD modes.
See $ROOT/usr/src/sc/pkg for details.
Changes and Bug Fixes in SDK version 1.10
Here is a list of the differences between SDK 1.9 and SDK 1.10:
-
A new API is provided to cancel a title import operation (in case the
network access goes away or the operation times out):
ES_ImportTitleCancel.
-
A bug in the USB driver on the NetCard was fixed that was causing the PC to
become slow and need to be rebooted.
-
ES_DeleteTitle now deletes all files under the /title/idH/idL directory,
including any game data files under /title/idH/idL/data.
-
ES_SetUid now allows the viewer to delete or access game data files.
-
Sample code is provided showing the method of updating the Viewer and Boot2.
See $ROOT/usr/src/gba/viewer/eTicket.c.
-
Sample code is provided showing how the Viewer can manipulate saved data
files belonging to games.
See $ROOT/usr/src/gba/viewer/delData.c.
Changes and Bug Fixes in SDK version 1.11
Here is a list of the differences between SDK 1.10 and SDK 1.11:
-
The filenames of all "wad" files has been changed to use the extension
.bwf instead of .wad. BWF is an abbreviation for
BroadOn Wad Format and distinguishes this wad file format from
the extended wad format used for Wii (still called .wad).
-
A bug was fixed in ES_GetConsumption that caused it to return error
-1017 (ES_ERR_INVAL) under certain circumstances.
-
Garbage collection operations in the SFFS have been modified to
do fewer commits of FAT blocks to avoid premature wear.
-
Use of the "copyback" and "cache programming" modes of all flash
parts has been disabled for greater robustness.
-
Performance of some crypto operations was improved significantly.
-
Startup of the system is faster in 1.11 because some optimizations
made to the ES startup code.
-
The ES API does more thorough checking that stateful callls are made
in the correct order.
-
ISFS_GetUsage call was added. This call takes a directory name and
returns the number of FS blocks and inodes consumed by the subtree
rooted at that directory (analogous to "du" command in linux).
-
ES_Sign and ES_VerifySign calls were added.
-
Unused crypto calls were removed (e.g. IOSC_GenerateKeyWithRandoms).
This change causes the system call table to change, so ELF files
built on SDK 1.10 are not compatible with 1.11 runtime software.