Cpwrite, Cpcancel, Downloading files – Sundance SMT6035 v.2.2 User Manual

Page 17: Binaryload, 13 downloading files

Advertising
background image

Version 2.2

Page 17 of 39

SMT6035 User Manual

nBytes

The number of bytes read from the comport.

12.2 CpWrite

Writes data to the comport.

Prototype:

void IFHw::CpWrite( const void *pData, UINT nBytes )

Parameters:

pData

Pointer to the buffer containing the data to write to the
comport.

nBytes

The number of bytes to be written.

12.3 CpCancel

Cancels any pending comport operation. Pending operations are those that
have been started but still haven’t reached completion. For example, suppose
that a thread is calling CpRead() and is waiting for the DSP to write some data.
Now, if some other thread calls CpCancel(), an exception will be raised in the
thread that started the read operation. The exception will be of type SMTExc.

Prototype:

void IFHw::CpCancel( void )

13 Downloading files

The host comport is the standard route for loading programs into your DSP.
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 its comports. The first
comport to become active is selected and the data it provides is loaded into the
DSP and executed. The host comport only gives you access to the Root TIM of
your DSP board. You can 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
network to be loaded. It is important that the file you specify to be a multiple of 4

User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.

Advertising