Skip navigation
Home > All Places > PSoC 6 MCU Community > Blog > Authors MarkA_91

PSoC 6 MCU Community

3 Posts authored by: MarkA_91
MarkA_91

PSoC 6 Watchdog

Posted by MarkA_91 May 24, 2017

Hello! Last week I described the PSoC 6 multi-counter watchdog (MCWDT) resource. Here I will describe the basic watchdog timer (WDT).

 

PSoC 6 actually has multiple watchdogs - a single basic watchdog timer (WDT) and one or more multi-counter watchdogs (MCWDT). In most cases you will use the WDT for the basic watchdog function, and the MCWDT counters for general counter/timer functions such as measuring time between events and generating periodic interrupts.

The WDT and MCWDT are similar in function, in that the counters generate periodic interrupts, with device reset on the third unhandled interrupt. There are some differences:

  • The WDT has a single 16-bit counter with a 16-bit match register.
  • The WDT is clocked by the internal low-speed oscillator; the MCWDT by ClkLf.
  • The WDT works in Active, Sleep, DeepSleep, and Hibernate modes. The MCWDT does not work in Hibernate mode.

PDL API support is provided for both resources. Remember, for an effective watchdog function, good practice is to never reset the watchdog from an interrupt handler. If you do, then if the CPU or background firmware crashes the watchdog may never trigger because it is still being reset in an interrupt handler. It is better to reset the watchdog somewhere in the main loop.

Hello! Here's some information on the multi-counter watchdog (MCWDT) resource in the PSoC 6 architecture.

 

PSoC 6 actually has multiple watchdogs - a single basic watchdog timer (WDT) and one or more multi-counter watchdogs (MCWDT). Each MCWDT has three counters, two of which can generate a watchdog reset. However, if you use the WDT for the basic watchdog function, then all of the MCWDT counters are available for general counter/timer functions such as measuring time between events and generating periodic interrupts.

 

mcwdt.jpg

Note that the counters can be cascaded, allowing you to create combinations of 16-, 32-, 48-, and 64-bit counters.

All watchdog timers - WDT and MCWDT - are clocked by the 32.768-kHz ClkLf.

 

Feel free to leave comments and ask questions, we appreciate the feedback!

Hello! Here's some information on how we handle product firmware upgrades in the field, also known as bootloading, with PSoC 6.

 

First, some background:

With PSoC 3, 4, and 5LP, we designed Bootloader and Bootloadable Components for Cypress's PSoC Creator IDE. These Components have several features. The most notable feature is that they enable bootloading that is agnostic to the host communication channel; that is, you can easily make a bootloader that downloads a new application from the host via UART, I2C, SPI, USB, BLE, and other common communication channels. You can even use a custom communication channel.

AN213924_Figure2.jpg

Furthermore, the complexities of bootloader and application image placement in target device flash are largely handled for you, making it very fast and easy to get simple bootloaders up and running. Advanced features such as dual images, golden image, host command timing, validation, and security are also available. For more information, see AN73854, PSoC Introduction to Bootloaders.

 

With PSoC 6, we took a different approach that enables more custom bootloader solutions. To do that, we replaced the PSoC Creator Components with a software development kit (SDK). We made the Bootloader SDK available as part of the Cypress Peripheral Driver Library (PDL) so that it can be used with other IDEs as well as PSoC Creator. You can use the Bootloader SDK to design bootloading solutions of arbitrary flexibility and complexity, while maintaining support for rapid development for common use cases. The Bootloader SDK has the following features:

  • Downloads application images from a host through a number of transport interfaces, e.g. BLE, USB, UART, I2C, SPI.
  • Programs application images to specified addresses in internal flash, SMIF, or external memory.
  • Supports up to 28 application images. Any application can have bootloader capabilities, and can bootload any other image.
  • Supports customization.
  • Enables validating applications.
  • Supports encrypted bootloader image files. Writes encrypted images to firmware without intermediate decryption.
  • Safe Bootloading: save an image at a temporary location, validate it and, if valid, overwrite the working image.
  • Allows copying applications.
  • Switch between applications. Allows passing parameters in RAM.

 

More details, as well as an application note guide and code examples, will be published soon.