Cpwrite, Cpcancel, Downloading files – Sundance SMT6025 v.2.9 User Manual
Page 17: Binaryload, 13 downloading files

Version 2.9
Page 17 of 45
SMT6025 User Manual
nBytes
The number of bytes to read from the comport.
12.2 CpWrite
Write data to the comport.
Prototype:
void IFHw::CpWrite( const void *pData, UINT nBytes )
Parameters:
pData
Pointer to the buffer that contains the data to write to the
comport.
nBytes
The number of bytes to write.
12.3 CpCancel
Cancel any pending comport operations. Pending operations are comport
operations that have been started but have not yet completed. For example:
Assume a thread is calling CpRead() and is waiting for the DSP to write some
data. Now assume that some other thread calls CpCancel(). In this case an
exception will be raised in the thread that started the operation CpRead()
operation. The exception will be of the type SMTExc.
Prototype:
void IFHw::CpCancel( void )
13 Downloading files
The host comport is the standard route for loading programs into your DSP
network.
Each TIM in your system will load a “bootloader” from its flash ROM when it
comes out of reset. This bootloader performs various housekeeping operations to
initialise the TIM and then waits until data arrives on any of it’s comports. The first
comport to become active is selected and the data it provides are loaded into the
DSP and executed. The host comport only gives you access to the Root TIM of
your DSP board. You must load any other TIMs in your system indirectly via the
root with explicit code. This is done automatically if you are loading a 3L Diamond
application.
13.1 BinaryLoad
The contents of the specified file will be sent down the host link unchanged, one
32-bit word at a time. Each 32-bit word is constructed from four bytes in the file,
the least significant byte coming first. This function is most commonly used to
load Diamond .app files that contain information allowing all processors in a
User Manual (QCF42); Version 2.9, 22/02/02; © Sundance Multiprocessor Technology Ltd. 2002