freedom KL46Z board seems to only run briefly

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

freedom KL46Z board seems to only run briefly

2,007 Views
russellsher
Contributor III

Hi All- I am using the freedom KL46Z board. When I run any code after copying (downloading) the hex file to the FRDM-KL46Z E: drive (as it appears on my PC),  the code appears to only work for a short duration: e.g. I had two successive lines to print a char to a terminal - It only prints the first, each time I reset, it just prints the first char. I thought it was my uart routine, so I used the code below just to light an led -

Bit1_SetVal(); switches the led off and Bit1_ClrVal(); switches it on.

If I do:

Bit1_SetVal(); 

Bit1_ClrVal();

then the led lights, but if I do say...

Bit1_SetVal();

Bit1_SetVal(); 

Bit1_ClrVal();

then it doesn't light. It is as though the extra delay caused by the extra line of code has stopped the main code.

It seems to be a watchdog type issue, but I have included the default line: PE_low_level_init();

Here is the code fragment for the led routine:

  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/

  PE_low_level_init();

  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */

  /* For example: for(;;) { } */

  Bit1_SetVal();

  Bit1_SetVal(); // If I comment this out the led lights

Bit1_ClrVal();

  for(;;)

  {

   

  }

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/

regards

Russell

0 Kudos
13 Replies

1,520 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Russel,

Please check whether you had disabled the watchdog timer or not in the Component Inspector like the Fig 1 shows.

2015-05-08_10-07-15.jpg

                                                  Fig 1
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,520 Views
russellsher
Contributor III

HI Ping

(Sorry I confused you with Mark)

I can't enter debug mode (only drag and drop to run)

How does the component inspector know if the watchdog is enabled?

It can't be reading my board - so is this just at software level?

0 Kudos

1,520 Views
russellsher
Contributor III

Ok - I got my board working but now when I enable interrupts in the uart property the routine prints one character and then stops - an interrupt problem maybe??

EDIT: Ok, if I put a delay between sending characters, then it sends individual characters - but only if interrupts are disabled (I had enabled interrupts to use the sendblock command later)

0 Kudos

1,520 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Russell,

I'm glad to hear that your board can work well.

However about your new issue of the UART send, I'm not very clear with it yet now and I was wondering if you can clarify it again.

I'm looking forward to your reply.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,520 Views
russellsher
Contributor III

Hi Ping, the problem is perhaps my understanding of using asyncroserial , Erich has pointed me to some examples so I'll try those.

0 Kudos

1,520 Views
PatriciaTeran
Contributor III

Hi, Russel

Have you solved your issue?

please let us know

Regards

Patricia

0 Kudos

1,520 Views
russellsher
Contributor III

Hello - sorry for my long time-no reply.

I have just returned, so I will try the suggestions and see how it all goes.

thank you for asking

Russell

0 Kudos

1,520 Views
russellsher
Contributor III

Hi Mark - mmm right you are: I see this:

But my init code should have disabled it in PE_low_level_init();  ?

pastedImage_0.png

0 Kudos

1,520 Views
russellsher
Contributor III

Hi jeremyzhou

Thanks I would like to try your suggestion  - forgive my ignorance, but how exactly do I use the binary ?

Am in codewarrior

0 Kudos

1,520 Views
mjbcswitzerland
Specialist V

Russell

Has the watchdog been enabled with a timeout of a few seconds which could explain it resetting?

Load a binary from here to check your board: µTasker FRDM-KL46Z support

Regards

Mark

Kinetis: µTasker Kinetis support

KL46: µTasker FRDM-KL46Z support  / µTasker Kinetis TWR-KL46Z48M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos

1,520 Views
russellsher
Contributor III

Hi Mark

Thanks, I would like to try your suggestion  - forgive my ignorance, but how exactly do I use the binary ?

Am in codewarrior

0 Kudos

1,520 Views
mjbcswitzerland
Specialist V

Russell

Binary files can be loaded via drag-and-drop to the FRDM-KL46's USB-MSD OpenSDA disk.

They can also be loaded using CodeWarrior's Flashing Utility.

The functionality of the binary is described at the link - when it runs it will display something in the SLCD, flash an LED and communicate via USB/UART.

Regards

Mark

Kinetis: µTasker Kinetis support

KL46: µTasker FRDM-KL46Z support  / µTasker Kinetis TWR-KL46Z48M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos

1,520 Views
russellsher
Contributor III

HI Mark, yes it works as you say - but so does the kinetis demos. My problem is any code that I write and drap/drop.

I also can't seem to get into debug mode. (Do I need other drivers for this?)

0 Kudos