Author Topic: Cannot change the magic number  (Read 8031 times)

Offline ewan

  • Newbie
  • *
  • Posts: 43
    • View Profile
Cannot change the magic number
« on: October 07, 2009, 12:54:15 AM »
My project has just restarted after almost a year.

I am using the MCF52233 with an AT45DB321 SPI chip and encrypted bootloading. With the magic number set to 0x1235 I can upload and run new software using ftp (with a small caveat). I then set the defines in "application.h" in the app and in "uTaskerBootLoader.c in the bootloader to 0x4235. I then also edited the "BM-Convert_Encrypt.bat" batch file to suit. I can no longer upload new software. Upon reseting the target, it comes up right away with no delay. I assume the boot loader does not like the new file(s) and goes with the old one.

The caveat is that I seem to need both "H_Upload_Enc.bin" and "HS.bin" for it to work with 0x1235.

Any help would be appreciated and prevent an ulser.

Regards,
Ewan Macpherson.

Offline mhoneywill

  • Full Member
  • ***
  • Posts: 173
    • View Profile
Re: Cannot change the magic number
« Reply #1 on: October 07, 2009, 09:22:52 AM »
Hi Ewan,

I use the bootloader with the Luminary LM3S chips, so might be able to help. One thing that you do not make clear in your email is that, are you re-flashing the target with the new bootloader and application via JTAG. Every time you change the magic number you have to change the bootloader in the target, because it has this magic number hard coded into it. Are you just creating a "H_Upload_Enc.bin" file and expecting the old bootloader to load it? that will not work.

Cheers Martin

Offline ewan

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Cannot change the magic number
« Reply #2 on: October 07, 2009, 04:03:53 PM »
Martin,

I am changing the bootloader too by erasing all sectors and reloading a new bootloader and a new app using the AxBDM hardware. I then switch to ethernet to try to load new software. It will not do it with the new magic number. It seems that I am missing changing a magic number somewhere but, to my knowledge there are only three places. One is in the bootloader, one is in the app and the third is in the .bat file. I am puzzled.

Thanks,
Ewan.

Offline ewan

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Cannot change the magic number
« Reply #3 on: October 07, 2009, 06:01:50 PM »
I tried without encryption and all worked fine. I then noticed that the VALID_VERSION_MAGIC_NUMBER in the app. is only used with USB. I left it alone (the original 0x1235) and everything worked with encryption except that I must still upload both files (HS.bin and H_Upload_Enc.bin).
When the software is successfully updated, the file in the target's ftp list (H.BIN) is deleted. It appears that the HS.BIN is deleted (or flaged) since I must resend it too to update the app..

I am about as confused as I ever want to be.   ???
Thanks,
Ewan.


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: Cannot change the magic number
« Reply #4 on: October 08, 2009, 06:01:36 PM »
Hi Ewan

HS.bin and H_Upload_enc.bin will be written to the same location in the uFileSystem so I can't explain why you need to upload them both.

If you don't find an acceptable solution please send my a test upload file (with the magic number and other boot loader settings to match it) so that I can look into it.

Regards

Mark