Some questions re mqx and coldfire mcf52259

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

Some questions re mqx and coldfire mcf52259

4,855 Views
geoffW
Contributor III

Hi

 

Just started looking at mqx running on an M52259EVB board. I am new to CodeWarrior, Coldfire and MQX so the learning curve is looking a bit vertical at the moment !

 

Q1) I have run the Flashx example demo code "flash_demo.c"

It seems to work OK but i am puzzled by the numbers it reports back

 

The BASE_ADDRESS: 0xf000
Number of sectors: 4
The WIDTH: 32
There are 4 sectors in Block 1
Block 1 Sector Size: 4096 (0x1000)
Total size of the Flash device is: 16384 (0x4000)

 

I was expecting this to somehow tie up with the size of the internal flash (512k/bytes). Can anyone explain how the blocks and sectors tie up with the 512k/bytes figure ?

 

 

Q2) I was pondering my options for a bootloader in my end product. I need a simple user friendly solution to upgrade my Application program either via USB memory stick or TFTP over Ethernet. My thoughts so far ...

 

a) Is U-Boot available and suitable for a 52259 ? I dont think U-boot is available for this chip, and from memory when I used it a while back it weighs in at 200k or so. This is almost half of the Internal flash, so I have dismissed U-boot as an option.

 

b) In the Eval board demo programs there is an example bootloader that updates Application code over the USB link. Great I thought, problem solved. Wrong, the update method is not via a USB memory stick, it is via a cable to a PC. Rewriting this to work as a host not a device isnt trivial I suspect ?

 

c) Maybe I could use the example USB host code and turn that into a bootloader program that can burn an App from a memory stick. Not sure on how big a job this might be ?

 

d) There is an open source Ethernet boot loader called FNET. This would give me the load App via TFTP, but its Interface isnt very user friendly for non techy people and I wasnt particularly wanting to have to figure out another package, MQX is enough to keep me busy for a while yet !

 

Thoughts on the bootloader ideas would be appreciated.  Thanks

 

  Regards Geoff

 

 

 

 

 

 

 

 

 

 

Message Edited by geoffW on 2009-11-26 03:44 PM
0 Kudos
16 Replies

1,283 Views
geoffW
Contributor III

hello Leo

 

Sorry I didnt really understand your reply.

 

Yes I can confirm that the boot build compiles OK. I have built it and burnt this bootloader into my board now. So far it seems to work as advertised, I can interact with it from the shell, and ping it from a PC.

 

However to do the experiment you need to have an "App" image for the bootloader to download and burn into flash above the bootloader. This App "shell boot" image is the one that wont build so I cant do the test.

 

I doubled checked the webpage instructions, it is definitely this shell_boot project that it tells you to build.

 

Would it be possible for you to check with the Freescale author of this FNET demo to get some feedback as to why it seems to be broken ? Thanks

 

Geoff

  

P.S 

 

Could I ask another small favour please ?

 

On the  USB memory stick experiment, I have now recompiled with the missing file you posted earlier.

It shows I am now missing a header file "usb_hub_version.h". Could you post a link to that file also please. I am pretty sure this should be the last missing file. Thanks

 

 

 

 

 

Message Edited by geoffW on 2010-01-26 02:15 PM
0 Kudos

1,283 Views
LeoPucci
Contributor III

I'm sending the whole usb directory.

 

See attachments.

0 Kudos

1,283 Views
LeoPucci
Contributor III

Talked with Andrey.

 

As you said it's just an array problem. (See on the bottom the error).

 

You can download the 0.6.4 version with this issue solved on this link:

 

http://sourceforge.net/projects/fnet/files/fnet/0.6.4/fnet_0_6_4.exe/download

 

 

 Just delete last 0s file fapp_tftp.c line 254 in the structure image_type image_types[]. struct image_type image_types[] =

{

{FAPP_PARAMS_TFTP_FILE_TYPE_RAW, FAPP_PARAMS_TFTP_FILE_TYPE_RAW_STR, 0, 0},

{FAPP_PARAMS_TFTP_FILE_TYPE_BIN, FAPP_PARAMS_TFTP_FILE_TYPE_BIN_STR, 0, 0},

{FAPP_PARAMS_TFTP_FILE_TYPE_SREC, FAPP_PARAMS_TFTP_FILE_TYPE_SREC_STR, 0, 0},

};

 

 

 

 

 

0 Kudos

1,283 Views
geoffW
Contributor III

Hi Leo

 

Thanks for the quick response.

 

I have now downloaded and tested the new 0.6.4 version. That builds OK and it now works on my Eval board. I have run the shell demo as one experiment, then I tried the boot loader & shell demo. It basically works, I have downloaded and burnt an image using TFTP. Incidentally the download speed over TFTP is fairly good. (I get 232,036 bytes sent in about 3 seconds)

 

What wasnt so good is the comms speeds I am seeing when

 

a) Talking to the Telnet Server on the board from a PC.

It is so slow it essentially broken (it outputs to the screen at about 20 baud if I was guessing)

I can see there are duplicated ACKs occurring and some data retransmission when doing something simple just like typing "help" to get the menu sent.

Note I am guessing the reason for this problem is I was using WinXP's Telnet client rather than the freeware one suggested in the webpage notes. I am not sure what the difference is likely to be, but if it doesnt work well with the standard Windows client it is a problem.

 

A second bug I noticed with Telnet is that if you exit a Telnet session, you cannot get a second session to connect up. (Even if you re-enable Telnet in the Serial console) 

 

 

b) Testing the HTTP Server in the shell demos also gave very bad performance for me. The initial webpage (quite a simple page with 40 or so text lines and 2 small images) takes between 5 to 15 seconds to load for me, typically 10 to 11 seconds. As this is so bad I am wondering if it really is a problem with FNet or a PC setting re:Firewalls or Antivirus software.

 

I would be interested to here Freescale's comments on the speed issues with Telnet and HTTP ?

 

 

Thanks Geoff 

 

 

0 Kudos

1,283 Views
LeoPucci
Contributor III

It seems to me that this slow telnet is related with Windows XP TCP windowing.

 

 

Coincidentally, I was reading today on MQX release notes some information about delayed ACKS on 52259 board. 

 

I think that you should try the Microsoft Knowledge base item. (See the full article on the bottom).


I took an eye on the article, you will have to do 2 procedures:  

 

 

 

1 - http://support.microsoft.com/kb/815230/

2 - http://support.microsoft.com/kb/328890

 

I'm without a power source here, so I could not test. I'm trying to run Fnet on the twrmcf51cn128 and I'm having trouble to flash it.

 

 

As this is a bootloader, and BL are optimized to shrink to the smallest footprint, maybe could be related to this comment:

-This issue is not directly related to the RTCS stack, however limited RAM resources on MCF52259 imply lower buffer and data window sizes, making it more difficult to work around the issue in RTCS software.

 

But I'm guessing that changing Acks on Xp might solve it. try it out than let me know about it!

 

Regards,

 

Pucci.

  1. Network Communication Performance and Delayed ACKs

Significant differences in performance of host to target TCP communication can be observed, depending on which client operating system is used. These differences are a result of the difference in implementation of the TCP delayed ACK algorithm.

Linux is more aggressive in acknowledging packets, and temporarily disables the delayed ACK algorithm on connection startup. As a result, there is no performance issue observed with Linux-based browsers (Mozilla Firefox tested).

Microsoft Windows based operating systems take a common approach to implementing the delayed ACK algorithm. As a result, web server performance can be significantly worse when it is accessed from Microsoft Windows-based browsers (Internet Explorer and Mozilla Firefox tested). This issue and a workaround are described at http://support.microsoft.com/kb/328890.

This issue is not directly related to the RTCS stack, however limited RAM resources on MCF52259 imply lower buffer and data window sizes, making it more difficult to work around the issue in RTCS software.

 

Message Edited by Leo Pucci on 2010-01-27 07:05 PM
0 Kudos

1,283 Views
Doug_EmbeddedAc
Senior Contributor I

Geoff, We have a Boot Loader that will load an image from a USB Memory Stick that can be licensed. This might be of interest to you to save the development time. Please contact sales@embedded-access.com for further details.

 

Regards,

Doug

0 Kudos

1,283 Views
LeoPucci
Contributor III

Hey Geoff,

 

You should see http://fnet.sourceforge.net/

 

  • Supported platforms:
  • Available as:
    • Stand-alone version. No underlying RTOS is required, although it can be used with it.

 

I´m working as Freescale Internship on Brazil. I´m working on a bootloader that updates the firmware over ethernet for the Tower board(mcf51cn128).

 

 After installing, checkout the this folder:

 

C:\Program Files\Freescale\FNET V0.6.3\fnet\fnet_demos\m52259evb_demo\boot\cw7\m52259evb_boot

 

Open with codewarrior 7.2 for microcontrollers, open this project.

 

For help, checkout on  C:\Program Files\Freescale\FNET V0.6.3\fnet\fnet_doc\fnet_user_manual

 

Great project. Just adapt to your needs and talk with the owner.

 

 Regards,

 

Leonardo Pucci 

 

 

 

 

 

0 Kudos

1,283 Views
gmnelson
Contributor III

Hello Leo,

 

This is very exciting to have a (non-MQX) 'ethernet' bootloader for these processors.  How will this be accomplished?  We are interested in having TFTP 'Server' so that we can use our PC to automatically load a new firmware image into our Mcf52259-based device.

 

Also, I'm slightly confused about your message, however.  Is this IN the FNET 0.6.3 distribution or is it expected in the next release.  Also, you mentioned that we should open the 0.6.3 FNET distribution with CodeWarrior for Microcontrollers 7.2.  I think you meant CodeWarrior for ColdFire 7.1.2.  Is that correct?

 

Thanks,

Gary

0 Kudos

1,283 Views
LeoPucci
Contributor III

Hi Gmnelson,

 

My bad! It´s the 7.1.2 version.for ColdFire!

 

It seems to me that is already Available on this release.

 

I´ll try it out and send you a feedback. Didn´t had time yet!

 

The part that explains how to

:Add FNET Bootloader support to an existing project

 

FNET Bootloader Quick Start  

 

 

The manual page: http://fnet.sourceforge.net/manual/index.html 

 

 

Regards,

 

Pucci 

0 Kudos

1,283 Views
geoffW
Contributor III

Hi Leo

 

Re: the usb stick upgradable bootloader

 

http://www.freescale.com/files/community_files/MQXGEN/upgrade3_forum_zip.zip

 

This is interesting, but has anyone tried this ? It wont compile due to missing header file(s) "usb_hub_device.h". Has anyone got a link to a copy of this missing file please? This project zip has no documentation whatsoever included which is a shame, as it could have been what I was looking for.

 

Incidentally, I think Freescale might be working on a bootloader example that can upgrade via a USB memory stick, but I havent got any official confirmation of this statement.

 

Your info re: FNET looks interesting too, as we have a separate future project in which we need to upgrade firmware but havent got access to a usb connection. Ethernet/TFTP image upload would be the way to go for that project. I will try to have a look into the FNET stuff this week.

 

Geoff

 

 

0 Kudos

1,283 Views
thillainathan_k
Contributor I

Hi,

 Did anyone tried Upgrade3_zip code. Its really nice to understand, I tried to execute this code with CW 7.2 + MQX 3.7. But when I compile the code I got undefined _VECTOR_TABLE_ROM_START. How do I sort out this issue, Please let me know if anybody done this without error..

 

Advanced Thanks,

KTN

0 Kudos

1,283 Views
LeoPucci
Contributor III

Geoff,

 

The usb_hub_device.h is\was released with the MQX. Unfortunately, I didn't find on the MQX 3.3, just on MQX 3.2 on this folder: C:\Program Files\Freescale\Freescale MQX 3.2\lib\m52259evb.cw\usb\host\

 

 

This error tells me that this project is not beeing updated for a while.

 

The header file is annexed.

 

Regards,

 

 

Pucci

 

 

0 Kudos

1,283 Views
geoffW
Contributor III

hello Leo

 

Thanks for your very prompt reply, I am new to MQX so I had only downloaded V3.3, that explains why I couldnt find it when I went searching. I will download the missing header file and have a play with it later, see if I can figure out how it works. One question I am speculating on, is does the Internal flash get blown directly from the USB stick a sector at a time ? I guess it probably does which means that the flash image could be quite big (max Size = 512k - bootloader size). Some of the other bootloader schemes have to store a full duplicate image in flash before burning which effectively halves the image size you can use ((max Size = 512k - bootloader size - duplicate image size))

 

Changing subject to FNET.

 

I just downloaded that and tried to compile (Code Warrior 7.1.2)

fnet\fnet_demos\<evb_name>\shell_boot\cw<x>\<evb_name>_shell_boot.mcp

I followed the simple instructions on http://fnet.sourceforge.net/manual/index.html

 

Unfortunately it doesnt compile, I am using an M52259EVB target. First error posted below

 

Error   : too many initializers
fapp_tftp.c line 256   S_TFTP_FILE_TYPE_RAW, FAPP_PARAMS_TFTP_FILE_TYPE_RAW_STR, 0, 0, 0}, 

 

It seems to have 5 initialisers for a structure with 4 params ?

 

I only tried this 10 minutes ago, so I could be missing something obvious here :smileyhappy:

 

Were you aware it doesnt seem to compile ? Any thoughts on this please ?

 

Geoff

 

 

0 Kudos

1,283 Views
LeoPucci
Contributor III

Yes,

 

Same error for me.

 

But I could compile normally on the \fnet\fnet_demos\m52259evb_demo\boot\cw7

 

 

Just selected the m52259evb_demo\boot folder. Not shell_boot.

 

 

 

 

About the firmware uploader doubts, some people is going throught the safe way. That is loading the 2 firmwares and then writing the code after. But for small memory purpuses, people try to rewrite memory directly. I'm new on this world too. So I can't say wich option is better.  

 

Message Edited by Leo Pucci on 2010-01-26 12:48 PM
0 Kudos

1,283 Views
CarlFST60L
Senior Contributor II

If you have a search around the MQX forum, I have previously posted questions about making an MQX bootloader, and posted an example of a USB boot loader which only works in MQX3.0 (wasnt my code, someone was kind enough to share, I used it to get some ideas from).

 

I have also developed a dual MQX boot loader which uploads via a comm port (could easily be modified to extract the code from 'anywhere', mine uses GPRS). I have also written a simple command line programmer in cygwin which allows you to upload new images. There is very little overhead to my code as its all managed within MQX, the boot loader simply validates which images is valid and more current and boots to that.

 

I am not sure what embedded solution is worth, but if you want to look at my solution, drop me an email carl@edsengineering.com.au

 

Carl.

0 Kudos

1,283 Views
LeoPucci
Contributor III

I think this is the file and conversations that Carl is talking about.

 

http://forums.freescale.com/freescale/board/message?board.id=MQXGEN&message.id=463#M463

 

http://www.freescale.com/files/community_files/MQXGEN/upgrade3_forum_zip.zip

Message Edited by Leo Pucci on 2010-01-20 11:47 AM
0 Kudos