MCF52233 bootloader with TFTP and DHCP client

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF52233 bootloader with TFTP and DHCP client

3,522 Views
PeterKirketerp
Contributor I

Hi

I need to download and/or reload the firmware for my MCF52233 device via the Ethernet.

I have an application running on the NicheLite stack. I am only using the UDP interface to send data logs from my embedded device to a server application.

Right know I am using the dBUG from Freescale but it is too large, I am planning on using the MCF52230 with only 128Kb on the final product.

Therefore I need a small bootloader with TFTP and DHCP client to

  1. Obtain an IP adr from the DHCP server at power up first time
  2. Check the current SW version on the TFTP server and replace the SW if needed.

 Any help?

Regards Peter Kirketerp

Develco A/S

Denmark

 

Labels (1)
0 Kudos
5 Replies

577 Views
mjbcswitzerland
Specialist V
Peter

Could you detail how you envisabe the checking of the software on the TFTP server?

Your board will be operating as a client and has the ability to perform a read or a write but not request information about the files there. Do you envisage reading a standard named file and comparing its content? If the content doesn't match that loaded on the board then deleting the boards code and reading the file again?

Regards

0 Kudos

577 Views
PeterKirketerp
Contributor I

Hi Mark

The TFTP client retrieves a specified configuration file name from the server. It is the content of the file we interpret.

We have down size the dBUG to 25Kb but that is without DHCP client, normally the DHCP client is 8Kb.

First I was thinking of using the NicheLite stack as the bootloader and then have the application running from a user define adr. But I have problems splitting up the stack and the application I 2 separated *.s19 or *.bin files. I was only using the dBUG because of the problems splitting up the stack and the application.

I can see that the uTasker has a MULTISTART functionalityfor replacing only the application code it sounds like what I am looking for!

I am very interesting in getting the source code for the uTasker to test the MULTISTART functionality with my application, please tell me how I can get the source code?

Med venlig hilsen / Best regards

Peter Kirketerp

Project manager
Direct: +45 87 400 311

Email:pkh@develco.dk

DEVELCO A/S
Olof Palmes Allé 40

DK-8200 Aarhus N

Pho: +45 87 400 300
Fax: +45 87 400 333
web: www.develco.dk

0 Kudos

577 Views
mjbcswitzerland
Specialist V
Hi Peter

The uTasker is free for non-commercial use - see the application form on the web site (which I have sent to you by email).
Commercial evaluation is free for 30 day including full email support.
If a project becomes commercial, a royalty free project license costs $485 including an additional 3 months personal email support.

I think that in your case the MULTISTART support will be a very powerful method to achieve what you require.
If you would like to strip down to a minimum boot loader here are the code sizes to be reconned with using the uTasker elements:
- DHCP 4.5k (this does full support including randomising and lease periods control to up to 100 years so could probably be reduced quite a lot if critical)
- TFTP client/server 2.4k (the PUT method could probally be removed to make it a bit smaller)
- File system 1.5k
- Ethernet 0.7k
- Hardware driver incl. interrupst etc. (this is not so clear but maybe 1k..2k ?)
- ARP - 2.9k
- IP - 1.4k
- UDP - 1.4k
- OS support in the boot phase (makes it easier but could be stripped) 1.3k plus drivers for internal timers and messaging (if needed) around 2k.

Regards

Mark
0 Kudos

577 Views
PeterKirketerp
Contributor I

Hi Mark

Thanks for the uTasker it is GREATE, especially the Visual Studion simulator.

I am now up a running with the bootloader and the stack you send me!!!, It was very easy (good documentation and a nice tutorial).

I have been working with the TCP/IP stack from InterNiche for some months, but in the future I will recommend the uTasker. One of the greats benefit is the simulator and the documentation.

Keep on the good work Mark

Best regards

Peter Kirketerp

 

 

 

0 Kudos

577 Views
mjbcswitzerland
Specialist V
Peter

I am sure that the NicheLite stack (as other free or open source ones) includes the protocols needed so it would be possible to patch up something after adding the necessary in circuit FLASH routines (IAP).

You can also look at the uTasker solution which is designed for the M5223X (free for non-commercial work). It is a 2k boot loader (one FLASH sector in the M5223X) and it allows complete software updates via Internet (I say Internet rather than LAN because it has secure upload capabilities based on HTTP POST methods and doesn't need a server as TFTP does).
It may be that this doesn't suit but you could look at it to be sure (it is documented here):
http://www.utasker.com/docs/uTasker/uTaskerBootLoader.PDF
http://www.utasker.com/docs/uTasker/BM-Booloader_for_M5223X.PDF

You will see that it requires application support (to allow the transfers using TCP based methods) before the application, OS and stack are replaced by the loader) and so needs enough space to store the new program alongside the old one. [The file system supports also saving in cheap external SPI based memory for such jobs which is an interesting approach when FLASH is restricted].

The uTasker bootloader doesn't have a configuration (at present) for a TFTP based transfer but the components are available if you would like to "plug them together"...
The disadvantage of having TFTP [IP, ARP, UDP] and DHCP [plus IAP] in the boot loader is that it will probably require about 16k of FLASH on the M5223X - see code size comparisons here:
http://www.utasker.com/docs/M5223X/uTaskerV1.2-Tutorial-M5223X.PDF (page 15)

A further approach is to include the OS and TCP/IP stack in the bootloader [disadvantage is that these elements can not be updated via LAN - only the application can be or parts of the others 'patched'], then the size of the boot loader is not an issue. The application parts make use of the same resources (eg. OS, Stack, File system etc.) after it has been loaded. The uTasker has what we call MULTISTART support - it enables an application (or additional applications) to be uploaded to the board and the system reconfigures itself to schedule the new software parts. In other words it can function as an application specific boot loader using what ever methods are required.

PS: Have you tried stripping down the dBug code (it is available as source) to see how small it can be made?

Regards

0 Kudos