Author Topic: SW uploads to SPI FLASH  (Read 26144 times)

Offline john_k

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SW uploads to SPI FLASH
« Reply #15 on: February 21, 2011, 10:28:18 AM »
Hi Mark,
    My problem is actually same with Kremer which the CW7.1 (CM7.2) add the address and length fields in the Moto image (bin file).
    For for information, when I program the MCF52235 with the two s19 file (uTasker_boot.s19- Bare Minimum Boot Loader & uTasker_BM.s19- uTasker Application Code) which the program working. When I program the MCF52235 with the bin that generate by the CW7.1 (uTasker_boot.bin + uTasker_BM.bin) or the bin file that generate by the uTaskerCombine (V1.1) (uTaskerBM_APP.bin), both also can't work.
     Please see the attachment picture for the memory data in MCF52235.
     The bin file & the s19 file which I send to your email (attachment is more than 128KB)
      Thanks & best regards.
     John

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: SW uploads to SPI FLASH
« Reply #16 on: February 23, 2011, 12:03:12 AM »
Hi John

I received the files and took a look.

The binary files are in motorola binary format and the problem is that the utility uTaskerCombine expects raw binary input files, which it combines into a single binary output file. When the Motorola format is used, the output is also in this format (although maybe corrupted)!

The utility uTaskerConvert is the one that does recognise Motorola binary input.

This means that there is a problem when two Motorola binary files need to be combined to one raw binary file, which is the case if you want to take the boot loader and an application and combine them for loading as a single file (you can however load each individually to get the same effect). The  uTaskerConvert then works correctly when it generates further files that can be uploaded to the board.

As workaround the following seems to work:
1) Use  uTaskerConvert to generate two binary files - one for the boot loader file and one of the application file. This results in two raw binary files with headers, which are not required. With a binary editor the headers (the first 8 bytes in each output file) can be deleted.
2) Now use uTaskerCombine to combine the two raw binary files from step 1 to result in a single raw binary file for loading to the target.

I will have a look at whether the uTaskerCombine utility could be adapted to also recognise Motorola binary format and automatically convert it when combining. Alternatively, whether the utility uTaskerConvert can be simply adapted to generate the raw binary output without the header (this is probably easier) so that it can be used generally to convert from Motorola binary to raw binary as pre-processing step when necessary.

Regards

Mark

Offline john_k

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SW uploads to SPI FLASH
« Reply #17 on: February 23, 2011, 05:02:48 AM »
Mark, thank you for help!
I follow the workaround that you suggest and it worked.
Thank you very much!
John

Offline john_k

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SW uploads to SPI FLASH
« Reply #18 on: February 24, 2011, 02:47:37 AM »
Hello Mark,
    I facing other problem, which the new firmware can't be upgraded after I upload the new firmware to the controller using the web.
    The problem is after the new firmware successful upload to the controller, the controller will reset. When the Boot loader try to check for the new firmware file, but it get the wrong file (which the magic number is 6C 3E and the actual is 0x1234). This magic number is from the html file. So what I suspect is the boot loader get the wrong file (html file in the data flash) instead of get the new firmware file. How to solve this problem ?
    Thanks.
    John

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: SW uploads to SPI FLASH
« Reply #19 on: February 26, 2011, 10:43:15 PM »
John

If the magic number is correctly in the file that you are uploading the problem is presumably due to the location of the file, or that its transfer was not correct.

Have you tried following the following? http://www.utasker.com/forum/index.php?topic=902.0

Regards

Mark