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.