The External Netboot library contains netboot code that can be invoked independently from the ROM. This library provides the latest NetBoot code that adds the following features:
This library works with IPv4 only.
The External Netboot library cannot reprogram the same flash chip it is running from, i.e. you need two separate flash memories.
Note that debug symbols have to be turned off in order to avoid a linker error (the linker cannot handle line numbers greater than 65534 and will return an "L220" error when debug symbols are enabled).
From assembly language: Jump to the XNETBOOT symbol. The r7 register needs to contain the desired clock multiplier.
Example:
#include <REG400.H>
EXTERN ECODE(XNETBOOT)
name ?C_STARTUP
public ?C_STARTUP
?C_CPURESET?0 segment code at 400000H ; Change this address
rseg ?C_CPURESET?0
?C_STARTUP: sjmp past_loader_tag
db 'TINI' ; Make sure the ROM can find us
db byte2(?C_STARTUP) ; Target bank
past_loader_tag:
; ...
mov r7, #2 ; x2 multiplier
ljmp XNETBOOT
From C: Call the xnetboot_boot() function. The function does not return.