- Implemented TCP/IP communication interface for the bootloader with support for the LM3S target. Demo program does not yet re-activate the bootloader.

git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@91 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
Frank Voorburg 2014-07-15 15:01:42 +00:00
parent 0d4b8dd196
commit 677ebf8a15
456 changed files with 115279 additions and 12544 deletions

View File

@ -113,6 +113,7 @@ type
private
FIsConnected : Boolean;
FTimerInterval : array[1..7] of Word;
FConnectCmdTimer : Word;
FIsIntel : Boolean;
FCtoPacketLen : Byte;
FCtoPGMPacketLen : Byte;
@ -144,7 +145,7 @@ type
destructor Destroy; override;
function GetLastError(var info : string) : Byte;
procedure Configure(iniFile : string);
procedure Connect;
function Connect : Boolean;
procedure Disconnect;
function StartProgrammingSession : Boolean;
function StopProgrammingSession : Boolean;
@ -196,6 +197,10 @@ begin
FTimerInterval[5] := 1000; // t5 = 1000ms - write and reset timeout
FTimerInterval[6] := 1000; // t6 = 1000ms - user specific connect
FTimerInterval[7] := 2000; // t7 = 2000ms - wait timer
// the connect command does not have a protocol specified timeout value. However, this
// timeout is important for the OpenBLT timed backdoor feature. The backdoor time should
// be at least 2.5 times the length of this timeout value.
FConnectCmdTimer := 20; // 20 ms - connect command
// create instance of XCP transport layer object
comDriver := TXcpTransport.Create;
@ -363,10 +368,11 @@ begin
FSeedKeyDll := ExtractFilePath(ParamStr(0))+FSeedKeyDll;
FTimerInterval[1] := settingsIni.ReadInteger('xcp', 't1', 1000);
FTimerInterval[3] := settingsIni.ReadInteger('xcp', 't3', 1000);
FTimerInterval[4] := settingsIni.ReadInteger('xcp', 't4', 1000);
FTimerInterval[3] := settingsIni.ReadInteger('xcp', 't3', 2000);
FTimerInterval[4] := settingsIni.ReadInteger('xcp', 't4', 10000);
FTimerInterval[5] := settingsIni.ReadInteger('xcp', 't5', 1000);
FTimerInterval[7] := settingsIni.ReadInteger('xcp', 't7', 1000);
FTimerInterval[7] := settingsIni.ReadInteger('xcp', 't7', 2000);
FConnectCmdTimer := settingsIni.ReadInteger('xcp', 'tconnect', 20);
// release ini file object
settingsIni.Free;
@ -380,15 +386,23 @@ end; //*** end of Configure ***
//***************************************************************************************
// NAME: Connect
// PARAMETER: none
// RETURN VALUE: none
// RETURN VALUE: True if connected, False otherwise.
// DESCRIPTION: Connects the XCP transport layer
//
//***************************************************************************************
procedure TXcpLoader.Connect;
function TXcpLoader.Connect : Boolean;
begin
// connect the XCP transport layer
comDriver.Connect;
FIsConnected := true;
if comDriver.Connect = true then
begin
FIsConnected := true;
result := true;
end
else
begin
FIsConnected := false;
result := false;
end;
end; //*** end of Connect ***
@ -539,7 +553,7 @@ begin
// send out the command with 20ms timeout. note that this timeout is not required at
// all by the XCP protocol. here it is set quite short to accomodate the OpenBTL
// bootloader default backdoor entry feature
if comDriver.SendPacket(20) then
if comDriver.SendPacket(FConnectCmdTimer) then
begin
// check to see if it was an error packet
if comDriver.packetData[0] = kCmdPidERR then

View File

@ -86,6 +86,8 @@ type
edtTransmitId: TEdit;
edtReceiveId: TEdit;
openDialog: TOpenDialog;
edtTconnect: TEdit;
lblTconnect: TLabel;
procedure btnOKClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure btnBrowseClick(Sender: TObject);
@ -224,6 +226,7 @@ begin
FSettingsForm.edtT4.Text := IntToStr(settingsIni.ReadInteger('xcp', 't4', 10000));
FSettingsForm.edtT5.Text := IntToStr(settingsIni.ReadInteger('xcp', 't5', 1000));
FSettingsForm.edtT7.Text := IntToStr(settingsIni.ReadInteger('xcp', 't7', 2000));
FSettingsForm.edtTconnect.Text := IntToStr(settingsIni.ReadInteger('xcp', 'tconnect', 20));
// release ini file object
settingsIni.Free;
@ -246,7 +249,7 @@ begin
FSettingsForm.edtT4.Text := IntToStr(10000);
FSettingsForm.edtT5.Text := IntToStr(1000);
FSettingsForm.edtT7.Text := IntToStr(2000);
FSettingsForm.edtTconnect.Text := IntToStr(20);
end;
// show the form as modal so we can get the result here
@ -272,6 +275,7 @@ begin
settingsIni.WriteInteger('xcp', 't4', StrToInt(FSettingsForm.edtT4.Text));
settingsIni.WriteInteger('xcp', 't5', StrToInt(FSettingsForm.edtT5.Text));
settingsIni.WriteInteger('xcp', 't7', StrToInt(FSettingsForm.edtT7.Text));
settingsIni.WriteInteger('xcp', 'tconnect', StrToInt(FSettingsForm.edtTconnect.Text));
// release ini file object
settingsIni.Free;

View File

@ -73,7 +73,7 @@ type
pcanDriver : TPCanDriver;
constructor Create;
procedure Configure(iniFile : string);
procedure Connect;
function Connect: Boolean;
function SendPacket(timeOutms: LongWord): Boolean;
procedure Disconnect;
destructor Destroy; override;
@ -187,15 +187,15 @@ end; //*** end of Configure ***
//***************************************************************************************
// NAME: Connect
// PARAMETER: none
// RETURN VALUE: none
// RETURN VALUE: True if successful, False otherwise.
// DESCRIPTION: Connects the transport layer device.
//
//***************************************************************************************
procedure TXcpTransport.Connect;
function TXcpTransport.Connect: Boolean;
begin
result := true;
if not pcanDriver.Connect then
Application.MessageBox( 'Could not connect to CAN bus.',
'Error', MB_OK or MB_ICONERROR );
result := false;
end; //*** end of Connect ***

View File

@ -31,5 +31,5 @@
-M
-$M16384,1048576
-K$00400000
-E../../../../
-LNc:\program files (x86)\borland\delphi4\Lib
-E../../../../../
-LNc:\borland\delphi4\Lib

View File

@ -39,7 +39,7 @@ MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=../../../../
OutputDir=../../../../../
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
@ -82,6 +82,7 @@ $(DELPHI)\Lib\dclusr40.bpl=Borland User
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlOutputDirectorry]
Count=2
Item0=../../../../
Item1=../../../
Count=3
Item0=../../../../../
Item1=../../../../
Item2=../../../

View File

@ -262,27 +262,37 @@ begin
timer.Enabled := False;
// connect the transport layer
MbiCallbackOnLog('Connecting the transport layer. t='+TimeToStr(Time));
loader.Connect;
MbiCallbackOnInfo('Connecting to the CAN interface.');
MbiCallbackOnLog('Connecting to the CAN interface. t='+TimeToStr(Time));
Application.ProcessMessages;
if not loader.Connect then
begin
// update the user info
MbiCallbackOnError('Could not connect to CAN interface. Check your configuration.');
MbiCallbackOnLog('Could not connect to CAN interface. Check your configuration and try again. t='+TimeToStr(Time));
Exit;
end;
//---------------- start the programming session --------------------------------------
MbiCallbackOnLog('Starting the programming session. t='+TimeToStr(Time));
// try initial connect via XCP
if not loader.StartProgrammingSession then
begin
// update the user info
MbiCallbackOnInfo('Could not connect. Please reset your target...');
MbiCallbackOnLog('Connect failed. Switching to backdoor entry mode. t='+TimeToStr(Time));
Application.ProcessMessages;
end;
while not loader.StartProgrammingSession do
begin
Application.ProcessMessages;
Sleep(5);
if stopRequest then
// continuously try to connect via XCP true the backdoor
while not loader.StartProgrammingSession do
begin
MbiCallbackOnError('Programming session cancelled by user.');
Exit;
Application.ProcessMessages;
Sleep(5);
if stopRequest then
begin
MbiCallbackOnError('Programming session cancelled by user.');
Exit;
end;
end;
end;

View File

@ -86,6 +86,8 @@ type
edtTransmitId: TEdit;
edtReceiveId: TEdit;
openDialog: TOpenDialog;
edtTconnect: TEdit;
lblTconnect: TLabel;
procedure btnOKClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure btnBrowseClick(Sender: TObject);
@ -224,6 +226,7 @@ begin
FSettingsForm.edtT4.Text := IntToStr(settingsIni.ReadInteger('xcp', 't4', 10000));
FSettingsForm.edtT5.Text := IntToStr(settingsIni.ReadInteger('xcp', 't5', 1000));
FSettingsForm.edtT7.Text := IntToStr(settingsIni.ReadInteger('xcp', 't7', 2000));
FSettingsForm.edtTconnect.Text := IntToStr(settingsIni.ReadInteger('xcp', 'tconnect', 20));
// release ini file object
settingsIni.Free;
@ -246,7 +249,7 @@ begin
FSettingsForm.edtT4.Text := IntToStr(10000);
FSettingsForm.edtT5.Text := IntToStr(1000);
FSettingsForm.edtT7.Text := IntToStr(2000);
FSettingsForm.edtTconnect.Text := IntToStr(20);
end;
// show the form as modal so we can get the result here
@ -272,6 +275,7 @@ begin
settingsIni.WriteInteger('xcp', 't4', StrToInt(FSettingsForm.edtT4.Text));
settingsIni.WriteInteger('xcp', 't5', StrToInt(FSettingsForm.edtT5.Text));
settingsIni.WriteInteger('xcp', 't7', StrToInt(FSettingsForm.edtT7.Text));
settingsIni.WriteInteger('xcp', 'tconnect', StrToInt(FSettingsForm.edtTconnect.Text));
// release ini file object
settingsIni.Free;

View File

@ -74,7 +74,7 @@ type
canDriver : TCanDriver;
constructor Create;
procedure Configure(iniFile : string);
procedure Connect;
function Connect: Boolean;
function SendPacket(timeOutms: LongWord): Boolean;
procedure Disconnect;
destructor Destroy; override;
@ -205,15 +205,15 @@ end; //*** end of Configure ***
//***************************************************************************************
// NAME: Connect
// PARAMETER: none
// RETURN VALUE: none
// RETURN VALUE: True if successful, False otherwise.
// DESCRIPTION: Connects the transport layer device.
//
//***************************************************************************************
procedure TXcpTransport.Connect;
function TXcpTransport.Connect: Boolean;
begin
result := true;
if not canDriver.Connect then
Application.MessageBox( 'Could not connect to CAN bus.',
'Error', MB_OK or MB_ICONERROR );
result := false;
end; //*** end of Connect ***

View File

@ -31,5 +31,5 @@
-M
-$M16384,1048576
-K$00400000
-E../../../../
-LNc:\program files (x86)\borland\delphi4\Lib
-E../../../../../
-LNc:\borland\delphi4\Lib

View File

@ -39,7 +39,7 @@ MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=../../../../
OutputDir=../../../../../
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
@ -82,5 +82,6 @@ $(DELPHI)\Lib\dclusr40.bpl=Borland User
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlOutputDirectorry]
Count=1
Item0=../../../../
Count=2
Item0=../../../../../
Item1=../../../../

View File

@ -262,27 +262,37 @@ begin
timer.Enabled := False;
// connect the transport layer
MbiCallbackOnLog('Connecting the transport layer. t='+TimeToStr(Time));
loader.Connect;
MbiCallbackOnInfo('Connecting to the CAN interface.');
MbiCallbackOnLog('Connecting to the CAN interface. t='+TimeToStr(Time));
Application.ProcessMessages;
if not loader.Connect then
begin
// update the user info
MbiCallbackOnError('Could not connect to CAN interface. Check your configuration.');
MbiCallbackOnLog('Could not connect to CAN interface. Check your configuration and try again. t='+TimeToStr(Time));
Exit;
end;
//---------------- start the programming session --------------------------------------
MbiCallbackOnLog('Starting the programming session. t='+TimeToStr(Time));
// try initial connect via XCP
if not loader.StartProgrammingSession then
begin
// update the user info
MbiCallbackOnInfo('Could not connect. Please reset your target...');
MbiCallbackOnLog('Connect failed. Switching to backdoor entry mode. t='+TimeToStr(Time));
Application.ProcessMessages;
end;
while not loader.StartProgrammingSession do
begin
Application.ProcessMessages;
Sleep(5);
if stopRequest then
// continuously try to connect via XCP true the backdoor
while not loader.StartProgrammingSession do
begin
MbiCallbackOnError('Programming session cancelled by user.');
Exit;
Application.ProcessMessages;
Sleep(5);
if stopRequest then
begin
MbiCallbackOnError('Programming session cancelled by user.');
Exit;
end;
end;
end;

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,274 @@
unit XcpSettings;
//***************************************************************************************
// Description: XCP settings interface for NET (TCP/IP)
// File Name: XcpSettings.pas
//
//---------------------------------------------------------------------------------------
// C O P Y R I G H T
//---------------------------------------------------------------------------------------
// Copyright (c) 2014 by Feaser http://www.feaser.com All rights reserved
//
// This software has been carefully tested, but is not guaranteed for any particular
// purpose. The author does not offer any warranties and does not guarantee the accuracy,
// adequacy, or completeness of the software and is not responsible for any errors or
// omissions or the results obtained from use of the software.
//
//---------------------------------------------------------------------------------------
// L I C E N S E
//---------------------------------------------------------------------------------------
// This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with OpenBLT.
// If not, see <http://www.gnu.org/licenses/>.
//
// A special exception to the GPL is included to allow you to distribute a combined work
// that includes OpenBLT without being obliged to provide the source code for any
// proprietary components. The exception text is included at the bottom of the license
// file <license.html>.
//
//***************************************************************************************
interface
//***************************************************************************************
// Includes
//***************************************************************************************
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls, ExtCtrls, IniFiles;
//***************************************************************************************
// Type Definitions
//***************************************************************************************
type
TXcpSettingsForm = class(TForm)
pnlFooter: TPanel;
btnOK: TButton;
btnCancel: TButton;
pageControl: TPageControl;
tabXcp: TTabSheet;
tabNet: TTabSheet;
iconNet: TImage;
lblNet: TLabel;
lblXcp: TLabel;
iconXcp2: TImage;
lblNetport: TLabel;
lblT1: TLabel;
lblT3: TLabel;
lblT4: TLabel;
lblT5: TLabel;
lblT7: TLabel;
edtT1: TEdit;
edtT3: TEdit;
edtT4: TEdit;
edtT5: TEdit;
edtT7: TEdit;
tabProt: TTabSheet;
iconXcp1: TImage;
lblPort: TLabel;
edtSeedKey: TEdit;
btnBrowse: TButton;
openDialog: TOpenDialog;
lblNethost: TLabel;
edtHostname: TEdit;
edtPort: TEdit;
edtTconnect: TEdit;
lblTconnect: TLabel;
procedure btnOKClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure btnBrowseClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
TXcpSettings = class(TObject)
private
FSettingsForm : TXcpSettingsForm;
FIniFile : string;
public
constructor Create(iniFile : string);
destructor Destroy; override;
function Configure : Boolean;
end;
implementation
{$R *.DFM}
//***************************************************************************************
// NAME: btnOKClick
// PARAMETER: none
// RETURN VALUE: modal result
// DESCRIPTION: Sets the module result to okay.
//
//***************************************************************************************
procedure TXcpSettingsForm.btnOKClick(Sender: TObject);
begin
ModalResult := mrOK;
end; //*** end of btnOKClick ***
//***************************************************************************************
// NAME: btnCancelClick
// PARAMETER: none
// RETURN VALUE: modal result
// DESCRIPTION: Sets the module result to cancel.
//
//***************************************************************************************
procedure TXcpSettingsForm.btnCancelClick(Sender: TObject);
begin
ModalResult := mrCancel;
end; //*** end of btnCancelClick ***
//***************************************************************************************
// NAME: btnBrowseClick
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Prompts the user to select the seed/key dll file.
//
//***************************************************************************************
procedure TXcpSettingsForm.btnBrowseClick(Sender: TObject);
begin
openDialog.InitialDir := ExtractFilePath(ParamStr(0));
if openDialog.Execute then
begin
edtSeedKey.Text := openDialog.FileName;
end;
end; //*** end of btnBrowseClick ***
//***************************************************************************************
// NAME: Create
// PARAMETER: Name of the INI file where the settings are and will be stored
// RETURN VALUE: none
// DESCRIPTION: Class constructor
//
//***************************************************************************************
constructor TXcpSettings.Create(iniFile : string);
begin
// call inherited constructor
inherited Create;
// set the inifile
FIniFile := iniFile;
// create an instance of the settings form
FSettingsForm := TXcpSettingsForm.Create(nil);
end; //*** end of Create ***
//***************************************************************************************
// NAME: Destroy
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Class destructor
//
//***************************************************************************************
destructor TXcpSettings.Destroy;
begin
// releaase the settings form object
FSettingsForm.Free;
// call inherited destructor
inherited;
end; //*** end of Destroy ***
//***************************************************************************************
// NAME: Configure
// PARAMETER: none
// RETURN VALUE: True if configuration was successfully changed, False otherwise
// DESCRIPTION: Allows the user to configure the XCP interface using a GUI.
//
//***************************************************************************************
function TXcpSettings.Configure : Boolean;
var
settingsIni: TIniFile;
begin
// initialize the return value
result := false;
// init the form elements using the configuration found in the INI
if FileExists(FIniFile) then
begin
// create ini file object
settingsIni := TIniFile.Create(FIniFile);
// NET related elements
FSettingsForm.edtHostname.Text := settingsIni.ReadString('net', 'hostname', '169.254.19.63');
FSettingsForm.edtPort.Text := settingsIni.ReadString('net', 'port', '1000');
// XCP related elements
FSettingsForm.edtSeedKey.Text := settingsIni.ReadString('xcp', 'seedkey', ExtractFilePath(ParamStr(0))+'');
FSettingsForm.edtT1.Text := IntToStr(settingsIni.ReadInteger('xcp', 't1', 1000));
FSettingsForm.edtT3.Text := IntToStr(settingsIni.ReadInteger('xcp', 't3', 2000));
FSettingsForm.edtT4.Text := IntToStr(settingsIni.ReadInteger('xcp', 't4', 10000));
FSettingsForm.edtT5.Text := IntToStr(settingsIni.ReadInteger('xcp', 't5', 1000));
FSettingsForm.edtT7.Text := IntToStr(settingsIni.ReadInteger('xcp', 't7', 2000));
FSettingsForm.edtTconnect.Text := IntToStr(settingsIni.ReadInteger('xcp', 'tconnect', 300));
// release ini file object
settingsIni.Free;
end
else
begin
// set defaults
// NET related elements
FSettingsForm.edtHostname.Text := '169.254.19.63';
FSettingsForm.edtPort.Text := '1000';
// XCP related elements
FSettingsForm.edtSeedKey.Text := ExtractFilePath(ParamStr(0))+'';
FSettingsForm.edtT1.Text := IntToStr(1000);
FSettingsForm.edtT3.Text := IntToStr(2000);
FSettingsForm.edtT4.Text := IntToStr(10000);
FSettingsForm.edtT5.Text := IntToStr(1000);
FSettingsForm.edtT7.Text := IntToStr(2000);
FSettingsForm.edtTconnect.Text := IntToStr(300);
end;
// show the form as modal so we can get the result here
if FSettingsForm.ShowModal = mrOK then
begin
if FIniFile <> '' then
begin
// create ini file object
settingsIni := TIniFile.Create(FIniFile);
// NET related elements
settingsIni.WriteString('net', 'hostname', FSettingsForm.edtHostname.Text);
settingsIni.WriteString('net', 'port', FSettingsForm.edtPort.Text);
// XCP related elements
settingsIni.WriteString('xcp', 'seedkey', FSettingsForm.edtSeedKey.Text);
settingsIni.WriteInteger('xcp', 't1', StrToInt(FSettingsForm.edtT1.Text));
settingsIni.WriteInteger('xcp', 't3', StrToInt(FSettingsForm.edtT3.Text));
settingsIni.WriteInteger('xcp', 't4', StrToInt(FSettingsForm.edtT4.Text));
settingsIni.WriteInteger('xcp', 't5', StrToInt(FSettingsForm.edtT5.Text));
settingsIni.WriteInteger('xcp', 't7', StrToInt(FSettingsForm.edtT7.Text));
settingsIni.WriteInteger('xcp', 'tconnect', StrToInt(FSettingsForm.edtTconnect.Text));
// release ini file object
settingsIni.Free;
// indicate that the settings where successfully updated
result := true;
end;
end;
end; //*** end of Configure ***
end.
//******************************** end of XcpSettings.pas *******************************

Binary file not shown.

View File

@ -0,0 +1,426 @@
unit XcpTransport;
//***************************************************************************************
// Description: XCP transport layer for SCI.
// File Name: XcpTransport.pas
//
//---------------------------------------------------------------------------------------
// C O P Y R I G H T
//---------------------------------------------------------------------------------------
// Copyright (c) 2014 by Feaser http://www.feaser.com All rights reserved
//
// This software has been carefully tested, but is not guaranteed for any particular
// purpose. The author does not offer any warranties and does not guarantee the accuracy,
// adequacy, or completeness of the software and is not responsible for any errors or
// omissions or the results obtained from use of the software.
//
//---------------------------------------------------------------------------------------
// L I C E N S E
//---------------------------------------------------------------------------------------
// This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with OpenBLT.
// If not, see <http://www.gnu.org/licenses/>.
//
// A special exception to the GPL is included to allow you to distribute a combined work
// that includes OpenBLT without being obliged to provide the source code for any
// proprietary components. The exception text is included at the bottom of the license
// file <license.html>.
//
//***************************************************************************************
interface
//***************************************************************************************
// Includes
//***************************************************************************************
uses
Windows, Messages, SysUtils, Classes, Forms, IniFiles, Winsock, WSocket;
//***************************************************************************************
// Global Constants
//***************************************************************************************
const kMaxPacketSize = 256 + 4; // 4 extra for TCP/IP counter overhead
const kTcpConnectedTimeoutMs = 1000; // timeout for connecting the socket
//***************************************************************************************
// Type Definitions
//***************************************************************************************
type
TXcpTransportInfo = (kNone, kConnected, kResponse, kError);
type
TXcpTransport = class(TObject)
private
comEventInfo : TXcpTransportInfo;
comEvent : THandle;
socket : TWSocket;
hostname : string;
port : string;
croCounter : LongWord;
procedure OnSocketSessionConnected(Sender: TObject; Error: Word);
procedure OnSocketDataAvailable(Sender: TObject; ErrCode: Word);
function MsgWaitForSingleObject(hHandle: THandle; dwMilliseconds: DWORD): DWORD;
public
packetData : array[0..kMaxPacketSize-1] of Byte;
packetLen : Word;
constructor Create;
procedure Configure(iniFile : string);
function Connect: Boolean;
function SendPacket(timeOutms: LongWord): Boolean;
procedure Disconnect;
destructor Destroy; override;
end;
implementation
//***************************************************************************************
// NAME: Create
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Class constructore
//
//***************************************************************************************
constructor TXcpTransport.Create;
begin
// call inherited constructor
inherited Create;
// reset can event info
comEventInfo := kNone;
// create the event that requires manual reset
comEvent := CreateEvent(nil, True, False, nil);
if comEvent = 0 then
Application.MessageBox( 'Could not obtain event placeholder.',
'Error', MB_OK or MB_ICONERROR );
// create a socket instance
socket := TWSocket.Create(nil);
// set the socket event handlers
socket.OnSessionConnected := OnSocketSessionConnected;
socket.OnDataAvailable := OnSocketDataAvailable;
// init CRO counter value
croCounter := 1;
// reset packet length
packetLen := 0;
end; //*** end of Create ***
//***************************************************************************************
// NAME: Destroy
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Class destructor
//
//***************************************************************************************
destructor TXcpTransport.Destroy;
begin
// release socket instance
socket.Free;
// call inherited destructor
inherited;
end; //*** end of Destroy ***
//***************************************************************************************
// NAME: Configure
// PARAMETER: filename of the INI
// RETURN VALUE: none
// DESCRIPTION: Configures both this class from the settings in the INI.
//
//***************************************************************************************
procedure TXcpTransport.Configure(iniFile : string);
var
settingsIni : TIniFile;
begin
// read XCP configuration from INI
if FileExists(iniFile) then
begin
// create ini file object
settingsIni := TIniFile.Create(iniFile);
// configure hostname
hostname := settingsIni.ReadString('net', 'hostname', '169.254.19.63');
// configure port
port := settingsIni.ReadString('net', 'port', '1000');
// release ini file object
settingsIni.Free;
end
else
begin
// configure defeault hostname
hostname := '169.254.19.63';
// configure default port
port := '1000';
end;
end; //*** end of Configure ***
//***************************************************************************************
// NAME: Connect
// PARAMETER: none
// RETURN VALUE: True if connected, False otherwise.
// DESCRIPTION: Connects the transport layer device.
//
//***************************************************************************************
function TXcpTransport.Connect: Boolean;
var
waitResult: Integer;
begin
// make sure the event is reset
ResetEvent(comEvent);
comEventInfo := kNone;
// init CRO counter value
croCounter := 1;
// make sure the socket is closed
if socket.State <> wsClosed then
begin
socket.Close;
socket.WaitForClose;
end;
// set the hostname, port and protocol
socket.Addr := hostname;
socket.Port := port;
socket.Proto := 'tcp';
// submit the connect request
socket.Connect;
// connection is being established. Now wait for the connected event
waitResult := MsgWaitForSingleObject(comEvent, kTcpConnectedTimeoutMs);
if waitResult <> WAIT_OBJECT_0 then
begin
// no com event triggered so either a timeout or internal error occurred
result := false;
Exit;
end;
// com event was triggered. now check that it is actually not an error
if comEventInfo <> kConnected then
begin
result := false;
Exit;
end;
// successfully connected
result := true;
end; //*** end of Connect ***
//***************************************************************************************
// NAME: SendPacket
// PARAMETER: the time[ms] allowed for the reponse from the slave to come in.
// RETURN VALUE: True if response received from slave, False otherwise
// DESCRIPTION: Sends the XCP packet using the data in 'packetData' and length in
// 'packetLen' and waits for the response to come in.
//
//***************************************************************************************
function TXcpTransport.SendPacket(timeOutms: LongWord): Boolean;
var
msgData : array of Byte;
cnt : byte;
waitResult: Integer;
begin
// make sure the event is reset
ResetEvent(comEvent);
comEventInfo := kNone;
// init the return value
result := false;
// prepare the packet. the first 4 bytes contain the CRO counter followed by the actual
// packet data
SetLength(msgData, packetLen+4);
// first store the CRO counter
msgData[0] := Byte(croCounter);
msgData[1] := Byte(croCounter shr 8);
msgData[2] := Byte(croCounter shr 16);
msgData[3] := Byte(croCounter shr 24);
// increment the CRO counter for the next packet
croCounter := croCounter + 1;
// copy the packet data
for cnt := 0 to packetLen-1 do
begin
msgData[cnt+4] := packetData[cnt];
end;
// submit the packet transmission request
if socket.Send(@msgData[0], packetLen+4) = -1 then
begin
// unable to submit tx request
Exit;
end;
// packet is being transmitted. Now wait for the response to come in
waitResult := MsgWaitForSingleObject(comEvent, timeOutms);
if waitResult <> WAIT_OBJECT_0 then
begin
// no com event triggered so either a timeout or internal error occurred
result := False;
Exit;
end;
// com event was triggered. now check if the reponse was correctly received
if comEventInfo <> kResponse then
begin
result := False;
Exit;
end;
// packet successfully transmitted and response packet received
result := True;
end; //*** end of SendPacket ***
//***************************************************************************************
// NAME: Disconnect
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Disconnects the transport layer device.
//
//***************************************************************************************
procedure TXcpTransport.Disconnect;
begin
// close the socket
socket.Close;
socket.WaitForClose;
end; //*** end of Disconnect ***
//***************************************************************************************
// NAME: OnSocketSessionConnected
// PARAMETER: Sender is the source that triggered the event.
// Error contains possible connection error information.
// RETURN VALUE: none
// DESCRIPTION: Socket connected event handler
//
//***************************************************************************************
procedure TXcpTransport.OnSocketSessionConnected(Sender: TObject; Error: Word);
begin
// set event flag
if Error <> 0 then
comEventInfo := kError
else
comEventInfo := kConnected;
// trigger the event
SetEvent(comEvent);
end; //*** end of OnSocketSessionConnected ***
//***************************************************************************************
// NAME: OnSocketDataAvailable
// PARAMETER: Sender is the source that triggered the event.
// Error contains possible data reception error information.
// RETURN VALUE: none
// DESCRIPTION: Socket data reception event handler
//
//***************************************************************************************
procedure TXcpTransport.OnSocketDataAvailable(Sender: TObject; ErrCode: Word);
var
tempBuffer : array[0..kMaxPacketSize-1] of Byte;
count : Integer;
idx : Integer;
begin
count := socket.Receive(@tempBuffer[0], kMaxPacketSize);
// the first 4 bytes contains the dto counter in which we are not really interested
packetLen := count - 4;
// store the response data
for idx := 0 to packetLen-1 do
begin
packetData[idx] := tempBuffer[idx+4];
end;
if packetLen = 0 then
// set event flag
comEventInfo := kError
else
// set event flag
comEventInfo := kResponse;
// trigger the event
SetEvent(comEvent);
end; //*** end of OnSocketDataAvailable ***
//***************************************************************************************
// NAME: MsgWaitForSingleObject
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Improved version of WaitForSingleObject. This version actually
// processes messages in the queue instead of blocking them.
//
//***************************************************************************************
function TXcpTransport.MsgWaitForSingleObject(hHandle: THandle; dwMilliseconds: DWORD): DWORD;
var
dwEnd:DWord;
begin
// compute the time when the WaitForSingleObject is supposed to time out
dwEnd := GetTickCount + dwMilliseconds;
repeat
// wait for an event to happen or a message to be in the queue
result := MsgWaitForMultipleObjects(1, hHandle, False, dwMilliseconds, QS_ALLINPUT);
// a message was in the queue?
if result = WAIT_OBJECT_0 + 1 then
begin
// process these messages
Application.ProcessMessages;
socket.MessagePump;
// check for timeout manually because if a message in the queue occurred, the
// MsgWaitForMultipleObjects will be called again and the timer will start from
// scratch. we need to make sure the correct timeout time is used.
dwMilliseconds := GetTickCount;
if dwMilliseconds < dwEnd then
begin
dwMilliseconds := dwEnd - dwMilliseconds;
end
else
begin
// timeout occured
result := WAIT_TIMEOUT;
Break;
end;
end
else
// the event occured?
begin
// we can stop
Break;
end;
until True = False;
end; //*** end of MsgWaitForSingleObject ***
end.
//******************************** end of XcpTransport.pas ******************************

View File

@ -0,0 +1,436 @@
unit XcpTransport;
//***************************************************************************************
// Description: XCP transport layer for SCI.
// File Name: XcpTransport.pas
//
//---------------------------------------------------------------------------------------
// C O P Y R I G H T
//---------------------------------------------------------------------------------------
// Copyright (c) 2014 by Feaser http://www.feaser.com All rights reserved
//
// This software has been carefully tested, but is not guaranteed for any particular
// purpose. The author does not offer any warranties and does not guarantee the accuracy,
// adequacy, or completeness of the software and is not responsible for any errors or
// omissions or the results obtained from use of the software.
//
//---------------------------------------------------------------------------------------
// L I C E N S E
//---------------------------------------------------------------------------------------
// This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with OpenBLT.
// If not, see <http://www.gnu.org/licenses/>.
//
// A special exception to the GPL is included to allow you to distribute a combined work
// that includes OpenBLT without being obliged to provide the source code for any
// proprietary components. The exception text is included at the bottom of the license
// file <license.html>.
//
//***************************************************************************************
interface
//***************************************************************************************
// Includes
//***************************************************************************************
uses
Windows, Messages, SysUtils, Classes, Forms, IniFiles, Winsock, WSocket;
//***************************************************************************************
// Global Constants
//***************************************************************************************
const kMaxPacketSize = 256 + 4; // 4 extra for TCP/IP counter overhead
const kTcpConnectedTimeoutMs = 1000; // timeout for connecting the socket
const kTcpMinReceptionTimeoutMs = 1000; // minimal timeout for data reception
//***************************************************************************************
// Type Definitions
//***************************************************************************************
type
TXcpTransportInfo = (kNone, kConnected, kResponse, kError);
type
TXcpTransport = class(TObject)
private
comEventInfo : TXcpTransportInfo;
comEvent : THandle;
socket : TWSocket;
hostname : string;
port : string;
croCounter : LongWord;
procedure OnSocketSessionConnected(Sender: TObject; Error: Word);
procedure OnSocketDataAvailable(Sender: TObject; ErrCode: Word);
function MsgWaitForSingleObject(hHandle: THandle; dwMilliseconds: DWORD): DWORD;
public
packetData : array[0..kMaxPacketSize-1] of Byte;
packetLen : Word;
constructor Create;
procedure Configure(iniFile : string);
function Connect: Boolean;
function SendPacket(timeOutms: LongWord): Boolean;
procedure Disconnect;
destructor Destroy; override;
end;
implementation
//***************************************************************************************
// NAME: Create
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Class constructore
//
//***************************************************************************************
constructor TXcpTransport.Create;
begin
// call inherited constructor
inherited Create;
// reset can event info
comEventInfo := kNone;
// create the event that requires manual reset
comEvent := CreateEvent(nil, True, False, nil);
if comEvent = 0 then
Application.MessageBox( 'Could not obtain event placeholder.',
'Error', MB_OK or MB_ICONERROR );
// create a socket instance
socket := TWSocket.Create(nil);
// set the socket event handlers
socket.OnSessionConnected := OnSocketSessionConnected;
socket.OnDataAvailable := OnSocketDataAvailable;
// init CRO counter value
croCounter := 1;
// reset packet length
packetLen := 0;
end; //*** end of Create ***
//***************************************************************************************
// NAME: Destroy
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Class destructor
//
//***************************************************************************************
destructor TXcpTransport.Destroy;
begin
// release socket instance
socket.Free;
// call inherited destructor
inherited;
end; //*** end of Destroy ***
//***************************************************************************************
// NAME: Configure
// PARAMETER: filename of the INI
// RETURN VALUE: none
// DESCRIPTION: Configures both this class from the settings in the INI.
//
//***************************************************************************************
procedure TXcpTransport.Configure(iniFile : string);
var
settingsIni : TIniFile;
begin
// read XCP configuration from INI
if FileExists(iniFile) then
begin
// create ini file object
settingsIni := TIniFile.Create(iniFile);
// configure hostname
hostname := settingsIni.ReadString('net', 'hostname', '169.254.19.63');
// configure port
port := settingsIni.ReadString('net', 'port', '1000');
// release ini file object
settingsIni.Free;
end
else
begin
// configure defeault hostname
hostname := '169.254.19.63';
// configure default port
port := '1000';
end;
end; //*** end of Configure ***
//***************************************************************************************
// NAME: Connect
// PARAMETER: none
// RETURN VALUE: True if connected, False otherwise.
// DESCRIPTION: Connects the transport layer device.
//
//***************************************************************************************
function TXcpTransport.Connect: Boolean;
var
waitResult: Integer;
begin
// make sure the event is reset
ResetEvent(comEvent);
comEventInfo := kNone;
// init CRO counter value
croCounter := 1;
// make sure the socket is closed
if socket.State <> wsClosed then
begin
socket.Close;
socket.WaitForClose;
end;
// set the hostname, port and protocol
socket.Addr := hostname;
socket.Port := port;
socket.Proto := 'tcp';
// submit the connect request
socket.Connect;
// connection is being established. Now wait for the connected event
waitResult := MsgWaitForSingleObject(comEvent, kTcpConnectedTimeoutMs);
if waitResult <> WAIT_OBJECT_0 then
begin
// no com event triggered so either a timeout or internal error occurred
result := false;
Exit;
end;
// com event was triggered. now check that it is actually not an error
if comEventInfo <> kConnected then
begin
result := false;
Exit;
end;
// successfully connected
result := true;
end; //*** end of Connect ***
//***************************************************************************************
// NAME: SendPacket
// PARAMETER: the time[ms] allowed for the reponse from the slave to come in.
// RETURN VALUE: True if response received from slave, False otherwise
// DESCRIPTION: Sends the XCP packet using the data in 'packetData' and length in
// 'packetLen' and waits for the response to come in.
//
//***************************************************************************************
function TXcpTransport.SendPacket(timeOutms: LongWord): Boolean;
var
msgData : array of Byte;
cnt : byte;
waitResult: Integer;
adjustedTimeoutMs: LongWord;
begin
// make sure the event is reset
ResetEvent(comEvent);
comEventInfo := kNone;
// init the return value
result := false;
// prepare the packet. the first 4 bytes contain the CRO counter followed by the actual
// packet data
SetLength(msgData, packetLen+4);
// first store the CRO counter
msgData[0] := Byte(croCounter);
msgData[1] := Byte(croCounter shr 8);
msgData[2] := Byte(croCounter shr 16);
msgData[3] := Byte(croCounter shr 24);
// increment the CRO counter for the next packet
croCounter := croCounter + 1;
// copy the packet data
for cnt := 0 to packetLen-1 do
begin
msgData[cnt+4] := packetData[cnt];
end;
// submit the packet transmission request
if socket.Send(@msgData[0], packetLen+4) = -1 then
begin
// unable to submit tx request
Exit;
end;
// realistically, on TCP/IP due to network latency the reception of a packet can take
// a little while. if a really short timeout time is specified, this should be over-
// ruled.
if timeOutms < kTcpMinReceptionTimeoutMs then
adjustedTimeoutMs := kTcpMinReceptionTimeoutMs
else
adjustedTimeoutMs := timeOutms;
// packet is being transmitted. Now wait for the response to come in
waitResult := MsgWaitForSingleObject(comEvent, adjustedTimeoutMs);
if waitResult <> WAIT_OBJECT_0 then
begin
// no com event triggered so either a timeout or internal error occurred
result := False;
Exit;
end;
// com event was triggered. now check if the reponse was correctly received
if comEventInfo <> kResponse then
begin
result := False;
Exit;
end;
// packet successfully transmitted and response packet received
result := True;
end; //*** end of SendPacket ***
//***************************************************************************************
// NAME: Disconnect
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Disconnects the transport layer device.
//
//***************************************************************************************
procedure TXcpTransport.Disconnect;
begin
// close the socket
socket.Close;
socket.WaitForClose;
end; //*** end of Disconnect ***
//***************************************************************************************
// NAME: OnSocketSessionConnected
// PARAMETER: Sender is the source that triggered the event.
// Error contains possible connection error information.
// RETURN VALUE: none
// DESCRIPTION: Socket connected event handler
//
//***************************************************************************************
procedure TXcpTransport.OnSocketSessionConnected(Sender: TObject; Error: Word);
begin
// set event flag
if Error <> 0 then
comEventInfo := kError
else
comEventInfo := kConnected;
// trigger the event
SetEvent(comEvent);
end; //*** end of OnSocketSessionConnected ***
//***************************************************************************************
// NAME: OnSocketDataAvailable
// PARAMETER: Sender is the source that triggered the event.
// Error contains possible data reception error information.
// RETURN VALUE: none
// DESCRIPTION: Socket data reception event handler
//
//***************************************************************************************
procedure TXcpTransport.OnSocketDataAvailable(Sender: TObject; ErrCode: Word);
var
tempBuffer : array[0..kMaxPacketSize-1] of Byte;
count : Integer;
idx : Integer;
begin
count := socket.Receive(@tempBuffer[0], kMaxPacketSize);
// the first 4 bytes contains the dto counter in which we are not really interested
packetLen := count - 4;
// store the response data
for idx := 0 to packetLen-1 do
begin
packetData[idx] := tempBuffer[idx+4];
end;
if packetLen = 0 then
// set event flag
comEventInfo := kError
else
// set event flag
comEventInfo := kResponse;
// trigger the event
SetEvent(comEvent);
end; //*** end of OnSocketDataAvailable ***
//***************************************************************************************
// NAME: MsgWaitForSingleObject
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Improved version of WaitForSingleObject. This version actually
// processes messages in the queue instead of blocking them.
//
//***************************************************************************************
function TXcpTransport.MsgWaitForSingleObject(hHandle: THandle; dwMilliseconds: DWORD): DWORD;
var
dwEnd:DWord;
begin
// compute the time when the WaitForSingleObject is supposed to time out
dwEnd := GetTickCount + dwMilliseconds;
repeat
// wait for an event to happen or a message to be in the queue
result := MsgWaitForMultipleObjects(1, hHandle, False, dwMilliseconds, QS_ALLINPUT);
// a message was in the queue?
if result = WAIT_OBJECT_0 + 1 then
begin
// process these messages
Application.ProcessMessages;
socket.MessagePump;
// check for timeout manually because if a message in the queue occurred, the
// MsgWaitForMultipleObjects will be called again and the timer will start from
// scratch. we need to make sure the correct timeout time is used.
dwMilliseconds := GetTickCount;
if dwMilliseconds < dwEnd then
begin
dwMilliseconds := dwEnd - dwMilliseconds;
end
else
begin
// timeout occured
result := WAIT_TIMEOUT;
Break;
end;
end
else
// the event occured?
begin
// we can stop
Break;
end;
until True = False;
end; //*** end of MsgWaitForSingleObject ***
end.
//******************************** end of XcpTransport.pas ******************************

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,35 @@
-$A+
-$B-
-$C+
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J+
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q-
-$R-
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-E../../../../
-LNc:\borland\delphi4\Lib

View File

@ -0,0 +1,85 @@
[Compiler]
A=1
B=0
C=1
D=1
E=0
F=0
G=1
H=1
I=1
J=1
K=0
L=1
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=1
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=../../../../
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=
Packages=Vcl40;Vclx40;Vcldb40;vcldbx40;VclSmp40;Qrpt40;IcsDel40
Conditionals=
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1043
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlOutputDirectorry]
Count=2
Item0=../../../../
Item1=../../../

View File

@ -0,0 +1,625 @@
library openblt_net;
//***************************************************************************************
// Project Name: MicroBoot Interface for Borland Delphi
// Description: XCP - NET (TCP/IP) interface for MicroBoot
// File Name: openblt_net.dpr
//
//---------------------------------------------------------------------------------------
// C O P Y R I G H T
//---------------------------------------------------------------------------------------
// Copyright (c) 2014 by Feaser http://www.feaser.com All rights reserved
//
// This software has been carefully tested, but is not guaranteed for any particular
// purpose. The author does not offer any warranties and does not guarantee the accuracy,
// adequacy, or completeness of the software and is not responsible for any errors or
// omissions or the results obtained from use of the software.
//
//---------------------------------------------------------------------------------------
// L I C E N S E
//---------------------------------------------------------------------------------------
// This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with OpenBLT.
// If not, see <http://www.gnu.org/licenses/>.
//
// A special exception to the GPL is included to allow you to distribute a combined work
// that includes OpenBLT without being obliged to provide the source code for any
// proprietary components. The exception text is included at the bottom of the license
// file <license.html>.
//
//***************************************************************************************
//***************************************************************************************
// Includes
//***************************************************************************************
uses
Windows,
Messages,
Graphics,
Controls,
Forms,
Dialogs,
SysUtils,
Classes,
Extctrls,
XcpProtection in '..\XcpProtection.pas',
SRecReader in '..\SRecReader.pas',
XcpDataFile in '..\XcpDataFile.pas',
XcpLoader in '..\XcpLoader.pas',
XcpTransport in 'XcpTransport.pas',
XcpSettings in 'XcpSettings.pas' {XcpSettingsForm};
//***************************************************************************************
// Global Constants
//***************************************************************************************
const kMaxProgLen = 256; // maximum number of bytes to progam at one time
//***************************************************************************************
// Type Definitions
//***************************************************************************************
// DLL Interface Callbacks - modifications requires potential update of all interfaces!
type
TStartedEvent = procedure(length: Longword) of object;
TProgressEvent = procedure(progress: Longword) of object;
TDoneEvent = procedure of object;
TErrorEvent = procedure(error: ShortString) of object;
TLogEvent = procedure(info: ShortString) of object;
TInfoEvent = procedure(info: ShortString) of object;
type
TEventHandlers = class // create a dummy class
procedure OnTimeout(Sender: TObject);
end;
//***************************************************************************************
// Global Variables
//***************************************************************************************
var
//--- begin of don't change ---
AppOnStarted : TStartedEvent;
AppOnProgress : TProgressEvent;
AppOnDone : TDoneEvent;
AppOnError : TErrorEvent;
AppOnLog : TLogEvent;
AppOnInfo : TInfoEvent;
//--- end of don't change ---
timer : TTimer;
events : TEventHandlers;
loader : TXcpLoader;
datafile : TXcpDataFile;
progdata : array of Byte;
progfile : string;
stopRequest : boolean;
//***************************************************************************************
// NAME: MbiCallbackOnStarted
// PARAMETER: length of the file that is being downloaded.
// RETURN VALUE: none
// DESCRIPTION: Wrapper function for safely calling an application callback
//
//***************************************************************************************
procedure MbiCallbackOnStarted(length: Longword);
begin
if Assigned(AppOnStarted) then
begin
AppOnStarted(length);
end;
end; //** end of MbiCallbackOnStarted ***
//***************************************************************************************
// NAME: MbiCallbackOnProgress
// PARAMETER: progress of the file download.
// RETURN VALUE: none
// DESCRIPTION: Wrapper function for safely calling an application callback
//
//***************************************************************************************
procedure MbiCallbackOnProgress(progress: Longword);
begin
if Assigned(AppOnProgress) then
begin
AppOnProgress(progress);
end;
end; //** end of MbiCallbackOnProgress ***
//***************************************************************************************
// NAME: MbiCallbackOnDone
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Wrapper function for safely calling an application callback
//
//***************************************************************************************
procedure MbiCallbackOnDone;
begin
if Assigned(AppOnDone) then
begin
AppOnDone;
end;
end; //** end of MbiCallbackOnDone ***
//***************************************************************************************
// NAME: MbiCallbackOnError
// PARAMETER: info about the error that occured.
// RETURN VALUE: none
// DESCRIPTION: Wrapper function for safely calling an application callback
//
//***************************************************************************************
procedure MbiCallbackOnError(error: ShortString);
begin
if Assigned(AppOnError) then
begin
AppOnError(error);
end;
end; //** end of MbiCallbackOnError ***
//***************************************************************************************
// NAME: MbiCallbackOnLog
// PARAMETER: info on the log event.
// RETURN VALUE: none
// DESCRIPTION: Wrapper function for safely calling an application callback
//
//***************************************************************************************
procedure MbiCallbackOnLog(info: ShortString);
begin
if Assigned(AppOnLog) then
begin
AppOnLog(info);
end;
end; //** end of MbiCallbackOnLog ***
//***************************************************************************************
// NAME: MbiCallbackOnInfo
// PARAMETER: details on the info event.
// RETURN VALUE: none
// DESCRIPTION: Wrapper function for safely calling an application callback
//
//***************************************************************************************
procedure MbiCallbackOnInfo(info: ShortString);
begin
if Assigned(AppOnInfo) then
begin
AppOnInfo(info);
end;
end; //** end of MbiCallbackOnLog ***
//***************************************************************************************
// NAME: LogData
// PARAMETER: pointer to byte array and the data length
// RETURN VALUE: none
// DESCRIPTION: Writes the program data formatted to the logfile
//
//***************************************************************************************
procedure LogData(data : PByteArray; len : longword); stdcall;
var
currentWriteCnt : byte;
cnt : byte;
logStr : string;
bufferOffset : longword;
begin
bufferOffset := 0;
while len > 0 do
begin
// set the current write length optimized to log 32 bytes per line
currentWriteCnt := len mod 32;
if currentWriteCnt = 0 then currentWriteCnt := 32;
logStr := '';
// prepare the line to add to the log
for cnt := 0 to currentWriteCnt-1 do
begin
logStr := logStr + Format('%2.2x ', [data[bufferOffset+cnt]]);
end;
// update the log
MbiCallbackOnLog(logStr);
// update loop variables
len := len - currentWriteCnt;
bufferOffset := bufferOffset + currentWriteCnt;
end;
end; //*** end of LogData ***
//***************************************************************************************
// NAME: OnTimeout
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Timer event handler. A timer is used in this example to simulate the
// progress of a file download. It also demonstrates how to use the
// application callbacks to keep the application informed.
//
//***************************************************************************************
procedure TEventHandlers.OnTimeout(Sender: TObject);
var
errorInfo : string;
progress : longword;
regionCnt : longword;
currentWriteCnt : word;
bufferOffset : longword;
addr : longword;
len : longword;
dataSizeKB : real;
begin
timer.Enabled := False;
// connect the transport layer
MbiCallbackOnInfo('Connecting to target via TCP/IP.');
MbiCallbackOnLog('Connecting to target via TCP/IP. t='+TimeToStr(Time));
Application.ProcessMessages;
if not loader.Connect then
begin
// update the user info
MbiCallbackOnInfo('Could not connect via TCP/IP. Retrying. Reset your target if this takes a long time.');
MbiCallbackOnLog('Transport layer connection failed. Check the configured IP address and port. t='+TimeToStr(Time));
MbiCallbackOnLog('Retrying transport layer connection. Reset your target if this takes a long time. t='+TimeToStr(Time));
Application.ProcessMessages;
// continuously try to connect the transport layer
while not loader.Connect do
begin
Application.ProcessMessages;
Sleep(5);
if stopRequest then
begin
MbiCallbackOnError('Transport layer connection cancelled by user.');
Exit;
end;
end;
end;
//---------------- start the programming session --------------------------------------
MbiCallbackOnLog('Starting the programming session. t='+TimeToStr(Time));
// try initial connect via XCP
if not loader.StartProgrammingSession then
begin
// update the user info
MbiCallbackOnInfo('Could not connect. Please reset your target...');
MbiCallbackOnLog('Connect failed. Switching to backdoor entry mode. t='+TimeToStr(Time));
Application.ProcessMessages;
// continuously try to connect via XCP true the backdoor
while not loader.StartProgrammingSession do
begin
Application.ProcessMessages;
Sleep(5);
if stopRequest then
begin
MbiCallbackOnError('Programming session cancelled by user.');
Exit;
end;
end;
end;
// still here so programming session was started
MbiCallbackOnLog('Programming session started. t='+TimeToStr(Time));
// create the datafile object
datafile := TXcpDataFile.Create(progfile);
// compute the size in kbytes
dataSizeKB := datafile.GetDataCnt / 1024;
// Call application callback when we start the actual download
MbiCallbackOnStarted(datafile.GetDataCnt);
// Init progress to 0 progress
progress := 0;
MbiCallbackOnProgress(progress);
//---------------- next clear the memory regions --------------------------------------
// update the user info
MbiCallbackOnInfo('Erasing memory...');
for regionCnt := 0 to datafile.GetRegionCnt-1 do
begin
// obtain the region info
datafile.GetRegionInfo(regionCnt, addr, len);
// erase the memory
MbiCallbackOnLog('Clearing Memory '+Format('addr:0x%x,len:0x%x',[addr,len])+'. t='+TimeToStr(Time));
if not loader.ClearMemory(addr, len) then
begin
loader.GetLastError(errorInfo);
MbiCallbackOnLog('Could not clear memory ('+errorInfo+'). t='+TimeToStr(Time));
MbiCallbackOnError('Could not clear memory ('+errorInfo+').');
datafile.Free;
Exit;
end;
MbiCallbackOnLog('Memory cleared. t='+TimeToStr(Time));
end;
//---------------- next program the memory regions ------------------------------------
for regionCnt := 0 to datafile.GetRegionCnt-1 do
begin
// update the user info
MbiCallbackOnInfo('Reading file...');
// obtain the region info
datafile.GetRegionInfo(regionCnt, addr, len);
// dynamically allocated buffer memory
SetLength(progdata, len);
// obtain the regiond data
datafile.GetRegionData(regionCnt, progdata);
bufferOffset := 0;
while len > 0 do
begin
// set the current write length taking into account kMaxProgLen
currentWriteCnt := len mod kMaxProgLen;
if currentWriteCnt = 0 then currentWriteCnt := kMaxProgLen;
// program the data
MbiCallbackOnLog('Programming Data '+Format('addr:0x%x,len:0x%x',[addr,currentWriteCnt])+'. t='+TimeToStr(Time));
LogData(@progdata[bufferOffset], currentWriteCnt);
if not loader.WriteData(addr, currentWriteCnt, @progdata[bufferOffset]) then
begin
loader.GetLastError(errorInfo);
MbiCallbackOnLog('Could not program data ('+errorInfo+'). t='+TimeToStr(Time));
MbiCallbackOnError('Could not program data ('+errorInfo+').');
datafile.Free;
Exit;
end;
MbiCallbackOnLog('Data Programmed. t='+TimeToStr(Time));
// update progress
progress := progress + currentWriteCnt;
MbiCallbackOnProgress(progress);
// update loop variables
len := len - currentWriteCnt;
addr := addr + currentWriteCnt;
bufferOffset := bufferOffset + currentWriteCnt;
// update the user info
MbiCallbackOnInfo('Programming data... ' + Format('(%.1n of %.1n Kbytes)',[(progress/1024), dataSizeKB]));
end;
end;
//---------------- stop the programming session ---------------------------------------
MbiCallbackOnLog('Stopping the programming session. t='+TimeToStr(Time));
if not loader.StopProgrammingSession then
begin
loader.GetLastError(errorInfo);
MbiCallbackOnLog('Could not stop the programming session ('+errorInfo+'). t='+TimeToStr(Time));
MbiCallbackOnError('Could not stop the programming session ('+errorInfo+').');
datafile.Free;
Exit;
end;
MbiCallbackOnLog('Programming session stopped. t='+TimeToStr(Time));
// all done so set progress to 100% and finish up
progress := datafile.GetDataCnt;
datafile.Free;
MbiCallbackOnProgress(progress);
MbiCallbackOnLog('File successfully downloaded t='+TimeToStr(Time));
MbiCallbackOnDone;
end; //*** end of OnTimeout ***
//***************************************************************************************
// NAME: MbiInit
// PARAMETER: callback function pointers
// RETURN VALUE: none
// DESCRIPTION: Called by the application to initialize the interface library.
//
//***************************************************************************************
procedure MbiInit(cbStarted: TStartedEvent; cbProgress: TProgressEvent;
cbDone: TDoneEvent; cbError: TErrorEvent; cbLog: TLogEvent;
cbInfo: TInfoEvent); stdcall;
begin
//--- begin of don't change ---
AppOnStarted := cbStarted;
AppOnProgress := cbProgress;
AppOnDone := cbDone;
AppOnLog := cbLog;
AppOnInfo := cbInfo;
AppOnError := cbError;
//--- end of don't change ---
// create xcp loader object
loader := TXcpLoader.Create;
// update to the latest configuration
loader.Configure(ExtractFilePath(ParamStr(0))+'openblt_net.ini');
// create and init a timer
events := TEventHandlers.Create;
timer := TTimer.Create(nil);
timer.Enabled := False;
timer.Interval := 100;
timer.OnTimer := events.OnTimeout;
end; //*** end of MbiInit ***
//***************************************************************************************
// NAME: MbiStart
// PARAMETER: filename of the file that is to be downloaded.
// RETURN VALUE: none
// DESCRIPTION: Called by the application to request the interface library to download
// the file that is passed as a parameter.
//
//***************************************************************************************
procedure MbiStart(fileName: ShortString); stdcall;
begin
// update the user info
MbiCallbackOnInfo('');
// start the log
MbiCallbackOnLog('--- Downloading "'+fileName+'" ---');
// reset stop request
stopRequest := false;
// start the startup timer which gives microBoot a chance to paint itself
timer.Enabled := True;
// store the program's filename
progfile := fileName;
end; //*** end of MbiStart ***
//***************************************************************************************
// NAME: MbiStop
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Called by the application to request the interface library to stop
// a download that could be in progress.
//
//***************************************************************************************
procedure MbiStop; stdcall;
begin
// set stop request
stopRequest := true;
// disconnect the transport layer
MbiCallbackOnLog('Disconnecting the transport layer. t='+TimeToStr(Time));
loader.Disconnect;
end; //*** end of MbiStop ***
//***************************************************************************************
// NAME: MbiDeInit
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Called by the application to uninitialize the interface library.
//
//***************************************************************************************
procedure MbiDeInit; stdcall;
begin
// release xcp loader object
loader.Free;
// release the timer and events object
timer.Free;
events.Free;
//--- begin of don't change ---
AppOnStarted := nil;
AppOnProgress := nil;
AppOnDone := nil;
AppOnLog := nil;
AppOnInfo := nil;
AppOnError := nil;
//--- end of don't change ---
end; //*** end of MbiDeInit ***
//***************************************************************************************
// NAME: MbiName
// PARAMETER: none
// RETURN VALUE: name of the interface library
// DESCRIPTION: Called by the application to obtain the name of the interface library.
//
//***************************************************************************************
function MbiName : ShortString; stdcall;
begin
Result := 'OpenBLT TCP/IP';
end; //*** end of MbiName ***
//***************************************************************************************
// NAME: MbiDescription
// PARAMETER: none
// RETURN VALUE: description of the interface library
// DESCRIPTION: Called by the application to obtain the description of the interface
// library.
//
//***************************************************************************************
function MbiDescription : ShortString; stdcall;
begin
Result := 'OpenBLT using TCP/IP';
end; //*** end of MbiDescription ***
//***************************************************************************************
// NAME: MbiVersion
// PARAMETER: none
// RETURN VALUE: version number
// DESCRIPTION: Called by the application to obtain the version number of the
// interface library.
//
//***************************************************************************************
function MbiVersion : Longword; stdcall;
begin
Result := 10000; // v1.00.00
end; //*** end of MbiVersion ***
//***************************************************************************************
// NAME: MbiVInterface
// PARAMETER: none
// RETURN VALUE: version number of the supported interface
// DESCRIPTION: Called by the application to obtain the version number of the
// Mbi interface uBootInterface.pas (not the interface library). This can
// be used by the application for backward compatibility.
//
//***************************************************************************************
function MbiVInterface : Longword; stdcall;
begin
Result := 10001; // v1.00.01
end; //*** end of MbiVInterface ***
//***************************************************************************************
// NAME: MbiConfigure
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Called by the application to enable the user to configure the inter-
// face library through the application.
//
//***************************************************************************************
procedure MbiConfigure; stdcall;
var
settings : TXcpSettings;
begin
// create xcp settings object
settings := TXcpSettings.Create(ExtractFilePath(ParamStr(0))+'openblt_net.ini');
// display the modal configuration dialog
settings.Configure;
// release the xcp settings object
settings.Free;
// update to the latest configuration
loader.Configure(ExtractFilePath(ParamStr(0))+'openblt_net.ini');
end; //*** end of MbiConfigure ***
//***************************************************************************************
// External Declarations
//***************************************************************************************
exports
//--- begin of don't change ---
MbiInit index 1,
MbiStart index 2,
MbiStop index 3,
MbiDeInit index 4,
MbiName index 5,
MbiDescription index 6,
MbiVersion index 7,
MbiConfigure index 8,
MbiVInterface index 9;
//--- end of don't change ---
end.
//********************************** end of openblt_net.dpr *****************************

View File

@ -0,0 +1,624 @@
library openblt_net;
//***************************************************************************************
// Project Name: MicroBoot Interface for Borland Delphi
// Description: XCP - NET (TCP/IP) interface for MicroBoot
// File Name: openblt_net.dpr
//
//---------------------------------------------------------------------------------------
// C O P Y R I G H T
//---------------------------------------------------------------------------------------
// Copyright (c) 2014 by Feaser http://www.feaser.com All rights reserved
//
// This software has been carefully tested, but is not guaranteed for any particular
// purpose. The author does not offer any warranties and does not guarantee the accuracy,
// adequacy, or completeness of the software and is not responsible for any errors or
// omissions or the results obtained from use of the software.
//
//---------------------------------------------------------------------------------------
// L I C E N S E
//---------------------------------------------------------------------------------------
// This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any later
// version.
//
// OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with OpenBLT.
// If not, see <http://www.gnu.org/licenses/>.
//
// A special exception to the GPL is included to allow you to distribute a combined work
// that includes OpenBLT without being obliged to provide the source code for any
// proprietary components. The exception text is included at the bottom of the license
// file <license.html>.
//
//***************************************************************************************
//***************************************************************************************
// Includes
//***************************************************************************************
uses
Windows,
Messages,
Graphics,
Controls,
Forms,
Dialogs,
SysUtils,
Classes,
Extctrls,
XcpProtection in '..\XcpProtection.pas',
SRecReader in '..\SRecReader.pas',
XcpDataFile in '..\XcpDataFile.pas',
XcpLoader in '..\XcpLoader.pas',
XcpTransport in 'XcpTransport.pas',
XcpSettings in 'XcpSettings.pas' {XcpSettingsForm};
//***************************************************************************************
// Global Constants
//***************************************************************************************
const kMaxProgLen = 256; // maximum number of bytes to progam at one time
//***************************************************************************************
// Type Definitions
//***************************************************************************************
// DLL Interface Callbacks - modifications requires potential update of all interfaces!
type
TStartedEvent = procedure(length: Longword) of object;
TProgressEvent = procedure(progress: Longword) of object;
TDoneEvent = procedure of object;
TErrorEvent = procedure(error: ShortString) of object;
TLogEvent = procedure(info: ShortString) of object;
TInfoEvent = procedure(info: ShortString) of object;
type
TEventHandlers = class // create a dummy class
procedure OnTimeout(Sender: TObject);
end;
//***************************************************************************************
// Global Variables
//***************************************************************************************
var
//--- begin of don't change ---
AppOnStarted : TStartedEvent;
AppOnProgress : TProgressEvent;
AppOnDone : TDoneEvent;
AppOnError : TErrorEvent;
AppOnLog : TLogEvent;
AppOnInfo : TInfoEvent;
//--- end of don't change ---
timer : TTimer;
events : TEventHandlers;
loader : TXcpLoader;
datafile : TXcpDataFile;
progdata : array of Byte;
progfile : string;
stopRequest : boolean;
//***************************************************************************************
// NAME: MbiCallbackOnStarted
// PARAMETER: length of the file that is being downloaded.
// RETURN VALUE: none
// DESCRIPTION: Wrapper function for safely calling an application callback
//
//***************************************************************************************
procedure MbiCallbackOnStarted(length: Longword);
begin
if Assigned(AppOnStarted) then
begin
AppOnStarted(length);
end;
end; //** end of MbiCallbackOnStarted ***
//***************************************************************************************
// NAME: MbiCallbackOnProgress
// PARAMETER: progress of the file download.
// RETURN VALUE: none
// DESCRIPTION: Wrapper function for safely calling an application callback
//
//***************************************************************************************
procedure MbiCallbackOnProgress(progress: Longword);
begin
if Assigned(AppOnProgress) then
begin
AppOnProgress(progress);
end;
end; //** end of MbiCallbackOnProgress ***
//***************************************************************************************
// NAME: MbiCallbackOnDone
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Wrapper function for safely calling an application callback
//
//***************************************************************************************
procedure MbiCallbackOnDone;
begin
if Assigned(AppOnDone) then
begin
AppOnDone;
end;
end; //** end of MbiCallbackOnDone ***
//***************************************************************************************
// NAME: MbiCallbackOnError
// PARAMETER: info about the error that occured.
// RETURN VALUE: none
// DESCRIPTION: Wrapper function for safely calling an application callback
//
//***************************************************************************************
procedure MbiCallbackOnError(error: ShortString);
begin
if Assigned(AppOnError) then
begin
AppOnError(error);
end;
end; //** end of MbiCallbackOnError ***
//***************************************************************************************
// NAME: MbiCallbackOnLog
// PARAMETER: info on the log event.
// RETURN VALUE: none
// DESCRIPTION: Wrapper function for safely calling an application callback
//
//***************************************************************************************
procedure MbiCallbackOnLog(info: ShortString);
begin
if Assigned(AppOnLog) then
begin
AppOnLog(info);
end;
end; //** end of MbiCallbackOnLog ***
//***************************************************************************************
// NAME: MbiCallbackOnInfo
// PARAMETER: details on the info event.
// RETURN VALUE: none
// DESCRIPTION: Wrapper function for safely calling an application callback
//
//***************************************************************************************
procedure MbiCallbackOnInfo(info: ShortString);
begin
if Assigned(AppOnInfo) then
begin
AppOnInfo(info);
end;
end; //** end of MbiCallbackOnLog ***
//***************************************************************************************
// NAME: LogData
// PARAMETER: pointer to byte array and the data length
// RETURN VALUE: none
// DESCRIPTION: Writes the program data formatted to the logfile
//
//***************************************************************************************
procedure LogData(data : PByteArray; len : longword); stdcall;
var
currentWriteCnt : byte;
cnt : byte;
logStr : string;
bufferOffset : longword;
begin
bufferOffset := 0;
while len > 0 do
begin
// set the current write length optimized to log 32 bytes per line
currentWriteCnt := len mod 32;
if currentWriteCnt = 0 then currentWriteCnt := 32;
logStr := '';
// prepare the line to add to the log
for cnt := 0 to currentWriteCnt-1 do
begin
logStr := logStr + Format('%2.2x ', [data[bufferOffset+cnt]]);
end;
// update the log
MbiCallbackOnLog(logStr);
// update loop variables
len := len - currentWriteCnt;
bufferOffset := bufferOffset + currentWriteCnt;
end;
end; //*** end of LogData ***
//***************************************************************************************
// NAME: OnTimeout
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Timer event handler. A timer is used in this example to simulate the
// progress of a file download. It also demonstrates how to use the
// application callbacks to keep the application informed.
//
//***************************************************************************************
procedure TEventHandlers.OnTimeout(Sender: TObject);
var
errorInfo : string;
progress : longword;
regionCnt : longword;
currentWriteCnt : word;
bufferOffset : longword;
addr : longword;
len : longword;
dataSizeKB : real;
begin
timer.Enabled := False;
// connect the transport layer
MbiCallbackOnInfo('Connecting the transport layer.');
MbiCallbackOnLog('Connecting the transport layer. t='+TimeToStr(Time));
Application.ProcessMessages;
if not loader.Connect then
begin
// update the user info
MbiCallbackOnInfo('Could not connect to transport layer. Automatically retrying...');
MbiCallbackOnLog('Transport layer connection failed. Automatically retrying. t='+TimeToStr(Time));
Application.ProcessMessages;
// continuously try to coonect the transport layer
while not loader.Connect do
begin
Application.ProcessMessages;
Sleep(5);
if stopRequest then
begin
MbiCallbackOnError('Transport layer connection cancelled by user.');
Exit;
end;
end;
end;
//---------------- start the programming session --------------------------------------
MbiCallbackOnLog('Starting the programming session. t='+TimeToStr(Time));
// try initial connect via XCP
if not loader.StartProgrammingSession then
begin
// update the user info
MbiCallbackOnInfo('Could not connect. Please reset your target...');
MbiCallbackOnLog('Connect failed. Switching to backdoor entry mode. t='+TimeToStr(Time));
Application.ProcessMessages;
// continuously try to connect via XCP true the backdoor
while not loader.StartProgrammingSession do
begin
Application.ProcessMessages;
Sleep(5);
if stopRequest then
begin
MbiCallbackOnError('Programming session cancelled by user.');
Exit;
end;
end;
end;
// still here so programming session was started
MbiCallbackOnLog('Programming session started. t='+TimeToStr(Time));
// create the datafile object
datafile := TXcpDataFile.Create(progfile);
// compute the size in kbytes
dataSizeKB := datafile.GetDataCnt / 1024;
// Call application callback when we start the actual download
MbiCallbackOnStarted(datafile.GetDataCnt);
// Init progress to 0 progress
progress := 0;
MbiCallbackOnProgress(progress);
//---------------- next clear the memory regions --------------------------------------
// update the user info
MbiCallbackOnInfo('Erasing memory...');
for regionCnt := 0 to datafile.GetRegionCnt-1 do
begin
// obtain the region info
datafile.GetRegionInfo(regionCnt, addr, len);
// erase the memory
MbiCallbackOnLog('Clearing Memory '+Format('addr:0x%x,len:0x%x',[addr,len])+'. t='+TimeToStr(Time));
if not loader.ClearMemory(addr, len) then
begin
loader.GetLastError(errorInfo);
MbiCallbackOnLog('Could not clear memory ('+errorInfo+'). t='+TimeToStr(Time));
MbiCallbackOnError('Could not clear memory ('+errorInfo+').');
datafile.Free;
Exit;
end;
MbiCallbackOnLog('Memory cleared. t='+TimeToStr(Time));
end;
//---------------- next program the memory regions ------------------------------------
for regionCnt := 0 to datafile.GetRegionCnt-1 do
begin
// update the user info
MbiCallbackOnInfo('Reading file...');
// obtain the region info
datafile.GetRegionInfo(regionCnt, addr, len);
// dynamically allocated buffer memory
SetLength(progdata, len);
// obtain the regiond data
datafile.GetRegionData(regionCnt, progdata);
bufferOffset := 0;
while len > 0 do
begin
// set the current write length taking into account kMaxProgLen
currentWriteCnt := len mod kMaxProgLen;
if currentWriteCnt = 0 then currentWriteCnt := kMaxProgLen;
// program the data
MbiCallbackOnLog('Programming Data '+Format('addr:0x%x,len:0x%x',[addr,currentWriteCnt])+'. t='+TimeToStr(Time));
LogData(@progdata[bufferOffset], currentWriteCnt);
if not loader.WriteData(addr, currentWriteCnt, @progdata[bufferOffset]) then
begin
loader.GetLastError(errorInfo);
MbiCallbackOnLog('Could not program data ('+errorInfo+'). t='+TimeToStr(Time));
MbiCallbackOnError('Could not program data ('+errorInfo+').');
datafile.Free;
Exit;
end;
MbiCallbackOnLog('Data Programmed. t='+TimeToStr(Time));
// update progress
progress := progress + currentWriteCnt;
MbiCallbackOnProgress(progress);
// update loop variables
len := len - currentWriteCnt;
addr := addr + currentWriteCnt;
bufferOffset := bufferOffset + currentWriteCnt;
// update the user info
MbiCallbackOnInfo('Programming data... ' + Format('(%.1n of %.1n Kbytes)',[(progress/1024), dataSizeKB]));
end;
end;
//---------------- stop the programming session ---------------------------------------
MbiCallbackOnLog('Stopping the programming session. t='+TimeToStr(Time));
if not loader.StopProgrammingSession then
begin
loader.GetLastError(errorInfo);
MbiCallbackOnLog('Could not stop the programming session ('+errorInfo+'). t='+TimeToStr(Time));
MbiCallbackOnError('Could not stop the programming session ('+errorInfo+').');
datafile.Free;
Exit;
end;
MbiCallbackOnLog('Programming session stopped. t='+TimeToStr(Time));
// all done so set progress to 100% and finish up
progress := datafile.GetDataCnt;
datafile.Free;
MbiCallbackOnProgress(progress);
MbiCallbackOnLog('File successfully downloaded t='+TimeToStr(Time));
MbiCallbackOnDone;
end; //*** end of OnTimeout ***
//***************************************************************************************
// NAME: MbiInit
// PARAMETER: callback function pointers
// RETURN VALUE: none
// DESCRIPTION: Called by the application to initialize the interface library.
//
//***************************************************************************************
procedure MbiInit(cbStarted: TStartedEvent; cbProgress: TProgressEvent;
cbDone: TDoneEvent; cbError: TErrorEvent; cbLog: TLogEvent;
cbInfo: TInfoEvent); stdcall;
begin
//--- begin of don't change ---
AppOnStarted := cbStarted;
AppOnProgress := cbProgress;
AppOnDone := cbDone;
AppOnLog := cbLog;
AppOnInfo := cbInfo;
AppOnError := cbError;
//--- end of don't change ---
// create xcp loader object
loader := TXcpLoader.Create;
// update to the latest configuration
loader.Configure(ExtractFilePath(ParamStr(0))+'openblt_net.ini');
// create and init a timer
events := TEventHandlers.Create;
timer := TTimer.Create(nil);
timer.Enabled := False;
timer.Interval := 100;
timer.OnTimer := events.OnTimeout;
end; //*** end of MbiInit ***
//***************************************************************************************
// NAME: MbiStart
// PARAMETER: filename of the file that is to be downloaded.
// RETURN VALUE: none
// DESCRIPTION: Called by the application to request the interface library to download
// the file that is passed as a parameter.
//
//***************************************************************************************
procedure MbiStart(fileName: ShortString); stdcall;
begin
// update the user info
MbiCallbackOnInfo('');
// start the log
MbiCallbackOnLog('--- Downloading "'+fileName+'" ---');
// reset stop request
stopRequest := false;
// start the startup timer which gives microBoot a chance to paint itself
timer.Enabled := True;
// store the program's filename
progfile := fileName;
end; //*** end of MbiStart ***
//***************************************************************************************
// NAME: MbiStop
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Called by the application to request the interface library to stop
// a download that could be in progress.
//
//***************************************************************************************
procedure MbiStop; stdcall;
begin
// set stop request
stopRequest := true;
// disconnect the transport layer
MbiCallbackOnLog('Disconnecting the transport layer. t='+TimeToStr(Time));
loader.Disconnect;
end; //*** end of MbiStop ***
//***************************************************************************************
// NAME: MbiDeInit
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Called by the application to uninitialize the interface library.
//
//***************************************************************************************
procedure MbiDeInit; stdcall;
begin
// release xcp loader object
loader.Free;
// release the timer and events object
timer.Free;
events.Free;
//--- begin of don't change ---
AppOnStarted := nil;
AppOnProgress := nil;
AppOnDone := nil;
AppOnLog := nil;
AppOnInfo := nil;
AppOnError := nil;
//--- end of don't change ---
end; //*** end of MbiDeInit ***
//***************************************************************************************
// NAME: MbiName
// PARAMETER: none
// RETURN VALUE: name of the interface library
// DESCRIPTION: Called by the application to obtain the name of the interface library.
//
//***************************************************************************************
function MbiName : ShortString; stdcall;
begin
Result := 'OpenBLT TCP/IP';
end; //*** end of MbiName ***
//***************************************************************************************
// NAME: MbiDescription
// PARAMETER: none
// RETURN VALUE: description of the interface library
// DESCRIPTION: Called by the application to obtain the description of the interface
// library.
//
//***************************************************************************************
function MbiDescription : ShortString; stdcall;
begin
Result := 'OpenBLT using TCP/IP';
end; //*** end of MbiDescription ***
//***************************************************************************************
// NAME: MbiVersion
// PARAMETER: none
// RETURN VALUE: version number
// DESCRIPTION: Called by the application to obtain the version number of the
// interface library.
//
//***************************************************************************************
function MbiVersion : Longword; stdcall;
begin
Result := 10000; // v1.00.00
end; //*** end of MbiVersion ***
//***************************************************************************************
// NAME: MbiVInterface
// PARAMETER: none
// RETURN VALUE: version number of the supported interface
// DESCRIPTION: Called by the application to obtain the version number of the
// Mbi interface uBootInterface.pas (not the interface library). This can
// be used by the application for backward compatibility.
//
//***************************************************************************************
function MbiVInterface : Longword; stdcall;
begin
Result := 10001; // v1.00.01
end; //*** end of MbiVInterface ***
//***************************************************************************************
// NAME: MbiConfigure
// PARAMETER: none
// RETURN VALUE: none
// DESCRIPTION: Called by the application to enable the user to configure the inter-
// face library through the application.
//
//***************************************************************************************
procedure MbiConfigure; stdcall;
var
settings : TXcpSettings;
begin
// create xcp settings object
settings := TXcpSettings.Create(ExtractFilePath(ParamStr(0))+'openblt_net.ini');
// display the modal configuration dialog
settings.Configure;
// release the xcp settings object
settings.Free;
// update to the latest configuration
loader.Configure(ExtractFilePath(ParamStr(0))+'openblt_net.ini');
end; //*** end of MbiConfigure ***
//***************************************************************************************
// External Declarations
//***************************************************************************************
exports
//--- begin of don't change ---
MbiInit index 1,
MbiStart index 2,
MbiStop index 3,
MbiDeInit index 4,
MbiName index 5,
MbiDescription index 6,
MbiVersion index 7,
MbiConfigure index 8,
MbiVInterface index 9;
//--- end of don't change ---
end.
//********************************** end of openblt_net.dpr *****************************

View File

@ -0,0 +1,5 @@
To build this interface in Delphi, the freeware Internet Component Suite (ICT) from F. Piette
should be installed in Delphi. It is located in the "OverbyteIcsV5.zip" archive.
For more information about ICS, visit: http://www.overbyte.be/frame_index.html

View File

@ -79,6 +79,8 @@ type
edtSeedKey: TEdit;
btnBrowse: TButton;
openDialog: TOpenDialog;
edtTconnect: TEdit;
lblTconnect: TLabel;
procedure btnOKClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure btnBrowseClick(Sender: TObject);
@ -213,6 +215,7 @@ begin
FSettingsForm.edtT4.Text := IntToStr(settingsIni.ReadInteger('xcp', 't4', 10000));
FSettingsForm.edtT5.Text := IntToStr(settingsIni.ReadInteger('xcp', 't5', 1000));
FSettingsForm.edtT7.Text := IntToStr(settingsIni.ReadInteger('xcp', 't7', 2000));
FSettingsForm.edtTconnect.Text := IntToStr(settingsIni.ReadInteger('xcp', 'tconnect', 20));
// release ini file object
settingsIni.Free;
@ -231,7 +234,7 @@ begin
FSettingsForm.edtT4.Text := IntToStr(10000);
FSettingsForm.edtT5.Text := IntToStr(1000);
FSettingsForm.edtT7.Text := IntToStr(2000);
FSettingsForm.edtTconnect.Text := IntToStr(20);
end;
// show the form as modal so we can get the result here
@ -253,6 +256,7 @@ begin
settingsIni.WriteInteger('xcp', 't4', StrToInt(FSettingsForm.edtT4.Text));
settingsIni.WriteInteger('xcp', 't5', StrToInt(FSettingsForm.edtT5.Text));
settingsIni.WriteInteger('xcp', 't7', StrToInt(FSettingsForm.edtT7.Text));
settingsIni.WriteInteger('xcp', 'tconnect', StrToInt(FSettingsForm.edtTconnect.Text));
// release ini file object
settingsIni.Free;

View File

@ -62,7 +62,7 @@ type
sciDriver : TCommPortDriver;
constructor Create;
procedure Configure(iniFile : string);
procedure Connect;
function Connect : Boolean;
function SendPacket(timeOutms: LongWord): Boolean;
procedure Disconnect;
destructor Destroy; override;
@ -174,15 +174,15 @@ end; //*** end of Configure ***
//***************************************************************************************
// NAME: Connect
// PARAMETER: none
// RETURN VALUE: none
// RETURN VALUE: True is successful, False otherwise.
// DESCRIPTION: Connects the transport layer device.
//
//***************************************************************************************
procedure TXcpTransport.Connect;
function TXcpTransport.Connect : Boolean;
begin
result := true;
if not sciDriver.Connect then
Application.MessageBox( 'Could not connect to COM port.',
'Error', MB_OK or MB_ICONERROR );
result := false;
end; //*** end of Connect ***

View File

@ -31,5 +31,5 @@
-M
-$M16384,1048576
-K$00400000
-E../../../
-LNc:\program files (x86)\borland\delphi4\Lib
-E../../../../
-LNc:\borland\delphi4\Lib

View File

@ -39,7 +39,7 @@ MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=../../../
OutputDir=../../../../
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
@ -82,5 +82,6 @@ $(DELPHI)\Lib\dclusr40.bpl=Borland User
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlOutputDirectorry]
Count=1
Item0=../../../
Count=2
Item0=../../../../
Item1=../../../

View File

@ -261,28 +261,37 @@ begin
timer.Enabled := False;
// connect the transport layer
MbiCallbackOnLog('Connecting the transport layer. t='+TimeToStr(Time));
loader.Connect;
MbiCallbackOnInfo('Connecting to the COM port.');
MbiCallbackOnLog('Connecting to the COM port. t='+TimeToStr(Time));
Application.ProcessMessages;
if not loader.Connect then
begin
// update the user info
MbiCallbackOnError('Could not connect to COM port. Check your configuration.');
MbiCallbackOnLog('Could not connect to COM port. Check your configuration and try again. t='+TimeToStr(Time));
Exit;
end;
//---------------- start the programming session --------------------------------------
MbiCallbackOnLog('Starting the programming session. t='+TimeToStr(Time));
// try initial connect via XCP
if not loader.StartProgrammingSession then
begin
// update the user info
MbiCallbackOnInfo('Could not connect. Please reset your target...');
MbiCallbackOnLog('Connect failed. Switching to backdoor entry mode. t='+TimeToStr(Time));
Application.ProcessMessages;
end;
while not loader.StartProgrammingSession do
begin
Application.ProcessMessages;
Sleep(5);
if stopRequest then
// continuously try to connect via XCP true the backdoor
while not loader.StartProgrammingSession do
begin
MbiCallbackOnError('Programming session cancelled by user.');
Exit;
Application.ProcessMessages;
Sleep(5);
if stopRequest then
begin
MbiCallbackOnError('Programming session cancelled by user.');
Exit;
end;
end;
end;

View File

@ -72,6 +72,8 @@ type
edtSeedKey: TEdit;
btnBrowse: TButton;
openDialog: TOpenDialog;
edtTconnect: TEdit;
lblTconnect: TLabel;
procedure btnOKClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure btnBrowseClick(Sender: TObject);
@ -202,6 +204,7 @@ begin
FSettingsForm.edtT4.Text := IntToStr(settingsIni.ReadInteger('xcp', 't4', 10000));
FSettingsForm.edtT5.Text := IntToStr(settingsIni.ReadInteger('xcp', 't5', 1000));
FSettingsForm.edtT7.Text := IntToStr(settingsIni.ReadInteger('xcp', 't7', 2000));
FSettingsForm.edtTconnect.Text := IntToStr(settingsIni.ReadInteger('xcp', 'tconnect', 20));
// release ini file object
settingsIni.Free;
@ -216,7 +219,7 @@ begin
FSettingsForm.edtT4.Text := IntToStr(10000);
FSettingsForm.edtT5.Text := IntToStr(1000);
FSettingsForm.edtT7.Text := IntToStr(2000);
FSettingsForm.edtTconnect.Text := IntToStr(20);
end;
// show the form as modal so we can get the result here
@ -234,6 +237,7 @@ begin
settingsIni.WriteInteger('xcp', 't4', StrToInt(FSettingsForm.edtT4.Text));
settingsIni.WriteInteger('xcp', 't5', StrToInt(FSettingsForm.edtT5.Text));
settingsIni.WriteInteger('xcp', 't7', StrToInt(FSettingsForm.edtT7.Text));
settingsIni.WriteInteger('xcp', 'tconnect', StrToInt(FSettingsForm.edtTconnect.Text));
// release ini file object
settingsIni.Free;

View File

@ -61,7 +61,7 @@ type
packetLen : Word;
constructor Create;
procedure Configure(iniFile : string);
procedure Connect;
function Connect: Boolean;
function SendPacket(timeOutms: LongWord): Boolean;
procedure Disconnect;
destructor Destroy; override;
@ -128,15 +128,15 @@ end; //*** end of Configure ***
//***************************************************************************************
// NAME: Connect
// PARAMETER: none
// RETURN VALUE: none
// RETURN VALUE: True if successful, False otherwise.
// DESCRIPTION: Connects the transport layer device.
//
//***************************************************************************************
procedure TXcpTransport.Connect;
function TXcpTransport.Connect: Boolean;
begin
result := true;
if UblOpen(Addr(deviceGuid)) <> UBL_OKAY then
Application.MessageBox( 'Could not connect to USB device.',
'Error', MB_OK or MB_ICONERROR );
result := false;
end; //*** end of Connect ***

View File

@ -31,5 +31,5 @@
-M
-$M16384,1048576
-K$00400000
-E.\..\..\..\
-LNc:\program files (x86)\borland\delphi4\Lib
-E.\..\..\..\..\
-LNc:\borland\delphi4\Lib

View File

@ -39,7 +39,7 @@ MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=.\..\..\..\
OutputDir=.\..\..\..\..\
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
@ -82,5 +82,6 @@ $(DELPHI)\Lib\dclusr40.bpl=Borland User
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlOutputDirectorry]
Count=1
Item0=.\..\..\..\
Count=2
Item0=.\..\..\..\..\
Item1=.\..\..\..\

View File

@ -261,28 +261,49 @@ begin
timer.Enabled := False;
// connect the transport layer
MbiCallbackOnLog('Connecting the transport layer. t='+TimeToStr(Time));
loader.Connect;
MbiCallbackOnInfo('Connecting to target via USB.');
MbiCallbackOnLog('Connecting to target via USB. t='+TimeToStr(Time));
Application.ProcessMessages;
if not loader.Connect then
begin
// update the user info
MbiCallbackOnInfo('Could not connect via USB. Retrying. Reset your target if this takes a long time.');
MbiCallbackOnLog('Transport layer connection failed. t='+TimeToStr(Time));
MbiCallbackOnLog('Retrying transport layer connection. Reset your target if this takes a long time. t='+TimeToStr(Time));
Application.ProcessMessages;
// continuously try to coonect the transport layer
while not loader.Connect do
begin
Application.ProcessMessages;
Sleep(5);
if stopRequest then
begin
MbiCallbackOnError('Transport layer connection cancelled by user.');
Exit;
end;
end;
end;
//---------------- start the programming session --------------------------------------
MbiCallbackOnLog('Starting the programming session. t='+TimeToStr(Time));
// try initial connect via XCP
if not loader.StartProgrammingSession then
begin
// update the user info
MbiCallbackOnInfo('Could not connect. Please reset your target...');
MbiCallbackOnLog('Connect failed. Switching to backdoor entry mode. t='+TimeToStr(Time));
Application.ProcessMessages;
end;
while not loader.StartProgrammingSession do
begin
Application.ProcessMessages;
Sleep(5);
if stopRequest then
// continuously try to connect via XCP true the backdoor
while not loader.StartProgrammingSession do
begin
MbiCallbackOnError('Programming session cancelled by user.');
Exit;
Application.ProcessMessages;
Sleep(5);
if stopRequest then
begin
MbiCallbackOnError('Programming session cancelled by user.');
Exit;
end;
end;
end;

Binary file not shown.

View File

@ -12,3 +12,4 @@ t3=2000
t4=10000
t5=1000
t7=2000
tconnect=20

Binary file not shown.

View File

@ -12,3 +12,4 @@ t3=2000
t4=10000
t5=1000
t7=2000
tconnect=20

BIN
Host/openblt_net.dll Normal file

Binary file not shown.

11
Host/openblt_net.ini Normal file
View File

@ -0,0 +1,11 @@
[net]
hostname=169.254.19.63
port=1000
[xcp]
seedkey=
t1=1000
t3=2000
t4=10000
t5=1000
t7=2000
tconnect=300

Binary file not shown.

View File

@ -8,3 +8,4 @@ t3=2000
t4=10000
t5=1000
t7=2000
tconnect=20

Binary file not shown.

View File

@ -5,3 +5,4 @@ t3=2000
t4=10000
t5=1000
t7=2000
tconnect=20

View File

@ -81,6 +81,48 @@
#define BOOT_COM_UART_CHANNEL_INDEX (0)
/* The NET communication interface for firmware updates via TCP/IP is selected by setting
* the BOOT_COM_NET_ENABLE configurable to 1. The maximum amount of data bytes in a
* message for data transmission and reception is set through BOOT_COM_NET_TX_MAX_DATA
* and BOOT_COM_NET_RX_MAX_DATA, respectively. The default IP address is configured
* with the macros BOOT_COM_NET_IPADDRx. The default netmask is configued with the macros
* BOOT_COM_NET_NETMASKx. The bootloader acts and a TCP/IP server. The port the server
* listen on for connections is configured with BOOT_COM_NET_PORT.
*/
/** \brief Enable/disable the NET transport layer. */
#define BOOT_COM_NET_ENABLE (1)
/** \brief Configure number of bytes in the target->host data packet. */
#define BOOT_COM_NET_TX_MAX_DATA (64)
/** \brief Configure number of bytes in the host->target data packet. */
#define BOOT_COM_NET_RX_MAX_DATA (64)
/** \brief Configure the port that the TCP/IP server listens on */
#define BOOT_COM_NET_PORT (1000)
/** \brief Configure the 1st byte of the IP address */
#define BOOT_COM_NET_IPADDR0 (169)
/** \brief Configure the 2nd byte of the IP address */
#define BOOT_COM_NET_IPADDR1 (254)
/** \brief Configure the 3rd byte of the IP address */
#define BOOT_COM_NET_IPADDR2 (19)
/** \brief Configure the 4th byte of the IP address */
#define BOOT_COM_NET_IPADDR3 (63)
/** \brief Configure the 1st byte of the network mask */
#define BOOT_COM_NET_NETMASK0 (255)
/** \brief Configure the 2nd byte of the network mask */
#define BOOT_COM_NET_NETMASK1 (255)
/** \brief Configure the 3rd byte of the network mask */
#define BOOT_COM_NET_NETMASK2 (0)
/** \brief Configure the 4th byte of the network mask */
#define BOOT_COM_NET_NETMASK3 (0)
/** \brief Enable/disable a hook function that is called when the IP address is about
* to be set. This allows a dynamic override of the BOOT_COM_NET_IPADDRx values.
*/
#define BOOT_COM_NET_IPADDR_HOOK_ENABLE (0)
/** \brief Enable/disable a hook function that is called when the netmask is about
* to be set. This allows a dynamic override of the BOOT_COM_NET_NETMASKx values.
*/
#define BOOT_COM_NET_NETMASK_HOOK_ENABLE (0)
/****************************************************************************************
* F I L E S Y S T E M I N T E R F A C E C O N F I G U R A T I O N
****************************************************************************************/

View File

@ -187,6 +187,55 @@ blt_bool NvmWriteChecksumHook(void)
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
/****************************************************************************************
* N E T W O R K I N T E R F A C E H O O K F U N C T I O N S
****************************************************************************************/
#if (BOOT_COM_NET_IPADDR_HOOK_ENABLE > 0)
/************************************************************************************//**
** \brief Callback that gets called when the IP address is about to be configured.
** \param ipAddrArray 4-byte array where the IP address should be stored.
** \return none.
**
****************************************************************************************/
void NetIpAddressHook(blt_int8u *ipAddrArray)
{
/* This hook function allows a dynamic configuration of the IP address. This could for
* example be used if the bootloader is activated from a running user program and
* should have the same IP address as the user program. This IP address could be stored
* at a fixed location in RAM which can be read here. For now the example implemen-
* tation simply configures the bootloader's default IP address.
*/
ipAddrArray[0] = BOOT_COM_NET_IPADDR0;
ipAddrArray[1] = BOOT_COM_NET_IPADDR1;
ipAddrArray[2] = BOOT_COM_NET_IPADDR2;
ipAddrArray[3] = BOOT_COM_NET_IPADDR3;
} /*** end of NetIpAddressHook ***/
#endif /* BOOT_COM_NET_IPADDR_HOOK_ENABLE > 0 */
#if (BOOT_COM_NET_NETMASK_HOOK_ENABLE > 0)
/************************************************************************************//**
** \brief Callback that gets called when the network mask is about to be configured.
** \param netMaskArray 4-byte array where the network mask should be stored.
** \return none.
**
****************************************************************************************/
void NetNetworkMaskHook(blt_int8u *netMaskArray)
{
/* This hook function allows a dynamic configuration of the network mask. This could
* for example be used if the bootloader is activated from a running user program and
* should have the same network mask as the user program. This network mask could be
* stored at a fixed location in RAM which can be read here. For now the example
* implementation simply configures the bootloader's default network mask.
*/
netMaskArray[0] = BOOT_COM_NET_NETMASK0;
netMaskArray[1] = BOOT_COM_NET_NETMASK1;
netMaskArray[2] = BOOT_COM_NET_NETMASK2;
netMaskArray[3] = BOOT_COM_NET_NETMASK3;
} /*** end of NetNetworkMaskHook ***/
#endif /* BOOT_COM_NET_NETMASK_HOOK_ENABLE > 0 */
/****************************************************************************************
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
****************************************************************************************/

View File

@ -1,7 +1,7 @@
<!DOCTYPE CrossStudio_Project_File>
<solution Name="lm3s6965_crossworks" target="8" version="2">
<project Name="openbtl_ek_lm3s6965">
<configuration Name="Common" Placement="Flash" Target="LM3S6965" arm_architecture="v7M" arm_core_type="Cortex-M3" arm_library_optimization="Small" arm_linker_heap_size="128" arm_linker_process_stack_size="0" arm_linker_stack_size="128" arm_simulator_memory_simulation_filename="$(TargetsDir)/LM3S/LM3SSimulatorMemory.dll" arm_simulator_memory_simulation_parameter="0x40000;0x10000" arm_target_debug_interface_type="ADIv5" arm_target_loader_applicable_loaders="Flash" arm_target_loader_default_loader="Flash" arm_use_gcc_libraries="Yes" build_intermediate_directory="$(Configuration)/../../obj" build_output_directory="$(ProjectDir)/../bin" c_preprocessor_definitions="gcc" c_user_include_directories="$(ProjectDir)/..;$(ProjectDir)/../lib;$(ProjectDir)/../lib/inc;$(ProjectDir)/../lib/fatfs;$(ProjectDir)/../lib/driverlib;$(ProjectDir)/../../../../Source;$(ProjectDir)/../../../../Source/third_party/fatfs/src;$(ProjectDir)/../../../../Source/ARMCM3_LM3S;$(ProjectDir)/../../../../Source/ARMCM3_LM3S/Crossworks" gcc_entry_point="reset_handler" gcc_optimization_level="Optimize For Size" link_include_standard_libraries="Yes" linker_DebugIO_enabled="No" linker_additional_files="" linker_keep_symbols="_vectors;EntryFromProg" linker_memory_map_file="$(TargetsDir)/LM3S/LM3S6965_MemoryMap.xml" linker_output_format="srec" linker_printf_enabled="No" linker_printf_width_precision_supported="No" linker_scanf_enabled="No" linker_scanf_fmt_level="int" linker_section_placement_file="$(StudioDir)/targets/Cortex_M/flash_placement.xml" project_directory="" project_type="Executable" property_groups_file_path="$(TargetsDir)/LM3S/propertyGroups.xml" target_get_partname_script="GetPartName()" target_reset_script="Reset()"/>
<configuration Name="Common" Placement="Flash" Target="LM3S6965" arm_architecture="v7M" arm_core_type="Cortex-M3" arm_gcc_target="arm-unknown-eabi" arm_library_optimization="Small" arm_linker_heap_size="128" arm_linker_process_stack_size="0" arm_linker_stack_size="128" arm_simulator_memory_simulation_filename="$(TargetsDir)/LM3S/LM3SSimulatorMemory.dll" arm_simulator_memory_simulation_parameter="0x40000;0x10000" arm_target_debug_interface_type="ADIv5" arm_target_loader_applicable_loaders="Flash" arm_target_loader_default_loader="Flash" arm_use_gcc_libraries="Yes" build_intermediate_directory="$(Configuration)/../../obj" build_output_directory="$(ProjectDir)/../bin" build_remove_unused_symbols="Yes" c_preprocessor_definitions="gcc" c_user_include_directories="$(ProjectDir)/..;$(ProjectDir)/../lib;$(ProjectDir)/../lib/inc;$(ProjectDir)/../lib/fatfs;$(ProjectDir)/../lib/uip;$(ProjectDir)/../lib/driverlib;$(ProjectDir)/../../../../Source;$(ProjectDir)/../../../../Source/third_party/fatfs/src;$(ProjectDir)/../../../../Source/third_party/uip/uip;$(ProjectDir)/../../../../Source/ARMCM3_LM3S;$(ProjectDir)/../../../../Source/ARMCM3_LM3S/Crossworks" gcc_entry_point="reset_handler" gcc_optimization_level="Optimize For Size" link_include_standard_libraries="Yes" linker_DebugIO_enabled="No" linker_additional_files="" linker_keep_symbols="_vectors;EntryFromProg" linker_memory_map_file="$(TargetsDir)/LM3S/LM3S6965_MemoryMap.xml" linker_output_format="srec" linker_printf_enabled="No" linker_printf_width_precision_supported="No" linker_scanf_enabled="No" linker_scanf_fmt_level="int" linker_section_placement_file="$(StudioDir)/targets/Cortex_M/flash_placement.xml" project_directory="" project_type="Executable" property_groups_file_path="$(TargetsDir)/LM3S/propertyGroups.xml" target_get_partname_script="GetPartName()" target_reset_script="Reset()"/>
<configuration Name="Flash" arm_target_flash_loader_file_path="$(TargetsDir)/LM3S/Release/Loader.elf" arm_target_flash_loader_type="LIBMEM RPC Loader" target_reset_script="FLASHReset()"/>
<folder Name="Source Files">
<configuration Name="Common" filter="c;cpp;cxx;cc;h;s;asm;inc"/>
@ -18,6 +18,7 @@
<file file_name="../lib/inc/hw_uart.h"/>
<file file_name="../lib/inc/hw_memmap.h"/>
<file file_name="../lib/inc/hw_ssi.h"/>
<file file_name="../lib/inc/hw_ethernet.h"/>
</folder>
<folder Name="driverlib" file_name="">
<file file_name="../lib/driverlib/sysctl.c"/>
@ -36,11 +37,20 @@
<file file_name="../lib/driverlib/pin_map.h"/>
<file file_name="../lib/driverlib/ssi.c"/>
<file file_name="../lib/driverlib/ssi.h"/>
<file file_name="../lib/driverlib/ethernet.c"/>
<file file_name="../lib/driverlib/ethernet.h"/>
</folder>
<folder Name="fatfs" file_name="">
<file file_name="../lib/fatfs/ffconf.h"/>
<file file_name="../lib/fatfs/mmc.c"/>
</folder>
<folder Name="uip" file_name="">
<file file_name="../lib/uip/clock-arch.c"/>
<file file_name="../lib/uip/clock-arch.h"/>
<file file_name="../lib/uip/netdev.c"/>
<file file_name="../lib/uip/netdev.h"/>
<file file_name="../lib/uip/uip-conf.h"/>
</folder>
</folder>
<file file_name="../hooks.c"/>
<file file_name="../main.c"/>
@ -88,7 +98,29 @@
<file file_name="../../../../Source/third_party/fatfs/src/integer.h"/>
<file file_name="../../../../Source/third_party/fatfs/src/option/unicode.c"/>
</folder>
<folder Name="uip" file_name="">
<file file_name="../../../../Source/third_party/uip/uip/clock.h"/>
<file file_name="../../../../Source/third_party/uip/uip/lc.h"/>
<file file_name="../../../../Source/third_party/uip/uip/lc-addrlabels.h"/>
<file file_name="../../../../Source/third_party/uip/uip/lc-switch.h"/>
<file file_name="../../../../Source/third_party/uip/uip/pt.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip.c"/>
<file file_name="../../../../Source/third_party/uip/uip/uip.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip_arch.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip_arp.c"/>
<file file_name="../../../../Source/third_party/uip/uip/uip_arp.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip_timer.c"/>
<file file_name="../../../../Source/third_party/uip/uip/uip_timer.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip-fw.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uiplib.c"/>
<file file_name="../../../../Source/third_party/uip/uip/uiplib.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip-neighbor.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uipopt.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip-split.h"/>
</folder>
</folder>
<file file_name="../../../../Source/net.c"/>
<file file_name="../../../../Source/net.h"/>
</folder>
</folder>
<folder Name="System Files">

View File

@ -19,7 +19,8 @@
<ProjectSessionItem path="lm3s6965_crossworks" name="unnamed" />
<ProjectSessionItem path="lm3s6965_crossworks;openbtl_ek_lm3s6965" name="unnamed" />
<ProjectSessionItem path="lm3s6965_crossworks;openbtl_ek_lm3s6965;Source Files" name="unnamed" />
<ProjectSessionItem path="lm3s6965_crossworks;openbtl_ek_lm3s6965;Source Files;Source" name="unnamed" />
<ProjectSessionItem path="lm3s6965_crossworks;openbtl_ek_lm3s6965;Source Files;Demo" name="unnamed" />
<ProjectSessionItem path="lm3s6965_crossworks;openbtl_ek_lm3s6965;Source Files;Demo;Boot" name="unnamed" />
</Project>
<Register1>
<RegisterWindow openNodes="" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="" decimalNodes="" octalNodes="" asciiNodes="" name="openbtl_ek_lm3s6965" />
@ -50,9 +51,7 @@
<Watches active="0" update="Never" />
</Watch4>
<Files>
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Boot\main.c" y="61" path="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Boot\main.c" left="18" selected="0" name="unnamed" top="37" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Work\software\OpenBLT\Target\Source\ARMCM3_LM3S\cpu.c" y="78" path="C:\Work\software\OpenBLT\Target\Source\ARMCM3_LM3S\cpu.c" left="18" selected="0" name="unnamed" top="45" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\work\software\openblt\target\source\file.h" y="11" path="C:\work\software\openblt\target\source\file.h" left="18" selected="1" name="unnamed" top="11" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Boot\main.c" y="82" path="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Boot\main.c" left="18" selected="1" name="unnamed" top="82" />
</Files>
<ARMCrossStudioWindow activeProject="openbtl_ek_lm3s6965" autoConnectTarget="Texas Instruments ICDI" debugSearchFileMap="" fileDialogInitialDirectory="C:\Work\software\OpenBLT\Target\Source\third_party\fatfs\src\option" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Debug" />
<ARMCrossStudioWindow activeProject="openbtl_ek_lm3s6965" autoConnectTarget="Luminary USB Debug" debugSearchFileMap="" fileDialogInitialDirectory="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Boot\lib\uip" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Debug" />
</session>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,187 @@
//*****************************************************************************
//
// ethernet.h - Defines and Macros for the ethernet module.
//
// Copyright (c) 2006-2013 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 10636 of the Stellaris Peripheral Driver Library.
//
//*****************************************************************************
#ifndef __ETHERNET_H__
#define __ETHERNET_H__
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
//*****************************************************************************
//
// Values that can be passed to EthernetConfigSet as the ulConfig value, and
// returned from EthernetConfigGet.
//
//*****************************************************************************
#define ETH_CFG_TS_TSEN 0x010000 // Enable Timestamp (CCP)
#define ETH_CFG_RX_BADCRCDIS 0x000800 // Disable RX BAD CRC Packets
#define ETH_CFG_RX_PRMSEN 0x000400 // Enable RX Promiscuous
#define ETH_CFG_RX_AMULEN 0x000200 // Enable RX Multicast
#define ETH_CFG_TX_DPLXEN 0x000010 // Enable TX Duplex Mode
#define ETH_CFG_TX_CRCEN 0x000004 // Enable TX CRC Generation
#define ETH_CFG_TX_PADEN 0x000002 // Enable TX Padding
//*****************************************************************************
//
// Values that can be passed to EthernetIntEnable, EthernetIntDisable, and
// EthernetIntClear as the ulIntFlags parameter, and returned from
// EthernetIntStatus.
//
//*****************************************************************************
#define ETH_INT_PHY 0x040 // PHY Event/Interrupt
#define ETH_INT_MDIO 0x020 // Management Transaction
#define ETH_INT_RXER 0x010 // RX Error
#define ETH_INT_RXOF 0x008 // RX FIFO Overrun
#define ETH_INT_TX 0x004 // TX Complete
#define ETH_INT_TXER 0x002 // TX Error
#define ETH_INT_RX 0x001 // RX Complete
//*****************************************************************************
//
// Helper Macros for Ethernet Processing
//
//*****************************************************************************
//
// htonl/ntohl - big endian/little endian byte swapping macros for
// 32-bit (long) values
//
//*****************************************************************************
#ifndef htonl
#define htonl(a) \
((((a) >> 24) & 0x000000ff) | \
(((a) >> 8) & 0x0000ff00) | \
(((a) << 8) & 0x00ff0000) | \
(((a) << 24) & 0xff000000))
#endif
#ifndef ntohl
#define ntohl(a) htonl((a))
#endif
//*****************************************************************************
//
// htons/ntohs - big endian/little endian byte swapping macros for
// 16-bit (short) values
//
//*****************************************************************************
#ifndef htons
#define htons(a) \
((((a) >> 8) & 0x00ff) | \
(((a) << 8) & 0xff00))
#endif
#ifndef ntohs
#define ntohs(a) htons((a))
#endif
//*****************************************************************************
//
// API Function prototypes
//
//*****************************************************************************
extern void EthernetInitExpClk(unsigned long ulBase, unsigned long ulEthClk);
extern void EthernetConfigSet(unsigned long ulBase, unsigned long ulConfig);
extern unsigned long EthernetConfigGet(unsigned long ulBase);
extern void EthernetMACAddrSet(unsigned long ulBase,
unsigned char *pucMACAddr);
extern void EthernetMACAddrGet(unsigned long ulBase,
unsigned char *pucMACAddr);
extern void EthernetEnable(unsigned long ulBase);
extern void EthernetDisable(unsigned long ulBase);
extern tBoolean EthernetPacketAvail(unsigned long ulBase);
extern tBoolean EthernetSpaceAvail(unsigned long ulBase);
extern long EthernetPacketGetNonBlocking(unsigned long ulBase,
unsigned char *pucBuf,
long lBufLen);
extern long EthernetPacketGet(unsigned long ulBase, unsigned char *pucBuf,
long lBufLen);
extern long EthernetPacketPutNonBlocking(unsigned long ulBase,
unsigned char *pucBuf,
long lBufLen);
extern long EthernetPacketPut(unsigned long ulBase, unsigned char *pucBuf,
long lBufLen);
extern void EthernetIntRegister(unsigned long ulBase,
void (*pfnHandler)(void));
extern void EthernetIntUnregister(unsigned long ulBase);
extern void EthernetIntEnable(unsigned long ulBase, unsigned long ulIntFlags);
extern void EthernetIntDisable(unsigned long ulBase, unsigned long ulIntFlags);
extern unsigned long EthernetIntStatus(unsigned long ulBase, tBoolean bMasked);
extern void EthernetIntClear(unsigned long ulBase, unsigned long ulIntFlags);
extern void EthernetPHYAddrSet(unsigned long ulBase, unsigned char ucAddr);
extern void EthernetPHYWrite(unsigned long ulBase, unsigned char ucRegAddr,
unsigned long ulData);
extern unsigned long EthernetPHYRead(unsigned long ulBase,
unsigned char ucRegAddr);
extern void EthernetPHYPowerOff(unsigned long ulBase);
extern void EthernetPHYPowerOn(unsigned long ulBase);
//*****************************************************************************
//
// Several Ethernet APIs have been renamed, with the original function name
// being deprecated. These defines provide backward compatibility.
//
//*****************************************************************************
#ifndef DEPRECATED
#include "driverlib/sysctl.h"
#define EthernetInit(a) \
EthernetInitExpClk(a, SysCtlClockGet())
#define EthernetPacketNonBlockingGet(a, b, c) \
EthernetPacketGetNonBlocking(a, b, c)
#define EthernetPacketNonBlockingPut(a, b, c) \
EthernetPacketPutNonBlocking(a, b, c)
#endif
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // __ETHERNET_H__

View File

@ -0,0 +1,703 @@
//*****************************************************************************
//
// hw_ethernet.h - Macros used when accessing the Ethernet hardware.
//
// Copyright (c) 2006-2013 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 10636 of the Stellaris Firmware Development Package.
//
//*****************************************************************************
#ifndef __HW_ETHERNET_H__
#define __HW_ETHERNET_H__
//*****************************************************************************
//
// The following are defines for the Ethernet MAC register offsets.
//
//*****************************************************************************
#define MAC_O_RIS 0x00000000 // Ethernet MAC Raw Interrupt
// Status/Acknowledge
#define MAC_O_IACK 0x00000000 // Ethernet MAC Raw Interrupt
// Status/Acknowledge
#define MAC_O_IM 0x00000004 // Ethernet MAC Interrupt Mask
#define MAC_O_RCTL 0x00000008 // Ethernet MAC Receive Control
#define MAC_O_TCTL 0x0000000C // Ethernet MAC Transmit Control
#define MAC_O_DATA 0x00000010 // Ethernet MAC Data
#define MAC_O_IA0 0x00000014 // Ethernet MAC Individual Address
// 0
#define MAC_O_IA1 0x00000018 // Ethernet MAC Individual Address
// 1
#define MAC_O_THR 0x0000001C // Ethernet MAC Threshold
#define MAC_O_MCTL 0x00000020 // Ethernet MAC Management Control
#define MAC_O_MDV 0x00000024 // Ethernet MAC Management Divider
#define MAC_O_MADD 0x00000028 // Ethernet MAC Management Address
#define MAC_O_MTXD 0x0000002C // Ethernet MAC Management Transmit
// Data
#define MAC_O_MRXD 0x00000030 // Ethernet MAC Management Receive
// Data
#define MAC_O_NP 0x00000034 // Ethernet MAC Number of Packets
#define MAC_O_TR 0x00000038 // Ethernet MAC Transmission
// Request
#define MAC_O_TS 0x0000003C // Ethernet MAC Timer Support
#define MAC_O_LED 0x00000040 // Ethernet MAC LED Encoding
#define MAC_O_MDIX 0x00000044 // Ethernet PHY MDIX
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_RIS register.
//
//*****************************************************************************
#define MAC_RIS_PHYINT 0x00000040 // PHY Interrupt
#define MAC_RIS_MDINT 0x00000020 // MII Transaction Complete
#define MAC_RIS_RXER 0x00000010 // Receive Error
#define MAC_RIS_FOV 0x00000008 // FIFO Overrun
#define MAC_RIS_TXEMP 0x00000004 // Transmit FIFO Empty
#define MAC_RIS_TXER 0x00000002 // Transmit Error
#define MAC_RIS_RXINT 0x00000001 // Packet Received
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_IACK register.
//
//*****************************************************************************
#define MAC_IACK_PHYINT 0x00000040 // Clear PHY Interrupt
#define MAC_IACK_MDINT 0x00000020 // Clear MII Transaction Complete
#define MAC_IACK_RXER 0x00000010 // Clear Receive Error
#define MAC_IACK_FOV 0x00000008 // Clear FIFO Overrun
#define MAC_IACK_TXEMP 0x00000004 // Clear Transmit FIFO Empty
#define MAC_IACK_TXER 0x00000002 // Clear Transmit Error
#define MAC_IACK_RXINT 0x00000001 // Clear Packet Received
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_IM register.
//
//*****************************************************************************
#define MAC_IM_PHYINTM 0x00000040 // Mask PHY Interrupt
#define MAC_IM_MDINTM 0x00000020 // Mask MII Transaction Complete
#define MAC_IM_RXERM 0x00000010 // Mask Receive Error
#define MAC_IM_FOVM 0x00000008 // Mask FIFO Overrun
#define MAC_IM_TXEMPM 0x00000004 // Mask Transmit FIFO Empty
#define MAC_IM_TXERM 0x00000002 // Mask Transmit Error
#define MAC_IM_RXINTM 0x00000001 // Mask Packet Received
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_RCTL register.
//
//*****************************************************************************
#define MAC_RCTL_RSTFIFO 0x00000010 // Clear Receive FIFO
#define MAC_RCTL_BADCRC 0x00000008 // Enable Reject Bad CRC
#define MAC_RCTL_PRMS 0x00000004 // Enable Promiscuous Mode
#define MAC_RCTL_AMUL 0x00000002 // Enable Multicast Frames
#define MAC_RCTL_RXEN 0x00000001 // Enable Receiver
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_TCTL register.
//
//*****************************************************************************
#define MAC_TCTL_DUPLEX 0x00000010 // Enable Duplex Mode
#define MAC_TCTL_CRC 0x00000004 // Enable CRC Generation
#define MAC_TCTL_PADEN 0x00000002 // Enable Packet Padding
#define MAC_TCTL_TXEN 0x00000001 // Enable Transmitter
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_DATA register.
//
//*****************************************************************************
#define MAC_DATA_TXDATA_M 0xFFFFFFFF // Transmit FIFO Data
#define MAC_DATA_RXDATA_M 0xFFFFFFFF // Receive FIFO Data
#define MAC_DATA_RXDATA_S 0
#define MAC_DATA_TXDATA_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_IA0 register.
//
//*****************************************************************************
#define MAC_IA0_MACOCT4_M 0xFF000000 // MAC Address Octet 4
#define MAC_IA0_MACOCT3_M 0x00FF0000 // MAC Address Octet 3
#define MAC_IA0_MACOCT2_M 0x0000FF00 // MAC Address Octet 2
#define MAC_IA0_MACOCT1_M 0x000000FF // MAC Address Octet 1
#define MAC_IA0_MACOCT4_S 24
#define MAC_IA0_MACOCT3_S 16
#define MAC_IA0_MACOCT2_S 8
#define MAC_IA0_MACOCT1_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_IA1 register.
//
//*****************************************************************************
#define MAC_IA1_MACOCT6_M 0x0000FF00 // MAC Address Octet 6
#define MAC_IA1_MACOCT5_M 0x000000FF // MAC Address Octet 5
#define MAC_IA1_MACOCT6_S 8
#define MAC_IA1_MACOCT5_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_THR register.
//
//*****************************************************************************
#define MAC_THR_THRESH_M 0x0000003F // Threshold Value
#define MAC_THR_THRESH_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MCTL register.
//
//*****************************************************************************
#define MAC_MCTL_REGADR_M 0x000000F8 // MII Register Address
#define MAC_MCTL_WRITE 0x00000002 // MII Register Transaction Type
#define MAC_MCTL_START 0x00000001 // MII Register Transaction Enable
#define MAC_MCTL_REGADR_S 3
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MDV register.
//
//*****************************************************************************
#define MAC_MDV_DIV_M 0x000000FF // Clock Divider
#define MAC_MDV_DIV_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MADD register.
//
//*****************************************************************************
#define MAC_MADD_PHYADR_M 0x0000001F // PHY Address
#define MAC_MADD_PHYADR_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MTXD register.
//
//*****************************************************************************
#define MAC_MTXD_MDTX_M 0x0000FFFF // MII Register Transmit Data
#define MAC_MTXD_MDTX_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MRXD register.
//
//*****************************************************************************
#define MAC_MRXD_MDRX_M 0x0000FFFF // MII Register Receive Data
#define MAC_MRXD_MDRX_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_NP register.
//
//*****************************************************************************
#define MAC_NP_NPR_M 0x0000003F // Number of Packets in Receive
// FIFO
#define MAC_NP_NPR_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_TR register.
//
//*****************************************************************************
#define MAC_TR_NEWTX 0x00000001 // New Transmission
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_TS register.
//
//*****************************************************************************
#define MAC_TS_TSEN 0x00000001 // Time Stamp Enable
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_LED register.
//
//*****************************************************************************
#define MAC_LED_LED1_M 0x00000F00 // LED1 Source
#define MAC_LED_LED1_LINK 0x00000000 // Link OK
#define MAC_LED_LED1_RXTX 0x00000100 // RX or TX Activity (Default LED1)
#define MAC_LED_LED1_100 0x00000500 // 100BASE-TX mode
#define MAC_LED_LED1_10 0x00000600 // 10BASE-T mode
#define MAC_LED_LED1_DUPLEX 0x00000700 // Full-Duplex
#define MAC_LED_LED1_LINKACT 0x00000800 // Link OK & Blink=RX or TX
// Activity
#define MAC_LED_LED0_M 0x0000000F // LED0 Source
#define MAC_LED_LED0_LINK 0x00000000 // Link OK (Default LED0)
#define MAC_LED_LED0_RXTX 0x00000001 // RX or TX Activity
#define MAC_LED_LED0_100 0x00000005 // 100BASE-TX mode
#define MAC_LED_LED0_10 0x00000006 // 10BASE-T mode
#define MAC_LED_LED0_DUPLEX 0x00000007 // Full-Duplex
#define MAC_LED_LED0_LINKACT 0x00000008 // Link OK & Blink=RX or TX
// Activity
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MDIX register.
//
//*****************************************************************************
#define MAC_MDIX_EN 0x00000001 // MDI/MDI-X Enable
//*****************************************************************************
//
// The following are defines for the Ethernet Controller PHY registers.
//
//*****************************************************************************
#define PHY_MR0 0x00000000 // Ethernet PHY Management Register
// 0 - Control
#define PHY_MR1 0x00000001 // Ethernet PHY Management Register
// 1 - Status
#define PHY_MR2 0x00000002 // Ethernet PHY Management Register
// 2 - PHY Identifier 1
#define PHY_MR3 0x00000003 // Ethernet PHY Management Register
// 3 - PHY Identifier 2
#define PHY_MR4 0x00000004 // Ethernet PHY Management Register
// 4 - Auto-Negotiation
// Advertisement
#define PHY_MR5 0x00000005 // Ethernet PHY Management Register
// 5 - Auto-Negotiation Link
// Partner Base Page Ability
#define PHY_MR6 0x00000006 // Ethernet PHY Management Register
// 6 - Auto-Negotiation Expansion
#define PHY_MR16 0x00000010 // Ethernet PHY Management Register
// 16 - Vendor-Specific
#define PHY_MR17 0x00000011 // Ethernet PHY Management Register
// 17 - Mode Control/Status
#define PHY_MR18 0x00000012 // Ethernet PHY Management Register
// 18 - Diagnostic
#define PHY_MR19 0x00000013 // Ethernet PHY Management Register
// 19 - Transceiver Control
#define PHY_MR23 0x00000017 // Ethernet PHY Management Register
// 23 - LED Configuration
#define PHY_MR24 0x00000018 // Ethernet PHY Management Register
// 24 -MDI/MDIX Control
#define PHY_MR27 0x0000001B // Ethernet PHY Management Register
// 27 - Special Control/Status
#define PHY_MR29 0x0000001D // Ethernet PHY Management Register
// 29 - Interrupt Status
#define PHY_MR30 0x0000001E // Ethernet PHY Management Register
// 30 - Interrupt Mask
#define PHY_MR31 0x0000001F // Ethernet PHY Management Register
// 31 - PHY Special Control/Status
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR0 register.
//
//*****************************************************************************
#define PHY_MR0_RESET 0x00008000 // Reset Registers
#define PHY_MR0_LOOPBK 0x00004000 // Loopback Mode
#define PHY_MR0_SPEEDSL 0x00002000 // Speed Select
#define PHY_MR0_ANEGEN 0x00001000 // Auto-Negotiation Enable
#define PHY_MR0_PWRDN 0x00000800 // Power Down
#define PHY_MR0_ISO 0x00000400 // Isolate
#define PHY_MR0_RANEG 0x00000200 // Restart Auto-Negotiation
#define PHY_MR0_DUPLEX 0x00000100 // Set Duplex Mode
#define PHY_MR0_COLT 0x00000080 // Collision Test
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR1 register.
//
//*****************************************************************************
#define PHY_MR1_100X_F 0x00004000 // 100BASE-TX Full-Duplex Mode
#define PHY_MR1_100X_H 0x00002000 // 100BASE-TX Half-Duplex Mode
#define PHY_MR1_10T_F 0x00001000 // 10BASE-T Full-Duplex Mode
#define PHY_MR1_10T_H 0x00000800 // 10BASE-T Half-Duplex Mode
#define PHY_MR1_MFPS 0x00000040 // Management Frames with Preamble
// Suppressed
#define PHY_MR1_ANEGC 0x00000020 // Auto-Negotiation Complete
#define PHY_MR1_RFAULT 0x00000010 // Remote Fault
#define PHY_MR1_ANEGA 0x00000008 // Auto-Negotiation
#define PHY_MR1_LINK 0x00000004 // Link Made
#define PHY_MR1_JAB 0x00000002 // Jabber Condition
#define PHY_MR1_EXTD 0x00000001 // Extended Capabilities
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR2 register.
//
//*****************************************************************************
#define PHY_MR2_OUI_M 0x0000FFFF // Organizationally Unique
// Identifier[21:6]
#define PHY_MR2_OUI_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR3 register.
//
//*****************************************************************************
#define PHY_MR3_OUI_M 0x0000FC00 // Organizationally Unique
// Identifier[5:0]
#define PHY_MR3_MN_M 0x000003F0 // Model Number
#define PHY_MR3_RN_M 0x0000000F // Revision Number
#define PHY_MR3_OUI_S 10
#define PHY_MR3_MN_S 4
#define PHY_MR3_RN_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR4 register.
//
//*****************************************************************************
#define PHY_MR4_NP 0x00008000 // Next Page
#define PHY_MR4_RF 0x00002000 // Remote Fault
#define PHY_MR4_A3 0x00000100 // Technology Ability Field [3]
#define PHY_MR4_A2 0x00000080 // Technology Ability Field [2]
#define PHY_MR4_A1 0x00000040 // Technology Ability Field [1]
#define PHY_MR4_A0 0x00000020 // Technology Ability Field [0]
#define PHY_MR4_S_M 0x0000001F // Selector Field
#define PHY_MR4_S_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR5 register.
//
//*****************************************************************************
#define PHY_MR5_NP 0x00008000 // Next Page
#define PHY_MR5_ACK 0x00004000 // Acknowledge
#define PHY_MR5_RF 0x00002000 // Remote Fault
#define PHY_MR5_A_M 0x00001FE0 // Technology Ability Field
#define PHY_MR5_S_M 0x0000001F // Selector Field
#define PHY_MR5_S_8023 0x00000001 // IEEE Std 802.3
#define PHY_MR5_S_8029 0x00000002 // IEEE Std 802.9 ISLAN-16T
#define PHY_MR5_S_8025 0x00000003 // IEEE Std 802.5
#define PHY_MR5_S_1394 0x00000004 // IEEE Std 1394
#define PHY_MR5_A_S 5
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR6 register.
//
//*****************************************************************************
#define PHY_MR6_PDF 0x00000010 // Parallel Detection Fault
#define PHY_MR6_LPNPA 0x00000008 // Link Partner is Next Page Able
#define PHY_MR6_PRX 0x00000002 // New Page Received
#define PHY_MR6_LPANEGA 0x00000001 // Link Partner is Auto-Negotiation
// Able
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR16 register.
//
//*****************************************************************************
#define PHY_MR16_RPTR 0x00008000 // Repeater Mode
#define PHY_MR16_INPOL 0x00004000 // Interrupt Polarity
#define PHY_MR16_TXHIM 0x00001000 // Transmit High Impedance Mode
#define PHY_MR16_SQEI 0x00000800 // SQE Inhibit Testing
#define PHY_MR16_NL10 0x00000400 // Natural Loopback Mode
#define PHY_MR16_SR_M 0x000003C0 // Silicon Revision Identifier
#define PHY_MR16_APOL 0x00000020 // Auto-Polarity Disable
#define PHY_MR16_RVSPOL 0x00000010 // Receive Data Polarity
#define PHY_MR16_PCSBP 0x00000002 // PCS Bypass
#define PHY_MR16_RXCC 0x00000001 // Receive Clock Control
#define PHY_MR16_SR_S 6
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR17 register.
//
//*****************************************************************************
#define PHY_MR17_JABBER_IE 0x00008000 // Jabber Interrupt Enable
#define PHY_MR17_FASTRIP 0x00004000 // 10-BASE-T Fast Mode Enable
#define PHY_MR17_RXER_IE 0x00004000 // Receive Error Interrupt Enable
#define PHY_MR17_EDPD 0x00002000 // Enable Energy Detect Power Down
#define PHY_MR17_PRX_IE 0x00002000 // Page Received Interrupt Enable
#define PHY_MR17_PDF_IE 0x00001000 // Parallel Detection Fault
// Interrupt Enable
#define PHY_MR17_LSQE 0x00000800 // Low Squelch Enable
#define PHY_MR17_LPACK_IE 0x00000800 // LP Acknowledge Interrupt Enable
#define PHY_MR17_LSCHG_IE 0x00000400 // Link Status Change Interrupt
// Enable
#define PHY_MR17_RFAULT_IE 0x00000200 // Remote Fault Interrupt Enable
#define PHY_MR17_ANEGCOMP_IE 0x00000100 // Auto-Negotiation Complete
// Interrupt Enable
#define PHY_MR17_FASTEST 0x00000100 // Auto-Negotiation Test Mode
#define PHY_MR17_JABBER_INT 0x00000080 // Jabber Event Interrupt
#define PHY_MR17_RXER_INT 0x00000040 // Receive Error Interrupt
#define PHY_MR17_PRX_INT 0x00000020 // Page Receive Interrupt
#define PHY_MR17_PDF_INT 0x00000010 // Parallel Detection Fault
// Interrupt
#define PHY_MR17_LPACK_INT 0x00000008 // LP Acknowledge Interrupt
#define PHY_MR17_LSCHG_INT 0x00000004 // Link Status Change Interrupt
#define PHY_MR17_FGLS 0x00000004 // Force Good Link Status
#define PHY_MR17_RFAULT_INT 0x00000002 // Remote Fault Interrupt
#define PHY_MR17_ENON 0x00000002 // Energy On
#define PHY_MR17_ANEGCOMP_INT 0x00000001 // Auto-Negotiation Complete
// Interrupt
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR18 register.
//
//*****************************************************************************
#define PHY_MR18_ANEGF 0x00001000 // Auto-Negotiation Failure
#define PHY_MR18_DPLX 0x00000800 // Duplex Mode
#define PHY_MR18_RATE 0x00000400 // Rate
#define PHY_MR18_RXSD 0x00000200 // Receive Detection
#define PHY_MR18_RX_LOCK 0x00000100 // Receive PLL Lock
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR19 register.
//
//*****************************************************************************
#define PHY_MR19_TXO_M 0x0000C000 // Transmit Amplitude Selection
#define PHY_MR19_TXO_00DB 0x00000000 // Gain set for 0.0dB of insertion
// loss
#define PHY_MR19_TXO_04DB 0x00004000 // Gain set for 0.4dB of insertion
// loss
#define PHY_MR19_TXO_08DB 0x00008000 // Gain set for 0.8dB of insertion
// loss
#define PHY_MR19_TXO_12DB 0x0000C000 // Gain set for 1.2dB of insertion
// loss
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR23 register.
//
//*****************************************************************************
#define PHY_MR23_LED1_M 0x000000F0 // LED1 Source
#define PHY_MR23_LED1_LINK 0x00000000 // Link OK
#define PHY_MR23_LED1_RXTX 0x00000010 // RX or TX Activity (Default LED1)
#define PHY_MR23_LED1_100 0x00000050 // 100BASE-TX mode
#define PHY_MR23_LED1_10 0x00000060 // 10BASE-T mode
#define PHY_MR23_LED1_DUPLEX 0x00000070 // Full-Duplex
#define PHY_MR23_LED1_LINKACT 0x00000080 // Link OK & Blink=RX or TX
// Activity
#define PHY_MR23_LED0_M 0x0000000F // LED0 Source
#define PHY_MR23_LED0_LINK 0x00000000 // Link OK (Default LED0)
#define PHY_MR23_LED0_RXTX 0x00000001 // RX or TX Activity
#define PHY_MR23_LED0_100 0x00000005 // 100BASE-TX mode
#define PHY_MR23_LED0_10 0x00000006 // 10BASE-T mode
#define PHY_MR23_LED0_DUPLEX 0x00000007 // Full-Duplex
#define PHY_MR23_LED0_LINKACT 0x00000008 // Link OK & Blink=RX or TX
// Activity
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR24 register.
//
//*****************************************************************************
#define PHY_MR24_PD_MODE 0x00000080 // Parallel Detection Mode
#define PHY_MR24_AUTO_SW 0x00000040 // Auto-Switching Enable
#define PHY_MR24_MDIX 0x00000020 // Auto-Switching Configuration
#define PHY_MR24_MDIX_CM 0x00000010 // Auto-Switching Complete
#define PHY_MR24_MDIX_SD_M 0x0000000F // Auto-Switching Seed
#define PHY_MR24_MDIX_SD_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR27 register.
//
//*****************************************************************************
#define PHY_MR27_XPOL 0x00000010 // Polarity State of 10 BASE-T
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR29 register.
//
//*****************************************************************************
#define PHY_MR29_EONIS 0x00000080 // ENERGYON Interrupt
#define PHY_MR29_ANCOMPIS 0x00000040 // Auto-Negotiation Complete
// Interrupt
#define PHY_MR29_RFLTIS 0x00000020 // Remote Fault Interrupt
#define PHY_MR29_LDIS 0x00000010 // Link Down Interrupt
#define PHY_MR29_LPACKIS 0x00000008 // Auto-Negotiation LP Acknowledge
#define PHY_MR29_PDFIS 0x00000004 // Parallel Detection Fault
#define PHY_MR29_PRXIS 0x00000002 // Auto Negotiation Page Received
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR30 register.
//
//*****************************************************************************
#define PHY_MR30_EONIM 0x00000080 // ENERGYON Interrupt Enabled
#define PHY_MR30_ANCOMPIM 0x00000040 // Auto-Negotiation Complete
// Interrupt Enabled
#define PHY_MR30_RFLTIM 0x00000020 // Remote Fault Interrupt Enabled
#define PHY_MR30_LDIM 0x00000010 // Link Down Interrupt Enabled
#define PHY_MR30_LPACKIM 0x00000008 // Auto-Negotiation LP Acknowledge
// Enabled
#define PHY_MR30_PDFIM 0x00000004 // Parallel Detection Fault Enabled
#define PHY_MR30_PRXIM 0x00000002 // Auto Negotiation Page Received
// Enabled
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR31 register.
//
//*****************************************************************************
#define PHY_MR31_AUTODONE 0x00001000 // Auto Negotiation Done
#define PHY_MR31_SPEED_M 0x0000001C // HCD Speed Value
#define PHY_MR31_SPEED_10HD 0x00000004 // 10BASE-T half duplex
#define PHY_MR31_SPEED_100HD 0x00000008 // 100BASE-T half duplex
#define PHY_MR31_SPEED_10FD 0x00000014 // 10BASE-T full duplex
#define PHY_MR31_SPEED_100FD 0x00000018 // 100BASE-T full duplex
#define PHY_MR31_SCRDIS 0x00000001 // Scramble Disable
//*****************************************************************************
//
// The following definitions are deprecated.
//
//*****************************************************************************
#ifndef DEPRECATED
//*****************************************************************************
//
// The following are deprecated defines for the Ethernet MAC register offsets.
//
//*****************************************************************************
#define MAC_O_IS 0x00000000 // Interrupt Status Register
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_IS
// register.
//
//*****************************************************************************
#define MAC_IS_PHYINT 0x00000040 // PHY Interrupt
#define MAC_IS_MDINT 0x00000020 // MDI Transaction Complete
#define MAC_IS_RXER 0x00000010 // RX Error
#define MAC_IS_FOV 0x00000008 // RX FIFO Overrun
#define MAC_IS_TXEMP 0x00000004 // TX FIFO Empy
#define MAC_IS_TXER 0x00000002 // TX Error
#define MAC_IS_RXINT 0x00000001 // RX Packet Available
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_IA0
// register.
//
//*****************************************************************************
#define MAC_IA0_MACOCT4 0xFF000000 // 4th Octet of MAC address
#define MAC_IA0_MACOCT3 0x00FF0000 // 3rd Octet of MAC address
#define MAC_IA0_MACOCT2 0x0000FF00 // 2nd Octet of MAC address
#define MAC_IA0_MACOCT1 0x000000FF // 1st Octet of MAC address
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_IA1
// register.
//
//*****************************************************************************
#define MAC_IA1_MACOCT6 0x0000FF00 // 6th Octet of MAC address
#define MAC_IA1_MACOCT5 0x000000FF // 5th Octet of MAC address
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_THR
// register.
//
//*****************************************************************************
#define MAC_THR_THRESH 0x0000003F // Transmit Threshold Value
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_MCTL
// register.
//
//*****************************************************************************
#define MAC_MCTL_REGADR 0x000000F8 // Address for Next MII Transaction
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_MDV
// register.
//
//*****************************************************************************
#define MAC_MDV_DIV 0x000000FF // Clock Divider for MDC for TX
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_MTXD
// register.
//
//*****************************************************************************
#define MAC_MTXD_MDTX 0x0000FFFF // Data for Next MII Transaction
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_MRXD
// register.
//
//*****************************************************************************
#define MAC_MRXD_MDRX 0x0000FFFF // Data Read from Last MII Trans
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_NP
// register.
//
//*****************************************************************************
#define MAC_NP_NPR 0x0000003F // Number of RX Frames in FIFO
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the PHY_MR23
// register.
//
//*****************************************************************************
#define PHY_MR23_LED1_TX 0x00000020 // TX Activity
#define PHY_MR23_LED1_RX 0x00000030 // RX Activity
#define PHY_MR23_LED1_COL 0x00000040 // Collision
#define PHY_MR23_LED0_TX 0x00000002 // TX Activity
#define PHY_MR23_LED0_RX 0x00000003 // RX Activity
#define PHY_MR23_LED0_COL 0x00000004 // Collision
//*****************************************************************************
//
// The following are deprecated defines for the reset values of the MAC
// registers.
//
//*****************************************************************************
#define MAC_RV_MDV 0x00000080
#define MAC_RV_IM 0x0000007F
#define MAC_RV_THR 0x0000003F
#define MAC_RV_RCTL 0x00000008
#define MAC_RV_IA0 0x00000000
#define MAC_RV_TCTL 0x00000000
#define MAC_RV_DATA 0x00000000
#define MAC_RV_MRXD 0x00000000
#define MAC_RV_TR 0x00000000
#define MAC_RV_IS 0x00000000
#define MAC_RV_NP 0x00000000
#define MAC_RV_MCTL 0x00000000
#define MAC_RV_MTXD 0x00000000
#define MAC_RV_IA1 0x00000000
#define MAC_RV_IACK 0x00000000
#define MAC_RV_MADD 0x00000000
#endif
#endif // __HW_ETHERNET_H__

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: clock-arch.c,v 1.2 2006/06/12 08:00:31 adam Exp $
*/
/**
* \file
* Implementation of architecture-specific clock functionality
* \author
* Adam Dunkels <adam@sics.se>
*/
#include "clock-arch.h"
#include "boot.h"
/*---------------------------------------------------------------------------*/
clock_time_t
clock_time(void)
{
return (clock_time_t)TimerGet();
}
/*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,40 @@
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: clock-arch.h,v 1.2 2006/06/12 08:00:31 adam Exp $
*/
#ifndef __CLOCK_ARCH_H__
#define __CLOCK_ARCH_H__
typedef int clock_time_t;
#define CLOCK_CONF_SECOND 1000
#endif /* __CLOCK_ARCH_H__ */

View File

@ -0,0 +1,169 @@
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: netdev.c,v 1.8 2006/06/07 08:39:58 adam Exp $
*/
/*---------------------------------------------------------------------------*/
#include "uip.h"
#include "uip_arp.h"
#include "boot.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_ethernet.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/ethernet.h"
#include "driverlib/flashlib.h"
/*---------------------------------------------------------------------------*/
#define NETDEV_LINKUP_TIMEOUT_MS (5000)
#define NETDEV_DEFAULT_MACADDR0 (0x08)
#define NETDEV_DEFAULT_MACADDR1 (0x00)
#define NETDEV_DEFAULT_MACADDR2 (0x27)
#define NETDEV_DEFAULT_MACADDR3 (0x69)
#define NETDEV_DEFAULT_MACADDR4 (0x5B)
#define NETDEV_DEFAULT_MACADDR5 (0x45)
/*---------------------------------------------------------------------------*/
void netdev_init(void)
{
blt_int32u ulTemp;
blt_int32u ulLinkTimeOut;
/* enable and reset the ethernet controller. */
SysCtlPeripheralEnable(SYSCTL_PERIPH_ETH);
SysCtlPeripheralReset(SYSCTL_PERIPH_ETH);
/* enable port F for ethernet LEDs.
* LED0 Bit 3 Output
* LED1 Bit 2 Output
*/
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeEthernetLED(GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_3);
/* intialize the ethernet controller and disable all ethernet controller
* interrupt sources.
*/
EthernetIntDisable(ETH_BASE, (ETH_INT_PHY | ETH_INT_MDIO | ETH_INT_RXER |
ETH_INT_RXOF | ETH_INT_TX | ETH_INT_TXER | ETH_INT_RX));
ulTemp = EthernetIntStatus(ETH_BASE, false);
EthernetIntClear(ETH_BASE, ulTemp);
/* initialize the ethernet controller for operation. */
EthernetInitExpClk(ETH_BASE, SysCtlClockGet());
/* configure the ethernet controller for normal operation.
* - Full Duplex
* - TX CRC Auto Generation
* - TX Padding Enabled
*/
EthernetConfigSet(ETH_BASE, (ETH_CFG_TX_DPLXEN | ETH_CFG_TX_CRCEN |
ETH_CFG_TX_PADEN));
/* wait for the link to become active. */
ulTemp = EthernetPHYRead(ETH_BASE, PHY_MR1);
ulLinkTimeOut = TimerGet() + NETDEV_LINKUP_TIMEOUT_MS;
while ((ulTemp & 0x0004) == 0)
{
ulTemp = EthernetPHYRead(ETH_BASE, PHY_MR1);
/* check for timeout so that the software program can still start if the
* ethernet cable is not connected.
*/
if (TimerGet() >= ulLinkTimeOut)
{
break;
}
}
/* enable the ethernet controller. */
EthernetEnable(ETH_BASE);
}
/*---------------------------------------------------------------------------*/
void netdev_setmacaddr(void)
{
struct uip_eth_addr macAddress;
unsigned long ulUser0, ulUser1;
/* set the default MAC address */
macAddress.addr[0] = NETDEV_DEFAULT_MACADDR0;
macAddress.addr[1] = NETDEV_DEFAULT_MACADDR1;
macAddress.addr[2] = NETDEV_DEFAULT_MACADDR2;
macAddress.addr[3] = NETDEV_DEFAULT_MACADDR3;
macAddress.addr[4] = NETDEV_DEFAULT_MACADDR4;
macAddress.addr[5] = NETDEV_DEFAULT_MACADDR5;
/* the LM3S eval kit should have a MAC address pre-propgrammed in flash by the
* manufacturer. try to use this one, otherwise use the default values.
*/
FlashUserGet(&ulUser0, &ulUser1);
if ( (ulUser0 != 0xffffffff) && (ulUser1 != 0xffffffff) )
{
macAddress.addr[0] = ((ulUser0 >> 0) & 0xff);
macAddress.addr[1] = ((ulUser0 >> 8) & 0xff);
macAddress.addr[2] = ((ulUser0 >> 16) & 0xff);
macAddress.addr[3] = ((ulUser1 >> 0) & 0xff);
macAddress.addr[4] = ((ulUser1 >> 8) & 0xff);
macAddress.addr[5] = ((ulUser1 >> 16) & 0xff);
}
EthernetMACAddrSet(ETH_BASE, &macAddress.addr[0]);
uip_setethaddr(macAddress);
}
/*---------------------------------------------------------------------------*/
unsigned int netdev_read(void)
{
blt_int32u ulTemp;
/* read and Clear the interrupt flag. */
ulTemp = EthernetIntStatus(ETH_BASE, false);
EthernetIntClear(ETH_BASE, ulTemp);
/* check to see if an RX Interrupt has occured. */
if(ulTemp & ETH_INT_RX)
{
return EthernetPacketGetNonBlocking(ETH_BASE, uip_buf, sizeof(uip_buf));
}
return 0;
}
/*---------------------------------------------------------------------------*/
void netdev_send(void)
{
EthernetPacketPut(ETH_BASE, uip_buf, uip_len);
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: netdev.h,v 1.1 2002/01/10 06:22:56 adam Exp $
*
*/
#ifndef __NETDEV_H__
#define __NETDEV_H__
void netdev_init(void);
unsigned int netdev_read(void);
void netdev_send(void);
void netdev_setmacaddr(void);
#endif /* __NETDEV_H__ */

View File

@ -0,0 +1,151 @@
/**
* \addtogroup uipopt
* @{
*/
/**
* \name Project-specific configuration options
* @{
*
* uIP has a number of configuration options that can be overridden
* for each project. These are kept in a project-specific uip-conf.h
* file and all configuration names have the prefix UIP_CONF.
*/
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: uip-conf.h,v 1.6 2006/06/12 08:00:31 adam Exp $
*/
/**
* \file
* An example uIP configuration file
* \author
* Adam Dunkels <adam@sics.se>
*/
#ifndef __UIP_CONF_H__
#define __UIP_CONF_H__
/**
* 8 bit datatype
*
* This typedef defines the 8-bit type used throughout uIP.
*
* \hideinitializer
*/
typedef unsigned char u8_t;
/**
* 16 bit datatype
*
* This typedef defines the 16-bit type used throughout uIP.
*
* \hideinitializer
*/
typedef unsigned short u16_t;
/**
* Statistics datatype
*
* This typedef defines the dataype used for keeping statistics in
* uIP.
*
* \hideinitializer
*/
typedef unsigned short uip_stats_t;
/**
* Maximum number of TCP connections.
*
* \hideinitializer
*/
#define UIP_CONF_MAX_CONNECTIONS 1
/**
* Maximum number of listening TCP ports.
*
* \hideinitializer
*/
#define UIP_CONF_MAX_LISTENPORTS 1
/**
* uIP buffer size.
*
* \hideinitializer
*/
#define UIP_CONF_BUFFER_SIZE 1600
/**
* CPU byte order.
*
* \hideinitializer
*/
#define UIP_CONF_BYTE_ORDER LITTLE_ENDIAN
/**
* Logging on or off
*
* \hideinitializer
*/
#define UIP_CONF_LOGGING 0
/**
* UDP support on or off
*
* \hideinitializer
*/
#define UIP_CONF_UDP 0
/**
* UDP checksums on or off
*
* \hideinitializer
*/
#define UIP_CONF_UDP_CHECKSUMS 1
/**
* uIP statistics on or off
*
* \hideinitializer
*/
#define UIP_CONF_STATISTICS 0
/* Here we include the header file for the application(s) we use in
our project. */
#include "boot.h"
#include "net.h"
#endif /* __UIP_CONF_H__ */
/** @} */
/** @} */

View File

@ -1,7 +1,7 @@
<!DOCTYPE CrossStudio_Project_File>
<solution Name="lm3s6965_crossworks" target="8" version="2">
<project Name="demoprog_ek_lm3s6965">
<configuration Name="Common" Placement="Flash" Target="LM3S6965" arm_architecture="v7M" arm_core_type="Cortex-M3" arm_linker_heap_size="128" arm_linker_process_stack_size="0" arm_linker_stack_size="128" arm_long_calls="Yes" arm_simulator_memory_simulation_filename="$(TargetsDir)/LM3S/LM3SSimulatorMemory.dll" arm_simulator_memory_simulation_parameter="0x40000;0x10000" arm_target_debug_interface_type="ADIv5" arm_target_loader_applicable_loaders="Flash" arm_target_loader_default_loader="Flash" arm_use_gcc_libraries="Yes" build_intermediate_directory="$(Configuration)/../../obj" build_output_directory="$(ProjectDir)/../bin" c_preprocessor_definitions="gcc" c_user_include_directories="$(ProjectDir)/..;$(ProjectDir)/../lib;$(ProjectDir)/../lib/inc;$(ProjectDir)/../lib/driverlib" gcc_entry_point="reset_handler" gcc_optimization_level="None" linker_additional_files="" linker_memory_map_file="$(TargetsDir)/LM3S/LM3S6965_MemoryMap.xml" linker_output_format="srec" linker_printf_width_precision_supported="No" linker_scanf_fmt_level="int" linker_section_placement_file="$(StudioDir)/targets/Cortex_M/flash_placement.xml" project_directory="" project_type="Executable" property_groups_file_path="$(TargetsDir)/LM3S/propertyGroups.xml" target_get_partname_script="GetPartName()" target_reset_script="Reset()"/>
<configuration Name="Common" Placement="Flash" Target="LM3S6965" arm_architecture="v7M" arm_core_type="Cortex-M3" arm_gcc_target="arm-unknown-eabi" arm_linker_heap_size="128" arm_linker_process_stack_size="0" arm_linker_stack_size="128" arm_long_calls="Yes" arm_simulator_memory_simulation_filename="$(TargetsDir)/LM3S/LM3SSimulatorMemory.dll" arm_simulator_memory_simulation_parameter="0x40000;0x10000" arm_target_debug_interface_type="ADIv5" arm_target_loader_applicable_loaders="Flash" arm_target_loader_default_loader="Flash" arm_use_gcc_libraries="Yes" build_intermediate_directory="$(Configuration)/../../obj" build_output_directory="$(ProjectDir)/../bin" c_preprocessor_definitions="gcc" c_user_include_directories="$(ProjectDir)/..;$(ProjectDir)/../lib;$(ProjectDir)/../lib/inc;$(ProjectDir)/../lib/driverlib" gcc_entry_point="reset_handler" gcc_optimization_level="None" linker_additional_files="" linker_memory_map_file="$(TargetsDir)/LM3S/LM3S6965_MemoryMap.xml" linker_output_format="srec" linker_printf_width_precision_supported="No" linker_scanf_fmt_level="int" linker_section_placement_file="$(StudioDir)/targets/Cortex_M/flash_placement.xml" project_directory="" project_type="Executable" property_groups_file_path="$(TargetsDir)/LM3S/propertyGroups.xml" target_get_partname_script="GetPartName()" target_reset_script="Reset()"/>
<configuration Name="Flash" arm_target_flash_loader_file_path="$(TargetsDir)/LM3S/Release/Loader.elf" arm_target_flash_loader_type="LIBMEM RPC Loader" target_reset_script="FLASHReset()"/>
<folder Name="Source Files">
<configuration Name="Common" filter="c;cpp;cxx;cc;h;s;asm;inc"/>

View File

@ -51,8 +51,8 @@
<Watches active="0" update="Never" />
</Watch4>
<Files>
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\main.c" y="0" path="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\main.c" left="0" selected="0" name="unnamed" top="0" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\led.c" y="40" path="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\led.c" left="0" selected="1" name="unnamed" top="40" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\main.c" y="0" path="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\main.c" left="18" selected="0" name="unnamed" top="0" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\led.c" y="44" path="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\led.c" left="0" selected="1" name="unnamed" top="37" />
</Files>
<ARMCrossStudioWindow activeProject="demoprog_ek_lm3s6965" autoConnectTarget="Texas Instruments ICDI" debugSearchFileMap="" fileDialogInitialDirectory="D:\usr\feaser\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Debug" />
</session>

View File

@ -5,7 +5,7 @@ MEMORY
Peripherals (wx) : ORIGIN = 0x40020000, LENGTH = 0x00100000
FiRM_Peripherals (wx) : ORIGIN = 0x40000000, LENGTH = 0x00010000
SRAM (wx) : ORIGIN = 0x20000000, LENGTH = 0x00010000
FLASH (rx) : ORIGIN = 0x00006000, LENGTH = 0x00040000 - 0x6000
FLASH (rx) : ORIGIN = 0x00008000, LENGTH = 0x00040000 - 0x8000
}
@ -19,7 +19,7 @@ SECTIONS
__FiRM_Peripherals_segment_end__ = 0x40010000;
__SRAM_segment_start__ = 0x20000000;
__SRAM_segment_end__ = 0x20010000;
__FLASH_segment_start__ = 0x00006000;
__FLASH_segment_start__ = 0x00008000;
__FLASH_segment_end__ = 0x00040000;
__STACKSIZE__ = 256;

View File

@ -7,38 +7,38 @@ start address 0x00000000
Program Header:
LOAD off 0x00008000 vaddr 0x00000000 paddr 0x00000000 align 2**15
filesz 0x00004954 memsz 0x00004954 flags r-x
LOAD off 0x00010000 vaddr 0x20000000 paddr 0x00004954 align 2**15
filesz 0x00000008 memsz 0x00001154 flags rw-
filesz 0x00006074 memsz 0x00006074 flags r-x
LOAD off 0x00010000 vaddr 0x20000000 paddr 0x00006074 align 2**15
filesz 0x00000008 memsz 0x000018ac flags rw-
private flags = 5000200: [Version5 EABI] [soft-float ABI]
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00004954 00000000 00000000 00008000 2**2
0 .text 00006074 00000000 00000000 00008000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000008 20000000 00004954 00010000 2**2
1 .data 00000008 20000000 00006074 00010000 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .bss 0000114c 20000008 0000495c 00010008 2**2
2 .bss 000018a4 20000008 0000607c 00010008 2**2
ALLOC
3 .debug_info 0000cf4d 00000000 00000000 00010008 2**0
3 .debug_info 0000f913 00000000 00000000 00010008 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_abbrev 000024d8 00000000 00000000 0001cf55 2**0
4 .debug_abbrev 0000300e 00000000 00000000 0001f91b 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_loc 0000a0cf 00000000 00000000 0001f42d 2**0
5 .debug_loc 0000b63e 00000000 00000000 00022929 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_aranges 00000bc8 00000000 00000000 000294fc 2**0
6 .debug_aranges 00000e00 00000000 00000000 0002df67 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_ranges 00000c80 00000000 00000000 0002a0c4 2**0
7 .debug_ranges 00000e98 00000000 00000000 0002ed67 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_line 00003e89 00000000 00000000 0002ad44 2**0
8 .debug_line 00004dee 00000000 00000000 0002fbff 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_str 0000259e 00000000 00000000 0002ebcd 2**0
9 .debug_str 00002e30 00000000 00000000 000349ed 2**0
CONTENTS, READONLY, DEBUGGING
10 .comment 00000030 00000000 00000000 0003116b 2**0
10 .comment 00000030 00000000 00000000 0003781d 2**0
CONTENTS, READONLY
11 .ARM.attributes 00000033 00000000 00000000 0003119b 2**0
11 .ARM.attributes 00000033 00000000 00000000 0003784d 2**0
CONTENTS, READONLY
12 .debug_frame 00002414 00000000 00000000 000311d0 2**2
12 .debug_frame 00002b2c 00000000 00000000 00037880 2**2
CONTENTS, READONLY, DEBUGGING
SYMBOL TABLE:
00000000 l d .text 00000000 .text
@ -57,223 +57,299 @@ SYMBOL TABLE:
00000000 l df *ABS* 00000000 vectors.c
00000000 l df *ABS* 00000000 cstart.c
0000011c l F .text 00000000 zero_loop2
00003e4e l F .text 00000000 zero_loop
000054a2 l F .text 00000000 zero_loop
00000000 l df *ABS* 00000000 hooks.c
00003f14 l O .text 0000001b firmwareFilename
00005610 l O .text 0000001b firmwareFilename
20000008 l O .bss 00000228 logfile
00000000 l df *ABS* 00000000 main.c
00000000 l df *ABS* 00000000 ethernet.c
00000274 l F .text 00000084 EthernetPacketGetInternal
000002f8 l F .text 00000066 EthernetPacketPutInternal.part.0
00000000 l df *ABS* 00000000 flashlib.c
00000000 l df *ABS* 00000000 sysctl.c
000003a8 l F .text 00000154 SysCtlPeripheralValid
00003f58 l O .text 0000006c g_pulXtals
00003fe0 l O .text 0000000c g_pulRCGCRegs
0000079c l F .text 00000154 SysCtlPeripheralValid
00005670 l O .text 0000006c g_pulXtals
000056f8 l O .text 0000000c g_pulRCGCRegs
00005704 l O .text 0000000c g_pulSRCRRegs
00000000 l df *ABS* 00000000 gpio.c
00000864 l F .text 00000054 GPIOBaseValid
00000ce8 l F .text 00000054 GPIOBaseValid
00000000 l df *ABS* 00000000 uartlib.c
00000ad4 l F .text 00000020 UARTBaseValid
00000f8c l F .text 00000020 UARTBaseValid
00000000 l df *ABS* 00000000 ssi.c
00000cc0 l F .text 00000014 SSIBaseValid
00001178 l F .text 00000014 SSIBaseValid
00000000 l df *ABS* 00000000 mmc.c
00000e4c l F .text 00000020 xchg_spi
00000e6c l F .text 00000028 wait_ready
00000e94 l F .text 0000001c deselect
00000eb0 l F .text 0000002c select
00000edc l F .text 0000007e send_cmd
00000f5a l F .text 0000003a xmit_datablock.part.1
00000f94 l F .text 00000058 rcvr_datablock
00001304 l F .text 00000020 xchg_spi
00001324 l F .text 00000028 wait_ready
0000134c l F .text 0000001c deselect
00001368 l F .text 0000002c select
00001394 l F .text 0000007e send_cmd
00001412 l F .text 0000003a xmit_datablock.part.1
0000144c l F .text 00000058 rcvr_datablock
20000230 l O .bss 00000004 CardType
20000000 l O .data 00000001 Stat
00000000 l df *ABS* 00000000 netdev.c
00000000 l df *ABS* 00000000 boot.c
00000000 l df *ABS* 00000000 com.c
20000234 l O .bss 00000001 comEntryStateConnect
20000235 l O .bss 00000040 xcpCtoReqPacket.4396
20000001 l O .data 00000001 comActiveInterface
20000235 l O .bss 00000040 xcpCtoReqPacket.4412
00000000 l df *ABS* 00000000 xcp.c
00001648 l F .text 00000014 XcpSetCtoError
00004033 l O .text 00000008 xcpStationId
00001c9c l F .text 00000014 XcpSetCtoError
00005757 l O .text 00000008 xcpStationId
20000278 l O .bss 0000004c xcpInfo
00000000 l df *ABS* 00000000 backdoor.c
200002c4 l O .bss 00000001 backdoorOpen
200002c8 l O .bss 00000004 backdoorOpenTime
00000000 l df *ABS* 00000000 cop.c
00000000 l df *ABS* 00000000 file.c
00001914 l F .text 0000002c FileLibByteNibbleToChar
00001940 l F .text 0000001e FileLibByteToHexString
00001960 l F .text 00000058 FileLibHexStringToByte
000019b8 l F .text 00000038 FileLibLongToIntString.constprop.0
00001f68 l F .text 0000002c FileLibByteNibbleToChar
00001f94 l F .text 0000001e FileLibByteToHexString
00001fb4 l F .text 00000058 FileLibHexStringToByte
0000200c l F .text 00000038 FileLibLongToIntString.constprop.0
200002cc l O .bss 00000040 loggingStr
2000030c l O .bss 00000001 firmwareUpdateState
20000310 l O .bss 00000008 eraseInfo
20000318 l O .bss 00000458 fatFsObjects
20000770 l O .bss 00000184 lineParseObject
00000000 l df *ABS* 00000000 net.c
200008f4 l O .bss 00000004 ARPTimerTimeOut
200008f8 l O .bss 00000004 periodicTimerTimeOut
00000000 l df *ABS* 00000000 assert.c
200008f4 l O .bss 00000004 assert_failure_file
200008f8 l O .bss 00000004 assert_failure_line
200008fc l O .bss 00000004 assert_failure_file
20000900 l O .bss 00000004 assert_failure_line
00000000 l df *ABS* 00000000 ff.c
00001f54 l F .text 00000012 mem_cpy
00001f66 l F .text 0000001e sum_sfn
00001f84 l F .text 0000002a validate
00001fae l F .text 000000ea get_fileinfo
00002098 l F .text 0000001c ld_clust.isra.0
000020b4 l F .text 00000088 check_fs
0000213c l F .text 0000030c chk_mounted
00002448 l F .text 0000004a sync_window.part.2
00002492 l F .text 0000000c sync_window
0000249e l F .text 0000002e move_window
000024cc l F .text 000000b6 sync_fs
00002666 l F .text 00000084 dir_sdi
000027dc l F .text 0000009a create_chain
00002876 l F .text 000000f2 dir_next
00002968 l F .text 0000012c dir_find.part.6
00002a94 l F .text 0000026c follow_path
00002d00 l F .text 0000004e dir_remove
00002d50 l F .text 000000fc dir_read.constprop.8
00002e4c l F .text 00000054 remove_chain
00002f20 l F .text 000001b0 dir_register
200008fc l O .bss 00000200 LfnBuf
20000afc l O .bss 00000002 Fsid
000041e6 l O .text 00000080 ExCvt
00004266 l O .text 0000000d LfnOfs
20000b00 l O .bss 00000004 FatFs
00002758 l F .text 00000012 mem_cpy
0000276a l F .text 0000001e sum_sfn
00002788 l F .text 0000002a validate
000027b2 l F .text 000000ea get_fileinfo
0000289c l F .text 0000001c ld_clust.isra.0
000028b8 l F .text 00000088 check_fs
00002940 l F .text 0000030c chk_mounted
00002c4c l F .text 0000004a sync_window.part.2
00002c96 l F .text 0000000c sync_window
00002ca2 l F .text 0000002e move_window
00002cd0 l F .text 000000b6 sync_fs
00002e6a l F .text 00000084 dir_sdi
00002fe0 l F .text 0000009a create_chain
0000307a l F .text 000000f2 dir_next
0000316c l F .text 0000012c dir_find.part.6
00003298 l F .text 0000026c follow_path
00003504 l F .text 0000004e dir_remove
00003554 l F .text 000000fc dir_read.constprop.8
00003650 l F .text 00000054 remove_chain
00003724 l F .text 000001b0 dir_register
20000904 l O .bss 00000200 LfnBuf
20000b04 l O .bss 00000002 Fsid
0000590a l O .text 00000080 ExCvt
0000598a l O .text 0000000d LfnOfs
20000b08 l O .bss 00000004 FatFs
00000000 l df *ABS* 00000000 unicode.c
00004274 l O .text 000001e0 tbl_lower.4259
00004454 l O .text 00000100 Tbl
00004554 l O .text 000001e0 tbl_upper.4260
00005998 l O .text 000001e0 tbl_lower.4259
00005b78 l O .text 00000100 Tbl
00005c78 l O .text 000001e0 tbl_upper.4260
00000000 l df *ABS* 00000000 uip.c
0000411c l F .text 00000038 chksum
00004154 l F .text 0000003c upper_layer_chksum
000041e4 l F .text 0000002c uip_add_rcv_nxt
20000b0c l O .bss 00000002 tmp16
20000b0e l O .bss 00000002 ipid
20000b10 l O .bss 00000004 iss
20000b14 l O .bss 00000002 lastport
20000b1c l O .bss 00000001 c
20000b1d l O .bss 00000001 opt
00000000 l df *ABS* 00000000 uip_arp.c
00004c2c l F .text 000000e4 uip_arp_update.constprop.0
20000b1e l O .bss 00000001 i
20000b1f l O .bss 00000001 tmpage
20000b20 l O .bss 00000060 arp_table
00005e58 l O .text 00000006 broadcast_ethaddr
20000b80 l O .bss 00000001 c
20000b81 l O .bss 00000001 arptime
20000b82 l O .bss 00000004 ipaddr
00000000 l df *ABS* 00000000 cpu.c
00000000 l df *ABS* 00000000 uart.c
20000b04 l O .bss 00000041 xcpCtoReqPacket.4626
20000b45 l O .bss 00000001 xcpCtoRxLength.4627
20000b46 l O .bss 00000001 xcpCtoRxInProgress.4628
20000b86 l O .bss 00000041 xcpCtoReqPacket.4628
20000bc7 l O .bss 00000001 xcpCtoRxInProgress.4630
20000bc8 l O .bss 00000001 xcpCtoRxLength.4629
00000000 l df *ABS* 00000000 nvm.c
00000000 l df *ABS* 00000000 timer.c
20000b48 l O .bss 00000004 millisecond_counter
20000bcc l O .bss 00000004 millisecond_counter
00000000 l df *ABS* 00000000 flash.c
00003ae0 l F .text 00000034 FlashGetSector
00003b14 l F .text 0000004c FlashWriteBlock
00003b60 l F .text 00000050 FlashSwitchBlock
00003bb0 l F .text 00000080 FlashAddToBlock
00004758 l O .text 000000cc flashLayout
20000b4c l O .bss 00000204 bootBlockInfo
20000d50 l O .bss 00000204 blockInfo
0000512c l F .text 00000034 FlashGetSector
00005160 l F .text 0000004c FlashWriteBlock
000051ac l F .text 00000050 FlashSwitchBlock
000051fc l F .text 00000080 FlashAddToBlock
00005e84 l O .text 000000c0 flashLayout
20000bd0 l O .bss 00000204 bootBlockInfo
20000dd4 l O .bss 00000204 blockInfo
00000000 l df *ABS* 00000000 memcpy-stub.c
00000000 l df *ABS* 00000000 memset.c
00000000 l df *ABS* 00000000 ctype_.c
00000000 l df *ABS* 00000000
00000200 l *ABS* 00000000 __STACKSIZE__
0000158c g F .text 00000034 ComInit
00003c48 g F .text 00000048 FlashWrite
00003818 g F .text 0000004e f_gets
00001f3c g F .text 00000018 AssertFailure
0000259a g F .text 000000cc get_fat
00000a6c g F .text 00000034 GPIOPinTypeSSI
00003e2c g F .text 00000040 reset_handler
00000e24 g F .text 00000028 SSIDataGet
00003ab4 g F .text 0000001c TimerUpdate
00001688 g F .text 00000010 XcpPacketTransmitted
000015c0 g F .text 00000028 ComTask
00000d9c g F .text 00000024 SSIEnable
00000560 g F .text 00000008 SysCtlDelay
00001638 g F .text 0000000c ComSetConnectEntryState
00001554 g F .text 0000001e BootInit
00001a9c g F .text 0000003e FileSrecVerifyChecksum
000018f0 g F .text 00000020 BackDoorInit
00000cd4 g F .text 000000c8 SSIConfigSetExpClk
00001912 g F .text 00000002 CopService
00004954 g .text 00000000 _etext
000038f4 g F .text 00000024 ff_wtoupper
00000a14 g F .text 00000024 GPIOPinWrite
00001c18 g F .text 00000324 FileTask
00000c28 g F .text 00000024 UARTSpaceAvail
00003aa8 g F .text 0000000c TimerReset
00000fec g F .text 00000228 disk_initialize
00000c74 g F .text 0000002c UARTCharPutNonBlocking
00001572 g F .text 0000001a BootTask
00003d60 g F .text 00000044 FlashWriteChecksum
000015ec g F .text 0000001c ComTransmitPacket
00001214 g F .text 00000014 disk_status
00001adc g F .text 0000013c FileSrecParseLine
0000136c g F .text 000001e0 disk_ioctl
00001a30 g F .text 00000028 FileHandleFirmwareUpdateRequest
000004fc g F .text 00000064 SysCtlPeripheralEnable
00002ea0 g F .text 0000007e gen_numname
00001bb8 g F .text 0000003c ComInit
00005294 g F .text 00000048 FlashWrite
0000401c g F .text 0000004e f_gets
00002740 g F .text 00000018 AssertFailure
00002d9e g F .text 000000cc get_fat
00000f24 g F .text 00000034 GPIOPinTypeSSI
00005480 g F .text 00000040 reset_handler
000012dc g F .text 00000028 SSIDataGet
00005100 g F .text 0000001c TimerUpdate
00001cdc g F .text 00000010 XcpPacketTransmitted
00001bf4 g F .text 0000003c ComTask
00001254 g F .text 00000024 SSIEnable
000009e4 g F .text 00000008 SysCtlDelay
00001c8c g F .text 0000000c ComSetConnectEntryState
20000fd8 g O .bss 00000002 uip_len
20000b16 g O .bss 00000006 uip_ethaddr
00004190 g F .text 00000054 uip_add32
00001b80 g F .text 0000001e BootInit
000020f0 g F .text 0000003e FileSrecVerifyChecksum
00001f44 g F .text 00000020 BackDoorInit
0000118c g F .text 000000c8 SSIConfigSetExpClk
00001f66 g F .text 00000002 CopService
00006074 g .text 00000000 _etext
000008f0 g F .text 00000090 SysCtlPeripheralReset
000040f8 g F .text 00000024 ff_wtoupper
00000e98 g F .text 00000024 GPIOPinWrite
00001b34 g F .text 00000034 netdev_read
00004280 g F .text 00000980 uip_process
0000546c g F .text 00000006 FlashGetUserProgBaseAddress
000054c8 g F .text 000000a6 memcpy
0000226c g F .text 00000324 FileTask
000010e0 g F .text 00000024 UARTSpaceAvail
000050f4 g F .text 0000000c TimerReset
000014a4 g F .text 00000228 disk_initialize
20000fdc g O .bss 00000004 uip_sappdata
00001a0c g F .text 00000090 netdev_init
20000fe0 g O .bss 00000004 uip_acc32
00004210 g F .text 00000020 uip_ipchksum
0000112c g F .text 0000002c UARTCharPutNonBlocking
00001b9e g F .text 0000001a BootTask
000053ac g F .text 00000044 FlashWriteChecksum
00001c34 g F .text 00000030 ComTransmitPacket
00000360 g F .text 0000002c EthernetInitExpClk
000016cc g F .text 00000014 disk_status
00002130 g F .text 0000013c FileSrecParseLine
00004264 g F .text 0000001c uip_listen
00001b68 g F .text 00000018 netdev_send
00001824 g F .text 000001e0 disk_ioctl
00002084 g F .text 00000028 FileHandleFirmwareUpdateRequest
000004d8 g F .text 0000005c EthernetPacketPut
00000980 g F .text 00000064 SysCtlPeripheralEnable
000036a4 g F .text 0000007e gen_numname
20000fe4 g O .bss 00000001 uip_flags
000001bc g F .text 00000030 FileFirmwareUpdateCompletedHook
00001678 g F .text 00000010 XcpIsConnected
0000375c g F .text 000000bc f_unlink
00003a64 g F .text 00000004 NvmInit
00003c30 g F .text 00000018 FlashInit
20000f54 g .bss 00000000 _ebss
00003866 g F .text 00000032 f_putc
00003898 g F .text 0000001e f_puts
00003e20 g F .text 0000000c UnusedISR
000015e8 g F .text 00000002 ComFree
00003964 g F .text 00000028 UartInit
00003a6c g F .text 00000004 NvmErase
00000c4c g F .text 00000028 UARTCharGetNonBlocking
00000de4 g F .text 00000040 SSIDataPut
00001ccc g F .text 00000010 XcpIsConnected
00003f60 g F .text 000000bc f_unlink
000050b0 g F .text 00000004 NvmInit
0000527c g F .text 00000018 FlashInit
200016aa g .bss 00000000 _ebss
0000406a g F .text 00000032 f_putc
0000409c g F .text 0000001e f_puts
00005474 g F .text 0000000c UnusedISR
00000484 g F .text 00000054 EthernetPacketGetNonBlocking
00001c30 g F .text 00000002 ComFree
00000ebc g F .text 00000034 GPIOPinTypeEthernetLED
00004fb0 g F .text 00000028 UartInit
00001a9c g F .text 00000098 netdev_setmacaddr
000050b8 g F .text 00000004 NvmErase
00001104 g F .text 00000028 UARTCharGetNonBlocking
0000129c g F .text 00000040 SSIDataPut
20000008 g .bss 00000000 _bss
000035cc g F .text 0000000e f_close
00001698 g F .text 00000214 XcpPacketReceived
00003230 g F .text 00000160 f_read
00003dec g F .text 00000034 FlashDone
00003dd0 g F .text 0000000e f_close
00001cec g F .text 00000214 XcpPacketReceived
00004230 g F .text 00000006 uip_tcpchksum
00003a34 g F .text 00000160 f_read
00005438 g F .text 00000034 FlashDone
000000f0 g F .text 00000050 EntryFromProg
000002c4 g F .text 000000e4 FlashProgram
0000154c g F .text 00000008 get_fattime
0000165c g F .text 0000001c XcpInit
000019f0 g F .text 0000002c FileInit
00003c90 g F .text 000000d0 FlashErase
00003e74 g F .text 0000009e memset
20000fe8 g O .bss 00000004 uip_appdata
20000fec g O .bss 00000004 uip_conn
20000ff0 g O .bss 00000068 uip_conns
00000658 g F .text 000000e4 FlashProgram
00001a04 g F .text 00000008 get_fattime
00001cb0 g F .text 0000001c XcpInit
00002044 g F .text 0000002c FileInit
0000056c g F .text 00000028 EthernetIntStatus
00004e18 g F .text 00000144 uip_arp_out
000052dc g F .text 000000d0 FlashErase
00005570 g F .text 0000009e memset
000001ec g F .text 00000014 FileFirmwareUpdateErrorHook
00000248 g F .text 0000002c main
00003522 g F .text 000000aa f_sync
000006b8 g F .text 000001ac SysCtlClockGet
00001a58 g F .text 00000044 FileSrecGetLineType
00000b24 g F .text 00000034 UARTDisable
00003a74 g F .text 00000012 NvmDone
000030d0 g F .text 00000020 f_mount
0000398c g F .text 0000006c UartTransmitPacket
00003a70 g F .text 00000004 NvmVerifyChecksum
00003940 g F .text 0000001e CpuMemCopy
000026ea g F .text 000000f2 put_fat
000035da g F .text 00000138 f_lseek
00001620 g F .text 00000018 ComGetActiveInterfaceMaxTxLen
000039f8 g F .text 0000006c UartReceivePacket
00003d26 g F .text 000000aa f_sync
00000b3c g F .text 000001ac SysCtlClockGet
000020ac g F .text 00000044 FileSrecGetLineType
00000fdc g F .text 00000034 UARTDisable
000050c0 g F .text 00000012 NvmDone
00000444 g F .text 00000040 EthernetEnable
000038d4 g F .text 00000020 f_mount
00004fd8 g F .text 0000006c UartTransmitPacket
000050bc g F .text 00000004 NvmVerifyChecksum
00004f8c g F .text 0000001e CpuMemCopy
00002eee g F .text 000000f2 put_fat
00003dde g F .text 00000138 f_lseek
00004d68 g F .text 000000b0 uip_arp_arpin
00001c78 g F .text 00000014 ComGetActiveInterfaceMaxTxLen
00005044 g F .text 0000006c UartReceivePacket
0000018c g F .text 00000008 FileGetFirmwareFilenameHook
000003e4 g F .text 00000060 EthernetMACAddrSet
00004d10 g F .text 00000058 uip_arp_timer
20001058 g O .bss 00000002 uip_listenports
2000105a g O .bss 00000004 uip_draddr
20000000 g .data 00000000 _data
00003714 g F .text 00000048 f_stat
00001910 g F .text 00000002 CopInit
0000395e g F .text 00000004 CpuReset
00000dc0 g F .text 00000024 SSIDisable
00003a68 g F .text 00000004 NvmWrite
00003918 g F .text 00000028 CpuStartUserProgram
00002582 g F .text 00000018 clust2sect
20001154 g .bss 00000000 _estack
00003da4 g F .text 00000048 FlashVerifyChecksum
000005c8 g F .text 00000040 EthernetPHYRead
00003f18 g F .text 00000048 f_stat
00001f64 g F .text 00000002 CopInit
00004faa g F .text 00000004 CpuReset
00001278 g F .text 00000024 SSIDisable
000050b4 g F .text 00000004 NvmWrite
00004f5c g F .text 00000030 CpuStartUserProgram
00002d86 g F .text 00000018 clust2sect
200018ac g .bss 00000000 _estack
0000038c g F .text 00000058 EthernetConfigSet
000053f0 g F .text 00000048 FlashVerifyChecksum
000025f0 g F .text 0000003c NetTransmitPacket
20000008 g .data 00000000 _edata
00001a1c g F .text 00000014 FileIsIdle
00003390 g F .text 00000192 f_write
00002070 g F .text 00000014 FileIsIdle
00004c00 g F .text 00000006 htons
00003b94 g F .text 00000192 f_write
00000000 g O .text 000000f0 _vectab
00000aa0 g F .text 00000034 GPIOPinTypeUART
000030f0 g F .text 00000140 f_open
000012ac g F .text 000000c0 disk_write
00000a38 g F .text 00000034 GPIOPinTypeGPIOOutput
0000073c g F .text 00000060 FlashUserGet
00000f58 g F .text 00000034 GPIOPinTypeUART
000038f4 g F .text 00000140 f_open
00001764 g F .text 000000c0 disk_write
00000ef0 g F .text 00000034 GPIOPinTypeGPIOOutput
00000200 g F .text 00000048 FileFirmwareUpdateLogHook
20000004 g O .data 00000004 __ctype_ptr__
00001644 g F .text 00000004 ComIsConnected
00004850 g O .text 00000101 _ctype_
00001c98 g F .text 00000004 ComIsConnected
00000534 g F .text 00000038 EthernetIntDisable
00005f70 g O .text 00000101 _ctype_
00000594 g F .text 00000034 EthernetIntClear
00000154 g F .text 00000038 FileIsFirmwareUpdateRequestedHook
00000ca0 g F .text 00000020 UARTBusy
00001608 g F .text 00000018 ComGetActiveInterfaceMaxRxLen
000008b8 g F .text 00000058 GPIODirModeSet
00001228 g F .text 00000084 disk_read
000018ac g F .text 00000044 BackDoorCheck
20000f54 g .bss 00000000 _stack
000038b8 g F .text 0000003c ff_convert
00003ad0 g F .text 00000010 TimerGet
00000b58 g F .text 000000d0 UARTConfigSetExpClk
00000568 g F .text 00000150 SysCtlClockSet
00000910 g F .text 00000104 GPIOPadConfigSet
00003a88 g F .text 00000020 TimerInit
00000274 g F .text 00000050 FlashClear
00001158 g F .text 00000020 UARTBusy
00004238 g F .text 0000002c uip_init
00001c64 g F .text 00000014 ComGetActiveInterfaceMaxRxLen
0000262c g F .text 000000b0 NetReceivePacket
00000d3c g F .text 00000058 GPIODirModeSet
000016e0 g F .text 00000084 disk_read
00001f00 g F .text 00000044 BackDoorCheck
200016aa g .bss 00000000 _stack
2000105e g O .bss 00000004 uip_netmask
20001062 g O .bss 00000004 uip_hostaddr
000040bc g F .text 0000003c ff_convert
0000511c g F .text 00000010 TimerGet
000026dc g F .text 00000064 NetApp
00001010 g F .text 000000d0 UARTConfigSetExpClk
00002590 g F .text 00000060 NetInit
000009ec g F .text 00000150 SysCtlClockSet
00000d94 g F .text 00000104 GPIOPadConfigSet
000050d4 g F .text 00000020 TimerInit
20001066 g O .bss 00000642 uip_buf
00000608 g F .text 00000050 FlashClear
00004c08 g F .text 00000024 uip_send
200016a8 g O .bss 00000002 uip_slen
00000194 g F .text 00000028 FileFirmwareUpdateStartedHook
00000af4 g F .text 00000030 UARTEnable
00000fac g F .text 00000030 UARTEnable

View File

@ -81,6 +81,48 @@
#define BOOT_COM_UART_CHANNEL_INDEX (0)
/* The NET communication interface for firmware updates via TCP/IP is selected by setting
* the BOOT_COM_NET_ENABLE configurable to 1. The maximum amount of data bytes in a
* message for data transmission and reception is set through BOOT_COM_NET_TX_MAX_DATA
* and BOOT_COM_NET_RX_MAX_DATA, respectively. The default IP address is configured
* with the macros BOOT_COM_NET_IPADDRx. The default netmask is configued with the macros
* BOOT_COM_NET_NETMASKx. The bootloader acts and a TCP/IP server. The port the server
* listen on for connections is configured with BOOT_COM_NET_PORT.
*/
/** \brief Enable/disable the NET transport layer. */
#define BOOT_COM_NET_ENABLE (1)
/** \brief Configure number of bytes in the target->host data packet. */
#define BOOT_COM_NET_TX_MAX_DATA (64)
/** \brief Configure number of bytes in the host->target data packet. */
#define BOOT_COM_NET_RX_MAX_DATA (64)
/** \brief Configure the port that the TCP/IP server listens on */
#define BOOT_COM_NET_PORT (1000)
/** \brief Configure the 1st byte of the IP address */
#define BOOT_COM_NET_IPADDR0 (169)
/** \brief Configure the 2nd byte of the IP address */
#define BOOT_COM_NET_IPADDR1 (254)
/** \brief Configure the 3rd byte of the IP address */
#define BOOT_COM_NET_IPADDR2 (19)
/** \brief Configure the 4th byte of the IP address */
#define BOOT_COM_NET_IPADDR3 (63)
/** \brief Configure the 1st byte of the network mask */
#define BOOT_COM_NET_NETMASK0 (255)
/** \brief Configure the 2nd byte of the network mask */
#define BOOT_COM_NET_NETMASK1 (255)
/** \brief Configure the 3rd byte of the network mask */
#define BOOT_COM_NET_NETMASK2 (0)
/** \brief Configure the 4th byte of the network mask */
#define BOOT_COM_NET_NETMASK3 (0)
/** \brief Enable/disable a hook function that is called when the IP address is about
* to be set. This allows a dynamic override of the BOOT_COM_NET_IPADDRx values.
*/
#define BOOT_COM_NET_IPADDR_HOOK_ENABLE (0)
/** \brief Enable/disable a hook function that is called when the netmask is about
* to be set. This allows a dynamic override of the BOOT_COM_NET_NETMASKx values.
*/
#define BOOT_COM_NET_NETMASK_HOOK_ENABLE (0)
/****************************************************************************************
* F I L E S Y S T E M I N T E R F A C E C O N F I G U R A T I O N
****************************************************************************************/

View File

@ -187,6 +187,55 @@ blt_bool NvmWriteChecksumHook(void)
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
/****************************************************************************************
* N E T W O R K I N T E R F A C E H O O K F U N C T I O N S
****************************************************************************************/
#if (BOOT_COM_NET_IPADDR_HOOK_ENABLE > 0)
/************************************************************************************//**
** \brief Callback that gets called when the IP address is about to be configured.
** \param ipAddrArray 4-byte array where the IP address should be stored.
** \return none.
**
****************************************************************************************/
void NetIpAddressHook(blt_int8u *ipAddrArray)
{
/* This hook function allows a dynamic configuration of the IP address. This could for
* example be used if the bootloader is activated from a running user program and
* should have the same IP address as the user program. This IP address could be stored
* at a fixed location in RAM which can be read here. For now the example implemen-
* tation simply configures the bootloader's default IP address.
*/
ipAddrArray[0] = BOOT_COM_NET_IPADDR0;
ipAddrArray[1] = BOOT_COM_NET_IPADDR1;
ipAddrArray[2] = BOOT_COM_NET_IPADDR2;
ipAddrArray[3] = BOOT_COM_NET_IPADDR3;
} /*** end of NetIpAddressHook ***/
#endif /* BOOT_COM_NET_IPADDR_HOOK_ENABLE > 0 */
#if (BOOT_COM_NET_NETMASK_HOOK_ENABLE > 0)
/************************************************************************************//**
** \brief Callback that gets called when the network mask is about to be configured.
** \param netMaskArray 4-byte array where the network mask should be stored.
** \return none.
**
****************************************************************************************/
void NetNetworkMaskHook(blt_int8u *netMaskArray)
{
/* This hook function allows a dynamic configuration of the network mask. This could
* for example be used if the bootloader is activated from a running user program and
* should have the same network mask as the user program. This network mask could be
* stored at a fixed location in RAM which can be read here. For now the example
* implementation simply configures the bootloader's default network mask.
*/
netMaskArray[0] = BOOT_COM_NET_NETMASK0;
netMaskArray[1] = BOOT_COM_NET_NETMASK1;
netMaskArray[2] = BOOT_COM_NET_NETMASK2;
netMaskArray[3] = BOOT_COM_NET_NETMASK3;
} /*** end of NetNetworkMaskHook ***/
#endif /* BOOT_COM_NET_NETMASK_HOOK_ENABLE > 0 */
/****************************************************************************************
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
****************************************************************************************/

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,187 @@
//*****************************************************************************
//
// ethernet.h - Defines and Macros for the ethernet module.
//
// Copyright (c) 2006-2013 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 10636 of the Stellaris Peripheral Driver Library.
//
//*****************************************************************************
#ifndef __ETHERNET_H__
#define __ETHERNET_H__
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
//*****************************************************************************
//
// Values that can be passed to EthernetConfigSet as the ulConfig value, and
// returned from EthernetConfigGet.
//
//*****************************************************************************
#define ETH_CFG_TS_TSEN 0x010000 // Enable Timestamp (CCP)
#define ETH_CFG_RX_BADCRCDIS 0x000800 // Disable RX BAD CRC Packets
#define ETH_CFG_RX_PRMSEN 0x000400 // Enable RX Promiscuous
#define ETH_CFG_RX_AMULEN 0x000200 // Enable RX Multicast
#define ETH_CFG_TX_DPLXEN 0x000010 // Enable TX Duplex Mode
#define ETH_CFG_TX_CRCEN 0x000004 // Enable TX CRC Generation
#define ETH_CFG_TX_PADEN 0x000002 // Enable TX Padding
//*****************************************************************************
//
// Values that can be passed to EthernetIntEnable, EthernetIntDisable, and
// EthernetIntClear as the ulIntFlags parameter, and returned from
// EthernetIntStatus.
//
//*****************************************************************************
#define ETH_INT_PHY 0x040 // PHY Event/Interrupt
#define ETH_INT_MDIO 0x020 // Management Transaction
#define ETH_INT_RXER 0x010 // RX Error
#define ETH_INT_RXOF 0x008 // RX FIFO Overrun
#define ETH_INT_TX 0x004 // TX Complete
#define ETH_INT_TXER 0x002 // TX Error
#define ETH_INT_RX 0x001 // RX Complete
//*****************************************************************************
//
// Helper Macros for Ethernet Processing
//
//*****************************************************************************
//
// htonl/ntohl - big endian/little endian byte swapping macros for
// 32-bit (long) values
//
//*****************************************************************************
#ifndef htonl
#define htonl(a) \
((((a) >> 24) & 0x000000ff) | \
(((a) >> 8) & 0x0000ff00) | \
(((a) << 8) & 0x00ff0000) | \
(((a) << 24) & 0xff000000))
#endif
#ifndef ntohl
#define ntohl(a) htonl((a))
#endif
//*****************************************************************************
//
// htons/ntohs - big endian/little endian byte swapping macros for
// 16-bit (short) values
//
//*****************************************************************************
#ifndef htons
#define htons(a) \
((((a) >> 8) & 0x00ff) | \
(((a) << 8) & 0xff00))
#endif
#ifndef ntohs
#define ntohs(a) htons((a))
#endif
//*****************************************************************************
//
// API Function prototypes
//
//*****************************************************************************
extern void EthernetInitExpClk(unsigned long ulBase, unsigned long ulEthClk);
extern void EthernetConfigSet(unsigned long ulBase, unsigned long ulConfig);
extern unsigned long EthernetConfigGet(unsigned long ulBase);
extern void EthernetMACAddrSet(unsigned long ulBase,
unsigned char *pucMACAddr);
extern void EthernetMACAddrGet(unsigned long ulBase,
unsigned char *pucMACAddr);
extern void EthernetEnable(unsigned long ulBase);
extern void EthernetDisable(unsigned long ulBase);
extern tBoolean EthernetPacketAvail(unsigned long ulBase);
extern tBoolean EthernetSpaceAvail(unsigned long ulBase);
extern long EthernetPacketGetNonBlocking(unsigned long ulBase,
unsigned char *pucBuf,
long lBufLen);
extern long EthernetPacketGet(unsigned long ulBase, unsigned char *pucBuf,
long lBufLen);
extern long EthernetPacketPutNonBlocking(unsigned long ulBase,
unsigned char *pucBuf,
long lBufLen);
extern long EthernetPacketPut(unsigned long ulBase, unsigned char *pucBuf,
long lBufLen);
extern void EthernetIntRegister(unsigned long ulBase,
void (*pfnHandler)(void));
extern void EthernetIntUnregister(unsigned long ulBase);
extern void EthernetIntEnable(unsigned long ulBase, unsigned long ulIntFlags);
extern void EthernetIntDisable(unsigned long ulBase, unsigned long ulIntFlags);
extern unsigned long EthernetIntStatus(unsigned long ulBase, tBoolean bMasked);
extern void EthernetIntClear(unsigned long ulBase, unsigned long ulIntFlags);
extern void EthernetPHYAddrSet(unsigned long ulBase, unsigned char ucAddr);
extern void EthernetPHYWrite(unsigned long ulBase, unsigned char ucRegAddr,
unsigned long ulData);
extern unsigned long EthernetPHYRead(unsigned long ulBase,
unsigned char ucRegAddr);
extern void EthernetPHYPowerOff(unsigned long ulBase);
extern void EthernetPHYPowerOn(unsigned long ulBase);
//*****************************************************************************
//
// Several Ethernet APIs have been renamed, with the original function name
// being deprecated. These defines provide backward compatibility.
//
//*****************************************************************************
#ifndef DEPRECATED
#include "driverlib/sysctl.h"
#define EthernetInit(a) \
EthernetInitExpClk(a, SysCtlClockGet())
#define EthernetPacketNonBlockingGet(a, b, c) \
EthernetPacketGetNonBlocking(a, b, c)
#define EthernetPacketNonBlockingPut(a, b, c) \
EthernetPacketPutNonBlocking(a, b, c)
#endif
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // __ETHERNET_H__

View File

@ -0,0 +1,703 @@
//*****************************************************************************
//
// hw_ethernet.h - Macros used when accessing the Ethernet hardware.
//
// Copyright (c) 2006-2013 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 10636 of the Stellaris Firmware Development Package.
//
//*****************************************************************************
#ifndef __HW_ETHERNET_H__
#define __HW_ETHERNET_H__
//*****************************************************************************
//
// The following are defines for the Ethernet MAC register offsets.
//
//*****************************************************************************
#define MAC_O_RIS 0x00000000 // Ethernet MAC Raw Interrupt
// Status/Acknowledge
#define MAC_O_IACK 0x00000000 // Ethernet MAC Raw Interrupt
// Status/Acknowledge
#define MAC_O_IM 0x00000004 // Ethernet MAC Interrupt Mask
#define MAC_O_RCTL 0x00000008 // Ethernet MAC Receive Control
#define MAC_O_TCTL 0x0000000C // Ethernet MAC Transmit Control
#define MAC_O_DATA 0x00000010 // Ethernet MAC Data
#define MAC_O_IA0 0x00000014 // Ethernet MAC Individual Address
// 0
#define MAC_O_IA1 0x00000018 // Ethernet MAC Individual Address
// 1
#define MAC_O_THR 0x0000001C // Ethernet MAC Threshold
#define MAC_O_MCTL 0x00000020 // Ethernet MAC Management Control
#define MAC_O_MDV 0x00000024 // Ethernet MAC Management Divider
#define MAC_O_MADD 0x00000028 // Ethernet MAC Management Address
#define MAC_O_MTXD 0x0000002C // Ethernet MAC Management Transmit
// Data
#define MAC_O_MRXD 0x00000030 // Ethernet MAC Management Receive
// Data
#define MAC_O_NP 0x00000034 // Ethernet MAC Number of Packets
#define MAC_O_TR 0x00000038 // Ethernet MAC Transmission
// Request
#define MAC_O_TS 0x0000003C // Ethernet MAC Timer Support
#define MAC_O_LED 0x00000040 // Ethernet MAC LED Encoding
#define MAC_O_MDIX 0x00000044 // Ethernet PHY MDIX
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_RIS register.
//
//*****************************************************************************
#define MAC_RIS_PHYINT 0x00000040 // PHY Interrupt
#define MAC_RIS_MDINT 0x00000020 // MII Transaction Complete
#define MAC_RIS_RXER 0x00000010 // Receive Error
#define MAC_RIS_FOV 0x00000008 // FIFO Overrun
#define MAC_RIS_TXEMP 0x00000004 // Transmit FIFO Empty
#define MAC_RIS_TXER 0x00000002 // Transmit Error
#define MAC_RIS_RXINT 0x00000001 // Packet Received
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_IACK register.
//
//*****************************************************************************
#define MAC_IACK_PHYINT 0x00000040 // Clear PHY Interrupt
#define MAC_IACK_MDINT 0x00000020 // Clear MII Transaction Complete
#define MAC_IACK_RXER 0x00000010 // Clear Receive Error
#define MAC_IACK_FOV 0x00000008 // Clear FIFO Overrun
#define MAC_IACK_TXEMP 0x00000004 // Clear Transmit FIFO Empty
#define MAC_IACK_TXER 0x00000002 // Clear Transmit Error
#define MAC_IACK_RXINT 0x00000001 // Clear Packet Received
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_IM register.
//
//*****************************************************************************
#define MAC_IM_PHYINTM 0x00000040 // Mask PHY Interrupt
#define MAC_IM_MDINTM 0x00000020 // Mask MII Transaction Complete
#define MAC_IM_RXERM 0x00000010 // Mask Receive Error
#define MAC_IM_FOVM 0x00000008 // Mask FIFO Overrun
#define MAC_IM_TXEMPM 0x00000004 // Mask Transmit FIFO Empty
#define MAC_IM_TXERM 0x00000002 // Mask Transmit Error
#define MAC_IM_RXINTM 0x00000001 // Mask Packet Received
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_RCTL register.
//
//*****************************************************************************
#define MAC_RCTL_RSTFIFO 0x00000010 // Clear Receive FIFO
#define MAC_RCTL_BADCRC 0x00000008 // Enable Reject Bad CRC
#define MAC_RCTL_PRMS 0x00000004 // Enable Promiscuous Mode
#define MAC_RCTL_AMUL 0x00000002 // Enable Multicast Frames
#define MAC_RCTL_RXEN 0x00000001 // Enable Receiver
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_TCTL register.
//
//*****************************************************************************
#define MAC_TCTL_DUPLEX 0x00000010 // Enable Duplex Mode
#define MAC_TCTL_CRC 0x00000004 // Enable CRC Generation
#define MAC_TCTL_PADEN 0x00000002 // Enable Packet Padding
#define MAC_TCTL_TXEN 0x00000001 // Enable Transmitter
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_DATA register.
//
//*****************************************************************************
#define MAC_DATA_TXDATA_M 0xFFFFFFFF // Transmit FIFO Data
#define MAC_DATA_RXDATA_M 0xFFFFFFFF // Receive FIFO Data
#define MAC_DATA_RXDATA_S 0
#define MAC_DATA_TXDATA_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_IA0 register.
//
//*****************************************************************************
#define MAC_IA0_MACOCT4_M 0xFF000000 // MAC Address Octet 4
#define MAC_IA0_MACOCT3_M 0x00FF0000 // MAC Address Octet 3
#define MAC_IA0_MACOCT2_M 0x0000FF00 // MAC Address Octet 2
#define MAC_IA0_MACOCT1_M 0x000000FF // MAC Address Octet 1
#define MAC_IA0_MACOCT4_S 24
#define MAC_IA0_MACOCT3_S 16
#define MAC_IA0_MACOCT2_S 8
#define MAC_IA0_MACOCT1_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_IA1 register.
//
//*****************************************************************************
#define MAC_IA1_MACOCT6_M 0x0000FF00 // MAC Address Octet 6
#define MAC_IA1_MACOCT5_M 0x000000FF // MAC Address Octet 5
#define MAC_IA1_MACOCT6_S 8
#define MAC_IA1_MACOCT5_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_THR register.
//
//*****************************************************************************
#define MAC_THR_THRESH_M 0x0000003F // Threshold Value
#define MAC_THR_THRESH_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MCTL register.
//
//*****************************************************************************
#define MAC_MCTL_REGADR_M 0x000000F8 // MII Register Address
#define MAC_MCTL_WRITE 0x00000002 // MII Register Transaction Type
#define MAC_MCTL_START 0x00000001 // MII Register Transaction Enable
#define MAC_MCTL_REGADR_S 3
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MDV register.
//
//*****************************************************************************
#define MAC_MDV_DIV_M 0x000000FF // Clock Divider
#define MAC_MDV_DIV_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MADD register.
//
//*****************************************************************************
#define MAC_MADD_PHYADR_M 0x0000001F // PHY Address
#define MAC_MADD_PHYADR_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MTXD register.
//
//*****************************************************************************
#define MAC_MTXD_MDTX_M 0x0000FFFF // MII Register Transmit Data
#define MAC_MTXD_MDTX_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MRXD register.
//
//*****************************************************************************
#define MAC_MRXD_MDRX_M 0x0000FFFF // MII Register Receive Data
#define MAC_MRXD_MDRX_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_NP register.
//
//*****************************************************************************
#define MAC_NP_NPR_M 0x0000003F // Number of Packets in Receive
// FIFO
#define MAC_NP_NPR_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_TR register.
//
//*****************************************************************************
#define MAC_TR_NEWTX 0x00000001 // New Transmission
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_TS register.
//
//*****************************************************************************
#define MAC_TS_TSEN 0x00000001 // Time Stamp Enable
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_LED register.
//
//*****************************************************************************
#define MAC_LED_LED1_M 0x00000F00 // LED1 Source
#define MAC_LED_LED1_LINK 0x00000000 // Link OK
#define MAC_LED_LED1_RXTX 0x00000100 // RX or TX Activity (Default LED1)
#define MAC_LED_LED1_100 0x00000500 // 100BASE-TX mode
#define MAC_LED_LED1_10 0x00000600 // 10BASE-T mode
#define MAC_LED_LED1_DUPLEX 0x00000700 // Full-Duplex
#define MAC_LED_LED1_LINKACT 0x00000800 // Link OK & Blink=RX or TX
// Activity
#define MAC_LED_LED0_M 0x0000000F // LED0 Source
#define MAC_LED_LED0_LINK 0x00000000 // Link OK (Default LED0)
#define MAC_LED_LED0_RXTX 0x00000001 // RX or TX Activity
#define MAC_LED_LED0_100 0x00000005 // 100BASE-TX mode
#define MAC_LED_LED0_10 0x00000006 // 10BASE-T mode
#define MAC_LED_LED0_DUPLEX 0x00000007 // Full-Duplex
#define MAC_LED_LED0_LINKACT 0x00000008 // Link OK & Blink=RX or TX
// Activity
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MDIX register.
//
//*****************************************************************************
#define MAC_MDIX_EN 0x00000001 // MDI/MDI-X Enable
//*****************************************************************************
//
// The following are defines for the Ethernet Controller PHY registers.
//
//*****************************************************************************
#define PHY_MR0 0x00000000 // Ethernet PHY Management Register
// 0 - Control
#define PHY_MR1 0x00000001 // Ethernet PHY Management Register
// 1 - Status
#define PHY_MR2 0x00000002 // Ethernet PHY Management Register
// 2 - PHY Identifier 1
#define PHY_MR3 0x00000003 // Ethernet PHY Management Register
// 3 - PHY Identifier 2
#define PHY_MR4 0x00000004 // Ethernet PHY Management Register
// 4 - Auto-Negotiation
// Advertisement
#define PHY_MR5 0x00000005 // Ethernet PHY Management Register
// 5 - Auto-Negotiation Link
// Partner Base Page Ability
#define PHY_MR6 0x00000006 // Ethernet PHY Management Register
// 6 - Auto-Negotiation Expansion
#define PHY_MR16 0x00000010 // Ethernet PHY Management Register
// 16 - Vendor-Specific
#define PHY_MR17 0x00000011 // Ethernet PHY Management Register
// 17 - Mode Control/Status
#define PHY_MR18 0x00000012 // Ethernet PHY Management Register
// 18 - Diagnostic
#define PHY_MR19 0x00000013 // Ethernet PHY Management Register
// 19 - Transceiver Control
#define PHY_MR23 0x00000017 // Ethernet PHY Management Register
// 23 - LED Configuration
#define PHY_MR24 0x00000018 // Ethernet PHY Management Register
// 24 -MDI/MDIX Control
#define PHY_MR27 0x0000001B // Ethernet PHY Management Register
// 27 - Special Control/Status
#define PHY_MR29 0x0000001D // Ethernet PHY Management Register
// 29 - Interrupt Status
#define PHY_MR30 0x0000001E // Ethernet PHY Management Register
// 30 - Interrupt Mask
#define PHY_MR31 0x0000001F // Ethernet PHY Management Register
// 31 - PHY Special Control/Status
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR0 register.
//
//*****************************************************************************
#define PHY_MR0_RESET 0x00008000 // Reset Registers
#define PHY_MR0_LOOPBK 0x00004000 // Loopback Mode
#define PHY_MR0_SPEEDSL 0x00002000 // Speed Select
#define PHY_MR0_ANEGEN 0x00001000 // Auto-Negotiation Enable
#define PHY_MR0_PWRDN 0x00000800 // Power Down
#define PHY_MR0_ISO 0x00000400 // Isolate
#define PHY_MR0_RANEG 0x00000200 // Restart Auto-Negotiation
#define PHY_MR0_DUPLEX 0x00000100 // Set Duplex Mode
#define PHY_MR0_COLT 0x00000080 // Collision Test
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR1 register.
//
//*****************************************************************************
#define PHY_MR1_100X_F 0x00004000 // 100BASE-TX Full-Duplex Mode
#define PHY_MR1_100X_H 0x00002000 // 100BASE-TX Half-Duplex Mode
#define PHY_MR1_10T_F 0x00001000 // 10BASE-T Full-Duplex Mode
#define PHY_MR1_10T_H 0x00000800 // 10BASE-T Half-Duplex Mode
#define PHY_MR1_MFPS 0x00000040 // Management Frames with Preamble
// Suppressed
#define PHY_MR1_ANEGC 0x00000020 // Auto-Negotiation Complete
#define PHY_MR1_RFAULT 0x00000010 // Remote Fault
#define PHY_MR1_ANEGA 0x00000008 // Auto-Negotiation
#define PHY_MR1_LINK 0x00000004 // Link Made
#define PHY_MR1_JAB 0x00000002 // Jabber Condition
#define PHY_MR1_EXTD 0x00000001 // Extended Capabilities
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR2 register.
//
//*****************************************************************************
#define PHY_MR2_OUI_M 0x0000FFFF // Organizationally Unique
// Identifier[21:6]
#define PHY_MR2_OUI_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR3 register.
//
//*****************************************************************************
#define PHY_MR3_OUI_M 0x0000FC00 // Organizationally Unique
// Identifier[5:0]
#define PHY_MR3_MN_M 0x000003F0 // Model Number
#define PHY_MR3_RN_M 0x0000000F // Revision Number
#define PHY_MR3_OUI_S 10
#define PHY_MR3_MN_S 4
#define PHY_MR3_RN_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR4 register.
//
//*****************************************************************************
#define PHY_MR4_NP 0x00008000 // Next Page
#define PHY_MR4_RF 0x00002000 // Remote Fault
#define PHY_MR4_A3 0x00000100 // Technology Ability Field [3]
#define PHY_MR4_A2 0x00000080 // Technology Ability Field [2]
#define PHY_MR4_A1 0x00000040 // Technology Ability Field [1]
#define PHY_MR4_A0 0x00000020 // Technology Ability Field [0]
#define PHY_MR4_S_M 0x0000001F // Selector Field
#define PHY_MR4_S_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR5 register.
//
//*****************************************************************************
#define PHY_MR5_NP 0x00008000 // Next Page
#define PHY_MR5_ACK 0x00004000 // Acknowledge
#define PHY_MR5_RF 0x00002000 // Remote Fault
#define PHY_MR5_A_M 0x00001FE0 // Technology Ability Field
#define PHY_MR5_S_M 0x0000001F // Selector Field
#define PHY_MR5_S_8023 0x00000001 // IEEE Std 802.3
#define PHY_MR5_S_8029 0x00000002 // IEEE Std 802.9 ISLAN-16T
#define PHY_MR5_S_8025 0x00000003 // IEEE Std 802.5
#define PHY_MR5_S_1394 0x00000004 // IEEE Std 1394
#define PHY_MR5_A_S 5
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR6 register.
//
//*****************************************************************************
#define PHY_MR6_PDF 0x00000010 // Parallel Detection Fault
#define PHY_MR6_LPNPA 0x00000008 // Link Partner is Next Page Able
#define PHY_MR6_PRX 0x00000002 // New Page Received
#define PHY_MR6_LPANEGA 0x00000001 // Link Partner is Auto-Negotiation
// Able
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR16 register.
//
//*****************************************************************************
#define PHY_MR16_RPTR 0x00008000 // Repeater Mode
#define PHY_MR16_INPOL 0x00004000 // Interrupt Polarity
#define PHY_MR16_TXHIM 0x00001000 // Transmit High Impedance Mode
#define PHY_MR16_SQEI 0x00000800 // SQE Inhibit Testing
#define PHY_MR16_NL10 0x00000400 // Natural Loopback Mode
#define PHY_MR16_SR_M 0x000003C0 // Silicon Revision Identifier
#define PHY_MR16_APOL 0x00000020 // Auto-Polarity Disable
#define PHY_MR16_RVSPOL 0x00000010 // Receive Data Polarity
#define PHY_MR16_PCSBP 0x00000002 // PCS Bypass
#define PHY_MR16_RXCC 0x00000001 // Receive Clock Control
#define PHY_MR16_SR_S 6
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR17 register.
//
//*****************************************************************************
#define PHY_MR17_JABBER_IE 0x00008000 // Jabber Interrupt Enable
#define PHY_MR17_FASTRIP 0x00004000 // 10-BASE-T Fast Mode Enable
#define PHY_MR17_RXER_IE 0x00004000 // Receive Error Interrupt Enable
#define PHY_MR17_EDPD 0x00002000 // Enable Energy Detect Power Down
#define PHY_MR17_PRX_IE 0x00002000 // Page Received Interrupt Enable
#define PHY_MR17_PDF_IE 0x00001000 // Parallel Detection Fault
// Interrupt Enable
#define PHY_MR17_LSQE 0x00000800 // Low Squelch Enable
#define PHY_MR17_LPACK_IE 0x00000800 // LP Acknowledge Interrupt Enable
#define PHY_MR17_LSCHG_IE 0x00000400 // Link Status Change Interrupt
// Enable
#define PHY_MR17_RFAULT_IE 0x00000200 // Remote Fault Interrupt Enable
#define PHY_MR17_ANEGCOMP_IE 0x00000100 // Auto-Negotiation Complete
// Interrupt Enable
#define PHY_MR17_FASTEST 0x00000100 // Auto-Negotiation Test Mode
#define PHY_MR17_JABBER_INT 0x00000080 // Jabber Event Interrupt
#define PHY_MR17_RXER_INT 0x00000040 // Receive Error Interrupt
#define PHY_MR17_PRX_INT 0x00000020 // Page Receive Interrupt
#define PHY_MR17_PDF_INT 0x00000010 // Parallel Detection Fault
// Interrupt
#define PHY_MR17_LPACK_INT 0x00000008 // LP Acknowledge Interrupt
#define PHY_MR17_LSCHG_INT 0x00000004 // Link Status Change Interrupt
#define PHY_MR17_FGLS 0x00000004 // Force Good Link Status
#define PHY_MR17_RFAULT_INT 0x00000002 // Remote Fault Interrupt
#define PHY_MR17_ENON 0x00000002 // Energy On
#define PHY_MR17_ANEGCOMP_INT 0x00000001 // Auto-Negotiation Complete
// Interrupt
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR18 register.
//
//*****************************************************************************
#define PHY_MR18_ANEGF 0x00001000 // Auto-Negotiation Failure
#define PHY_MR18_DPLX 0x00000800 // Duplex Mode
#define PHY_MR18_RATE 0x00000400 // Rate
#define PHY_MR18_RXSD 0x00000200 // Receive Detection
#define PHY_MR18_RX_LOCK 0x00000100 // Receive PLL Lock
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR19 register.
//
//*****************************************************************************
#define PHY_MR19_TXO_M 0x0000C000 // Transmit Amplitude Selection
#define PHY_MR19_TXO_00DB 0x00000000 // Gain set for 0.0dB of insertion
// loss
#define PHY_MR19_TXO_04DB 0x00004000 // Gain set for 0.4dB of insertion
// loss
#define PHY_MR19_TXO_08DB 0x00008000 // Gain set for 0.8dB of insertion
// loss
#define PHY_MR19_TXO_12DB 0x0000C000 // Gain set for 1.2dB of insertion
// loss
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR23 register.
//
//*****************************************************************************
#define PHY_MR23_LED1_M 0x000000F0 // LED1 Source
#define PHY_MR23_LED1_LINK 0x00000000 // Link OK
#define PHY_MR23_LED1_RXTX 0x00000010 // RX or TX Activity (Default LED1)
#define PHY_MR23_LED1_100 0x00000050 // 100BASE-TX mode
#define PHY_MR23_LED1_10 0x00000060 // 10BASE-T mode
#define PHY_MR23_LED1_DUPLEX 0x00000070 // Full-Duplex
#define PHY_MR23_LED1_LINKACT 0x00000080 // Link OK & Blink=RX or TX
// Activity
#define PHY_MR23_LED0_M 0x0000000F // LED0 Source
#define PHY_MR23_LED0_LINK 0x00000000 // Link OK (Default LED0)
#define PHY_MR23_LED0_RXTX 0x00000001 // RX or TX Activity
#define PHY_MR23_LED0_100 0x00000005 // 100BASE-TX mode
#define PHY_MR23_LED0_10 0x00000006 // 10BASE-T mode
#define PHY_MR23_LED0_DUPLEX 0x00000007 // Full-Duplex
#define PHY_MR23_LED0_LINKACT 0x00000008 // Link OK & Blink=RX or TX
// Activity
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR24 register.
//
//*****************************************************************************
#define PHY_MR24_PD_MODE 0x00000080 // Parallel Detection Mode
#define PHY_MR24_AUTO_SW 0x00000040 // Auto-Switching Enable
#define PHY_MR24_MDIX 0x00000020 // Auto-Switching Configuration
#define PHY_MR24_MDIX_CM 0x00000010 // Auto-Switching Complete
#define PHY_MR24_MDIX_SD_M 0x0000000F // Auto-Switching Seed
#define PHY_MR24_MDIX_SD_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR27 register.
//
//*****************************************************************************
#define PHY_MR27_XPOL 0x00000010 // Polarity State of 10 BASE-T
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR29 register.
//
//*****************************************************************************
#define PHY_MR29_EONIS 0x00000080 // ENERGYON Interrupt
#define PHY_MR29_ANCOMPIS 0x00000040 // Auto-Negotiation Complete
// Interrupt
#define PHY_MR29_RFLTIS 0x00000020 // Remote Fault Interrupt
#define PHY_MR29_LDIS 0x00000010 // Link Down Interrupt
#define PHY_MR29_LPACKIS 0x00000008 // Auto-Negotiation LP Acknowledge
#define PHY_MR29_PDFIS 0x00000004 // Parallel Detection Fault
#define PHY_MR29_PRXIS 0x00000002 // Auto Negotiation Page Received
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR30 register.
//
//*****************************************************************************
#define PHY_MR30_EONIM 0x00000080 // ENERGYON Interrupt Enabled
#define PHY_MR30_ANCOMPIM 0x00000040 // Auto-Negotiation Complete
// Interrupt Enabled
#define PHY_MR30_RFLTIM 0x00000020 // Remote Fault Interrupt Enabled
#define PHY_MR30_LDIM 0x00000010 // Link Down Interrupt Enabled
#define PHY_MR30_LPACKIM 0x00000008 // Auto-Negotiation LP Acknowledge
// Enabled
#define PHY_MR30_PDFIM 0x00000004 // Parallel Detection Fault Enabled
#define PHY_MR30_PRXIM 0x00000002 // Auto Negotiation Page Received
// Enabled
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR31 register.
//
//*****************************************************************************
#define PHY_MR31_AUTODONE 0x00001000 // Auto Negotiation Done
#define PHY_MR31_SPEED_M 0x0000001C // HCD Speed Value
#define PHY_MR31_SPEED_10HD 0x00000004 // 10BASE-T half duplex
#define PHY_MR31_SPEED_100HD 0x00000008 // 100BASE-T half duplex
#define PHY_MR31_SPEED_10FD 0x00000014 // 10BASE-T full duplex
#define PHY_MR31_SPEED_100FD 0x00000018 // 100BASE-T full duplex
#define PHY_MR31_SCRDIS 0x00000001 // Scramble Disable
//*****************************************************************************
//
// The following definitions are deprecated.
//
//*****************************************************************************
#ifndef DEPRECATED
//*****************************************************************************
//
// The following are deprecated defines for the Ethernet MAC register offsets.
//
//*****************************************************************************
#define MAC_O_IS 0x00000000 // Interrupt Status Register
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_IS
// register.
//
//*****************************************************************************
#define MAC_IS_PHYINT 0x00000040 // PHY Interrupt
#define MAC_IS_MDINT 0x00000020 // MDI Transaction Complete
#define MAC_IS_RXER 0x00000010 // RX Error
#define MAC_IS_FOV 0x00000008 // RX FIFO Overrun
#define MAC_IS_TXEMP 0x00000004 // TX FIFO Empy
#define MAC_IS_TXER 0x00000002 // TX Error
#define MAC_IS_RXINT 0x00000001 // RX Packet Available
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_IA0
// register.
//
//*****************************************************************************
#define MAC_IA0_MACOCT4 0xFF000000 // 4th Octet of MAC address
#define MAC_IA0_MACOCT3 0x00FF0000 // 3rd Octet of MAC address
#define MAC_IA0_MACOCT2 0x0000FF00 // 2nd Octet of MAC address
#define MAC_IA0_MACOCT1 0x000000FF // 1st Octet of MAC address
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_IA1
// register.
//
//*****************************************************************************
#define MAC_IA1_MACOCT6 0x0000FF00 // 6th Octet of MAC address
#define MAC_IA1_MACOCT5 0x000000FF // 5th Octet of MAC address
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_THR
// register.
//
//*****************************************************************************
#define MAC_THR_THRESH 0x0000003F // Transmit Threshold Value
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_MCTL
// register.
//
//*****************************************************************************
#define MAC_MCTL_REGADR 0x000000F8 // Address for Next MII Transaction
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_MDV
// register.
//
//*****************************************************************************
#define MAC_MDV_DIV 0x000000FF // Clock Divider for MDC for TX
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_MTXD
// register.
//
//*****************************************************************************
#define MAC_MTXD_MDTX 0x0000FFFF // Data for Next MII Transaction
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_MRXD
// register.
//
//*****************************************************************************
#define MAC_MRXD_MDRX 0x0000FFFF // Data Read from Last MII Trans
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_NP
// register.
//
//*****************************************************************************
#define MAC_NP_NPR 0x0000003F // Number of RX Frames in FIFO
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the PHY_MR23
// register.
//
//*****************************************************************************
#define PHY_MR23_LED1_TX 0x00000020 // TX Activity
#define PHY_MR23_LED1_RX 0x00000030 // RX Activity
#define PHY_MR23_LED1_COL 0x00000040 // Collision
#define PHY_MR23_LED0_TX 0x00000002 // TX Activity
#define PHY_MR23_LED0_RX 0x00000003 // RX Activity
#define PHY_MR23_LED0_COL 0x00000004 // Collision
//*****************************************************************************
//
// The following are deprecated defines for the reset values of the MAC
// registers.
//
//*****************************************************************************
#define MAC_RV_MDV 0x00000080
#define MAC_RV_IM 0x0000007F
#define MAC_RV_THR 0x0000003F
#define MAC_RV_RCTL 0x00000008
#define MAC_RV_IA0 0x00000000
#define MAC_RV_TCTL 0x00000000
#define MAC_RV_DATA 0x00000000
#define MAC_RV_MRXD 0x00000000
#define MAC_RV_TR 0x00000000
#define MAC_RV_IS 0x00000000
#define MAC_RV_NP 0x00000000
#define MAC_RV_MCTL 0x00000000
#define MAC_RV_MTXD 0x00000000
#define MAC_RV_IA1 0x00000000
#define MAC_RV_IACK 0x00000000
#define MAC_RV_MADD 0x00000000
#endif
#endif // __HW_ETHERNET_H__

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: clock-arch.c,v 1.2 2006/06/12 08:00:31 adam Exp $
*/
/**
* \file
* Implementation of architecture-specific clock functionality
* \author
* Adam Dunkels <adam@sics.se>
*/
#include "clock-arch.h"
#include "boot.h"
/*---------------------------------------------------------------------------*/
clock_time_t
clock_time(void)
{
return (clock_time_t)TimerGet();
}
/*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,40 @@
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: clock-arch.h,v 1.2 2006/06/12 08:00:31 adam Exp $
*/
#ifndef __CLOCK_ARCH_H__
#define __CLOCK_ARCH_H__
typedef int clock_time_t;
#define CLOCK_CONF_SECOND 1000
#endif /* __CLOCK_ARCH_H__ */

View File

@ -0,0 +1,169 @@
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: netdev.c,v 1.8 2006/06/07 08:39:58 adam Exp $
*/
/*---------------------------------------------------------------------------*/
#include "uip.h"
#include "uip_arp.h"
#include "boot.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_ethernet.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/ethernet.h"
#include "driverlib/flashlib.h"
/*---------------------------------------------------------------------------*/
#define NETDEV_LINKUP_TIMEOUT_MS (5000)
#define NETDEV_DEFAULT_MACADDR0 (0x08)
#define NETDEV_DEFAULT_MACADDR1 (0x00)
#define NETDEV_DEFAULT_MACADDR2 (0x27)
#define NETDEV_DEFAULT_MACADDR3 (0x69)
#define NETDEV_DEFAULT_MACADDR4 (0x5B)
#define NETDEV_DEFAULT_MACADDR5 (0x45)
/*---------------------------------------------------------------------------*/
void netdev_init(void)
{
blt_int32u ulTemp;
blt_int32u ulLinkTimeOut;
/* enable and reset the ethernet controller. */
SysCtlPeripheralEnable(SYSCTL_PERIPH_ETH);
SysCtlPeripheralReset(SYSCTL_PERIPH_ETH);
/* enable port F for ethernet LEDs.
* LED0 Bit 3 Output
* LED1 Bit 2 Output
*/
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeEthernetLED(GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_3);
/* intialize the ethernet controller and disable all ethernet controller
* interrupt sources.
*/
EthernetIntDisable(ETH_BASE, (ETH_INT_PHY | ETH_INT_MDIO | ETH_INT_RXER |
ETH_INT_RXOF | ETH_INT_TX | ETH_INT_TXER | ETH_INT_RX));
ulTemp = EthernetIntStatus(ETH_BASE, false);
EthernetIntClear(ETH_BASE, ulTemp);
/* initialize the ethernet controller for operation. */
EthernetInitExpClk(ETH_BASE, SysCtlClockGet());
/* configure the ethernet controller for normal operation.
* - Full Duplex
* - TX CRC Auto Generation
* - TX Padding Enabled
*/
EthernetConfigSet(ETH_BASE, (ETH_CFG_TX_DPLXEN | ETH_CFG_TX_CRCEN |
ETH_CFG_TX_PADEN));
/* wait for the link to become active. */
ulTemp = EthernetPHYRead(ETH_BASE, PHY_MR1);
ulLinkTimeOut = TimerGet() + NETDEV_LINKUP_TIMEOUT_MS;
while ((ulTemp & 0x0004) == 0)
{
ulTemp = EthernetPHYRead(ETH_BASE, PHY_MR1);
/* check for timeout so that the software program can still start if the
* ethernet cable is not connected.
*/
if (TimerGet() >= ulLinkTimeOut)
{
break;
}
}
/* enable the ethernet controller. */
EthernetEnable(ETH_BASE);
}
/*---------------------------------------------------------------------------*/
void netdev_setmacaddr(void)
{
struct uip_eth_addr macAddress;
unsigned long ulUser0, ulUser1;
/* set the default MAC address */
macAddress.addr[0] = NETDEV_DEFAULT_MACADDR0;
macAddress.addr[1] = NETDEV_DEFAULT_MACADDR1;
macAddress.addr[2] = NETDEV_DEFAULT_MACADDR2;
macAddress.addr[3] = NETDEV_DEFAULT_MACADDR3;
macAddress.addr[4] = NETDEV_DEFAULT_MACADDR4;
macAddress.addr[5] = NETDEV_DEFAULT_MACADDR5;
/* the LM3S eval kit should have a MAC address pre-propgrammed in flash by the
* manufacturer. try to use this one, otherwise use the default values.
*/
FlashUserGet(&ulUser0, &ulUser1);
if ( (ulUser0 != 0xffffffff) && (ulUser1 != 0xffffffff) )
{
macAddress.addr[0] = ((ulUser0 >> 0) & 0xff);
macAddress.addr[1] = ((ulUser0 >> 8) & 0xff);
macAddress.addr[2] = ((ulUser0 >> 16) & 0xff);
macAddress.addr[3] = ((ulUser1 >> 0) & 0xff);
macAddress.addr[4] = ((ulUser1 >> 8) & 0xff);
macAddress.addr[5] = ((ulUser1 >> 16) & 0xff);
}
EthernetMACAddrSet(ETH_BASE, &macAddress.addr[0]);
uip_setethaddr(macAddress);
}
/*---------------------------------------------------------------------------*/
unsigned int netdev_read(void)
{
blt_int32u ulTemp;
/* read and Clear the interrupt flag. */
ulTemp = EthernetIntStatus(ETH_BASE, false);
EthernetIntClear(ETH_BASE, ulTemp);
/* check to see if an RX Interrupt has occured. */
if(ulTemp & ETH_INT_RX)
{
return EthernetPacketGetNonBlocking(ETH_BASE, uip_buf, sizeof(uip_buf));
}
return 0;
}
/*---------------------------------------------------------------------------*/
void netdev_send(void)
{
EthernetPacketPut(ETH_BASE, uip_buf, uip_len);
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: netdev.h,v 1.1 2002/01/10 06:22:56 adam Exp $
*
*/
#ifndef __NETDEV_H__
#define __NETDEV_H__
void netdev_init(void);
unsigned int netdev_read(void);
void netdev_send(void);
void netdev_setmacaddr(void);
#endif /* __NETDEV_H__ */

View File

@ -0,0 +1,151 @@
/**
* \addtogroup uipopt
* @{
*/
/**
* \name Project-specific configuration options
* @{
*
* uIP has a number of configuration options that can be overridden
* for each project. These are kept in a project-specific uip-conf.h
* file and all configuration names have the prefix UIP_CONF.
*/
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: uip-conf.h,v 1.6 2006/06/12 08:00:31 adam Exp $
*/
/**
* \file
* An example uIP configuration file
* \author
* Adam Dunkels <adam@sics.se>
*/
#ifndef __UIP_CONF_H__
#define __UIP_CONF_H__
/**
* 8 bit datatype
*
* This typedef defines the 8-bit type used throughout uIP.
*
* \hideinitializer
*/
typedef unsigned char u8_t;
/**
* 16 bit datatype
*
* This typedef defines the 16-bit type used throughout uIP.
*
* \hideinitializer
*/
typedef unsigned short u16_t;
/**
* Statistics datatype
*
* This typedef defines the dataype used for keeping statistics in
* uIP.
*
* \hideinitializer
*/
typedef unsigned short uip_stats_t;
/**
* Maximum number of TCP connections.
*
* \hideinitializer
*/
#define UIP_CONF_MAX_CONNECTIONS 1
/**
* Maximum number of listening TCP ports.
*
* \hideinitializer
*/
#define UIP_CONF_MAX_LISTENPORTS 1
/**
* uIP buffer size.
*
* \hideinitializer
*/
#define UIP_CONF_BUFFER_SIZE 1600
/**
* CPU byte order.
*
* \hideinitializer
*/
#define UIP_CONF_BYTE_ORDER LITTLE_ENDIAN
/**
* Logging on or off
*
* \hideinitializer
*/
#define UIP_CONF_LOGGING 0
/**
* UDP support on or off
*
* \hideinitializer
*/
#define UIP_CONF_UDP 0
/**
* UDP checksums on or off
*
* \hideinitializer
*/
#define UIP_CONF_UDP_CHECKSUMS 1
/**
* uIP statistics on or off
*
* \hideinitializer
*/
#define UIP_CONF_STATISTICS 0
/* Here we include the header file for the application(s) we use in
our project. */
#include "boot.h"
#include "net.h"
#endif /* __UIP_CONF_H__ */
/** @} */
/** @} */

View File

@ -38,6 +38,7 @@ PROJ_FILES= \
blt_conf.h \
hooks.c \
main.c \
./lib/inc/hw_ethernet.h \
./lib/inc/hw_flash.h \
./lib/inc/hw_gpio.h \
./lib/inc/hw_ints.h \
@ -47,6 +48,8 @@ main.c \
./lib/inc/hw_types.h \
./lib/inc/hw_uart.h \
./lib/inc/hw_ssi.h \
./lib/driverlib/ethernet.c \
./lib/driverlib/ethernet.h \
./lib/driverlib/cpulib.c \
./lib/driverlib/flashlib.c \
./lib/driverlib/gpio.h \
@ -65,6 +68,11 @@ main.c \
./lib/driverlib/ssi.h \
./lib/fatfs/ffconf.h \
./lib/fatfs/mmc.c \
./lib/uip/clock-arch.c \
./lib/uip/clock-arch.h \
./lib/uip/netdev.c \
./lib/uip/netdev.h \
./lib/uip/uip-conf.h \
../../../Source/boot.c \
../../../Source/boot.h \
../../../Source/com.c \
@ -77,6 +85,8 @@ main.c \
../../../Source/cop.h \
../../../Source/file.c \
../../../Source/file.h \
../../../Source/net.c \
../../../Source/net.h \
../../../Source/assert.c \
../../../Source/assert.h \
../../../Source/plausibility.h \
@ -85,6 +95,24 @@ main.c \
../../../Source/third_party/fatfs/src/ff.h \
../../../Source/third_party/fatfs/src/integer.h \
../../../Source/third_party/fatfs/src/option/unicode.c \
../../../Source/third_party/uip/uip/clock.h \
../../../Source/third_party/uip/uip/lc-addrlabels.h \
../../../Source/third_party/uip/uip/lc-switch.h \
../../../Source/third_party/uip/uip/lc.h \
../../../Source/third_party/uip/uip/pt.h \
../../../Source/third_party/uip/uip/uip-fw.h \
../../../Source/third_party/uip/uip/uip-neighbor.h \
../../../Source/third_party/uip/uip/uip-split.h \
../../../Source/third_party/uip/uip/uip.c \
../../../Source/third_party/uip/uip/uip.h \
../../../Source/third_party/uip/uip/uip_arch.h \
../../../Source/third_party/uip/uip/uip_arp.c \
../../../Source/third_party/uip/uip/uip_arp.h \
../../../Source/third_party/uip/uip/uip_timer.c \
../../../Source/third_party/uip/uip/uip_timer.h \
../../../Source/third_party/uip/uip/uiplib.c \
../../../Source/third_party/uip/uip/uiplib.h \
../../../Source/third_party/uip/uip/uipopt.h \
../../../Source/ARMCM3_LM3S/types.h \
../../../Source/ARMCM3_LM3S/cpu.c \
../../../Source/ARMCM3_LM3S/cpu.h \

View File

@ -3,43 +3,43 @@ bin/demoprog_ek_lm3s6965.elf: file format elf32-littlearm
bin/demoprog_ek_lm3s6965.elf
architecture: arm, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00006000
start address 0x00008000
Program Header:
LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**15
filesz 0x00007078 memsz 0x00007078 flags r-x
LOAD off 0x00008000 vaddr 0x20000000 paddr 0x20000000 align 2**15
LOAD off 0x00008000 vaddr 0x00008000 paddr 0x00008000 align 2**15
filesz 0x00001078 memsz 0x00001078 flags r-x
LOAD off 0x00010000 vaddr 0x20000000 paddr 0x20000000 align 2**15
filesz 0x00000000 memsz 0x0000015c flags rw-
private flags = 5000202: [Version5 EABI] [soft-float ABI] [has entry point]
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00001078 00006000 00006000 00006000 2**2
0 .text 00001078 00008000 00008000 00008000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .bss 0000015c 20000000 20000000 00008000 2**2
1 .bss 0000015c 20000000 20000000 00010000 2**2
ALLOC
2 .debug_info 00003cc0 00000000 00000000 00007078 2**0
2 .debug_info 00003cc0 00000000 00000000 00009078 2**0
CONTENTS, READONLY, DEBUGGING
3 .debug_abbrev 00000b94 00000000 00000000 0000ad38 2**0
3 .debug_abbrev 00000b94 00000000 00000000 0000cd38 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_loc 00001fb9 00000000 00000000 0000b8cc 2**0
4 .debug_loc 00001fb9 00000000 00000000 0000d8cc 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_aranges 00000660 00000000 00000000 0000d885 2**0
5 .debug_aranges 00000660 00000000 00000000 0000f885 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_ranges 00000590 00000000 00000000 0000dee5 2**0
6 .debug_ranges 00000590 00000000 00000000 0000fee5 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_line 00001611 00000000 00000000 0000e475 2**0
7 .debug_line 00001611 00000000 00000000 00010475 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_str 00001079 00000000 00000000 0000fa86 2**0
8 .debug_str 00001079 00000000 00000000 00011a86 2**0
CONTENTS, READONLY, DEBUGGING
9 .comment 00000030 00000000 00000000 00010aff 2**0
9 .comment 00000030 00000000 00000000 00012aff 2**0
CONTENTS, READONLY
10 .ARM.attributes 00000033 00000000 00000000 00010b2f 2**0
10 .ARM.attributes 00000033 00000000 00000000 00012b2f 2**0
CONTENTS, READONLY
11 .debug_frame 00001000 00000000 00000000 00010b64 2**2
11 .debug_frame 00001000 00000000 00000000 00012b64 2**2
CONTENTS, READONLY, DEBUGGING
SYMBOL TABLE:
00006000 l d .text 00000000 .text
00008000 l d .text 00000000 .text
20000000 l d .bss 00000000 .bss
00000000 l d .debug_info 00000000 .debug_info
00000000 l d .debug_abbrev 00000000 .debug_abbrev
@ -57,7 +57,7 @@ SYMBOL TABLE:
20000004 l O .bss 00000041 xcpCtoReqPacket.4439
20000048 l O .bss 00000001 xcpCtoRxInProgress.4441
00000000 l df *ABS* 00000000 cstart.c
00006248 l F .text 00000000 zero_loop
00008248 l F .text 00000000 zero_loop
00000000 l df *ABS* 00000000 irq.c
00000000 l df *ABS* 00000000 led.c
2000004c l O .bss 00000004 timer_counter_last.4435
@ -68,55 +68,55 @@ SYMBOL TABLE:
20000058 l O .bss 00000004 millisecond_counter
00000000 l df *ABS* 00000000 cpu.c
00000000 l df *ABS* 00000000 gpio.c
00006408 l F .text 0000008a GPIOBaseValid
00008408 l F .text 0000008a GPIOBaseValid
00000000 l df *ABS* 00000000 interrupt.c
00000000 l df *ABS* 00000000 sysctl.c
00006708 l F .text 00000154 SysCtlPeripheralValid
00006fc8 l O .text 0000005c g_pulXtals
0000703c l O .text 0000000c g_pulRCGCRegs
00008708 l F .text 00000154 SysCtlPeripheralValid
00008fc8 l O .text 0000005c g_pulXtals
0000903c l O .text 0000000c g_pulRCGCRegs
00000000 l df *ABS* 00000000 systick.c
00000000 l df *ABS* 00000000 uart.c
00006d8c l F .text 00000026 UARTBaseValid
00008d8c l F .text 00000026 UARTBaseValid
00000000 l df *ABS* 00000000
00000100 l *ABS* 00000000 __STACKSIZE__
0000638c g F .text 0000000c __error__
00006204 g F .text 00000060 reset_handler
000068b8 g F .text 00000008 SysCtlDelay
00006270 g F .text 0000000e IrqInterruptEnable
00007078 g .text 00000000 _etext
00006630 g F .text 00000030 GPIOPinWrite
0000685c g F .text 00000046 SysCtlPeripheralEnable
000068a4 g F .text 00000012 SysCtlReset
0000838c g F .text 0000000c __error__
00008204 g F .text 00000060 reset_handler
000088b8 g F .text 00000008 SysCtlDelay
00008270 g F .text 0000000e IrqInterruptEnable
00009078 g .text 00000000 _etext
00008630 g F .text 00000030 GPIOPinWrite
0000885c g F .text 00000046 SysCtlPeripheralEnable
000088a4 g F .text 00000012 SysCtlReset
2000005c g .bss 00000000 _ebss
000063fc g F .text 00000002 UnusedISR
00006280 g F .text 0000003a LedInit
000063ec g F .text 00000010 TimeISRHandler
00006f78 g F .text 00000036 UARTCharGetNonBlocking
000083fc g F .text 00000002 UnusedISR
00008280 g F .text 0000003a LedInit
000083ec g F .text 00000010 TimeISRHandler
00008f78 g F .text 00000036 UARTCharGetNonBlocking
20000000 g .bss 00000000 _bss
00006d60 g F .text 0000002a SysTickPeriodSet
00006338 g F .text 00000052 main
00006a7c g F .text 000002ba SysCtlClockGet
00006df0 g F .text 00000044 UARTDisable
000060f4 g F .text 00000050 BootComInit
000066f8 g F .text 00000010 IntMasterEnable
00006398 g F .text 00000046 TimeInit
00008d60 g F .text 0000002a SysTickPeriodSet
00008338 g F .text 00000052 main
00008a7c g F .text 000002ba SysCtlClockGet
00008df0 g F .text 00000044 UARTDisable
000080f4 g F .text 00000050 BootComInit
000086f8 g F .text 00000010 IntMasterEnable
00008398 g F .text 00000046 TimeInit
20000000 g .text 00000000 _data
000062bc g F .text 0000007a LedToggle
000082bc g F .text 0000007a LedToggle
2000015c g .bss 00000000 _estack
20000000 g .text 00000000 _edata
00006000 g O .text 000000f4 _vectab
000066ac g F .text 0000004c GPIOPinTypeUART
00006660 g F .text 0000004c GPIOPinTypeGPIOOutput
00006144 g F .text 000000c0 BootComCheckActivationRequest
000063e0 g F .text 0000000c TimeGet
00006400 g F .text 00000008 CPUcpsie
00006494 g F .text 0000006c GPIODirModeSet
00008000 g O .text 000000f4 _vectab
000086ac g F .text 0000004c GPIOPinTypeUART
00008660 g F .text 0000004c GPIOPinTypeGPIOOutput
00008144 g F .text 000000c0 BootComCheckActivationRequest
000083e0 g F .text 0000000c TimeGet
00008400 g F .text 00000008 CPUcpsie
00008494 g F .text 0000006c GPIODirModeSet
2000005c g .bss 00000000 _stack
00006d38 g F .text 00000012 SysTickEnable
00006d4c g F .text 00000012 SysTickIntEnable
00006e34 g F .text 00000142 UARTConfigSetExpClk
000068c0 g F .text 000001ba SysCtlClockSet
00006500 g F .text 0000012e GPIOPadConfigSet
00006db4 g F .text 0000003c UARTEnable
00008d38 g F .text 00000012 SysTickEnable
00008d4c g F .text 00000012 SysTickIntEnable
00008e34 g F .text 00000142 UARTConfigSetExpClk
000088c0 g F .text 000001ba SysCtlClockSet
00008500 g F .text 0000012e GPIOPadConfigSet
00008db4 g F .text 0000003c UARTEnable

View File

@ -1,266 +1,266 @@
S020000062696E2F64656D6F70726F675F656B5F6C6D3373363936352E7372656358
S11360005C01002005620000FD630000FD630000E8
S1136010FD630000FD630000FD630000FD630000FC
S1136020FD630000FD630000FD630000FD630000EC
S1136030FD630000FD630000FD630000ED630000EC
S1136040FD630000FD630000FD630000FD630000CC
S1136050FD630000FD630000FD630000FD630000BC
S1136060FD630000FD630000FD630000FD630000AC
S1136070FD630000FD630000FD630000FD6300009C
S1136080FD630000FD630000FD630000FD6300008C
S1136090FD630000FD630000FD630000FD6300007C
S11360A0FD630000FD630000FD630000FD6300006C
S11360B0FD630000FD630000FD630000FD6300005C
S11360C0FD630000FD630000FD630000FD6300004C
S11360D0FD630000FD630000FD630000FD6300003C
S11360E0FD630000FD630000FD630000FD6300002C
S11360F0EE11AA5510B50120C1F2000046F65D0468
S1136100C0F20004A0470120C2F20000A0474FF0F3
S11361104020032146F2AD63C0F20003984746F6DF
S11361207D23C0F20003984701464FF44040C4F277
S113613000004FF46142602346F63564C0F2000467
S1136140A04710BD10B540F24803C2F200031B780B
S1136150EBB94FF44040C4F2000046F67973C0F244
S113616000039847B0F1FF3F4BD040F20403C2F262
S11361700003187040F24803C2F2000301221A70AF
S113618040F20003C2F2000300221A7010BD40F274
S11361900003C2F200031B785C1C4FF44040C4F2BD
S11361A0000046F67973C0F200039847B0F1FF3F50
S11361B027D040F20403C2F20003185540F2000253
S11361C0C2F2000211780131C9B211701B788B42FE
S11361D017D140F24803C2F2000300221A7040F2C1
S11361E00403C2F200035B78FF2B0AD140F20403DC
S11361F0C2F200039B7823B946F6A503C0F200035C
S1136200984710BD10B517498D4640F20002C2F2FE
S1136210000240F20003C2F200039A4210D2131D9E
S11362200F4CE41A24F0030404340023104647F20C
S11362307801C0F200015A581A500433A342FAD12B
S113624009480A494FF000028842B8BF40F8042BBD
S1136250FADB46F23933C0F20003984710BD00BFA1
S1136260030000205C010020000000205C000020EE
S113627008B546F2F963C0F20003984708BD00BFB1
S113628010B52020C2F2000046F65D03C0F2000300
S113629098474FF4A044C4F202042046012146F278
S11362A06163C0F20003984720460121002246F2B0
S11362B03163C0F20003984710BD00BF10B546F229
S11362C0E133C0F200039847044640F24C03C2F2A3
S11362D000031B68C31AB3F5FA7F2BD340F25003B3
S11362E0C2F200031B7883B940F25003C2F20003E8
S11362F001221A704FF4A040C4F20200114646F283
S11363003163C0F2000398470FE040F25003C2F239
S1136310000300221A704FF4A040C4F202000121CD
S113632046F23163C0F20003984740F24C03C2F2D4
S113633000031C6010BD00BF08B54FF46070C0F2CC
S1136340C01046F6C103C0F20003984746F2812309
S1136350C0F20003984746F29933C0F2000398470D
S113636046F27123C0F20003984746F2F503C0F2E7
S11363700003984746F2BD25C0F2000546F24514D5
S1136380C0F20004A847A047FCE700BF40F2540352
S1136390C2F200031960FEE708B546F67D23C0F299
S11363A00003984744F6D353C1F26203A3FB0020D1
S11363B0800946F66153C0F20003984746F6395304
S11363C0C0F20003984746F64D53C0F200039847C5
S11363D040F25803C2F2000300221A6008BD00BF55
S11363E040F25803C2F200031868704740F25803A1
S11363F0C2F200031A6801321A607047FEE700BF58
S1136400EFF3108062B6704720F480534FF40042DB
S1136410C4F20502934218BFB3F1402F31D04FF4B8
S1136420C041C4F200014FF42042C4F20502934279
S113643018BF8B4227D04FF48041C4F202014FF4BD
S11364404042C4F20502934218BF8B421DD04FF460
S1136450C041C4F202014FF46042C4F20502934207
S113646018BF8B4213D04FF45042C4F203020023EE
S1136470C4F20603984218BF904214BF00200120C2
S113648070470120704701207047012070470120A8
S1136490704700BF70B504460E46154646F20943E0
S11364A0C0F20003984748B946F6B070C0F2000045
S11364B0E42146F28D33C0F200039847022D09D936
S11364C046F6B070C0F20000E62146F28D33C0F209
S11364D00003984715F0010F04F58063D4F80024F5
S11364E014BF3243B2431A6015F0020F04F58463FB
S11364F0D4F8202414BF164322EA06061E6070BD99
S1136500F8B504460D4617461E4646F20943C0F246
S11365100003984750B946F6B070C0F200004FF43B
S1136520DD7146F28D33C0F20003984727F008026C
S11365307B1E042A18BF012B0AD946F6B070C0F29C
S113654000004FF4DF7146F28D33C0F20003984728
S1136550A6F10803052B0BD956B146F6B070C0F26C
S1136560000040F2C51146F28D33C0F20003984793
S113657017F0010F04F5A063D4F8002514BF2A43D3
S1136580AA431A6017F0020F04F20453D4F8042546
S113659014BF2A43AA431A6017F0040F04F5A16339
S11365A0D4F8082514BF2A43AA431A6017F0080F29
S11365B004F5A363D4F8182514BF2A43AA431A6028
S11365C016F0010F04F20C53D4F80C2514BF2A431F
S11365D0AA431A6016F0020F04F5A263D4F810253A
S11365E014BF2A43AA431A6016F0040F04F214538A
S11365F0D4F8142514BF2A43AA431A6016F0080FCE
S113660004F21C53D4F81C2514BF2A43AA431A606D
S11366102EB904F5A563D4F82825154305E004F53F
S1136620A563D4F8282522EA05051D60F8BD00BF3E
S113663070B504460D46164646F20943C0F20003FF
S1136640984750B946F6B070C0F200004FF451714B
S113665046F28D33C0F20003984744F8256070BDBC
S113666038B505460C4646F20943C0F20003984784
S113667050B946F6B070C0F2000040F2044146F250
S11366808D33C0F20003984728462146012246F282
S11366909543C0F200039847284621460122082367
S11366A046F20154C0F20004A04738BD38B505468F
S11366B00C4646F20943C0F20003984750B946F627
S11366C0B070C0F2000040F21F5146F28D33C0F2A8
S11366D00003984728462146022246F29543C0F219
S11366E000039847284621460122082346F2015414
S11366F0C0F20004A04738BD08B546F20143C0F219
S113670000039847C0B208BD30B420F08053A3F50D
S11367108012013A4FF48071C0F210018B4218BF0D
S1136720012A98BF012040F297804FF40071C0F213
S113673010014FF48062C0F21002934218BF8B42E2
S113674008BF012000F088804FF4A041C2F210017C
S113675000F16042013A884218BF012A98BF012023
S11367607AD90422C2F20002904208BF012073D0F9
S11367701022C2F20002904208BF01206CD02022F5
S1136780C2F20002904208BF012065D020F48014B8
S11367908021C2F200014FF48072C2F200029442DE
S11367A018BF8B4208BF012056D020F00052B0F130
S11367B0102F18BF402A08BF01204DD04FF480414C
S11367C0C1F200018C4208BF012045D0B0F1101F76
S11367D008BF012040D04FF48075C1F200054FF48A
S11367E00071C1F20001884218BFA84208BF01200D
S11367F032D01025C1F200052021C1F200018A42E5
S113680018BFAA4208BF012026D00821C1F21001F6
S113681088421CD000F170410139012917D90421A3
S1136820C1F200018C4214D0B0F1202F13D0012109
S1136830C2F2100188420ED04FF48050C0F2100012
S1136840834218BF082A14BF0020012004E001205D
S113685002E0012000E0012030BC704710B504467E
S113686046F20973C0F20003984750B947F2240076
S1136870C0F200004FF4FC7146F28D33C0F2000305
S1136880984747F23C03C0F20003220F53F822302A
S11368901A68A1B2C4F3044401FA04F414431C605A
S11368A010BD00BF4EF60C53CEF200030422C0F21A
S11368B0FA521A60FEE700BF01387FF4FDAF70475B
S11368C070B504464FF46043C4F20F031B6813F021
S11368D0E04F0BD04FF46043C4F20F031A68002357
S11368E0C7F2FF031340B3F1805F02D1002CC0F262
S11368F0C3804EF26002C4F20F0211684EF27003BC
S1136900C4F20F031E6821F4800545F4006546F4C3
S113691000601560186011F0020F02D014F0020F2D
S113692005D011F0010F24D014F0010F21D164F02F
S113693003031D404EF26003C4F20F031D600028E0
S113694004DA06F03003302B04D00BE005F03003FA
S1136950302B07D14FF4805046F6B903C0F2000340
S1136960984706E04FF4002046F6B903C0F200034E
S1136970984725F45F5525F0300543F2F073234022
S11369801D434DF68F73C7F6FF73334043F4006223
S113699042F23003C8F200032340134304F0080218
S11369A04EF25801C4F20F014020086053EAC206B7
S11369B00AD54EF27003C4F20F031E604EF2600358
S11369C0C4F20F031D6009E04EF26003C4F20F032A
S11369D01D604EF27003C4F20F031E60102046F6D1
S11369E0B902C0F20002904725F0F86020F00300DD
S11369F00323C0F2C0732340184326F0FC5604F06E
S1136A00FC510E4314F0804F1FBF40F4800026F465
S1136A1080050023C4F240031ABF23401D4326F01F
S1136A20804514F4006F17D14EF25003C4F20F03E3
S1136A301B6813F0400F0BD147F6FF734EF2500161
S1136A40C4F20F010A6812F0400F01D1013BF9D1E1
S1136A5020F4006025F400654EF26003C4F20F03D5
S1136A6018604EF27003C4F20F031D60102046F646
S1136A70B903C0F20003984770BD00BF30B44EF2B2
S1136A806003C4F20F0319684EF27003C4F20F03DB
S1136A901A68002AB4BF02F0700301F03003202BFF
S1136AA071D003D87BB1102B16D037E1602B00F0E6
S1136AB0C180702B00F0BB80302B08BF03F5EA4384
S1136AC000F0CF802AE146F6C873C0F20003C1F398
S1136AD0841053F82030C4E04FF46043C4F20F0331
S1136AE01B6813F0E04F04BF4EF2C013C0F2E4037E
S1136AF000F0B7804FF46043C4F20F03186800231A
S1136B00C7F2FF030340B3F1805F00F096804FF4B7
S1136B106043C4F20F0318680023C7F2FF03034065
S1136B200020C1F20100834208D14FF46043C4F253
S1136B300F031B689BB2022B00F084804FF4604368
S1136B40C4F20F0318680023C7F2FF0303400020B8
S1136B50C1F2030083421CBF4FF41053C0F2F4038C
S1136B607FD14FF46043C4F20F031C68A4B24FF406
S1136B70D853C0F2B7034FF41050C0F2F400002C05
S1136B8018BF03466DE04FF46043C4F20F031B6863
S1136B9013F0E04F04BF43F67003C0F2390360D032
S1136BA04FF46043C4F20F0318680023C7F2FF03D5
S1136BB00340B3F1805F4AD04FF46043C4F20F0343
S1136BC018680023C7F2FF0303400020C1F201004C
S1136BD0834207D14FF46043C4F20F031B689BB296
S1136BE0022B39D04FF46043C4F20F03186800231A
S1136BF0C7F2FF0303400020C1F2030083421CBF1D
S1136C004FF41063C0F23D032BD14FF46043C4F240
S1136C100F031C68A4B24CF2C063C0F22D034FF4FE
S1136C201060C0F23D00002C18BF034619E04FF479
S1136C30004316E04FF4800313E04EF2C013C0F299
S1136C40E4030EE04FF4D853C0F2B70309E043F66F
S1136C507003C0F2390304E04CF2C063C0F22D03A8
S1136C60FFE7002A03DA12F4006F03D058E011F4AE
S1136C70006F5AD14EF26400C4F20F0000684FF462
S1136C806044C4F20F04246814F0E04F0BD04FF4B6
S1136C906044C4F20F0425680024C7F2FF042C40AA
S1136CA0B4F1805F0AD1C0F34814023404FB03F347
S1136CB000F01F040234B3FBF4F309E0C0F34814FA
S1136CC004FB03F300F01F0401346400B3FBF4F38A
S1136CD010F4804F18BF5B0810F4004F18BF9B08D6
S1136CE0002AA8BF41F4800112DA12F0804F09D0C3
S1136CF012F4006F06D15B00C2F386520132B3FB7B
S1136D00F2F016E0C2F3C5500130B3FBF0F010E02E
S1136D10C1F3C3500130B3FBF0F00AE0002008E0F7
S1136D2011F4800FE1D1184603E011F4800FEFD184
S1136D30184630BC704700BF4EF21003CEF2000379
S1136D401A6842F005021A60704700BF4EF2100341
S1136D50CEF200031A6842F002021A60704700BFC4
S1136D6010B5441EB4F1807F09D347F24800C0F245
S1136D700000D02146F28D33C0F2000398474EF252
S1136D801403CEF200031C6010BD00BF20F4805237
S1136D904FF44043C4F200039A4208D04FF46043D6
S1136DA0C4F20003984214BF002001207047012060
S1136DB0704700BF10B5044646F68D53C0F2000379
S1136DC0984750B947F26000C0F200004FF4CF7109
S1136DD046F28D33C0F200039847E36A43F0100390
S1136DE0E362236B43F4407343F00103236310BD58
S1136DF010B5044646F68D53C0F20003984750B9C7
S1136E0047F26000C0F200004FF4DF7146F28D33A8
S1136E10C0F200039847A36913F0080FFBD1E36A9B
S1136E2023F01003E362236B23F4407323F0010384
S1136E30236310BDF8B504460E4615461F4646F6B4
S1136E408D52C0F20002904750B947F26000C0F280
S1136E50000040F20D1146F28D33C0F20003984752
S1136E6055B947F26000C0F200004FF4877146F252
S1136E708D33C0F2000398474FF46042C4F20F020E
S1136E80136813F0E04F08BF102340D04FF4604361
S1136E90C4F20F031A680023C7F2FF031340B3F1CF
S1136EA0805F08BF102332D04FF46043C4F20F0355
S1136EB01A680023C7F2FF0313400022C1F2010243
S1136EC0934209D14FF46043C4F20F031B689BB291
S1136ED0022B08BF10231AD04FF46043C4F20F03EF
S1136EE01A680023C7F2FF0313400022C1F2030211
S1136EF0934218BF08230AD14FF46043C4F20F032E
S1136F001B689BB2002B0CBF10230823FFE705FB73
S1136F1003F3B3420AD947F26000C0F2000040F222
S1136F200F1146F28D33C0F200039847204646F60F
S1136F30F152C0F200029047B6EB051F236B3DBF30
S1136F4043F0200323636D0823F0200328BF236349
S1136F50F600B6FBF5F50135EB096362C5F34505AB
S1136F60A562E7620023A361204646F6B553C0F24A
S1136F7000039847F8BD00BF10B5044646F68D538C
S1136F80C0F20003984750B947F26000C0F2000015
S1136F9040F2094146F28D33C0F200039847A369D9
S1136FA013F0100F0CBF20684FF0FF3010BD00BF6E
S1136FB06C69622F6472697665726C69622F67709E
S1136FC0696F2E630000000040420F0000201C0087
S1136FD080841E0000802500999E36000040380001
S1136FE000093D0000803E0000004B00404B4C0077
S1136FF000204E00808D5B0000C05D0000807000AA
S113700000127A0000007D0080969800001BB700F3
S11370100080BB00C0E8CE00647ADA000024F400EB
S11370200000FA006C69622F6472697665726C699B
S1137030622F73797363746C2E63000000E10F4058
S113704004E10F4008E10F406C69622F64726976B5
S113705065726C69622F7379737469636B2E630054
S11370606C69622F6472697665726C69622F7561EE
S10B707072742E63000000009D
S90360009C
S11380005C01002005820000FD830000FD83000068
S1138010FD830000FD830000FD830000FD8300005C
S1138020FD830000FD830000FD830000FD8300004C
S1138030FD830000FD830000FD830000ED8300004C
S1138040FD830000FD830000FD830000FD8300002C
S1138050FD830000FD830000FD830000FD8300001C
S1138060FD830000FD830000FD830000FD8300000C
S1138070FD830000FD830000FD830000FD830000FC
S1138080FD830000FD830000FD830000FD830000EC
S1138090FD830000FD830000FD830000FD830000DC
S11380A0FD830000FD830000FD830000FD830000CC
S11380B0FD830000FD830000FD830000FD830000BC
S11380C0FD830000FD830000FD830000FD830000AC
S11380D0FD830000FD830000FD830000FD8300009C
S11380E0FD830000FD830000FD830000FD8300008C
S11380F0EE11AA5510B50120C1F2000048F65D0446
S1138100C0F20004A0470120C2F20000A0474FF0D3
S11381104020032148F2AD63C0F20003984748F6BB
S11381207D23C0F20003984701464FF44040C4F257
S113813000004FF46142602348F63564C0F2000445
S1138140A04710BD10B540F24803C2F200031B78EB
S1138150EBB94FF44040C4F2000048F67973C0F222
S113816000039847B0F1FF3F4BD040F20403C2F242
S11381700003187040F24803C2F2000301221A708F
S113818040F20003C2F2000300221A7010BD40F254
S11381900003C2F200031B785C1C4FF44040C4F29D
S11381A0000048F67973C0F200039847B0F1FF3F2E
S11381B027D040F20403C2F20003185540F2000233
S11381C0C2F2000211780131C9B211701B788B42DE
S11381D017D140F24803C2F2000300221A7040F2A1
S11381E00403C2F200035B78FF2B0AD140F20403BC
S11381F0C2F200039B7823B948F6A503C0F200033A
S1138200984710BD10B517498D4640F20002C2F2DE
S1138210000240F20003C2F200039A4210D2131D7E
S11382200F4CE41A24F0030404340023104649F2EA
S11382307801C0F200015A581A500433A342FAD10B
S113824009480A494FF000028842B8BF40F8042B9D
S1138250FADB48F23933C0F20003984710BD00BF7F
S1138260030000205C010020000000205C000020CE
S113827008B548F2F963C0F20003984708BD00BF8F
S113828010B52020C2F2000048F65D03C0F20003DE
S113829098474FF4A044C4F202042046012148F256
S11382A06163C0F20003984720460121002248F28E
S11382B03163C0F20003984710BD00BF10B548F207
S11382C0E133C0F200039847044640F24C03C2F283
S11382D000031B68C31AB3F5FA7F2BD340F2500393
S11382E0C2F200031B7883B940F25003C2F20003C8
S11382F001221A704FF4A040C4F20200114648F261
S11383003163C0F2000398470FE040F25003C2F219
S1138310000300221A704FF4A040C4F202000121AD
S113832048F23163C0F20003984740F24C03C2F2B2
S113833000031C6010BD00BF08B54FF46070C0F2AC
S1138340C01048F6C103C0F20003984748F28123E5
S1138350C0F20003984748F29933C0F200039847EB
S113836048F27123C0F20003984748F2F503C0F2C3
S11383700003984748F2BD25C0F2000548F24514B1
S1138380C0F20004A847A047FCE700BF40F2540332
S1138390C2F200031960FEE708B548F67D23C0F277
S11383A00003984744F6D353C1F26203A3FB0020B1
S11383B0800948F66153C0F20003984748F63953E0
S11383C0C0F20003984748F64D53C0F200039847A3
S11383D040F25803C2F2000300221A6008BD00BF35
S11383E040F25803C2F200031868704740F2580381
S11383F0C2F200031A6801321A607047FEE700BF38
S1138400EFF3108062B6704720F480534FF40042BB
S1138410C4F20502934218BFB3F1402F31D04FF498
S1138420C041C4F200014FF42042C4F20502934259
S113843018BF8B4227D04FF48041C4F202014FF49D
S11384404042C4F20502934218BF8B421DD04FF440
S1138450C041C4F202014FF46042C4F205029342E7
S113846018BF8B4213D04FF45042C4F203020023CE
S1138470C4F20603984218BF904214BF00200120A2
S11384807047012070470120704701207047012088
S1138490704700BF70B504460E46154648F20943BE
S11384A0C0F20003984748B948F6B070C0F2000023
S11384B0E42148F28D33C0F200039847022D09D914
S11384C048F6B070C0F20000E62148F28D33C0F2E5
S11384D00003984715F0010F04F58063D4F80024D5
S11384E014BF3243B2431A6015F0020F04F58463DB
S11384F0D4F8202414BF164322EA06061E6070BD79
S1138500F8B504460D4617461E4648F20943C0F224
S11385100003984750B948F6B070C0F200004FF419
S1138520DD7148F28D33C0F20003984727F008024A
S11385307B1E042A18BF012B0AD948F6B070C0F27A
S113854000004FF4DF7148F28D33C0F20003984706
S1138550A6F10803052B0BD956B148F6B070C0F24A
S1138560000040F2C51148F28D33C0F20003984771
S113857017F0010F04F5A063D4F8002514BF2A43B3
S1138580AA431A6017F0020F04F20453D4F8042526
S113859014BF2A43AA431A6017F0040F04F5A16319
S11385A0D4F8082514BF2A43AA431A6017F0080F09
S11385B004F5A363D4F8182514BF2A43AA431A6008
S11385C016F0010F04F20C53D4F80C2514BF2A43FF
S11385D0AA431A6016F0020F04F5A263D4F810251A
S11385E014BF2A43AA431A6016F0040F04F214536A
S11385F0D4F8142514BF2A43AA431A6016F0080FAE
S113860004F21C53D4F81C2514BF2A43AA431A604D
S11386102EB904F5A563D4F82825154305E004F51F
S1138620A563D4F8282522EA05051D60F8BD00BF1E
S113863070B504460D46164648F20943C0F20003DD
S1138640984750B948F6B070C0F200004FF4517129
S113865048F28D33C0F20003984744F8256070BD9A
S113866038B505460C4648F20943C0F20003984762
S113867050B948F6B070C0F2000040F2044148F22C
S11386808D33C0F20003984728462146012248F260
S11386909543C0F200039847284621460122082347
S11386A048F20154C0F20004A04738BD38B505466D
S11386B00C4648F20943C0F20003984750B948F603
S11386C0B070C0F2000040F21F5148F28D33C0F286
S11386D00003984728462146022248F29543C0F2F7
S11386E000039847284621460122082348F20154F2
S11386F0C0F20004A04738BD08B548F20143C0F2F7
S113870000039847C0B208BD30B420F08053A3F5ED
S11387108012013A4FF48071C0F210018B4218BFED
S1138720012A98BF012040F297804FF40071C0F2F3
S113873010014FF48062C0F21002934218BF8B42C2
S113874008BF012000F088804FF4A041C2F210015C
S113875000F16042013A884218BF012A98BF012003
S11387607AD90422C2F20002904208BF012073D0D9
S11387701022C2F20002904208BF01206CD02022D5
S1138780C2F20002904208BF012065D020F4801498
S11387908021C2F200014FF48072C2F200029442BE
S11387A018BF8B4208BF012056D020F00052B0F110
S11387B0102F18BF402A08BF01204DD04FF480412C
S11387C0C1F200018C4208BF012045D0B0F1101F56
S11387D008BF012040D04FF48075C1F200054FF46A
S11387E00071C1F20001884218BFA84208BF0120ED
S11387F032D01025C1F200052021C1F200018A42C5
S113880018BFAA4208BF012026D00821C1F21001D6
S113881088421CD000F170410139012917D9042183
S1138820C1F200018C4214D0B0F1202F13D00121E9
S1138830C2F2100188420ED04FF48050C0F21000F2
S1138840834218BF082A14BF0020012004E001203D
S113885002E0012000E0012030BC704710B504465E
S113886048F20973C0F20003984750B949F2240052
S1138870C0F200004FF4FC7148F28D33C0F20003E3
S1138880984749F23C03C0F20003220F53F8223008
S11388901A68A1B2C4F3044401FA04F414431C603A
S11388A010BD00BF4EF60C53CEF200030422C0F2FA
S11388B0FA521A60FEE700BF01387FF4FDAF70473B
S11388C070B504464FF46043C4F20F031B6813F001
S11388D0E04F0BD04FF46043C4F20F031A68002337
S11388E0C7F2FF031340B3F1805F02D1002CC0F242
S11388F0C3804EF26002C4F20F0211684EF270039C
S1138900C4F20F031E6821F4800545F4006546F4A3
S113891000601560186011F0020F02D014F0020F0D
S113892005D011F0010F24D014F0010F21D164F00F
S113893003031D404EF26003C4F20F031D600028C0
S113894004DA06F03003302B04D00BE005F03003DA
S1138950302B07D14FF4805048F6B903C0F200031E
S1138960984706E04FF4002048F6B903C0F200032C
S1138970984725F45F5525F0300543F2F073234002
S11389801D434DF68F73C7F6FF73334043F4006203
S113899042F23003C8F200032340134304F00802F8
S11389A04EF25801C4F20F014020086053EAC20697
S11389B00AD54EF27003C4F20F031E604EF2600338
S11389C0C4F20F031D6009E04EF26003C4F20F030A
S11389D01D604EF27003C4F20F031E60102048F6AF
S11389E0B902C0F20002904725F0F86020F00300BD
S11389F00323C0F2C0732340184326F0FC5604F04E
S1138A00FC510E4314F0804F1FBF40F4800026F445
S1138A1080050023C4F240031ABF23401D4326F0FF
S1138A20804514F4006F17D14EF25003C4F20F03C3
S1138A301B6813F0400F0BD147F6FF734EF2500141
S1138A40C4F20F010A6812F0400F01D1013BF9D1C1
S1138A5020F4006025F400654EF26003C4F20F03B5
S1138A6018604EF27003C4F20F031D60102048F624
S1138A70B903C0F20003984770BD00BF30B44EF292
S1138A806003C4F20F0319684EF27003C4F20F03BB
S1138A901A68002AB4BF02F0700301F03003202BDF
S1138AA071D003D87BB1102B16D037E1602B00F0C6
S1138AB0C180702B00F0BB80302B08BF03F5EA4364
S1138AC000F0CF802AE148F6C873C0F20003C1F376
S1138AD0841053F82030C4E04FF46043C4F20F0311
S1138AE01B6813F0E04F04BF4EF2C013C0F2E4035E
S1138AF000F0B7804FF46043C4F20F0318680023FA
S1138B00C7F2FF030340B3F1805F00F096804FF497
S1138B106043C4F20F0318680023C7F2FF03034045
S1138B200020C1F20100834208D14FF46043C4F233
S1138B300F031B689BB2022B00F084804FF4604348
S1138B40C4F20F0318680023C7F2FF030340002098
S1138B50C1F2030083421CBF4FF41053C0F2F4036C
S1138B607FD14FF46043C4F20F031C68A4B24FF4E6
S1138B70D853C0F2B7034FF41050C0F2F400002CE5
S1138B8018BF03466DE04FF46043C4F20F031B6843
S1138B9013F0E04F04BF43F67003C0F2390360D012
S1138BA04FF46043C4F20F0318680023C7F2FF03B5
S1138BB00340B3F1805F4AD04FF46043C4F20F0323
S1138BC018680023C7F2FF0303400020C1F201002C
S1138BD0834207D14FF46043C4F20F031B689BB276
S1138BE0022B39D04FF46043C4F20F0318680023FA
S1138BF0C7F2FF0303400020C1F2030083421CBFFD
S1138C004FF41063C0F23D032BD14FF46043C4F220
S1138C100F031C68A4B24CF2C063C0F22D034FF4DE
S1138C201060C0F23D00002C18BF034619E04FF459
S1138C30004316E04FF4800313E04EF2C013C0F279
S1138C40E4030EE04FF4D853C0F2B70309E043F64F
S1138C507003C0F2390304E04CF2C063C0F22D0388
S1138C60FFE7002A03DA12F4006F03D058E011F48E
S1138C70006F5AD14EF26400C4F20F0000684FF442
S1138C806044C4F20F04246814F0E04F0BD04FF496
S1138C906044C4F20F0425680024C7F2FF042C408A
S1138CA0B4F1805F0AD1C0F34814023404FB03F327
S1138CB000F01F040234B3FBF4F309E0C0F34814DA
S1138CC004FB03F300F01F0401346400B3FBF4F36A
S1138CD010F4804F18BF5B0810F4004F18BF9B08B6
S1138CE0002AA8BF41F4800112DA12F0804F09D0A3
S1138CF012F4006F06D15B00C2F386520132B3FB5B
S1138D00F2F016E0C2F3C5500130B3FBF0F010E00E
S1138D10C1F3C3500130B3FBF0F00AE0002008E0D7
S1138D2011F4800FE1D1184603E011F4800FEFD164
S1138D30184630BC704700BF4EF21003CEF2000359
S1138D401A6842F005021A60704700BF4EF2100321
S1138D50CEF200031A6842F002021A60704700BFA4
S1138D6010B5441EB4F1807F09D349F24800C0F223
S1138D700000D02148F28D33C0F2000398474EF230
S1138D801403CEF200031C6010BD00BF20F4805217
S1138D904FF44043C4F200039A4208D04FF46043B6
S1138DA0C4F20003984214BF002001207047012040
S1138DB0704700BF10B5044648F68D53C0F2000357
S1138DC0984750B949F26000C0F200004FF4CF71E7
S1138DD048F28D33C0F200039847E36A43F010036E
S1138DE0E362236B43F4407343F00103236310BD38
S1138DF010B5044648F68D53C0F20003984750B9A5
S1138E0049F26000C0F200004FF4DF7148F28D3384
S1138E10C0F200039847A36913F0080FFBD1E36A7B
S1138E2023F01003E362236B23F4407323F0010364
S1138E30236310BDF8B504460E4615461F4648F692
S1138E408D52C0F20002904750B949F26000C0F25E
S1138E50000040F20D1148F28D33C0F20003984730
S1138E6055B949F26000C0F200004FF4877148F22E
S1138E708D33C0F2000398474FF46042C4F20F02EE
S1138E80136813F0E04F08BF102340D04FF4604341
S1138E90C4F20F031A680023C7F2FF031340B3F1AF
S1138EA0805F08BF102332D04FF46043C4F20F0335
S1138EB01A680023C7F2FF0313400022C1F2010223
S1138EC0934209D14FF46043C4F20F031B689BB271
S1138ED0022B08BF10231AD04FF46043C4F20F03CF
S1138EE01A680023C7F2FF0313400022C1F20302F1
S1138EF0934218BF08230AD14FF46043C4F20F030E
S1138F001B689BB2002B0CBF10230823FFE705FB53
S1138F1003F3B3420AD949F26000C0F2000040F200
S1138F200F1148F28D33C0F200039847204648F6EB
S1138F30F152C0F200029047B6EB051F236B3DBF10
S1138F4043F0200323636D0823F0200328BF236329
S1138F50F600B6FBF5F50135EB096362C5F345058B
S1138F60A562E7620023A361204648F6B553C0F228
S1138F7000039847F8BD00BF10B5044648F68D536A
S1138F80C0F20003984750B949F26000C0F20000F3
S1138F9040F2094148F28D33C0F200039847A369B7
S1138FA013F0100F0CBF20684FF0FF3010BD00BF4E
S1138FB06C69622F6472697665726C69622F67707E
S1138FC0696F2E630000000040420F0000201C0067
S1138FD080841E0000802500999E360000403800E1
S1138FE000093D0000803E0000004B00404B4C0057
S1138FF000204E00808D5B0000C05D00008070008A
S113900000127A0000007D0080969800001BB700D3
S11390100080BB00C0E8CE00647ADA000024F400CB
S11390200000FA006C69622F6472697665726C697B
S1139030622F73797363746C2E63000000E10F4038
S113904004E10F4008E10F406C69622F6472697695
S113905065726C69622F7379737469636B2E630034
S11390606C69622F6472697665726C69622F7561CE
S10B907072742E63000000007D
S90380007C

View File

@ -1,6 +1,6 @@
MEMORY
{
FLASH (rx) : ORIGIN = 0x00006000, LENGTH = 232K
FLASH (rx) : ORIGIN = 0x00008000, LENGTH = 224K
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
}

View File

@ -83,6 +83,48 @@
#define BOOT_COM_UART_CHANNEL_INDEX (0)
/* The NET communication interface for firmware updates via TCP/IP is selected by setting
* the BOOT_COM_NET_ENABLE configurable to 1. The maximum amount of data bytes in a
* message for data transmission and reception is set through BOOT_COM_NET_TX_MAX_DATA
* and BOOT_COM_NET_RX_MAX_DATA, respectively. The default IP address is configured
* with the macros BOOT_COM_NET_IPADDRx. The default netmask is configued with the macros
* BOOT_COM_NET_NETMASKx. The bootloader acts and a TCP/IP server. The port the server
* listen on for connections is configured with BOOT_COM_NET_PORT.
*/
/** \brief Enable/disable the NET transport layer. */
#define BOOT_COM_NET_ENABLE (1)
/** \brief Configure number of bytes in the target->host data packet. */
#define BOOT_COM_NET_TX_MAX_DATA (64)
/** \brief Configure number of bytes in the host->target data packet. */
#define BOOT_COM_NET_RX_MAX_DATA (64)
/** \brief Configure the port that the TCP/IP server listens on */
#define BOOT_COM_NET_PORT (1000)
/** \brief Configure the 1st byte of the IP address */
#define BOOT_COM_NET_IPADDR0 (169)
/** \brief Configure the 2nd byte of the IP address */
#define BOOT_COM_NET_IPADDR1 (254)
/** \brief Configure the 3rd byte of the IP address */
#define BOOT_COM_NET_IPADDR2 (19)
/** \brief Configure the 4th byte of the IP address */
#define BOOT_COM_NET_IPADDR3 (63)
/** \brief Configure the 1st byte of the network mask */
#define BOOT_COM_NET_NETMASK0 (255)
/** \brief Configure the 2nd byte of the network mask */
#define BOOT_COM_NET_NETMASK1 (255)
/** \brief Configure the 3rd byte of the network mask */
#define BOOT_COM_NET_NETMASK2 (0)
/** \brief Configure the 4th byte of the network mask */
#define BOOT_COM_NET_NETMASK3 (0)
/** \brief Enable/disable a hook function that is called when the IP address is about
* to be set. This allows a dynamic override of the BOOT_COM_NET_IPADDRx values.
*/
#define BOOT_COM_NET_IPADDR_HOOK_ENABLE (0)
/** \brief Enable/disable a hook function that is called when the netmask is about
* to be set. This allows a dynamic override of the BOOT_COM_NET_NETMASKx values.
*/
#define BOOT_COM_NET_NETMASK_HOOK_ENABLE (0)
/****************************************************************************************
* F I L E S Y S T E M I N T E R F A C E C O N F I G U R A T I O N
****************************************************************************************/

View File

@ -187,6 +187,55 @@ blt_bool NvmWriteChecksumHook(void)
#endif /* BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0 */
/****************************************************************************************
* N E T W O R K I N T E R F A C E H O O K F U N C T I O N S
****************************************************************************************/
#if (BOOT_COM_NET_IPADDR_HOOK_ENABLE > 0)
/************************************************************************************//**
** \brief Callback that gets called when the IP address is about to be configured.
** \param ipAddrArray 4-byte array where the IP address should be stored.
** \return none.
**
****************************************************************************************/
void NetIpAddressHook(blt_int8u *ipAddrArray)
{
/* This hook function allows a dynamic configuration of the IP address. This could for
* example be used if the bootloader is activated from a running user program and
* should have the same IP address as the user program. This IP address could be stored
* at a fixed location in RAM which can be read here. For now the example implemen-
* tation simply configures the bootloader's default IP address.
*/
ipAddrArray[0] = BOOT_COM_NET_IPADDR0;
ipAddrArray[1] = BOOT_COM_NET_IPADDR1;
ipAddrArray[2] = BOOT_COM_NET_IPADDR2;
ipAddrArray[3] = BOOT_COM_NET_IPADDR3;
} /*** end of NetIpAddressHook ***/
#endif /* BOOT_COM_NET_IPADDR_HOOK_ENABLE > 0 */
#if (BOOT_COM_NET_NETMASK_HOOK_ENABLE > 0)
/************************************************************************************//**
** \brief Callback that gets called when the network mask is about to be configured.
** \param netMaskArray 4-byte array where the network mask should be stored.
** \return none.
**
****************************************************************************************/
void NetNetworkMaskHook(blt_int8u *netMaskArray)
{
/* This hook function allows a dynamic configuration of the network mask. This could
* for example be used if the bootloader is activated from a running user program and
* should have the same network mask as the user program. This network mask could be
* stored at a fixed location in RAM which can be read here. For now the example
* implementation simply configures the bootloader's default network mask.
*/
netMaskArray[0] = BOOT_COM_NET_NETMASK0;
netMaskArray[1] = BOOT_COM_NET_NETMASK1;
netMaskArray[2] = BOOT_COM_NET_NETMASK2;
netMaskArray[3] = BOOT_COM_NET_NETMASK3;
} /*** end of NetNetworkMaskHook ***/
#endif /* BOOT_COM_NET_NETMASK_HOOK_ENABLE > 0 */
/****************************************************************************************
* W A T C H D O G D R I V E R H O O K F U N C T I O N S
****************************************************************************************/

File diff suppressed because it is too large Load Diff

View File

@ -300,6 +300,8 @@
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..\..\..\..\Source</state>
<state>$PROJ_DIR$\..\..\..\..\Source\third_party\fatfs\src</state>
<state>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip</state>
<state>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\apps\hello-world</state>
<state>$PROJ_DIR$\..\..\..\..\Source\ARMCM3_LM3S</state>
<state>$PROJ_DIR$\..\..\..\..\Source\ARMCM3_LM3S\IAR</state>
<state>$PROJ_DIR$\..</state>
@ -307,6 +309,7 @@
<state>$PROJ_DIR$\..\lib\inc</state>
<state>$PROJ_DIR$\..\lib\driverlib</state>
<state>$PROJ_DIR$\..\lib\fatfs</state>
<state>$PROJ_DIR$\..\lib\uip</state>
</option>
<option>
<name>CCStdIncCheck</name>
@ -1858,6 +1861,12 @@
<file>
<name>$PROJ_DIR$\..\lib\driverlib\debug.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\lib\driverlib\ethernet.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\lib\driverlib\ethernet.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\lib\driverlib\flashlib.c</name>
</file>
@ -1909,6 +1918,9 @@
</group>
<group>
<name>inc</name>
<file>
<name>$PROJ_DIR$\..\lib\inc\hw_ethernet.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\lib\inc\hw_flash.h</name>
</file>
@ -1937,6 +1949,24 @@
<name>$PROJ_DIR$\..\lib\inc\hw_uart.h</name>
</file>
</group>
<group>
<name>uip</name>
<file>
<name>$PROJ_DIR$\..\lib\uip\clock-arch.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\lib\uip\clock-arch.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\lib\uip\netdev.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\lib\uip\netdev.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\lib\uip\uip-conf.h</name>
</file>
</group>
</group>
<file>
<name>$PROJ_DIR$\..\blt_conf.h</name>
@ -2015,6 +2045,63 @@
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\fatfs\src\option\unicode.c</name>
</file>
</group>
<group>
<name>uip</name>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\clock.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\lc-addrlabels.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\lc-switch.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\lc.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\pt.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip-fw.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip-neighbor.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip-split.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip_arch.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip_arp.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip_arp.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip_timer.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip_timer.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uiplib.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uiplib.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uipopt.h</name>
</file>
</group>
</group>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\assert.c</name>
@ -2052,6 +2139,12 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\file.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\net.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\net.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\plausibility.h</name>
</file>

View File

@ -33,13 +33,13 @@
<DisasmHistory/>
<ShowCodeCoverage>0</ShowCodeCoverage><ShowInstrProfiling>0</ShowInstrProfiling></Disassembly>
<WATCH_1><PreferedWindows><Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><expressions><item/></expressions><col-names><item>Expression</item><item>Location</item><item>Type</item><item>Value</item></col-names><col-widths><item>147</item><item>150</item><item>100</item><item>174</item></col-widths></WATCH_1><Register><PreferedWindows><Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows></Register><STACK_1><PreferedWindows><Position>1</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><stack>CSTACK</stack><width>4</width><vars>1</vars><offset>0</offset><col-names><item>Data</item><item>Frame</item><item>Location</item><item>Type</item><item>Value</item><item>Variable</item></col-names><col-widths><item>100</item><item>100</item><item>100</item><item>100</item><item>100</item><item>100</item></col-widths></STACK_1><Memory><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><FindDirection>1</FindDirection><FindAsHex>0</FindAsHex></Memory></Static>
<PreferedWindows><Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><ShowCodeCoverage>0</ShowCodeCoverage><ShowInstrProfiling>0</ShowInstrProfiling></Disassembly>
<WATCH_1><PreferedWindows><Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><expressions><item>data</item><item>s-&gt;dto_data</item><item/></expressions><col-names><item>Expression</item><item>Location</item><item>Type</item><item>Value</item></col-names><col-widths><item>147</item><item>150</item><item>100</item><item>174</item></col-widths></WATCH_1><Register><PreferedWindows><Position>2</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows></Register><STACK_1><PreferedWindows><Position>1</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><stack>CSTACK</stack><width>4</width><vars>1</vars><offset>0</offset><col-names><item>Data</item><item>Frame</item><item>Location</item><item>Type</item><item>Value</item><item>Variable</item></col-names><col-widths><item>100</item><item>100</item><item>100</item><item>100</item><item>100</item><item>100</item></col-widths></STACK_1><Memory><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><FindDirection>1</FindDirection><FindAsHex>0</FindAsHex></Memory></Static>
<Windows>
<Wnd0>
<Wnd2>
<Tabs>
<Tab>
<Identity>TabID-4214-26312</Identity>
@ -47,34 +47,24 @@
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>lm3s6965</ExpandedNode><ExpandedNode>lm3s6965/Source</ExpandedNode><ExpandedNode>lm3s6965/Source/ARMCM3_LM3S</ExpandedNode></NodeDict></Session>
<NodeDict><ExpandedNode>lm3s6965</ExpandedNode><ExpandedNode>lm3s6965/Source</ExpandedNode><ExpandedNode>lm3s6965/Source/ARMCM3_LM3S</ExpandedNode><ExpandedNode>lm3s6965/Source/ARMCM3_LM3S/IAR</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd0><Wnd3>
<Tabs>
<Tab>
<Identity>TabID-14962-26315</Identity>
<TabName>Disassembly</TabName>
<Factory>Disassembly</Factory>
<Session/>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd3><Wnd4><Tabs><Tab><Identity>TabID-14429-10902</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd4></Windows>
<SelectedTab>0</SelectedTab></Wnd2><Wnd3><Tabs><Tab><Identity>TabID-14429-10902</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd3><Wnd5><Tabs><Tab><Identity>TabID-29443-18340</Identity><TabName>Disassembly</TabName><Factory>Disassembly</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd5></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>44</YPos2><SelStart2>3038</SelStart2><SelEnd2>3038</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\assert.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>11</YPos2><SelStart2>2174</SelStart2><SelEnd2>2174</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\IAR\cstart.s</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>62</YPos2><SelStart2>3795</SelStart2><SelEnd2>3795</SelEnd2></Tab><ActiveTab>2</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\blt_conf.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>109</YPos2><SelStart2>7195</SelStart2><SelEnd2>7195</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>40</YPos2><SelStart2>3038</SelStart2><SelEnd2>3038</SelEnd2></Tab><ActiveTab>1</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\backdoor.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>13</YPos2><SelStart2>3088</SelStart2><SelEnd2>3088</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\flash.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>86</YPos2><SelStart2>6203</SelStart2><SelEnd2>6203</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\cpu.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>24</YPos2><SelStart2>2556</SelStart2><SelEnd2>2556</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\flash.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>2346</SelStart2><SelEnd2>2373</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\types.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>7</YPos2><SelStart2>2676</SelStart2><SelEnd2>2684</SelEnd2></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-00b0ba70><key>iaridepm.enu1</key></Toolbar-00b0ba70></Sizes></Row0><Row1><Sizes><Toolbar-07ea1318><key>debuggergui.enu1</key></Toolbar-07ea1318></Sizes></Row1></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>741</Bottom><Right>285</Right><x>-2</x><y>-2</y><xscreen>240</xscreen><yscreen>243</yscreen><sizeHorzCX>125000</sizeHorzCX><sizeHorzCY>241071</sizeHorzCY><sizeVertCX>149479</sizeVertCX><sizeVertCY>737103</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>741</Bottom><Right>252</Right><x>-2</x><y>-2</y><xscreen>240</xscreen><yscreen>243</yscreen><sizeHorzCX>125000</sizeHorzCX><sizeHorzCY>241071</sizeHorzCY><sizeVertCX>132292</sizeVertCX><sizeVertCY>737103</sizeVertCY></Rect></Wnd3></Sizes></Row0></Right><Bottom><Row0><Sizes><Wnd4><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1922</Right><x>-2</x><y>-2</y><xscreen>1924</xscreen><yscreen>200</yscreen><sizeHorzCX>1002083</sizeHorzCX><sizeHorzCY>198413</sizeHorzCY><sizeVertCX>104167</sizeVertCX><sizeVertCY>198413</sizeVertCY></Rect></Wnd4></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
<Top><Row0><Sizes><Toolbar-02a0ba70><key>iaridepm.enu1</key></Toolbar-02a0ba70></Sizes></Row0><Row1><Sizes><Toolbar-036a10f8><key>debuggergui.enu1</key></Toolbar-036a10f8></Sizes></Row1></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>741</Bottom><Right>285</Right><x>-2</x><y>-2</y><xscreen>240</xscreen><yscreen>243</yscreen><sizeHorzCX>125000</sizeHorzCX><sizeHorzCY>241071</sizeHorzCY><sizeVertCX>149479</sizeVertCX><sizeVertCY>737103</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes><Wnd5><Rect><Top>-2</Top><Left>-2</Left><Bottom>741</Bottom><Right>198</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>104167</sizeHorzCX><sizeHorzCY>198413</sizeHorzCY><sizeVertCX>104167</sizeVertCX><sizeVertCY>737103</sizeVertCY></Rect></Wnd5></Sizes></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1922</Right><x>-2</x><y>-2</y><xscreen>1924</xscreen><yscreen>200</yscreen><sizeHorzCX>1002083</sizeHorzCX><sizeHorzCY>198413</sizeHorzCY><sizeVertCX>104167</sizeVertCX><sizeVertCY>198413</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Project>

View File

@ -9,7 +9,7 @@ TriggerName=main
LimitSize=0
ByteLimit=50
[DebugChecksum]
Checksum=-1053812097
Checksum=1777559187
[Exceptions]
StopOnUncaught=_ 0
StopOnThrow=_ 0

View File

@ -12,12 +12,12 @@
<Column0>332</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
<Column0>410</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Build><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Find-in-Files</Factory></Window></Windows></PreferedWindows><ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1155</ColumnWidth1><ColumnWidth2>308</ColumnWidth2><ColumnWidth3>77</ColumnWidth3></Build><Find-in-Files><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><ColumnWidth0>552</ColumnWidth0><ColumnWidth1>78</ColumnWidth1><ColumnWidth2>946</ColumnWidth2></Find-in-Files><TerminalIO/><PROJECT_GUI_CALL_GRAPH><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><col-names><item>File</item><item>Function</item><item>Line</item></col-names><col-widths><item>200</item><item>700</item><item>100</item></col-widths></PROJECT_GUI_CALL_GRAPH><Select-Ambiguous-Definitions><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Build</Factory></Window><Window><Factory>Find-in-Files</Factory></Window><Window><Factory>Find-All-References</Factory></Window></Windows></PreferedWindows><ColumnWidth0>664</ColumnWidth0><ColumnWidth1>94</ColumnWidth1><ColumnWidth2>1138</ColumnWidth2></Select-Ambiguous-Definitions><Find-All-References><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Build</Factory></Window><Window><Factory>Find-in-Files</Factory></Window></Windows></PreferedWindows><ColumnWidth0>664</ColumnWidth0><ColumnWidth1>94</ColumnWidth1><ColumnWidth2>1138</ColumnWidth2></Find-All-References></Static>
<Build><PreferedWindows><Position>1</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Find-All-References</Factory></Window></Windows></PreferedWindows><ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1155</ColumnWidth1><ColumnWidth2>308</ColumnWidth2><ColumnWidth3>77</ColumnWidth3></Build><Find-in-Files><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><ColumnWidth0>552</ColumnWidth0><ColumnWidth1>78</ColumnWidth1><ColumnWidth2>946</ColumnWidth2></Find-in-Files><TerminalIO/><PROJECT_GUI_CALL_GRAPH><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><col-names><item>File</item><item>Function</item><item>Line</item></col-names><col-widths><item>200</item><item>700</item><item>100</item></col-widths></PROJECT_GUI_CALL_GRAPH><Select-Ambiguous-Definitions><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Build</Factory></Window><Window><Factory>Find-in-Files</Factory></Window><Window><Factory>Find-All-References</Factory></Window></Windows></PreferedWindows><ColumnWidth0>664</ColumnWidth0><ColumnWidth1>94</ColumnWidth1><ColumnWidth2>1138</ColumnWidth2></Select-Ambiguous-Definitions><Find-All-References><PreferedWindows><Position>1</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Build</Factory></Window></Windows></PreferedWindows><ColumnWidth0>664</ColumnWidth0><ColumnWidth1>94</ColumnWidth1><ColumnWidth2>1138</ColumnWidth2></Find-All-References></Static>
<Windows>
<Wnd0>
<Wnd1>
<Tabs>
<Tab>
<Identity>TabID-31649-22318</Identity>
@ -25,24 +25,24 @@
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>lm3s6965</ExpandedNode><ExpandedNode>lm3s6965/Boot</ExpandedNode><ExpandedNode>lm3s6965/Boot/lib</ExpandedNode><ExpandedNode>lm3s6965/Output</ExpandedNode><ExpandedNode>lm3s6965/Source</ExpandedNode><ExpandedNode>lm3s6965/Source/ARMCM3_LM3S</ExpandedNode><ExpandedNode>lm3s6965/Source/ARMCM3_LM3S/IAR</ExpandedNode><ExpandedNode>lm3s6965/Source/fatfs</ExpandedNode></NodeDict></Session>
<NodeDict><ExpandedNode>lm3s6965</ExpandedNode><ExpandedNode>lm3s6965/Boot</ExpandedNode><ExpandedNode>lm3s6965/Output</ExpandedNode><ExpandedNode>lm3s6965/Source</ExpandedNode><ExpandedNode>lm3s6965/Source/ARMCM3_LM3S</ExpandedNode><ExpandedNode>lm3s6965/Source/fatfs</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd0><Wnd3><Tabs><Tab><Identity>TabID-25743-19564</Identity><TabName>Build</TabName><Factory>Build</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd3></Windows>
<SelectedTab>0</SelectedTab></Wnd1><Wnd2><Tabs><Tab><Identity>TabID-23631-11730</Identity><TabName>Build</TabName><Factory>Build</Factory><Session/></Tab><Tab><Identity>TabID-25094-12726</Identity><TabName>Ambiguous Definitions</TabName><Factory>Select-Ambiguous-Definitions</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd2></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>44</YPos2><SelStart2>3038</SelStart2><SelEnd2>3038</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\assert.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>11</YPos2><SelStart2>2174</SelStart2><SelEnd2>2174</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\IAR\cstart.s</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>48</YPos2><SelStart2>3795</SelStart2><SelEnd2>3795</SelEnd2></Tab><ActiveTab>2</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\blt_conf.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>109</YPos2><SelStart2>7195</SelStart2><SelEnd2>7195</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>40</YPos2><SelStart2>3038</SelStart2><SelEnd2>3038</SelEnd2></Tab><ActiveTab>1</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\backdoor.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>13</YPos2><SelStart2>3088</SelStart2><SelEnd2>3088</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\flash.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>86</YPos2><SelStart2>6203</SelStart2><SelEnd2>6203</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\cpu.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>24</YPos2><SelStart2>2556</SelStart2><SelEnd2>2556</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\flash.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>2346</SelStart2><SelEnd2>2373</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\types.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>7</YPos2><SelStart2>2676</SelStart2><SelEnd2>2684</SelEnd2></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-014dba70><key>iaridepm.enu1</key></Toolbar-014dba70></Sizes></Row0></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>963</Bottom><Right>406</Right><x>-2</x><y>-2</y><xscreen>288</xscreen><yscreen>297</yscreen><sizeHorzCX>150000</sizeHorzCX><sizeHorzCY>294643</sizeHorzCY><sizeVertCX>212500</sizeVertCX><sizeVertCY>957341</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>963</Bottom><Right>507</Right><x>-2</x><y>-2</y><xscreen>2309</xscreen><yscreen>242</yscreen><sizeHorzCX>1202604</sizeHorzCX><sizeHorzCY>240079</sizeHorzCY><sizeVertCX>265104</sizeVertCX><sizeVertCY>957341</sizeVertCY></Rect></Wnd3></Sizes></Row0></Right><Bottom><Row0><Sizes/></Row0></Bottom><Float><Sizes/></Float></Positions>
<Top><Row0><Sizes><Toolbar-02a0ba70><key>iaridepm.enu1</key></Toolbar-02a0ba70></Sizes></Row0><Row1><Sizes/></Row1><Row2><Sizes/></Row2></Top><Left><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>548</Bottom><Right>501</Right><x>-2</x><y>-2</y><xscreen>372</xscreen><yscreen>353</yscreen><sizeHorzCX>193750</sizeHorzCX><sizeHorzCY>350198</sizeHorzCY><sizeVertCX>261979</sizeVertCX><sizeVertCY>545635</sizeVertCY></Rect></Wnd1><Wnd2><Rect><Top>0</Top><Left>0</Left><Bottom>0</Bottom><Right>49443096</Right><x>-2</x><y>546</y><xscreen>258</xscreen><yscreen>238</yscreen><sizeHorzCX>134375</sizeHorzCX><sizeHorzCY>236111</sizeHorzCY><sizeVertCX>261979</sizeVertCX><sizeVertCY>413690</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes/></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,187 @@
//*****************************************************************************
//
// ethernet.h - Defines and Macros for the ethernet module.
//
// Copyright (c) 2006-2013 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 10636 of the Stellaris Peripheral Driver Library.
//
//*****************************************************************************
#ifndef __ETHERNET_H__
#define __ETHERNET_H__
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
//*****************************************************************************
//
// Values that can be passed to EthernetConfigSet as the ulConfig value, and
// returned from EthernetConfigGet.
//
//*****************************************************************************
#define ETH_CFG_TS_TSEN 0x010000 // Enable Timestamp (CCP)
#define ETH_CFG_RX_BADCRCDIS 0x000800 // Disable RX BAD CRC Packets
#define ETH_CFG_RX_PRMSEN 0x000400 // Enable RX Promiscuous
#define ETH_CFG_RX_AMULEN 0x000200 // Enable RX Multicast
#define ETH_CFG_TX_DPLXEN 0x000010 // Enable TX Duplex Mode
#define ETH_CFG_TX_CRCEN 0x000004 // Enable TX CRC Generation
#define ETH_CFG_TX_PADEN 0x000002 // Enable TX Padding
//*****************************************************************************
//
// Values that can be passed to EthernetIntEnable, EthernetIntDisable, and
// EthernetIntClear as the ulIntFlags parameter, and returned from
// EthernetIntStatus.
//
//*****************************************************************************
#define ETH_INT_PHY 0x040 // PHY Event/Interrupt
#define ETH_INT_MDIO 0x020 // Management Transaction
#define ETH_INT_RXER 0x010 // RX Error
#define ETH_INT_RXOF 0x008 // RX FIFO Overrun
#define ETH_INT_TX 0x004 // TX Complete
#define ETH_INT_TXER 0x002 // TX Error
#define ETH_INT_RX 0x001 // RX Complete
//*****************************************************************************
//
// Helper Macros for Ethernet Processing
//
//*****************************************************************************
//
// htonl/ntohl - big endian/little endian byte swapping macros for
// 32-bit (long) values
//
//*****************************************************************************
#ifndef htonl
#define htonl(a) \
((((a) >> 24) & 0x000000ff) | \
(((a) >> 8) & 0x0000ff00) | \
(((a) << 8) & 0x00ff0000) | \
(((a) << 24) & 0xff000000))
#endif
#ifndef ntohl
#define ntohl(a) htonl((a))
#endif
//*****************************************************************************
//
// htons/ntohs - big endian/little endian byte swapping macros for
// 16-bit (short) values
//
//*****************************************************************************
#ifndef htons
#define htons(a) \
((((a) >> 8) & 0x00ff) | \
(((a) << 8) & 0xff00))
#endif
#ifndef ntohs
#define ntohs(a) htons((a))
#endif
//*****************************************************************************
//
// API Function prototypes
//
//*****************************************************************************
extern void EthernetInitExpClk(unsigned long ulBase, unsigned long ulEthClk);
extern void EthernetConfigSet(unsigned long ulBase, unsigned long ulConfig);
extern unsigned long EthernetConfigGet(unsigned long ulBase);
extern void EthernetMACAddrSet(unsigned long ulBase,
unsigned char *pucMACAddr);
extern void EthernetMACAddrGet(unsigned long ulBase,
unsigned char *pucMACAddr);
extern void EthernetEnable(unsigned long ulBase);
extern void EthernetDisable(unsigned long ulBase);
extern tBoolean EthernetPacketAvail(unsigned long ulBase);
extern tBoolean EthernetSpaceAvail(unsigned long ulBase);
extern long EthernetPacketGetNonBlocking(unsigned long ulBase,
unsigned char *pucBuf,
long lBufLen);
extern long EthernetPacketGet(unsigned long ulBase, unsigned char *pucBuf,
long lBufLen);
extern long EthernetPacketPutNonBlocking(unsigned long ulBase,
unsigned char *pucBuf,
long lBufLen);
extern long EthernetPacketPut(unsigned long ulBase, unsigned char *pucBuf,
long lBufLen);
extern void EthernetIntRegister(unsigned long ulBase,
void (*pfnHandler)(void));
extern void EthernetIntUnregister(unsigned long ulBase);
extern void EthernetIntEnable(unsigned long ulBase, unsigned long ulIntFlags);
extern void EthernetIntDisable(unsigned long ulBase, unsigned long ulIntFlags);
extern unsigned long EthernetIntStatus(unsigned long ulBase, tBoolean bMasked);
extern void EthernetIntClear(unsigned long ulBase, unsigned long ulIntFlags);
extern void EthernetPHYAddrSet(unsigned long ulBase, unsigned char ucAddr);
extern void EthernetPHYWrite(unsigned long ulBase, unsigned char ucRegAddr,
unsigned long ulData);
extern unsigned long EthernetPHYRead(unsigned long ulBase,
unsigned char ucRegAddr);
extern void EthernetPHYPowerOff(unsigned long ulBase);
extern void EthernetPHYPowerOn(unsigned long ulBase);
//*****************************************************************************
//
// Several Ethernet APIs have been renamed, with the original function name
// being deprecated. These defines provide backward compatibility.
//
//*****************************************************************************
#ifndef DEPRECATED
#include "driverlib/sysctl.h"
#define EthernetInit(a) \
EthernetInitExpClk(a, SysCtlClockGet())
#define EthernetPacketNonBlockingGet(a, b, c) \
EthernetPacketGetNonBlocking(a, b, c)
#define EthernetPacketNonBlockingPut(a, b, c) \
EthernetPacketPutNonBlocking(a, b, c)
#endif
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // __ETHERNET_H__

View File

@ -0,0 +1,703 @@
//*****************************************************************************
//
// hw_ethernet.h - Macros used when accessing the Ethernet hardware.
//
// Copyright (c) 2006-2013 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 10636 of the Stellaris Firmware Development Package.
//
//*****************************************************************************
#ifndef __HW_ETHERNET_H__
#define __HW_ETHERNET_H__
//*****************************************************************************
//
// The following are defines for the Ethernet MAC register offsets.
//
//*****************************************************************************
#define MAC_O_RIS 0x00000000 // Ethernet MAC Raw Interrupt
// Status/Acknowledge
#define MAC_O_IACK 0x00000000 // Ethernet MAC Raw Interrupt
// Status/Acknowledge
#define MAC_O_IM 0x00000004 // Ethernet MAC Interrupt Mask
#define MAC_O_RCTL 0x00000008 // Ethernet MAC Receive Control
#define MAC_O_TCTL 0x0000000C // Ethernet MAC Transmit Control
#define MAC_O_DATA 0x00000010 // Ethernet MAC Data
#define MAC_O_IA0 0x00000014 // Ethernet MAC Individual Address
// 0
#define MAC_O_IA1 0x00000018 // Ethernet MAC Individual Address
// 1
#define MAC_O_THR 0x0000001C // Ethernet MAC Threshold
#define MAC_O_MCTL 0x00000020 // Ethernet MAC Management Control
#define MAC_O_MDV 0x00000024 // Ethernet MAC Management Divider
#define MAC_O_MADD 0x00000028 // Ethernet MAC Management Address
#define MAC_O_MTXD 0x0000002C // Ethernet MAC Management Transmit
// Data
#define MAC_O_MRXD 0x00000030 // Ethernet MAC Management Receive
// Data
#define MAC_O_NP 0x00000034 // Ethernet MAC Number of Packets
#define MAC_O_TR 0x00000038 // Ethernet MAC Transmission
// Request
#define MAC_O_TS 0x0000003C // Ethernet MAC Timer Support
#define MAC_O_LED 0x00000040 // Ethernet MAC LED Encoding
#define MAC_O_MDIX 0x00000044 // Ethernet PHY MDIX
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_RIS register.
//
//*****************************************************************************
#define MAC_RIS_PHYINT 0x00000040 // PHY Interrupt
#define MAC_RIS_MDINT 0x00000020 // MII Transaction Complete
#define MAC_RIS_RXER 0x00000010 // Receive Error
#define MAC_RIS_FOV 0x00000008 // FIFO Overrun
#define MAC_RIS_TXEMP 0x00000004 // Transmit FIFO Empty
#define MAC_RIS_TXER 0x00000002 // Transmit Error
#define MAC_RIS_RXINT 0x00000001 // Packet Received
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_IACK register.
//
//*****************************************************************************
#define MAC_IACK_PHYINT 0x00000040 // Clear PHY Interrupt
#define MAC_IACK_MDINT 0x00000020 // Clear MII Transaction Complete
#define MAC_IACK_RXER 0x00000010 // Clear Receive Error
#define MAC_IACK_FOV 0x00000008 // Clear FIFO Overrun
#define MAC_IACK_TXEMP 0x00000004 // Clear Transmit FIFO Empty
#define MAC_IACK_TXER 0x00000002 // Clear Transmit Error
#define MAC_IACK_RXINT 0x00000001 // Clear Packet Received
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_IM register.
//
//*****************************************************************************
#define MAC_IM_PHYINTM 0x00000040 // Mask PHY Interrupt
#define MAC_IM_MDINTM 0x00000020 // Mask MII Transaction Complete
#define MAC_IM_RXERM 0x00000010 // Mask Receive Error
#define MAC_IM_FOVM 0x00000008 // Mask FIFO Overrun
#define MAC_IM_TXEMPM 0x00000004 // Mask Transmit FIFO Empty
#define MAC_IM_TXERM 0x00000002 // Mask Transmit Error
#define MAC_IM_RXINTM 0x00000001 // Mask Packet Received
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_RCTL register.
//
//*****************************************************************************
#define MAC_RCTL_RSTFIFO 0x00000010 // Clear Receive FIFO
#define MAC_RCTL_BADCRC 0x00000008 // Enable Reject Bad CRC
#define MAC_RCTL_PRMS 0x00000004 // Enable Promiscuous Mode
#define MAC_RCTL_AMUL 0x00000002 // Enable Multicast Frames
#define MAC_RCTL_RXEN 0x00000001 // Enable Receiver
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_TCTL register.
//
//*****************************************************************************
#define MAC_TCTL_DUPLEX 0x00000010 // Enable Duplex Mode
#define MAC_TCTL_CRC 0x00000004 // Enable CRC Generation
#define MAC_TCTL_PADEN 0x00000002 // Enable Packet Padding
#define MAC_TCTL_TXEN 0x00000001 // Enable Transmitter
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_DATA register.
//
//*****************************************************************************
#define MAC_DATA_TXDATA_M 0xFFFFFFFF // Transmit FIFO Data
#define MAC_DATA_RXDATA_M 0xFFFFFFFF // Receive FIFO Data
#define MAC_DATA_RXDATA_S 0
#define MAC_DATA_TXDATA_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_IA0 register.
//
//*****************************************************************************
#define MAC_IA0_MACOCT4_M 0xFF000000 // MAC Address Octet 4
#define MAC_IA0_MACOCT3_M 0x00FF0000 // MAC Address Octet 3
#define MAC_IA0_MACOCT2_M 0x0000FF00 // MAC Address Octet 2
#define MAC_IA0_MACOCT1_M 0x000000FF // MAC Address Octet 1
#define MAC_IA0_MACOCT4_S 24
#define MAC_IA0_MACOCT3_S 16
#define MAC_IA0_MACOCT2_S 8
#define MAC_IA0_MACOCT1_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_IA1 register.
//
//*****************************************************************************
#define MAC_IA1_MACOCT6_M 0x0000FF00 // MAC Address Octet 6
#define MAC_IA1_MACOCT5_M 0x000000FF // MAC Address Octet 5
#define MAC_IA1_MACOCT6_S 8
#define MAC_IA1_MACOCT5_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_THR register.
//
//*****************************************************************************
#define MAC_THR_THRESH_M 0x0000003F // Threshold Value
#define MAC_THR_THRESH_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MCTL register.
//
//*****************************************************************************
#define MAC_MCTL_REGADR_M 0x000000F8 // MII Register Address
#define MAC_MCTL_WRITE 0x00000002 // MII Register Transaction Type
#define MAC_MCTL_START 0x00000001 // MII Register Transaction Enable
#define MAC_MCTL_REGADR_S 3
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MDV register.
//
//*****************************************************************************
#define MAC_MDV_DIV_M 0x000000FF // Clock Divider
#define MAC_MDV_DIV_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MADD register.
//
//*****************************************************************************
#define MAC_MADD_PHYADR_M 0x0000001F // PHY Address
#define MAC_MADD_PHYADR_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MTXD register.
//
//*****************************************************************************
#define MAC_MTXD_MDTX_M 0x0000FFFF // MII Register Transmit Data
#define MAC_MTXD_MDTX_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MRXD register.
//
//*****************************************************************************
#define MAC_MRXD_MDRX_M 0x0000FFFF // MII Register Receive Data
#define MAC_MRXD_MDRX_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_NP register.
//
//*****************************************************************************
#define MAC_NP_NPR_M 0x0000003F // Number of Packets in Receive
// FIFO
#define MAC_NP_NPR_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_TR register.
//
//*****************************************************************************
#define MAC_TR_NEWTX 0x00000001 // New Transmission
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_TS register.
//
//*****************************************************************************
#define MAC_TS_TSEN 0x00000001 // Time Stamp Enable
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_LED register.
//
//*****************************************************************************
#define MAC_LED_LED1_M 0x00000F00 // LED1 Source
#define MAC_LED_LED1_LINK 0x00000000 // Link OK
#define MAC_LED_LED1_RXTX 0x00000100 // RX or TX Activity (Default LED1)
#define MAC_LED_LED1_100 0x00000500 // 100BASE-TX mode
#define MAC_LED_LED1_10 0x00000600 // 10BASE-T mode
#define MAC_LED_LED1_DUPLEX 0x00000700 // Full-Duplex
#define MAC_LED_LED1_LINKACT 0x00000800 // Link OK & Blink=RX or TX
// Activity
#define MAC_LED_LED0_M 0x0000000F // LED0 Source
#define MAC_LED_LED0_LINK 0x00000000 // Link OK (Default LED0)
#define MAC_LED_LED0_RXTX 0x00000001 // RX or TX Activity
#define MAC_LED_LED0_100 0x00000005 // 100BASE-TX mode
#define MAC_LED_LED0_10 0x00000006 // 10BASE-T mode
#define MAC_LED_LED0_DUPLEX 0x00000007 // Full-Duplex
#define MAC_LED_LED0_LINKACT 0x00000008 // Link OK & Blink=RX or TX
// Activity
//*****************************************************************************
//
// The following are defines for the bit fields in the MAC_O_MDIX register.
//
//*****************************************************************************
#define MAC_MDIX_EN 0x00000001 // MDI/MDI-X Enable
//*****************************************************************************
//
// The following are defines for the Ethernet Controller PHY registers.
//
//*****************************************************************************
#define PHY_MR0 0x00000000 // Ethernet PHY Management Register
// 0 - Control
#define PHY_MR1 0x00000001 // Ethernet PHY Management Register
// 1 - Status
#define PHY_MR2 0x00000002 // Ethernet PHY Management Register
// 2 - PHY Identifier 1
#define PHY_MR3 0x00000003 // Ethernet PHY Management Register
// 3 - PHY Identifier 2
#define PHY_MR4 0x00000004 // Ethernet PHY Management Register
// 4 - Auto-Negotiation
// Advertisement
#define PHY_MR5 0x00000005 // Ethernet PHY Management Register
// 5 - Auto-Negotiation Link
// Partner Base Page Ability
#define PHY_MR6 0x00000006 // Ethernet PHY Management Register
// 6 - Auto-Negotiation Expansion
#define PHY_MR16 0x00000010 // Ethernet PHY Management Register
// 16 - Vendor-Specific
#define PHY_MR17 0x00000011 // Ethernet PHY Management Register
// 17 - Mode Control/Status
#define PHY_MR18 0x00000012 // Ethernet PHY Management Register
// 18 - Diagnostic
#define PHY_MR19 0x00000013 // Ethernet PHY Management Register
// 19 - Transceiver Control
#define PHY_MR23 0x00000017 // Ethernet PHY Management Register
// 23 - LED Configuration
#define PHY_MR24 0x00000018 // Ethernet PHY Management Register
// 24 -MDI/MDIX Control
#define PHY_MR27 0x0000001B // Ethernet PHY Management Register
// 27 - Special Control/Status
#define PHY_MR29 0x0000001D // Ethernet PHY Management Register
// 29 - Interrupt Status
#define PHY_MR30 0x0000001E // Ethernet PHY Management Register
// 30 - Interrupt Mask
#define PHY_MR31 0x0000001F // Ethernet PHY Management Register
// 31 - PHY Special Control/Status
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR0 register.
//
//*****************************************************************************
#define PHY_MR0_RESET 0x00008000 // Reset Registers
#define PHY_MR0_LOOPBK 0x00004000 // Loopback Mode
#define PHY_MR0_SPEEDSL 0x00002000 // Speed Select
#define PHY_MR0_ANEGEN 0x00001000 // Auto-Negotiation Enable
#define PHY_MR0_PWRDN 0x00000800 // Power Down
#define PHY_MR0_ISO 0x00000400 // Isolate
#define PHY_MR0_RANEG 0x00000200 // Restart Auto-Negotiation
#define PHY_MR0_DUPLEX 0x00000100 // Set Duplex Mode
#define PHY_MR0_COLT 0x00000080 // Collision Test
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR1 register.
//
//*****************************************************************************
#define PHY_MR1_100X_F 0x00004000 // 100BASE-TX Full-Duplex Mode
#define PHY_MR1_100X_H 0x00002000 // 100BASE-TX Half-Duplex Mode
#define PHY_MR1_10T_F 0x00001000 // 10BASE-T Full-Duplex Mode
#define PHY_MR1_10T_H 0x00000800 // 10BASE-T Half-Duplex Mode
#define PHY_MR1_MFPS 0x00000040 // Management Frames with Preamble
// Suppressed
#define PHY_MR1_ANEGC 0x00000020 // Auto-Negotiation Complete
#define PHY_MR1_RFAULT 0x00000010 // Remote Fault
#define PHY_MR1_ANEGA 0x00000008 // Auto-Negotiation
#define PHY_MR1_LINK 0x00000004 // Link Made
#define PHY_MR1_JAB 0x00000002 // Jabber Condition
#define PHY_MR1_EXTD 0x00000001 // Extended Capabilities
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR2 register.
//
//*****************************************************************************
#define PHY_MR2_OUI_M 0x0000FFFF // Organizationally Unique
// Identifier[21:6]
#define PHY_MR2_OUI_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR3 register.
//
//*****************************************************************************
#define PHY_MR3_OUI_M 0x0000FC00 // Organizationally Unique
// Identifier[5:0]
#define PHY_MR3_MN_M 0x000003F0 // Model Number
#define PHY_MR3_RN_M 0x0000000F // Revision Number
#define PHY_MR3_OUI_S 10
#define PHY_MR3_MN_S 4
#define PHY_MR3_RN_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR4 register.
//
//*****************************************************************************
#define PHY_MR4_NP 0x00008000 // Next Page
#define PHY_MR4_RF 0x00002000 // Remote Fault
#define PHY_MR4_A3 0x00000100 // Technology Ability Field [3]
#define PHY_MR4_A2 0x00000080 // Technology Ability Field [2]
#define PHY_MR4_A1 0x00000040 // Technology Ability Field [1]
#define PHY_MR4_A0 0x00000020 // Technology Ability Field [0]
#define PHY_MR4_S_M 0x0000001F // Selector Field
#define PHY_MR4_S_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR5 register.
//
//*****************************************************************************
#define PHY_MR5_NP 0x00008000 // Next Page
#define PHY_MR5_ACK 0x00004000 // Acknowledge
#define PHY_MR5_RF 0x00002000 // Remote Fault
#define PHY_MR5_A_M 0x00001FE0 // Technology Ability Field
#define PHY_MR5_S_M 0x0000001F // Selector Field
#define PHY_MR5_S_8023 0x00000001 // IEEE Std 802.3
#define PHY_MR5_S_8029 0x00000002 // IEEE Std 802.9 ISLAN-16T
#define PHY_MR5_S_8025 0x00000003 // IEEE Std 802.5
#define PHY_MR5_S_1394 0x00000004 // IEEE Std 1394
#define PHY_MR5_A_S 5
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR6 register.
//
//*****************************************************************************
#define PHY_MR6_PDF 0x00000010 // Parallel Detection Fault
#define PHY_MR6_LPNPA 0x00000008 // Link Partner is Next Page Able
#define PHY_MR6_PRX 0x00000002 // New Page Received
#define PHY_MR6_LPANEGA 0x00000001 // Link Partner is Auto-Negotiation
// Able
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR16 register.
//
//*****************************************************************************
#define PHY_MR16_RPTR 0x00008000 // Repeater Mode
#define PHY_MR16_INPOL 0x00004000 // Interrupt Polarity
#define PHY_MR16_TXHIM 0x00001000 // Transmit High Impedance Mode
#define PHY_MR16_SQEI 0x00000800 // SQE Inhibit Testing
#define PHY_MR16_NL10 0x00000400 // Natural Loopback Mode
#define PHY_MR16_SR_M 0x000003C0 // Silicon Revision Identifier
#define PHY_MR16_APOL 0x00000020 // Auto-Polarity Disable
#define PHY_MR16_RVSPOL 0x00000010 // Receive Data Polarity
#define PHY_MR16_PCSBP 0x00000002 // PCS Bypass
#define PHY_MR16_RXCC 0x00000001 // Receive Clock Control
#define PHY_MR16_SR_S 6
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR17 register.
//
//*****************************************************************************
#define PHY_MR17_JABBER_IE 0x00008000 // Jabber Interrupt Enable
#define PHY_MR17_FASTRIP 0x00004000 // 10-BASE-T Fast Mode Enable
#define PHY_MR17_RXER_IE 0x00004000 // Receive Error Interrupt Enable
#define PHY_MR17_EDPD 0x00002000 // Enable Energy Detect Power Down
#define PHY_MR17_PRX_IE 0x00002000 // Page Received Interrupt Enable
#define PHY_MR17_PDF_IE 0x00001000 // Parallel Detection Fault
// Interrupt Enable
#define PHY_MR17_LSQE 0x00000800 // Low Squelch Enable
#define PHY_MR17_LPACK_IE 0x00000800 // LP Acknowledge Interrupt Enable
#define PHY_MR17_LSCHG_IE 0x00000400 // Link Status Change Interrupt
// Enable
#define PHY_MR17_RFAULT_IE 0x00000200 // Remote Fault Interrupt Enable
#define PHY_MR17_ANEGCOMP_IE 0x00000100 // Auto-Negotiation Complete
// Interrupt Enable
#define PHY_MR17_FASTEST 0x00000100 // Auto-Negotiation Test Mode
#define PHY_MR17_JABBER_INT 0x00000080 // Jabber Event Interrupt
#define PHY_MR17_RXER_INT 0x00000040 // Receive Error Interrupt
#define PHY_MR17_PRX_INT 0x00000020 // Page Receive Interrupt
#define PHY_MR17_PDF_INT 0x00000010 // Parallel Detection Fault
// Interrupt
#define PHY_MR17_LPACK_INT 0x00000008 // LP Acknowledge Interrupt
#define PHY_MR17_LSCHG_INT 0x00000004 // Link Status Change Interrupt
#define PHY_MR17_FGLS 0x00000004 // Force Good Link Status
#define PHY_MR17_RFAULT_INT 0x00000002 // Remote Fault Interrupt
#define PHY_MR17_ENON 0x00000002 // Energy On
#define PHY_MR17_ANEGCOMP_INT 0x00000001 // Auto-Negotiation Complete
// Interrupt
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR18 register.
//
//*****************************************************************************
#define PHY_MR18_ANEGF 0x00001000 // Auto-Negotiation Failure
#define PHY_MR18_DPLX 0x00000800 // Duplex Mode
#define PHY_MR18_RATE 0x00000400 // Rate
#define PHY_MR18_RXSD 0x00000200 // Receive Detection
#define PHY_MR18_RX_LOCK 0x00000100 // Receive PLL Lock
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR19 register.
//
//*****************************************************************************
#define PHY_MR19_TXO_M 0x0000C000 // Transmit Amplitude Selection
#define PHY_MR19_TXO_00DB 0x00000000 // Gain set for 0.0dB of insertion
// loss
#define PHY_MR19_TXO_04DB 0x00004000 // Gain set for 0.4dB of insertion
// loss
#define PHY_MR19_TXO_08DB 0x00008000 // Gain set for 0.8dB of insertion
// loss
#define PHY_MR19_TXO_12DB 0x0000C000 // Gain set for 1.2dB of insertion
// loss
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR23 register.
//
//*****************************************************************************
#define PHY_MR23_LED1_M 0x000000F0 // LED1 Source
#define PHY_MR23_LED1_LINK 0x00000000 // Link OK
#define PHY_MR23_LED1_RXTX 0x00000010 // RX or TX Activity (Default LED1)
#define PHY_MR23_LED1_100 0x00000050 // 100BASE-TX mode
#define PHY_MR23_LED1_10 0x00000060 // 10BASE-T mode
#define PHY_MR23_LED1_DUPLEX 0x00000070 // Full-Duplex
#define PHY_MR23_LED1_LINKACT 0x00000080 // Link OK & Blink=RX or TX
// Activity
#define PHY_MR23_LED0_M 0x0000000F // LED0 Source
#define PHY_MR23_LED0_LINK 0x00000000 // Link OK (Default LED0)
#define PHY_MR23_LED0_RXTX 0x00000001 // RX or TX Activity
#define PHY_MR23_LED0_100 0x00000005 // 100BASE-TX mode
#define PHY_MR23_LED0_10 0x00000006 // 10BASE-T mode
#define PHY_MR23_LED0_DUPLEX 0x00000007 // Full-Duplex
#define PHY_MR23_LED0_LINKACT 0x00000008 // Link OK & Blink=RX or TX
// Activity
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR24 register.
//
//*****************************************************************************
#define PHY_MR24_PD_MODE 0x00000080 // Parallel Detection Mode
#define PHY_MR24_AUTO_SW 0x00000040 // Auto-Switching Enable
#define PHY_MR24_MDIX 0x00000020 // Auto-Switching Configuration
#define PHY_MR24_MDIX_CM 0x00000010 // Auto-Switching Complete
#define PHY_MR24_MDIX_SD_M 0x0000000F // Auto-Switching Seed
#define PHY_MR24_MDIX_SD_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR27 register.
//
//*****************************************************************************
#define PHY_MR27_XPOL 0x00000010 // Polarity State of 10 BASE-T
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR29 register.
//
//*****************************************************************************
#define PHY_MR29_EONIS 0x00000080 // ENERGYON Interrupt
#define PHY_MR29_ANCOMPIS 0x00000040 // Auto-Negotiation Complete
// Interrupt
#define PHY_MR29_RFLTIS 0x00000020 // Remote Fault Interrupt
#define PHY_MR29_LDIS 0x00000010 // Link Down Interrupt
#define PHY_MR29_LPACKIS 0x00000008 // Auto-Negotiation LP Acknowledge
#define PHY_MR29_PDFIS 0x00000004 // Parallel Detection Fault
#define PHY_MR29_PRXIS 0x00000002 // Auto Negotiation Page Received
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR30 register.
//
//*****************************************************************************
#define PHY_MR30_EONIM 0x00000080 // ENERGYON Interrupt Enabled
#define PHY_MR30_ANCOMPIM 0x00000040 // Auto-Negotiation Complete
// Interrupt Enabled
#define PHY_MR30_RFLTIM 0x00000020 // Remote Fault Interrupt Enabled
#define PHY_MR30_LDIM 0x00000010 // Link Down Interrupt Enabled
#define PHY_MR30_LPACKIM 0x00000008 // Auto-Negotiation LP Acknowledge
// Enabled
#define PHY_MR30_PDFIM 0x00000004 // Parallel Detection Fault Enabled
#define PHY_MR30_PRXIM 0x00000002 // Auto Negotiation Page Received
// Enabled
//*****************************************************************************
//
// The following are defines for the bit fields in the PHY_MR31 register.
//
//*****************************************************************************
#define PHY_MR31_AUTODONE 0x00001000 // Auto Negotiation Done
#define PHY_MR31_SPEED_M 0x0000001C // HCD Speed Value
#define PHY_MR31_SPEED_10HD 0x00000004 // 10BASE-T half duplex
#define PHY_MR31_SPEED_100HD 0x00000008 // 100BASE-T half duplex
#define PHY_MR31_SPEED_10FD 0x00000014 // 10BASE-T full duplex
#define PHY_MR31_SPEED_100FD 0x00000018 // 100BASE-T full duplex
#define PHY_MR31_SCRDIS 0x00000001 // Scramble Disable
//*****************************************************************************
//
// The following definitions are deprecated.
//
//*****************************************************************************
#ifndef DEPRECATED
//*****************************************************************************
//
// The following are deprecated defines for the Ethernet MAC register offsets.
//
//*****************************************************************************
#define MAC_O_IS 0x00000000 // Interrupt Status Register
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_IS
// register.
//
//*****************************************************************************
#define MAC_IS_PHYINT 0x00000040 // PHY Interrupt
#define MAC_IS_MDINT 0x00000020 // MDI Transaction Complete
#define MAC_IS_RXER 0x00000010 // RX Error
#define MAC_IS_FOV 0x00000008 // RX FIFO Overrun
#define MAC_IS_TXEMP 0x00000004 // TX FIFO Empy
#define MAC_IS_TXER 0x00000002 // TX Error
#define MAC_IS_RXINT 0x00000001 // RX Packet Available
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_IA0
// register.
//
//*****************************************************************************
#define MAC_IA0_MACOCT4 0xFF000000 // 4th Octet of MAC address
#define MAC_IA0_MACOCT3 0x00FF0000 // 3rd Octet of MAC address
#define MAC_IA0_MACOCT2 0x0000FF00 // 2nd Octet of MAC address
#define MAC_IA0_MACOCT1 0x000000FF // 1st Octet of MAC address
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_IA1
// register.
//
//*****************************************************************************
#define MAC_IA1_MACOCT6 0x0000FF00 // 6th Octet of MAC address
#define MAC_IA1_MACOCT5 0x000000FF // 5th Octet of MAC address
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_THR
// register.
//
//*****************************************************************************
#define MAC_THR_THRESH 0x0000003F // Transmit Threshold Value
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_MCTL
// register.
//
//*****************************************************************************
#define MAC_MCTL_REGADR 0x000000F8 // Address for Next MII Transaction
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_MDV
// register.
//
//*****************************************************************************
#define MAC_MDV_DIV 0x000000FF // Clock Divider for MDC for TX
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_MTXD
// register.
//
//*****************************************************************************
#define MAC_MTXD_MDTX 0x0000FFFF // Data for Next MII Transaction
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_MRXD
// register.
//
//*****************************************************************************
#define MAC_MRXD_MDRX 0x0000FFFF // Data Read from Last MII Trans
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the MAC_O_NP
// register.
//
//*****************************************************************************
#define MAC_NP_NPR 0x0000003F // Number of RX Frames in FIFO
//*****************************************************************************
//
// The following are deprecated defines for the bit fields in the PHY_MR23
// register.
//
//*****************************************************************************
#define PHY_MR23_LED1_TX 0x00000020 // TX Activity
#define PHY_MR23_LED1_RX 0x00000030 // RX Activity
#define PHY_MR23_LED1_COL 0x00000040 // Collision
#define PHY_MR23_LED0_TX 0x00000002 // TX Activity
#define PHY_MR23_LED0_RX 0x00000003 // RX Activity
#define PHY_MR23_LED0_COL 0x00000004 // Collision
//*****************************************************************************
//
// The following are deprecated defines for the reset values of the MAC
// registers.
//
//*****************************************************************************
#define MAC_RV_MDV 0x00000080
#define MAC_RV_IM 0x0000007F
#define MAC_RV_THR 0x0000003F
#define MAC_RV_RCTL 0x00000008
#define MAC_RV_IA0 0x00000000
#define MAC_RV_TCTL 0x00000000
#define MAC_RV_DATA 0x00000000
#define MAC_RV_MRXD 0x00000000
#define MAC_RV_TR 0x00000000
#define MAC_RV_IS 0x00000000
#define MAC_RV_NP 0x00000000
#define MAC_RV_MCTL 0x00000000
#define MAC_RV_MTXD 0x00000000
#define MAC_RV_IA1 0x00000000
#define MAC_RV_IACK 0x00000000
#define MAC_RV_MADD 0x00000000
#endif
#endif // __HW_ETHERNET_H__

Some files were not shown because too many files have changed in this diff Show More