MKL03 startup failed?

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

MKL03 startup failed?

Jump to solution
2,675 Views
Babycat
Contributor III

Hi everyone.

I have built a custom board with MCU KL03Z32VFK4. Everything working well except it has issue with startup sequence (my opinion). The custom board has a CR2023 holder, MCU is flashed with LED blinking example in SDK package. When I insert the battery into board. It is about 7/10 times the LED not blinking and 3/10 times I got luck it works. 

My board does not have pull-up resistor (10K) and delay cap (0.1uF) on pin 23 RST. When I place these resistor and capacitor, the lucky rate is better about 5/10. 

Capture.JPG

I realized that I could force the board working by pull down RST pin to GND for a while, then wait for about 3 sec...The LED will start blinking. Unfortunately, my board currently does not have the RST button, thus I feel much annoying.

My questions are: 

1. Does my board must place R13, C13?

2. How to get the board just straingforward working? 

Thank you!

 

 

0 Kudos
Reply
1 Solution
2,670 Views
myke_predko
Senior Contributor III

@Babycat 

You need three things for a processor to start working:

  1. Power
  2. Reset
  3. Clocking

From what you're describing, I suspect that you have an issue with power (and possibly not have the clocks running) when the reset line goes high.  

I'm not 100% sure what a "CR2023" battery is - do you mean "CR2032"?  I tried looking for the CR2023 datasheet online but couldn't find any (just a number of articles stating that the CR2023 and CR2032 are equivalent).  I'm asking about the battery this because button cells have a high ESR and the power up slope can be quite slow if you have a fair amount of capacitance in your circuit (ie processor capacitors).  I couldn't find a datasheet for a "CR2023" to understand ESR and maximum current.  

I suggest you put a scope on your P3V3 and RST_TGTMCU lines to ensure that you have a valid power level when RST_TGTMCU is no longer active.  If they look good according to the MCU's datasheet (ie P3V3 is at at acceptable level when RST_TGTMCU has reached the threshold) then you'll have to look at the clocks.  

The solution could very possibly be simply adding a larger value for the resistor at R13 to ensure power is at an acceptable level and stable when RST_TGTMCU is no longer active.

Good luck!

View solution in original post

0 Kudos
Reply
8 Replies
2,657 Views
Babycat
Contributor III

Hi,

After changed R13 to 100K, the board is working well now. 

I think the problem comes from my poor CR2032 holder (in the picture), this kind of holder creates alot power fluctuation when battery inserting in. Thus MCU does not have proper power start up sequence. 

My problem is solved. Thank you very much

Capture.JPG

2,652 Views
myke_predko
Senior Contributor III

Hi @Babycat 

Glad to hear that things are working out for you - I was working on finding a good explanation of what the issues are.  

To net them out they are:

  1. Batteries are always a pain to work with in order to:
    1. Get things working
    2. Get maximum performance (life) out of the circuit
  2. Lithium button cells are the worse things known to man to work with because:
    1. They have inconveniently large ESRs which limits the amount of current available (the CR2032 has an ESR to 20-40Ohms which corresponds to the maximum output current of 100mA listed in the datasheets)
    2. Along with large ESRs they have terrible surge (like when you start up an MCU) characteristics
    3. Points b & c mean that filter/decoupling caps take an unreasonably long time to charge which means start up takes longer than expected happen

I'm guessing you're looking for a low-cost application, which means button cells and no power management and a simple reset circuit.  In this case, the right thing to is to increase the time constant of your RC reset circuit (which you have done with increasing R13's value) until the MCU starts up reliably.  

If you can get access to a 'scope, I'd be interested in seeing what the P3V3 & TGT_MCURST signals look like when power is first applied. 

Congratulations!

0 Kudos
Reply
2,633 Views
Babycat
Contributor III

Hi @myke_predko 

Thank you, your experience has helped my case. 

Yes, this is a low cost keyfob, so there is no power management unit on the board. 

Our city is locked down, next couple of week I will have oscilloscope with me. For sure, I will capture P3V3 and RST signal for references

Thank you!

0 Kudos
Reply
2,671 Views
myke_predko
Senior Contributor III

@Babycat 

You need three things for a processor to start working:

  1. Power
  2. Reset
  3. Clocking

From what you're describing, I suspect that you have an issue with power (and possibly not have the clocks running) when the reset line goes high.  

I'm not 100% sure what a "CR2023" battery is - do you mean "CR2032"?  I tried looking for the CR2023 datasheet online but couldn't find any (just a number of articles stating that the CR2023 and CR2032 are equivalent).  I'm asking about the battery this because button cells have a high ESR and the power up slope can be quite slow if you have a fair amount of capacitance in your circuit (ie processor capacitors).  I couldn't find a datasheet for a "CR2023" to understand ESR and maximum current.  

I suggest you put a scope on your P3V3 and RST_TGTMCU lines to ensure that you have a valid power level when RST_TGTMCU is no longer active.  If they look good according to the MCU's datasheet (ie P3V3 is at at acceptable level when RST_TGTMCU has reached the threshold) then you'll have to look at the clocks.  

The solution could very possibly be simply adding a larger value for the resistor at R13 to ensure power is at an acceptable level and stable when RST_TGTMCU is no longer active.

Good luck!

0 Kudos
Reply
2,665 Views
Babycat
Contributor III

Hi myke_predko

Sorry to make you confused. Yes, it is CR2032 coin (my typo in previous post). I dont have the scope here with me, so I will try to increase R13 as your suggestion and update the results.

Btw: Any clue why the board needs about 3sec to start working after manually reset?

Thank you

0 Kudos
Reply
2,636 Views
ErichStyger
Specialist I

Hi @Babycat ,

Btw: Any clue why the board needs about 3sec to start working after manually reset?

The KL03Z has a ROM Bootloader with a timeout. Check

peripheralDetectionTimeoutMs

See https://mcuoneclipse.com/2017/07/12/getting-started-rom-bootloader-on-the-nxp-frdm-kl03z-board/

I hope this helps,

Erich

2,630 Views
Babycat
Contributor III

Hi ErichS.

I have read your article before posting this thread. I also think about Bootloader but I am not familiar with this part. I had thought the code BootloaderConfiguration locates some where in startup file. I search in example project but did not found anything. So I gave up. 

Sorry, I did not read the article carefully. Now, understand the code (must) should be place in flash via linker... I am stuying your artice agian.

Thank you!

0 Kudos
Reply
2,622 Views
ErichStyger
Specialist I

Hi @Babycat ,

the structure is either defined in C or in assembly (not sure how it is done in your project).

Check the linker map for the memory around 0x3C0. Or inspect that area with the debugger and see what is stored there.

I hope it helps,

Erich

0 Kudos
Reply