This post is part of my Roadtest Review of Cypress PSoC 62S2 Wi-Fi & BT5.0 Pioneer Dev Kit - Review. My review is splitted into multiple reviews and tutorials. Main page of review contains brief description of every chapter. Some projects are implemented in multiple variants. Main page of review contains brief description about every chapter, project and variants and contains some reccomendations for reading.
Table of Contents
- Intruction, Table of Contents, Overview of Table of Contets
- Review of Development Board
- Review of Microcontroller
- Review of Wi-FI and BT Module
- Review of Onboard Peripherals
- Review of Onboard Programmer and Debugger (this article)
- Review of Development Software
- Review of Documentation
- Project 1 - Serial Interfaces
- Project 3 - FRAM
- Project 4 - CapSense and Bluetooth
- Project 5 - Dual Core Application
- Project 6 - Profiler
- Summary and Score
Review of Programmer and Debugger
Development boards contains onboard programmer. Programmer is named Kitprog3 and can take control over main MCU, erase his memory, flash his memory, halt both cores and debug them. Maybe you remember the era when you must buy separate programmer or debugger (for example J-Link in the world of ARMs) and connect it the developed system using JTAG connector. This era is over. Almost all nowadays development boards (sometimes also including boards featuring 8bit MCUs) contain integrated debugger and this development board also feature this. I will sometimes compare to following competitive onboard programmers: ST-Link, Segger J-Link OB and DAPLink. Most of them are available as embedded onboard debugger and also they are available as standalone debuggers. ST-Link is used on development boards like Nucleo or discovery featuring STM32 microcontrollers. Some vendors who don’t want to develop their own debugger like ST or Cypress did, may buy license for Segger J-Link OB which is onboard variant of J-Link. The third one is DAPlink. It is developed by ARM for MBED ecosystem and it is the only opensource. You can for example place DAPlink on your own custom design board without paying any fee for his firmware. You can consider them as opensource alternative to Segger J-Link OB.
I will sort the programmers to the 2 groups. Proprietary and DAPLink. Historically there were only proprietary programmers like ST-Link, J-Link or KitProg but later ARM has release opensource programmer DAPLink which is mostly incompatible with the proprietary ones but brings new features and is becoming standard in the industry. Most proprietary programmers (including KitProg) are supported by OpenOCD software (Cypress added support of KitProg3 itself). OpenOCD can control the programmer and target system using them. OpenOCD then start debugging server and your development IDE can connect to that debugging server. The DAPLink brings new environment named PyOCD supporting only DAPLink. PyOCD has fewer features than OpenOCD and does not support proprietary debuggers so much, but according to ARM it is the new standard. PyOCD is internally used by MBED Studio but you can use it simply from command line. PyOCD can be scripted using Python while OpenOCD can be scripted in their own TCL shell. Both are usually used as GDB servers.
KitProg3 support their own mode and also support DAPLink mode. When you choose KitProg mode it act as proprietary programmer. You can use them in OpenOCD and in that mode it can be used in almost all current development environment including ModusToolbox. DAPLink mode should be used when you are developing using MBED or you want to use PyOCD. In that mode KitProg emulates DAPLink. The support for both modes I consider as big advantage because you can freely choose whatever you will use. Ability to operate in two modes brings you benefits of both ecosystems. To switch mode just press onboard button. AS I mentioned before, normally your choice dependes on used development environment. If you use tools from Cypress like Modus Toolbox or Cypress programmer (both are reviews in chapter “Review of development software”) you will use normal KitProg3 mode (Kitpro3 Status LED will lit in this mode) and If you want use MBED Studio or PyOCD, you will use DAPLink mode (KitProg3 status LED will slowly flash).
The second most important advantage I see is that Cypress prefer open-source tools. There are no restrictions to use IAR/Keil or any other proprietary and expensive tools, but you can use them if you want. Currently Cypress has OpenOCD forked and their modification are available using their GitHub. You can also download it as installer (It is bundled with “Cypress programmer”) but they are working on integrating they modifications to the mainline OpenOCD (OpenOCD is quite slow project). When you download now mainline OpenOCD it will contain support for KitProg but for now it is not working seamlessly yet.
There is tool to update firmware of the KitProg3. You most probably receive the board with little bit older firmware then is actual. In my case I received board with KitProg3 firmware 2.00 b809 and update utility upgraded it to the version 2.10 b878.
In DAPLink mode the programmer will act as different USB device and offers different features. For example, It will show up as mass storage and you can flash the target firmware using copying hex file to that virtual mass storage device. It is very user friendly because you do not need any additional tool installed for flashing firmware using this way. Disadvantage is that it is slow. It takes time to enumerate USB storage device, list their contents and the second slowness of it is that after finalizing coping the file, the whole device (including programmer) will reset.
KitProg3 is not a just programmer. It is composite device and additional feature it offers is UART bridge. It has interconnected TX and RX lines with the main MCU so you can make communication over UART between your computer and main MCU without need of use external USB-to-UART bridge. Nowadays this is common feature and almost all competitive programmers include that feature. Some older boards may not have this feature.
The more interesting is that except USB-UART bridge it also contains USB-I2C bridge. This is feature quite unique to Cypress because I have never seen any of these bridges on any other onboard programmer. These bridge enable you to begin I2C communication with the main MCU and onboard peripherals. At this bus is connected multiple devices. There are main MCU, cypress programmer, I2C EEPROM (which is unsoldered, but you can solder it yourself) and it is exposed on extension header. You can connect any other devices on this bus using expansion header and access it directly form computer. This bridge is also used by utility for tuning capacitive buttons. Demonstration application sends measured data to the computer and utility in computer reads them and visualize it in real time.
The documentation of KitProg says that there is also USB-SPI bridge but according to schematics I did not find any SPI connection from KitProg and have never seen any software option for this. After quick research using Google, I found that it is present on some PSoC 4 boards but it looks like at this board this feature is not present.
The programmer has also voltage monitor which monitors power voltage of the board. Support for it is implemented in OpenOCD script and when you are debugging, and voltage drop occur you will see this in console. It should look like following example which I have seen once I have been connecting some peripherals and maybe shorted some wires for a short period of time.
Info : Power dropout detected, running power_dropout proc. Power dropout, target voltage: 2.686 mV Power restore, target voltage: 2.961 mV Power restore, target voltage: 2.902 mV Info : Power dropout detected, running power_dropout proc. Power dropout, target voltage: 2.688 mV Power restore, target voltage: 2.885 mV Info : Power dropout detected, running power_dropout proc. Power dropout, target voltage: 2.645 mV Power restore, target voltage: 2.876 mV
The interesting feature is that programmer can disconnect power supply from the software. Cypress programmer utility has button that can power-off the board while the power of programmer remains. If you think that power led lit for the whole time You are not correct. When you disable power of the board led will turn out. It is interesting feature which enables you debugging of startup and reset causes of the MCU. I used this feature in project “Project 3 – FRAM”.
To sumarize, I like the KitProg3 and it fullfills all my expectations from embeded programmer and debugger. It has good support in tools.