Tag Archives: SAM3U

ChipWhisperer-Lite is an educational board for embedded security


ChipWhisperer is the first open-source toolchain for embedded hardware security research including side-channel power analysis and glitching.


Side-channel power analysis refers to a method of breaking implementations of completely secure algorithms such as AES-256. Such capabilities have been known for a long time – the attack was first published in 1998. But even today many consider side-channel attacks exotic, and don’t take them seriously when designing secure systems. That is why Canadian startup NewAE Technology has launched a new project to help inform designers that they need to take these threats seriously, by teaching them how the attacks work!

photo-1024x768

Recently debuted on Kickstarter, the aptly named ChipWhisperer-Lite is essentially an educational tool, designed to introduce embedded enthusiasts to the area of side-channel power analysis. You may also recall the project from last year’s Hackaday Prize, where it garnered second place accolades.

Side-channel attacks aren’t magic; in fact, it is possible to design systems which are resistant to them. For instance, Atmel has a line of secure processors which would have encryption peripherals which cannot easily be attacked. Another example is the ATAES132 device – again this has resistance against side-channel attacks, so you could be more confident in the security of that device, compared to a generic microcontroller with an AES hardware peripheral (such as the AVR XMEGA). It’s all about managing the risk!

8a98245ccbc082ea5c6f1c36fe33147c_large

Additionally, the ChipWhisperer-Lite required a high-speed USB interface, and so, the NewAE Technology team turned to the Atmel | SMART SAM3U2C to accomplish this feat.

“While a number of systems are designed around generic interface chips, using a high-speed USB microcontroller gave me a lot more flexibility. In addition the cost of the microcontroller chip was cheaper than the stand-alone interface chip I would have used, so all these benefits came at no penalty to the BOM cost,” writes company co-founder Colin O’Flynn.

This shows the basic connections between the SAM3U2C and the FPGA. The external memory interface on the SAM3U2C is used to simplify data and control transfer to and from the FPGA.

This shows the basic connections between the SAM3U2C and the FPGA. The external memory interface on the SAM3U2C is used to simplify data and control transfer to and from the FPGA.

According to O’Flynn, the SAM3U family was selected based on set of criteria:

  • High-speed USB 2.0 interface
  • External memory interface with programmable timing parameters
  • TQFP Package (as he wanted people to be able to build this project themselves)
  • Lower cost than standalone interface chip (he had been looking for roughly $3-$4 in a quantity of 1,000)
  • ROM-resident USB bootloader (so that people building their own don’t need a programmer, and makes the board unbrickable)

“The external memory interface is actually critical to achieving a simple FPGA interface. This allows me to memory-map sections of the FPGA right into the SAM3U processor memory. If transferring data over USB to the FPGA, I can point the USB code from the Atmel Software Framework (ASF) to the location in the FPGA I want the data to go,” O’Flynn adds. “This means no need to copy the data multiple times between buffers, or use some specialized protocol to transfer data from the microcontroller to the FPGA.”

Beyond that, the SAM3U2C simplifies system management. Meeting USB sleep mode current limits (2.5 mA) means shutting off the FPGA and analog portions of the board. Standalone interface chips provide a ‘SUSPEND’ output which you can use, but having the microcontroller offered much more control, which ChipWhisperer-Lite’s creators were able to use for meeting inrush current limits.

The USB standard has limits on the inrush current; this current occurs when the USB device is plugged in and all the capacitors start charging. To avoid exceeding these currents most boards need a ‘soft-start,’ where power supplies are turned on after some delay (or after the USB device finishes enumerating).

“Putting this in the microcontroller gives me control over that delay if fine-tuning is needed, or even having the option of adding multiple switches or slower ramps using a PWM output,” says O’Flynn.

This shows the switch for the FPGA and analog power supplies. Depending on the total load, an RC filter can be added to slow the turn-on speed of the FETs.

This shows the switch for the FPGA and analog power supplies. Depending on the total load, an RC filter can be added to slow the turn-on speed of the FETs.

Using the SAM3U2C also provided a nice set of peripherals to use, too. The ChipWhisperer-Lite required a ‘target’ device that the user (i.e. student) programs with their algorithm of interest. For this case, the team selected an XMEGA MCU to serve as a programmable target for the student.

The XMEGA device can easily be programmed with only two wires (PDI), and this is generated by one of the SPI modules in the SAM3U. O’Flynn also used a USART module to communicate with the XMEGA, and finally another SPI module to download configuration data to the FPGA.

“While generic interface chips often have support for serial protocols (such as SPI or USARTs), the problem is they are normally limited in the number of channels offered, or I couldn’t use the serial-interface mode at the same time as high-speed parallel interface mode.”

In addition the details of the protocol (such as the low-level PDI programming protocol for the XMEGA) go into the firmware on the SAM3U2C, simplifying the higher-layer USB interface.

c0213e143d5dc2cf1c1fb4dde421ea6b_large

“I find it easier to develop those low-level protocols on an embedded system from within Atmel Studio 6.2, compared to trying to send timing-specific information across the USB bus to be processed by the interface chip! Anytime you can avoid USB debugging is time well spent in my books,” O’Flynn emphasizes. “Using an ASF application example as a starting point for the whole application let me rocket through development, with satisfyingly few moments of pounding my head against the desk figuring out why things weren’t working!”

A final nicety of the design was the ability to use the unique ID programmed into the SAM3U2C as part of the USB device serial number. In other words, the NewAE Technology crew could generate unique serial numbers for each device without requiring any special manufacturing step – every device is loaded with the same binary firmware yet still has a unique serial number. As an end-user, having unique USB serial numbers improves the experience since otherwise Windows will reload the driver when you change the USB port the device is plugged into.

“We’re eliminating the problem for good by making the tools open-source. Because this whole area is an active research area, the tools need to be open-source. This isn’t a case of attempting to seem sexy by adding the word ‘open-source’, but placing something of commercial value into the open-source domain, in the hope it spurs a larger community. This includes hours of tutorials on this area, more than just a few board files and some source code.”

Indeed, this project was devised as a fairly advanced piece of test equipment for well-seasoned Makers, embedded developers and computer engineers. That being said, it is important to note that it is not Arduino-compatible, nor does it work with Raspberry Pi or BeagleBone. However, O’Flynn does reveal that an Arduino-compatible, ATmega328P based target board is in the works. Impressively, ChipWhisperer-Lite also enables users to snap off the ‘target board,’ giving them both a main measurement tool and a target device.

e1dd963d975ca506d1570c18a6023fae_large-1

Interested in learning more? You can head over to its official Kickstarter page, where the team is well on its way to achieving its $50,000 goal. Pending all goes to plan, shipment is slated for August 2015.

Designing PLC systems and I/O modules with Atmel

PLC systems are typically highly complex,  as they integrate numerous board modules required by current-gen automated industrial environments, including:

  • Programmable logic controllers (PLC) or programmable automated controllers (PAC)
  • Distributed Control Systems
  • Digital and analog IO-modules
  • Field bus communication modules
  • Industrial Ethernet interfaces
  • Wireless communication module

“Clearly, the diversity of board designs for industrial PLC applications is challenging for R&D departments. For optimal hardware and software development, designers require a broad, efficient product family where development can be re-used as much as possible,” an Atmel engineering rep told Bits & Pieces.

“To meet these needs, Atmel offers efficient AVR and ARM-based product lineups ranging from low pincount, low flash size microcontrollers to high-performing embedded MPUs running at 400MHz.”

Indeed, for main CPU applications, Atmel’s SAM9 series offers up to 400Mhz ARM926EJ core with up to 32KB instruction and data caches for fast execution times, while a unique dual EBI (External Bus interface) feature allows connecting dedicated circuits for field bus or real time industrial Ethernet communication without strongly impacting the bus load and the performance of the application.

“In addition, the implementation of the TCM (Tightly Coupled Memory) interface on selected products enables access to the internal SRAM with zero wait state at 400MHz. With this feature, time-critical code sections and interrupt routines can be executed fast and deterministically,” the Atmel engineering rep continued. “Plus, our microcontrollers support up to 37 DMA channels with double buffering feature to minimize CPU load and reduce real time constraints, while support for DDR2 external memory enables lower cost and longer availability for CPU devices.”

Additional key features? An integrated power-on-reset (eliminates the need for cost-intensive external power management IC), serial NVM for system boot (allows smaller PCB layout), industrial BGA package with 0.8mm pitch (eases PCB layout and reduces assembly costs) and system security solutions (peripheral components).

“In terms of I/O module solutions, Atmel offers high-speed serial peripherals for a fast communication with backplane bus interface or the connection to high resolution external ADC or DAC, with SPI data rates up to 48Mbps on the SAM3U. CAN modules are available on Atmel AVR UC3, megaAVR and AT91SAM microcontrollers,” the engineering rep explained.

“There are also numerous 16-bit timers with input capture function for time stamping, PWM channels support control and dim functions for LEDs. Of course, Atmel supports a rich set of analog functions such as 12-bit ADC and DAC, as well as analog comparator for monitoring the operation condition of the IO-module. And last, but certainly not least, we offer a high performance CPU up to 96MHz with integrated MAC unit supporting the growing demand for signal conditioning on the analog IO-module.”

Interested in learning more about designing PLC and I/O modules with Atmel tech? You can check out our complete device breakdown here.

Powering industrial communications with Atmel

Industrial communications are a critical aspect of current-gen automated systems – with defined standards that continue to evolve as new industrial Ethernet protocols emerge. Atmel’s versatile portfolio of microcontrollers (MCUs) provides engineers with the peripherals and internal system architecture required to efficiently interface new products with leading field busses, industrial Ethernet standards and wireless communications.

Field Bus

Atmel offers a dedicated RS485 mode for USART peripherals which is available on most ARM processor-based AT91SAM and AVR 32-bit microcontrollers. Meanwhile, a rich number of DMA channels on Atmel megaAVR, AVR XMEGA, AVR 32-bit and AT91SAM MCUs unload the CPU during industrial communication transfers, with multi-layer bus implementation on Atmel 32-bit microcontrollers enabling true parallel data transfers and effectively minimizing bus load limitation.

In addition, there is an (optional) external bus interface on several Atmel microcontrollers, with up to 32-bit data supports dedicated ASSP for protocols such as Profibus. Plus, up to 12Mbps USART on the SAM3U and SAM9 microcontrollers provides support for external transceivers. In terms of single or dual CAN controllers, select Atmel MCUs are V2.0A and V2.0B standard compliant, supporting independent message objects that are programmable on the fly and ideal for field bus such as CANopen and DeviceNet.

Industrial Ethernet

The vertical integration of management execution systems with factory floor equipment has resulted in the continued convergence of the Ethernet TCP/IP protocol with industrial field busses. As noted above, several industrial Ethernet protocols have emerged, including Profinet, Ethernet/IP, ModbusTCP/IP, EtherCat and Ethernet Powerlink.

“Most industrial Ethernet automated systems do not require compliance with a PLC cycle times lower than a few milliseconds. For these applications, the industrial Ethernet protocol can be cost-effectively implemented in software on a microcontroller with an integrated standard Ethernet MAC peripheral,” an Atmel engineering rep told Bits & Pieces.

“Due to their moderate flash size requirement, protocols like Modbus TCP can be implemented in a microcontroller. Atmel offers ARM-based and 32-bit AVR microcontrollers with up to 512KB of flash and an integrated Ethernet MAC unit.”

According to the rep, one of the most noteworthy features includes a 10/100 Ethernet Media Access Controller (EMAC) peripheral with chained buffer Direct Memory Access (DMA). This acts as a master on the internal multi layer bus with multiple internal SRAM blocks – enabling a true parallel data transfer between the Ethernet frames and the application data.

“Atmel’s  SAM9  MPUs are also price-competitive solutions for implementing industrial Ethernet protocols, such as the Ethernet/IP standard, which requires a higher flash size and faster execution time,” the engineering rep continued.

“Atmel’s  SAM9 MPU, like the SAM9G45, offers a variety of benefits, including a 400Mhz clocked ARM926EJ core with 32KB instruction and data caches speed execution time. There is also deterministic execution time with the use of the TCM (Tightly Coupled Memory) interface, enabling access to the internal SRAM with zero wait state at 400MHz. Indeed, by dynamically configuring the SRAM as TCM, Ethernet frames can be analyzed at full speed without any copy to the cache.”

For motion control applications, synchronism and short latency aspects are crucial. Protocols such as Profinet IRT or Ethercat address these requirements and are suited for systems with a sub-millisecond PLC times. In this case, specific ASSP or FPGA solutions must be used. The Atmel SAM9G45, with its dual EBI feature, lets designers integrate the industrial Ethernet communication module with minimal performance impact. Data transfers between the ASIC or FPGA can be handled by the DMA unit, in parallel with external RAM access.

Wireless Communication

Wireless communication in the industrial automation sector is increasingly popular, as it provides an easier way to install and connect mobile or inaccessible equipment. To be sure, industrial control equipment such as PLC and DCS IO modules primarily utilize IEEE802.11 WLAN and Bluetooth standards. And that is one of the reasons Atmel’s 32-bit microcontrollers and microprocessors feature an embedded multimedia card interface which supports connection to an SDIO WLAN or Bluetooth module. In fact, a full reference design based on the Atmel AVR 32-bit microcontroller and the industrial Wifi Module from H&D is available for evaluation and development here, while a Linux-based solution for Atmel SAM9 microcontrollers can be found here.

And last, but certainly not least, industrial sensors and actuators have demanding requirements for power consumption, board space and implementation cost. For these products, IEEE802.15.4 technology, such as Zigbee or Wireless-HART is most appropriate, with Atmel offering complete wireless solutions based on our low-power microcontrollers and RF transceivers. Benefits include excellent RF performance, which enables longer range and more robust RF link, optimized power consumption and lowest system cost.

Additional information about Atmel MCUs that can be used to power a wide range of industrial communication devices is available here.