How do you program and run from flash?

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

How do you program and run from flash?

Jump to solution
987 Views
dave408
Senior Contributor II

I have been searching all over, and haven't found the information I need to program and run from flash.  Currently, I can test my code just fine in the debugger.  However, if I instead select Run As -> Run Configurations and then create a configuration, it doesn't run as I would like or expect (likely lack of eclipse experience here).

What I'd like to be able to do is to create a flash image in KDS that can then be loaded and execute when I reset my FRDM-K22F.  I have already read posts from Erich and others that indicates that I need to go to the project properties and "create flash image", like so:

pastedImage_0.png

I have tried to program this file using the Run -> Flash from file option.

pastedImage_1.png

But when I flash, if I leave the debugger features enabled, the GDB server just stops.  If I disable the debugger, then I just get this error:

pastedImage_2.png

Can anyone point me to a document that explains running from flash and how it can be done?  I realize that I can change the output format to BIN and then load the mbed firmware and copy my file over, but that is not the process I want to use in the end product.

Thank you!

Tags (4)
0 Kudos
1 Solution
652 Views
BlackNight
NXP Employee
NXP Employee

'Flash from File' is basically creating a debug/program session without the necessary project. Not sure why it fails for you, but I suspect that you misconfigured the launch/debug configuration for it?

As for what you might be looking for:

"Emulating Eclipse ‘Run’ with ‘Debug’ Configuration | MCU on Eclipse" describes how to emulate 'run as' for an embedded target with Eclipse Kepler (which is KDS too).

If you intend to do such things for automation or from command line, then have a look at this article too: "Command Line Programming and Debugging with GDB | MCU on Eclipse"

I hope this helps,

Erich

View solution in original post

0 Kudos
3 Replies
653 Views
BlackNight
NXP Employee
NXP Employee

'Flash from File' is basically creating a debug/program session without the necessary project. Not sure why it fails for you, but I suspect that you misconfigured the launch/debug configuration for it?

As for what you might be looking for:

"Emulating Eclipse ‘Run’ with ‘Debug’ Configuration | MCU on Eclipse" describes how to emulate 'run as' for an embedded target with Eclipse Kepler (which is KDS too).

If you intend to do such things for automation or from command line, then have a look at this article too: "Command Line Programming and Debugging with GDB | MCU on Eclipse"

I hope this helps,

Erich

0 Kudos
652 Views
dave408
Senior Contributor II

Absolutely brilliant, this is exactly what I needed.  Thanks!

If you can provide any insight into another problem (that's what caused me to ask about "running"), I have another post here: Why does calling a function in a particular implementation file cause GDB to no longer work?

Really, really strange debugger behavior that I just cannot explain.

0 Kudos
652 Views
dave408
Senior Contributor II

Thanks, Erich, I will take a look now.  Regarding the debug configuration, I know that it works because it was originally the same config I had used to debug the program, which did work.


There are two reasons why I am trying to do this right now: 1) because at some point I will need to be able to create production firmware, and 2) I'm having a problem where the debugger fails to start if I include any function calls in a particular object file, but that's the topic for an upcoming post here.  :smileyhappy:

Thanks!  I'll mark your answer once I give your suggestions a try.

0 Kudos