Auto connect JLink when application start up

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

Auto connect JLink when application start up

1,304 Views
LuBiq
Contributor II

I want to capture the initial state of the application. Is there any solution to make FreeMASTER connect target board immediately and automatically when application start up?

0 Kudos
Reply
2 Replies

1,277 Views
iulian_stan
NXP Employee
NXP Employee

Hi @LuBiq,

You can achieve this behavior by simulating a loop in the initialization phase of your application that would wait for a global variable (trigger).

After you connect to the target using FreeMASTER, you can change that variable value to continue application execution. Ex:

volatile char wait = 1; // Trigger variable (to be chnaged from FreeMASTER)
void main() {
  while (wait) {
    // Wait for trigger to change
  }
  // Application logic
} 

 

Note: this approach will work only with BDM plugin as other plugins require some initializations before you'll be able to connect to the target.

1,236 Views
LuBiq
Contributor II

I find a very simple solution.

(1) After building, start the application via debug. The application will be suspended at the first code in main() by a breakpoint.

(2) Start communication in FreeMASTER.

(3) Disable all breakpoints, application begins to run.

Can this solution meet my requirement?

0 Kudos
Reply