01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Top of list<br />

Index page<br />

Usage of the TCP/IP API<br />

Top of list<br />

Index page<br />

1. Processing of a socket callback functions (see Register callback) should be kept at a minimum<br />

to prevent stack overflows.<br />

2. Declaring of socket callback functions with Borland C:<br />

void huge my_callback(int socketdescriptor, int eventflagmask)<br />

3. Declaring of socket callback functions with Microsoft C:<br />

void far _saveregs _loadds my_callback(int sd, int eventmask)<br />

4. The internal TCP/IP stack of the <strong>IPC<strong>@CHIP</strong></strong> allocates memory for buffers smaller than 4096 bytes<br />

from a pre-allocated memory block. Larger buffers are allocated direct from the CHIP-<strong>RTOS</strong>. If<br />

user TCP/IP network communication sends/receives packets with a size larger than 4096 bytes,<br />

the user application should not use all available memory in the <strong>IPC<strong>@CHIP</strong></strong> because of these<br />

additional allocations. There should be in that case always a minimum of 30-40 KBytes of free<br />

available memory in the <strong>IPC<strong>@CHIP</strong></strong>. The mem command shows the whole memory list of the<br />

<strong>IPC<strong>@CHIP</strong></strong> at runtime. The maximum amount of TCP/IP memory can be configured at chip.ini<br />

(see Set TCP/IP memory size). The application programmer can reduce or increase this size in<br />

chip.ini. With the API call Get TCP/IP memory info it is possible to control the TCP/IP memory<br />

usage at the application runtime.<br />

TCP/IP API<br />

General notes for the usage of the DOS and <strong>@CHIP</strong>-<strong>RTOS</strong> int API calls<br />

1. At the start of a user program the Stdio focus should be set to USER. Before ending the<br />

application switch the focus back to SHELL or BOTH (see Set Stdio focus).<br />

2. If more than one user program runs in the <strong>IPC<strong>@CHIP</strong></strong>, only one of them should read characters<br />

from Stdin<br />

3. The functionality of most of the shell commands is also available through calls into the <strong>@CHIP</strong>-<br />

<strong>RTOS</strong> INT API. If not, use the <strong>@CHIP</strong>-<strong>RTOS</strong> INT call Execute a shell command. This call<br />

executes a shell command from inside the user application.<br />

4. Install a fatal user error handler, which does a reboot of the <strong>IPC<strong>@CHIP</strong></strong> with Install user fatal<br />

error handler<br />

5. Used software interrupts (all others are free for use):<br />

0x00 - Reserved (<strong>@CHIP</strong>-<strong>RTOS</strong> Divide Overflow Handler)<br />

0x01 - Reserved (Debugger Trace Interrupt)<br />

0x02 - Reserved (Hardware Non-Maskable Interrupt (NMI))<br />

0x03 - Reserved (Debugger Breakpoint Interrupt)<br />

0x04 - Reserved (<strong>@CHIP</strong>-<strong>RTOS</strong> INTO Overflow Handler)<br />

0x05 - Reserved (<strong>@CHIP</strong>-<strong>RTOS</strong> Array Bounds Exception Handler)<br />

Page 9 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!