DHCP instellen

Updates, algemene discussies

Postby thijsbeckers » Wed Sep 03, 2008 12:00 am

Voor het 'omprogrammeren' van de DigiButler voor gebruik van DHCP heeft Elektor UK forumgebruiker John Stuart een (Engelstalige) handleiding geschreven:

Detailed procedure
Below please find advice on how to modify and compile the DigiButler source code enabling it to get an IP address automatically through DHCP. The use of the TBLCF programmer to flash the new firmware into the DigiButler is also covered. A functional TBLCF unit or equivalent Coldfire programming tool is required.

Firstly here are the files you will need:
1. CodeWarrior for Coldfire Architectures 7.1. This can be found here: www.freescale.com/webapp/sps/site/overview.jsp?nodeId=01272600610BF1
2. archive 071102-11.zip. This can be found at www.elektor.com/digibutler. It is under the heading "Free downloads" as "Software." The same is also available on the CD-ROM supplied with Elektor’s DigiButler kit 071102-71.
3. setup.xml; also available from the above project page (‘DHCP Update’).
4. mcf5223_sysinit.txt (possibly); also available from the above project page (‘DHCP Update’)

The first step is to install CodeWarrior 7.1. Once this is done you need to extract the project files from archive 071102-11.zip. Extract all the files from 071102-11.zip into a folder. Then open the folder called "Versions CW 7.0"; inside there should be another zip called SW_Main_Board_31_03_08.zip. Extract this zip and you should have a folder called SW_Main_Board, this folder contains all the project files and source code.

The directory that contains the CodeWarrior project files is ..\SW_Main_Board\build\m5223evb. In the folder m5223evb there is a file called elektor.mcp. Either drag and drop elektor.mcp into CodeWarrior, or when inside CodeWarrior, go to File then Open and choose elektor.mcp. Now on the left in CodeWarrior you should see a directory of all the source files.

To enable DHCP you should make two changes. The first is in main.c. Open main.c by double clicking on its name in the directory (it is in the "project files" folder). Find the following code in main.c:

#if 1
IP_ADDRESS(192,168,0,151);
DEF_GATEWAY(192,168,0,1);
SUBN_MASK(255,255,255,0);
#else // IP: 0.0.0.0 Gateway: 0.0.0.0 Mask: 255.255.255.0 - Now DHCP client works properly
IP_ADDRESS(10,171,88,10);
DEF_GATEWAY(10,171,88,254);
SUBN_MASK(255,255,255,0);
#endif

Delete this code and replace it with:

#if 0
IP_ADDRESS(192,168,0,151);
DEF_GATEWAY(192,168,0,1);
SUBN_MASK(255,255,255,0);
#else // IP: 0.0.0.0 Gateway: 0.0.0.0 Mask: 255.255.255.0 - Now DHCP client works properly
IP_ADDRESS(0,0,0,0);
DEF_GATEWAY(0,0,0,0);
SUBN_MASK(255,255,255,0);
#endif

The next change is in ipport.h, this is found in the folder \common\ColdfireLite\headers. Find the following code:

// EMG - To enable DHCP, uncomment the line below
//#define DHCP_CLIENT 1 /* include DHCP client code */

Delete this code and replace it with:
// EMG - To enable DHCP, uncomment the line below
#define DHCP_CLIENT 1 /* include DHCP client code */

Now compile the code by going to the Project menu and choosing make or by pressing F7. Hopefully it will compile without any errors. You are now ready to flash the DigiButler with new firmware.

Open the folder "TBLCF" that was in 071102-11.zip. Inside this folder extract the files from "tblcf_v10.zip". Closely and accurately follow the instructions in manual_v14.pdf to install the TBLCF drivers and flash the TBLCF. Once you have finish setting up the TBLCF go to the Tools menu and choose "Flash programmer" in CodeWarrior. Click on the "Load Settings" button and choose setup.xml. Now CodeWarrior is ready to flash the DigiButler.

Before programming make sure that you have right jumper setting on the DigiButler board. Jumper 2 should be on and pins 1 and 2 of jumper 2 should be connected.

Connect the TBLCF to the programming port of the DigiButler, then plug the TBLCF into your computer, then power up the DigiButler. Click on the "Erase / Blank Check" button in CodeWarrior. Click Erase and wait for a success message to appear. If the erase fails, try again and if it still fails restart CodeWarrior.

Next click on the "Program / Verify" button then click on Browse. Go to the folder SW_Main_Board\obj and choose web_coordinator.S19. Now click program and wait for a success message.

Now the DigiButler is programmed you can run the software by going to Project then Debug or by pressing F5. If a dialogue box appears, click Yes. The debug window should now open. Click on the run button at the top left of this window (it is the button with an arrow and a bug on it.) You may need to press the run button twice to start the program. Alternatively if you do not want to debug just press the reset button on the DigiButler board to start the program.

If after programming you get the message "@@@@ LINK IS DOWN @@@@" over the serial port, use a software workaround found in the latest TCP/IP stack. Reprogram the DigiButler as detailed above. In CodeWarrior, open the file called mcf5223_sysinit.c that is in the cpu directory. Select all the code and delete it. Copy the code from mcf5223_sysinit.txt (download from the project page) and paste it into mcf5223_sysinit.c. Compile and flash the code to the DigiButler. Now the problem should be solved.

Notes:
1. You must always erase the MCU before programming.
2. You may need to restart CodeWarrior between each programming. This may just be a bug in the setup.
3. After programming the serial baud rate will be 115200. This can be changed in the file m5223evb.h by changing this line:
#define UART_BAUD 115200 /* 19200*/
Replace 115200 with the baud rate you want.'
thijsbeckers
 
Posts: 1134
Joined: Thu Jan 02, 2014 10:37 am

Postby ericbakker » Sat Sep 13, 2008 12:00 am

Uit ervaring kan ik melden dat bovenstaande uitleg inderdaad tot een goed werkende digibutler leid. Wel een programmertje nodig. Om het warmte probleem aan te pakken heb ik zlef in eerste instantie de verbindingssnelheid geforceerd naar 10 Mbs. Scheelt 100mA en heel wat warmte. Samen met een gelijmd koellichaampje blijft de temperatuur < 40 graden.

Zo nu de echte leuke dingen gaan doen !

Eric
ericbakker
 
Posts: 29
Joined: Thu Jan 02, 2014 10:43 am

Postby networker » Fri Jan 02, 2009 12:00 am

Hallo,

Ja de DHCP heb ik ook voor elkaar, het aanpassen van de source is een eitje maar het programmeren was niet zo eenvoudig. Ik heb een zelfbouw P&E micro parallel programmer gebruikt. Die is gebaseerd op een EPM3032 of 3064, deze waren ooit bij conrad verkrijgbaar, ze zijn 3,3V maar tolereren 5V. Wel moet er dan nog een Altera Byteblaster gebouwd worden om de epld te programmeren maar die is ook op het web te vinden. Ik gebruik Vista en het heeft me veel tijd gekost om uit te vinden dat je codewarrior of een andere programmer moet uitvoeren als administrator zelfs als je bent ingelogd onder een administrator account. Doe je dat niet dan krijg je een melding in de trant van "parallel port not found". Verder helpt het om te weten dat de FLASH begint op 00000000H en het RAM op 20000000H. Het RAM wordt gebruikt als buffer en voor het flash programmeer programma.

@eric: Hoe heb je de snelheid op 10Mb/s gekregen?

Ad
networker
 
Posts: 2
Joined: Thu Jan 02, 2014 3:38 pm

Postby ericbakker » Sun Jan 04, 2009 12:00 am

Forceren naar 10 MB: zie attachment (file : mcf5223_sysinit.c ) en zoek op "// EBA: force to 10Mb". Een en ander is wat aanpassinkjes in volgorde en overruling van auto connect afhandeling. Met deze code zal de digibutler dus altijd in 10MB opstarten.

groet,

Eric
Attachments
mcf5223-sysinit.c
(14.57 KiB) Downloaded 35 times
ericbakker
 
Posts: 29
Joined: Thu Jan 02, 2014 10:43 am


Return to Digibutler

Who is online

Users browsing this forum: No registered users and 1 guest