Running a coldfire application on internal flash

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

Running a coldfire application on internal flash

Jump to solution
2,333 Views
Ardoster
Contributor III

Hi

 

I'm starting with Coldfire/CodeWarrior and MQX and I'm having several problems. My hardware and software is a MCF5229, a M5229Demokit, and CodeWarrior Development Studio 7.12. My main question is the next:

 

When I create a whole new project for my hardware, I obtain a minimal application "Hello world". I can run it with no problem when my "Selected target" is "INTERNAL_RAM". My application also run when my target is "CONSOLE_INTERNAL_RAM". But my application doesn't run when my target is "INTERNAL_FLASH". I obtain an message saying "Program "MCF52259_INTERNAL_FLASH.elf" is executing". But my application doen't run, not even with breakpoints.

 

So, could you help me? I suppose the solution is very simple, but after reading a lot of documentation, and searching in the forum, I haven't obtained any solution.

 

Thanks you in advance.

Message Edited by Ardoster on 2009-09-04 09:04 AM
Message Edited by t.dowe on 2009-09-04 12:08 PM
Labels (1)
0 Kudos
1 Solution
971 Views
Ardoster
Contributor III

Thanks you a lot of. And yes, i'm completely new...

 

Your indications were correct, but I have fixed the problem several minutes before reading your reply. I've solved this "problem" reading a readme_file i've founded in my test project. I copy & paste the solution in this thread thinking in future newbies like me.

 

Thanks you a lot of.

 

Here, the solution:

 

//------------------------------------------------------------------------
//  Flashing the code
//------------------------------------------------------------------------
1. Select the appropriate project target and build it
2. Make sure the correct remote connection is selected in the Remote
   Connection debugger panel
3. In the CodeWarrior IDE menu, select Project > Set Default Project
   and select your project
4. In the CodeWarrior IDE menu, select Project > Set Default Target
   and select the project target that has the code you want to flash
5. In the CodeWarrior IDE menu, select Tools > Flash Programmer
6. Go to the flash programmer Target Configuration panel, click Load
   Settings
7. Browse to the <your project location>\cfg sub folder and
   select the flash settings xml file matching your build target
8. Check that Use Custom Settings checkbox is not selected
9. Go to the Erase/Blank Check panel, select the All Sectors option and
   click Erase
10. Go to Program/Verify panel, click Program
11. Your code should now be flashed

View solution in original post

0 Kudos
8 Replies
971 Views
SimonMarsden_de
Contributor II

Hi Ardoster

 

My apologies if I'm telling you something very obvious, but if you're completely new to all this you might not realise...

 

You have to 'burn' the program image into the Flash memory before you can run it. It's not sufficient to compile the INTERNAL_FLASH target and then expect to be able to run it - there's the intermediate step of flashing it as well. The sequence is compile-flash-debug.

 

For the flash programming step you can use the Flash Programmer from CodeWarrior's tools menu.

 

Hope this helps

 

 

Simon

0 Kudos
972 Views
Ardoster
Contributor III

Thanks you a lot of. And yes, i'm completely new...

 

Your indications were correct, but I have fixed the problem several minutes before reading your reply. I've solved this "problem" reading a readme_file i've founded in my test project. I copy & paste the solution in this thread thinking in future newbies like me.

 

Thanks you a lot of.

 

Here, the solution:

 

//------------------------------------------------------------------------
//  Flashing the code
//------------------------------------------------------------------------
1. Select the appropriate project target and build it
2. Make sure the correct remote connection is selected in the Remote
   Connection debugger panel
3. In the CodeWarrior IDE menu, select Project > Set Default Project
   and select your project
4. In the CodeWarrior IDE menu, select Project > Set Default Target
   and select the project target that has the code you want to flash
5. In the CodeWarrior IDE menu, select Tools > Flash Programmer
6. Go to the flash programmer Target Configuration panel, click Load
   Settings
7. Browse to the <your project location>\cfg sub folder and
   select the flash settings xml file matching your build target
8. Check that Use Custom Settings checkbox is not selected
9. Go to the Erase/Blank Check panel, select the All Sectors option and
   click Erase
10. Go to Program/Verify panel, click Program
11. Your code should now be flashed

0 Kudos
971 Views
FWFan
Contributor III

Hi,

 

Do we have to reflash every time we use the demo board?  I replugged the usb cable but the board does not run.  I assume we only have to flash it once and it will run every time we turn on the board.

 

Thank you. 

0 Kudos
971 Views
Ardoster
Contributor III

Hi,

 

Are you completely sure you are loading your code into intern Flash and not in RAM??? Probably you are wrong and you are loading your code into RAM. If this is not your case, I don't know what to say you. :smileysad:

 

Regards

 

 

0 Kudos
971 Views
FWFan
Contributor III

Hi Ardoster,

 

I followed the steps shown above.  I used the Internal_Flash target.  Is there something else I am missing?

 

Thank you.

0 Kudos
971 Views
Ardoster
Contributor III

Hi

 

I'm so sorry but I don't have idea what's happens to your board. Have you tried with another board? Pherhaps is a hardware problem. Are you trying with an example or you are loading your own code? Pherhaps you have a missing pointer which is overwriting a flash section.

 

I don't know. I'm sorry I can't help you.

 

Regards

0 Kudos
971 Views
FWFan
Contributor III

Hi Ardoster,

 

I am using my own code.  What do you mean by a missing pointer? 

 

Thank you.

0 Kudos
971 Views
Ardoster
Contributor III

I mean that pherhaps in your code, you are overwriting accidentally a Flash section with necessary code to boot the system. I would try before with an example. If with an example works correctly, the problem is your code. If not, there's a problem in your board, or there's something you are not doing correctly.

 

Try this and tell me.

 

Regards,

0 Kudos