I recently had the pleasure of building a fairly involved embedded application using a Cypress EZ-BLE module. However, I didn’t have a robust hardware test platform to assist in the process. I did tolerably well using the Cypress BLE Pioneer kit, but the kit has some inherent limitations that prevented thorough testing of all of the project’s features.
First, the BLE Pioneer kit doesn’t expose all of the BLE evaluation module’s pins via accessible headers. Multiple pins are routed to hardware components such as the SW2 user button and RGB LED. This makes it hard to test external signals on these pins, or even to connect a logic analyzer in many cases.
Second, the PSoC 5LP providing debugging and USB-to-UART bridge via the standard “KitProg” firmware has its own limits. The debug interface can’t go above 1.6 MHz (painful when you’re reflashing a 256k part all the time). UART communication doesn’t support flow control, non-standard baud rates, or any baud rate above 115200.
Third, testing a second module required constantly switching debugger connections between two devices, or swapping back and forth between two plug-in evaluation boards. I built a custom breakout board for the second module used for testing, but this too has some limitations. It has no built-in debugger or USB-to-UART bridge, and the design (obviously) doesn’t match exactly with the BLE Pioneer kit. This introduces extra variables into some test results.
In short, it was tedious and inefficient. The BLE Pioneer board is excellent in most respects, but not as a comprehensive hardware test platform for the project I worked on. I don’t think it should change; that would make it less valuable for much more typical use cases. But the fact remains that I need something better going forward.
I’ve never focused heavily on test-driven-development before, and some hiccups in this project revealed just how important it is. Since I have a plenty of future development to do with this same hardware, I have therefore put in some time (hooray for holiday weekends!) to create a platform perfectly suited for automated testing and debugging. I’ve never created this kind of thing before, although I have seen a few lying on coworkers’ desks. This post explains my design choices and how I intend to implement a complete embedded test setup.
Once it’s working as intended, I will make the design available for anyone else who happens to be building with Cypress EZ-BLE modules (which, frankly, are pretty great).
PCB Design
Here’s the “CYBLE-EVAL-TEST V1.0” PCB layout, in all its glory:
The board is not small at 7.5 x 5.5 inches. Given the board’s purpose, I’m not concerned with size—if anything, it needs to be big enough to allow easy physical access to all important signals, sometimes at multiple points. While I normally design for minimum component count and small size, this board uses all through-hole parts, plenty of headers, and off-the-shelf Cypress evaluation kits. My primary goal here is to make all testing possible without using jumper wires or swapping hardware in and out.
The board has a mirrored layout, including two of each of the important pieces. This allows master/slave testing (my requirement), or A/B testing between different designs, or just two identical units operating simultaneously in the same vicinity. Of course, you can also only plug in one set of parts and leave the other sockets empty.
I replicated a few features of the BLE Pioneer kit for convenience, namely the SW1 reset and SW2 user button and the RGB LED. However, I also broke out all of these same signals to header pins and connections to the PSoC 5LP.
Important Components
Here are the Cypress kits required to fully populate the board and use it as intended:
- 2x CYBLE-XXXXXX-EVAL modules (I used CYBLE-212019-EVAL @ $20/ea): these provide the DUTs (Device Under Test), BLE connectivity, etc.
- 2x CY8CKIT-059 PSoC 5LP Prototyping Kits @ $10/ea: these provide flexible GPIO connections to the BLE modules, and communicate back to a host PC through USB-provided virtual serial port.
- 2x CYUSBS232 USB-UART LP Reference Design Kits @ $20/ea: these provide fully configurable UART communication to the BLE module, and communicate back to a host PC through a USB-provided virtual serial port.
- 1x CY8CKIT-002 PSoC MiniProg3 Program and Debug Kit @ $89: this provides a powerful and fast debugger that works with the PSoC 5LP kits and the EZ-BLE modules.
All told, that’s $40 + $20 + $40 + $89 = $189 for all the kits. Other components are negligible in terms of cost.
Another notable feature of the hardware design is the 5-way rotary switch at the bottom, which is connected to four 74HC4066 bilateral analog switch ICs. This selectively connects the MiniProg3’s clock, data, reset, and Vtarg signals to one (or none) of the four programmable kits on the board. Being able to switch quickly and easily between programming targets with a single debugger will be wonderfully convenient.
Aside from the huge collection of headers, the only other components on the board are a few LEDs, buttons, and a 5V to 3.3V regulator.
Headers Everywhere
The image above shows prevalence of standard 0.1″ pitch headers everywhere on the board. Some headers are necessary for plugging in each evaluation board, but the majority of them allow external access or internal connectivity between the PSoC 5LP and BLE module or USB-to-UART bridge and BLE module. I like this approach for the flexibility that it provides, although it means you need 100+ jumpers for a full complement of internal connections. I may opt for DIP switches in a later revision, but I’ll have to think about how that might affect usability after I go through the next round of development.
The various headers provide control over all of the following:
- RXD, TXD, RTS, and CTS connectivity between the CYUSBS232 kit and BLE module
- Complete GPIO connectivity between the PSoC 5LP kit and BLE module
- RGB LED connection to the BLE module (matches BLE Pioneer Kit routing)
- BLE supply voltage (5V or regulated 3.3V)
- BLE power net connectivity (selected BLE supply to VDDD, VDDR, VDDA, and VREF)
- Optional 5V board supply taken from any of the four USB devices
In addition—and this is another tremendous convenience—every BLE module pin is broken out to a front-of-board row of labeled pins for simple logic analyzer (or other) connectivity. This solves one of my biggest headaches during the previous development phase. I hate having sprawling jumper wires everywhere going to random analyzer leads. Ugh.
Next Steps
This post is labeled “Part 1” for a reason. I have placed a prototype order for the test PCB, and I’m currently waiting on that; I expect to receive it about 10 days from now. In the meantime, I’ll be working on the firmware/software portions of the test setup. Each of the PSoC 5LP kits will manage GPIO control and monitoring, reporting back to the host PC as directed via a simple binary protocol. The main application logic will reside on the host PC, implemented using Python and PySerial. With all four USB-provided virtual serial ports, the test software will be able to do anything it wants.
Stay tuned for another update after the PCB arrives.