Minimal environment for MKL03Z8VFG4 (development & production programming)

cancel
Showing results for 
Search instead for 
Did you mean: 

Minimal environment for MKL03Z8VFG4 (development & production programming)

435 Views
baxsie
Contributor I

I'm just starting with MKL03Z8VFG4. I have a FRDM-KL03Z on order, and I am slowly crunching through the reference manual on the MKL03Z8VFG4.

I currently have an ATTINY412-SSNR on the project, coded, doing its thing, but need like two more pins, and that tips the balance over to the MKL03Z8VFG4 -- plus as a company we are trying to standardize on ARM architecture.

On the software side, I assume MCUXpresso is what everybody is using? Or have the cool kids found something better?

Here are my initial questions that I have:

1) What is the minimal connector for hardware debug/programming during development?

From the "FRDM-KL03Z 5.2.1 Debugging interface" I assume that I need: +3.3v, GND, SWD_IO, SWD_CLK, and RST. This also echoes the PSoC4 development interface.

2) What is the best supported / most popular hardware that I need for debug/programming during development?

I  have heard the J-Link and OpenSDA mentioned. I will have a FRDM-KL03Z that I assume can program its own micro, can the FRDM-KL03Z also reprogram an external micro on my board? After years of blind programming, I do want the luxury of to be able to single step through the code. The PSoC4 uses something called a MiniProg3 that allows all this, is there a similar NXP product?

3) What is the best method for production in the 1000 of units range?

Since this MKL03Z8VFG4 has a bootloader in it, and my application code is small (less than 8K, right?), I think this approach might work well. Is there an NXP example source code that programs the chip through the bootloader?

Background: For one STM32 ARM based product we make I wrote a PC utility that talks to the device's serial bootloader through a USB adapter. The adapter is a simple FTDI FT232RL based board that provides Rx, Tx and two additional control lines (RTS & DTR) that are connected to RST and nBOOT pins of the STM32. That gives the PC-based programmer complete control over resetting the micro without the operators having to hold buttons or sequence power.

4) What is the minimal connector for serial production programming through the bootloader?

I assume I would need 3.3v, GND, Tx, Rx, and RST, but I think there must also be one other pin to tell the MKL03Z8VFG4 to boot into the ROM instead of the flash.

Thank you for any help or suggestions you can offer.

Labels (1)
Tags (1)
0 Kudos
5 Replies

133 Views
baxsie
Contributor I

An update:

I have the PCB back with the MKL03Z8VFG4.

I was able to install MCUXpresso and the LPC-Link 2 and I can talk to the chip.

So for my application, it appears that the minimum hardware needed for prototyping is:

  • USB mini cable
  • LPC-Link 2
  • 10-pin SWD connector soldered to my PCB
  • MKL03Z8VFG4 soldered to my PCB

Now on to writing firmware :-)

Thanks for all your help.

0 Kudos

133 Views
baxsie
Contributor I

Jeremy / Erich:

Thank you for your kind replies.

Based on your comments, in addition to the FRDM-KL03Z, I have also ordered the OM13054: LPC-Link2 onto which I'll apparently have to load the CMSIS-DAP firmware. From what I can tell, at that point, I should be able to use MPCXpresso to talk to the LPC-Link2+CMSIS-DAP to download and debug. 

My initial target will be the processor on the FRDM-KL03Z, then as soon as I can figure it out, it will be to program/debug the MKL03Z8VFG4 on my own board.

The primary job of this micro is to send a couple hundred bytes out the SPI to initialize a device.

There is also some random GPIO sequencing (reset etc).

If I can swing it, I also want to measure the duty of an incoming PWM: 250Hz, 1/128 duty . . . so the minimum pulse width would be 31.25uS. Using this pulse I would set another higher frequency PWM . . . maybe in the 100KHz range. Kind of an intercept and multiply the frequency scheme.

I plan on working on the schematic shortly. The functions I need are:

  • SPI Master (to initialize the device)
  • GPIO input to a timer that can measure the incoming PWM pulse width
  • GPIO output of a timer that is the outgoing, higher frequency PWM 
  • A couple of random GPIO
  • Pins to program the MKL03Z8VFG4 using ROM bootloader
    • +3.3v
    • GND
    • UART Rx
    • UART Tx
    • NMI
  • Pins to debug the MKL03Z8VFG4 using LPC-Link2+CMSIS-DAP
    • 3.3v
    • GND
    • SWD_CLK
    • SWD_DIO
    • RST

That should keep me busy for a bit :-)

For feedback on the schematic, should I post images in this thread or resolve this one and open another?

My hope is to make a kind of MKL03Z8VFG4 getting started reference thread, but I want to follow the conventions of this forum.

Thanks again for your comments, insight, and suggestions.

0 Kudos

133 Views
mjbcswitzerland
Specialist V

Hi

See also the following if you are new to the KL03 and starting a professional project:
http://www.utasker.com/services.html

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html
Kinetis KL02/KL03/KL05:
- http://www.utasker.com/kinetis/FRDM-KL02Z.html
- http://www.utasker.com/kinetis/FRDM-KL03Z.html
- http://www.utasker.com/kinetis/FRDM-KL05Z.html


For less questions and faster, cheaper developments: try uTasker for Kinetis

0 Kudos

133 Views
BlackNight
NXP Employee
NXP Employee

Hi Brent,

in addition to what Jeremy said:

0) IDE: MCUXpresso IDE is the recommended one by NXP, free of charge and unlimited, and this is what is used the most.

1) Debug interface: SWD with Vcc, GND, RST, IO and CLK is the standard ARM interface.

2) Debug probe: OpenSDA both means a circuit and a combination of bootloader and debug firmware (see OpenSDA on the Freedom KL25Z Board | MCU on Eclipse and OpenSDA Serial and Debug Adapter|NXP . On top of the bootloader you can run a CMSIS-DAP application (e.g. to use it with the LinkServer connection in MCUXpresso IDE) or to behave like a SEGGER J-Link, P&E Multilink Universal or NXP LPC-Link2. What you really want is an external P&E Multilink (PEmicro | Experts in Embedded tools for Flash Programming and Development ) or a Segger J-Link or (J-Link Debug Probes | SEGGER - The Embedded Experts ) a LPC-Link2 (LPC-Link2|NXP , Custom 3D Printed Enclosure for NXP LPC-Link2 Debug Probes | MCU on Eclipse ) for your development. Each of them has different features, capabilities and price points, best if you have all of them available. Keep in mind that you *could* use your FRDM board as a programmer (see Using the Freedom Board as SWD Programmer | MCU on Eclipse or Freedom Board with Segger OpenSDA Debug Firmware | MCU on Eclipse ), but you have to carefully review the license agreement for each connection. E.g. the Segger agreement does not allow you to debug your custom board (see above article). Using an external debug probe (LPC-Link2, Segger or P&E) is really what you want.

3) You could use the bootloader for your production programming. I wrote a tutorial (Getting Started: ROM Bootloader on the NXP FRDM-KL03Z Board | MCU on Eclipse ) how to use it. I recommend you have a read at the errata of the bootloader too to make sure you can use it as intendend for your use case. Personally I would use the bootloader for updates in the field, not for production programming. What I do for production programming is to have Tag-Connect pads (see First tinyK22 Board with NXP K22FN512 ARM Cortex-M4F | MCU on Eclipse ) on the board which saves you the costs of the debug connector and do factory programming on these pads with an external flasher (Segger Flasher (Flashing many ARM Boards without a Host PC | MCU on Eclipse ) or a P&E Cyclone programmer).

4) see point 3) and what Jeremy wrote above.

I hope this helps,

Erich

0 Kudos

133 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
1) What is the minimal connector for hardware debug/programming during development?
-- SWD interface.
2) What is the best supported / most popular hardware that I need for debug/programming during development?
-- OpenSDA is the choice.
3) What is the best method for production in 1000 of units range?
-- NXP has provided a solution to program the Kinetis MCU via the bootloader, definitely, KL03 is included, please learn the more information via the MCU Bootloader|NXP

4) What is the minimal connector for serial production programming through the bootloader?
-- When NMI pin is sampled at the end of reset, it will force the MCU boot from the ROM.


Have a great day,
TIC

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

0 Kudos