Coldfire Vi Flash programming question

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

Coldfire Vi Flash programming question

560 Views
sudhanshumehta
Contributor IV

Hi Team,

 

I am using MCF51JM128VLH microcontroller.

we write programOutput.bin file (please note .bin file format) on microcontroller. we programmed by bad way and microcontroller /board does not work as expected.

Now I re-programmed same board using     " .elf "      file.

After this board is working as expected

 

 

 

now my question is,

1) Is there is chance that my microcontroller will not work as expected in future

        I feel answer is no Because, when microcontroller boots up it copies required bytes into RAM. In RAM it will copy only                required data guided by new .elf file programmed.

 

2) Can there be any section in Flash that have old data? if yes do I need to worry?

 

 

Thanks

Sudhanshu

Labels (1)
0 Kudos
3 Replies

420 Views
TomE
Specialist II

What file do the instructions with your Development System or Programmer say to use?

The "bin" file is raw data. There's nothing in the file to tell the programmer where in the device memory it is to be written. So it may guess and get it wrong. If the system generates the data in one contiguous block, then it may work. But the system may generate different blocks of data (the executable code and the data) that aren't necessarily contiguous.

It may be possible to request the system generate a "bin" file that is suitable for programming, but it might not be set up to do that properly.

The "elf" file contains the binary data, plus lots of metadata about it, giving addresses, symbols and debugging information. It is the file that is usually loaded into the debugger so it can show labels, code and so on.

You might also be able to program with the "hex" file, which is the old and original way of doing this. The "hex" file contains the addresses of the data.

Tom

0 Kudos

420 Views
sudhanshumehta
Contributor IV

Hi TomE,

Thanks for your reply.

My development system generates both .elf as well as .bin.

My question is, in my scenario, if i originally programmed .bin file (in wrong way) and then programmed .elf file (in correct way) and system is currently working good now(main features verified).

Is there is chance that micro controller will give some bad result because earlier i programmed .bin file in wrong way?

Thanks

Sudhanshu

0 Kudos

420 Views
TomE
Specialist II

> Is there is chance that micro controller will give some bad result because earlier

> i programmed .bin file in wrong way?

Unlikely. The programming erases all of the Flash and then burns the new code in.

But you should check any logs that the programming creates, and any options that it gives you to make sure that is happening.

It might be possible that it can be set up to only erase the part of the Flash that you are loading new code into. So there might be "stale pages" with old data in it. That shouldn't matter as your code shouldn't be looking at that area (unless it has a bug), or unless you have code that expects to be able to write data into the unused pages, and might have problems if there's something already there and they need erasing.

If you were very unlucky and with a non-robust hardware design, then loading "bad code" could drive some output pins to states that caused some short circuits, or drove signals to external hardware that could have damaged it. Nobody can possibly tell if that has happened. it is very unlikely. If you're paranoid, put a label on the hardware listing what happened in case it plays up in the future.

Tom

0 Kudos