Finally my Freescale TWR-K21F120M board arrived 🙂
For the next generation of INTRO Zumo robots I’m evaluating a new ‘brain’: more processing power, more FLASH, more RAM, more of everything 😉
The board comes assembled, with one micro-B USB cable, a CR2025 coin cell battery and quickstart guide.
💡 Be very careful with these micro-B USB connectors! The cables lock into the connector, and some force is used to pull them off. As the connectors are SMD ones, they easily could get ripped of the board if you are not careful!
The board has 4 user LED’s, potentiometer, an accelerometer (MMA8451Q), extension sockets (TWRPI) two push buttons, and on the back side an SD card socket:
On the back side you see as well the S08JM60 CPU responsible for the onboard debug interface (OSJTAG).
💡 The OSJTAG is not very fast. I recommend to use an external TAP (P&E Universal Multilink or Segger J-Link) with the onboard JTAG header.
The heart of the board is the MK21FN1M0V12 in BGA package:
In a small and tiny package I get
- ARM Cortex-M4F with Hardware Floating Point Unit
- Up to 120 MHz
- 1 MB FLASH
- 128 KByte SRAM (splitted up in two 64 KByte areas)
💡 I probably will go with a QFN package, as even if I manufacture the new robot board outside, that BGA package is not very hobby friendly.
So plenty of space and performance for my bot :-).
The onboard OSJTAG interface features a serial-to-USB bridge. As I do not plan to add the OSJTAG debug interface on my board, and as I need a serial connection to my robot, my first concern was to bring up USB CDC on the K21F120M.
The port of the Freescale USB Baremetal stack I have has not supported that K21F120M yet, so I have extended the FSL_USB_Stack component for the K21F120M:
My USB CDC component uses ring buffers for Tx and Rx:
The implementation was limited to use a byte as buffer entry, and a buffer was only able to have up to 256 elements.
Now the component has been extended for different element size, increased buffer size and an option to have it using reentrant or non-reentrant access to the buffer:
USB CDC device is working fine now for the K21F120M, and I made a quick port of my robot application to the K21F120M which is looking good. The USB HID keyboard and mouse plus MSD Host should be working too, but I have not tested it yet. I’m still not decided on the CPU, and I need to have a look at the Kinetis K22 too, as that one even looks a better choice for what I’m looking for?
My current project and components are available on GitHub:
Happy Evaluating 🙂