How to Compile and boot MQX and where to write a boot loader

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to Compile and boot MQX and where to write a boot loader

跳至解决方案
16,566 次查看
CarlFST60L
Senior Contributor II

 

We need to be able to compile and boot an 'image' of MQX from a bootloader. We will be periodically uploading new MQX images as updates become available (either from MQX, or our own updates). When I say MQX Image, I mean MQX RToS with our application code which can be booted from some bootloader...

 

We cannot find complete information in the user guide which covers any requirments to be able to perform any boot loader functions, not even memory control or details on how MQX boots, memory control of code sections or the organisation and building blocks of MQX...

 

Please assist us buy supplying some essential information about the operating system:

 

- Where do we write the C function for a bootloader exactly (pre MQX running)? This code really needs to be able to be seperated from the rest of the MQX image to allow it to update the MQX image without overwriting itself (see memory diagram below).

 

- How are the memory locations controlled for the above (How do we fix the location of the bootloader software and MQX application image)?

 

- How do we actually boot to the address of this MQX image we have created?

 

- Is there any other memory requirments we must meet to allow MQX to boot properly, or, to get our firware to enter and exit properly?

 

Here is how the I think the memory map might look...

 

---------------------------

- START BOOTLOADER address of where reset vector points, this part of code is fixed in firmware

 

Pre MQX - pre MQX/C setup requiments..

USER Mem - boot loader function which updates MQX Image in the other flash blocks (flash routines etc here)

Pre MQX - pre MQX image boot, this might be a bit of both user code and MQX code, no idea...

Pre MQX - MQX image boot function, might clean memory / allocate memory and actually jumps to MQX image

 

- END BOOTLOADER

---------------------------

- START MQX + USER APPLICATION MQX Image which will be updated

 

MQX RToS + Application Code as normal

 

- END MQX + USER APPLICATION

---------------------------


 

 

Message Edited by CarlFST60L on 2009-03-22 10:49 PM
0 项奖励
回复
1 解答
5,721 次查看
jart
Contributor II

Hi,

 

I have attached a new version of my bootloader. In this version I have moved the bootloader to the first page of flash. This solves the problem I described at the end of my last post. Also to use this version you do not need to modify the file vectors.cw. If you did change the vectors.cw file you can change it back. You must still replace the file intflash_usb.lcf with the contents of lcf.txt as described above.

 

upgrade3_forum_zip.zip

Message Edited by t.dowe on 2009-08-27 02:40 PM

在原帖中查看解决方案

0 项奖励
回复
24 回复数
630 次查看
DavidS
NXP Employee
NXP Employee

Hi Alejandro,

Your questions are very good and many customers have them too.  There is no one answer but I'll give a couple answers and/or options.

A1) Yes the bootloader can check for update and if it determines one is needed it then doesn the update.

Secondly if the FSLMQX application is running it too can check to see if an update is needed and if one is it could:

- set a flag in flash (either in the FNET parameter block or even in the application space at specific address that FNET can check as well).

- once flag is set then reset the device using the software reset bit in the RCR register.

- Bootloader will see flag and do update or it could even verify with server again that update is needed and update the system.

 

You might want to investigate using DNS client to retrieve the IP address of the TFTP server.

 

A2) I've done simple check of the FSLMQX image at start address and end address and assume that if I see these to ares having expected btye codes then everything in between was programmed correctly....then jump to FSLMQX application if check worked or back to bootloader mode if it failed.

A more robust method would be to generate a CRC or other hash value over the FSLMQX image area and compare to expected value that the server side generates.  If the CRC or hash fail then restart bootloader process.

 

Hope this helps.

Regards,

David

 

0 项奖励
回复
630 次查看
CarlFST60L
Senior Contributor II

Drop me an email and I will send it to you carl@edsengineering.com.au

0 项奖励
回复
630 次查看
freegeek
Contributor III

Hi, my son has created something like this for an MQX project he is working on but has built the bootloader function outside of mqx, I will ask him to post what he has done.

 

However it would be better to have this built into MQX.

0 项奖励
回复
630 次查看
CarlFST60L
Senior Contributor II
Thanks freegeek, that would be great!
0 项奖励
回复