Author Topic: Bootloader question  (Read 7620 times)

Offline Kuroro

  • Newbie
  • *
  • Posts: 38
    • View Profile
Bootloader question
« on: June 03, 2008, 03:28:06 PM »
Hi mark

I read the entire forum but i don't find a answer.

I have personalise the demo for my personal board and they work's fine, now i want to use the softeware udpate feature.

Right now when i building the project i use the M52235EVB_ROM target and it work the boot loader is not include.

If i want to use the bootloader i have juste to choose the bar_min_app_rom right ?

Or i need to do something else ?

Thank's

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3191
    • View Profile
    • uTasker
Re: Bootloader question
« Reply #1 on: June 03, 2008, 03:33:20 PM »
Hi

Yes, choose the bare_min build. But you have to load the boot loader AND this build to the target the first time.

The following has full details:
http://www.utasker.com/docs/uTasker/BM-Booloader_for_M5223X.PDF

Regards

Mark

Offline Kuroro

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Bootloader question
« Reply #2 on: June 03, 2008, 04:06:29 PM »
Hello

I have many error message with the original bootloader :

did i need to merge the bootloader and the demo project ?

I'm sorry but i don't really understand how that work's

Thank's
 

Offline Kuroro

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Bootloader question
« Reply #3 on: June 04, 2008, 01:27:57 PM »
Hello have you try to build the bootloader with CW 7.0 ?

If i build the bootloader with CW 7.0 I have a lot of error about size_t.

If I build it with CW 6.4 i teld my that OSCCLK is undefined .

Do you have any idea about that ?

Thank's

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3191
    • View Profile
    • uTasker
Re: Bootloader question
« Reply #4 on: June 05, 2008, 11:15:51 AM »
Hi

This is an incompatibility with SP7 (sorry about that).
The set up of the PLL has been made more flexibly but the boot project was not tested with this (it shares the hardware header file M5223x.h).

To correct this with CW6.3/CW6.4 add the following to config.h

#define OSCCLK 25000000  // the bootloader works without active PLL with the crystal frequency

CW7.0:
When opening the project it will convert it to the CW7.0 format. After the correction for CW6.4 I could compiler without any warnings or errors.
It is however to note that it has been observed that some configuration parameters seems to be able to get lost when converting the project (see http://www.utasker.com/forum/index.php?topic=265.msg1123#msg1123 for more details about known problems) so I looked at the use of size_t in more detail.

CodeWarrior delivers this typedef itself so it must not be supplied by the project code (whereas other compilers don't deliver this and it does need to be defined in the code). The typedef is in type.h and is also conditional on the compiler type used:

#if !defined CODE_WARRIOR_CF
    #typedef unsigned int size_t;
#endif


If I force the define here I also get a lot of errors about size_t, which suggests that the pre-processor define CODE_WARRIOR_CF is missing in your converted project.

In CW7.0 check the set up of C/C++ Preprocessor - it should look like this:

#if !__option(precompile)
#include "mwerks.h" /* was "Prefix file" */
#endif
#define _M5223X
#define _CODE_WARRIOR
#define _CODE_WARRIOR_CF


Good luck

Regards

Mark

PS. The 'merge' is only when downloading. The two projects (boot loader and application) are compiled seperately. Then both are downloaded to the board (they are copied to their own specific regions in FLASH) and then they work together. The document explains how to download like this - it is in fact very easy to do.


Offline Kuroro

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Bootloader question
« Reply #5 on: June 05, 2008, 01:23:11 PM »
In fact my really probleme is i can't use the code warrior programmer (I got : Error:  System clock check failed  See Details for additional information).

So i use the CFflasher to proramme my board, it work fine with the stand alone code but when i want to programme the bootloader and after the programme code i think's that CFflasher erase the first block and the Bootloader too.

It's possible to load only the bootloader and the programme after by serial interface or ethernet ?
I see you say it's possible but i don't find how to do it ?

Thank's a lot Mark

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3191
    • View Profile
    • uTasker
Re: Bootloader question
« Reply #6 on: June 06, 2008, 12:00:41 AM »
Hi

You may like to try uninstalling the USB driver and re-installing to try to get the debugger working with CW directly.

With CF Flasher you may be able to achieve the same result by manipulating the target configuration. Try to manipulate (or make) a configuration which only deletes and programs the first 2k FLASH sector for the boot loader and another which only deletes and programs the rest (not first sector so that it doesn't destroy the loaded boot loader).

However you may also find that you can perform DELETE (clear complete FLASH) then program the 2 files individually. As long as the program cycles don't automatically erase I don't see why the 2 programs can not simply be loaded one after another.

Good luck

Regards

Mark

Offline kourov

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Bootloader question
« Reply #7 on: June 18, 2008, 02:15:31 PM »
(I got : Error:  System clock check failed  See Details for additional information).
If you haven't resolved this problem yet.
I often have the same error with codewarrior v7.0 if you close codewarrior and you reopen it it will works

regards

kourov