Tag Archives: Uncategorized

Enhance your Arduino development with fast and easy debugging from Segger

via Arduino Blog

Arduino has partnered with Segger to further support developers in creating their own embedded systems, implementing compatibility of Segger debugging solutions with Portenta boards. 

Debuggers are the scalpel that allows a developer to dissect any application code running on embedded hardware. This versatile tool helps the programmer to halt programs at specific points, inspect values stored in memory units, modify CPU registers and enter test data to narrow down on buggy pieces of code. This tool comes in handy when you want to locate malfunctioning code and fix faulty program execution.

J-Link debug probes are the most popular choice for optimizing the debugging and flash programming experience. Among the key benefits are:

  • Record-breaking flashloaders, up to 3MB/s RAM download speed.
  • Unlimited Flash Breakpoints feature allows the user to set an unlimited number of breakpoints when debugging in flash memory.
  • Wide range of CPUs and architectures supported; in fact, everything from single 8051 to mass market Cortex-M to high-end cores like Cortex-A (32- & 64-bit).
  • Direct interface with SPI flashes, without the need of a CPU between J-Link and the SPI flash.
  • Supported by major IDEs.

In the meantime, we’re working to make the Arduino IDE 2.0 compatible with Segger debugger solutions.

To quickly get started, check out our new tutorials on the Portenta Breakout and MKR boards. You’ll learn how to debug your Arduino sketch by connecting Portenta Breakout to the Segger J-link device and using the Ozone debugger and performance analyzer.

Ozone is Segger’s full-featured graphical debugger for embedded systems. Thanks to features such as trace, code profiling and code coverage analysis, it’s also an extremely powerful performance analyzer. Ozone supports the debugging of any embedded application on C/C++ source and assembly level. It can load applications built with any toolchain/IDE and even debug the target’s resident application without any source. Ozone includes all well-known debug controls and information windows, while making use of the best performance of J-Link debug probes. The user interface is highly intuitive, yet fully configurable. Each window can be moved, re-sized and docked to fit every developer’s needs.

There are four different J-Link models already available on the Arduino Store:

  • J-LINK BASE COMPACT: USB powered JTAG debug probe supports a large number of CPU cores. Based on a 32-bit RISC CPU, it can communicate at high speed with supported target CPUs.
  • J-LINK PLUS COMPACT: With this compact version of the J-Link PLUS, users have an unlimited number of flash breakpoints. Mounts securely and unobtrusively into development and end user equipment
  • J-LINK EDU: Reserved for educational purposes, the J-LINK EDU offers the same functionalities as the J-Link BASE. It’s been designed to allow students, educational facilities and hobbyists access to top of the line debug probe technology.
  • J-LINK EDU MINI: The smallest J-Link debugger, intended for non-commercial use.

To connect the Portenta boards with J-Link debuggers, there are two adapters available: Segger’s 50-Mil 10-Pin Patch Adapter and J-Link 19-pin Cortex-M Adapter. The 50-Mil 10-Pin Patch Adapter converts the standard 20 pin 0.1″ connector to the standard 10-pin 0.05″ Cortex-M connector. This allows custom connections/wiring between the 20-pin and 10-pin side.

The 19-Pin Cortex-M Adapter allows JTAG, SWD, and SWO connections between J-Link and Cortex-M based target hardware systems. It adapts from the 20-pin 0.1” JTAG connector to a 19-pin 0.05” Samtec FTSH connector as defined by Arm.

For more information and tech specs, please check out the Segger items in the store.

The post Enhance your Arduino development with fast and easy debugging from Segger appeared first on Arduino Blog.

Bring on the documentation

via Raspberry Pi

I joined Raspberry Pi eighteen months ago and spent my first year here keeping secrets and writing about Raspberry Silicon, and the chip that would eventually be known as RP2040. This is all (largely) completed work: Raspberry Pi Pico made its way out into the world back in January, and our own Raspberry Silicon followed last month.

The question is then, what have I done for you lately?

The Documentation

Until today our documentation for the “big” boards — as opposed to Raspberry Pi Pico — lived in a Github repository and was written in Github-flavoured Markdown. From there our documentation site was built from the Markdown source, which was pulled periodically from the repository, run through a script written many years ago which turned it into HTML, and then deployed onto our website.

This all worked really rather well in the early days of Raspberry Pi.

The old-style documentation

The documentation repository itself has been left to grow organically. When I arrived here, it needed to be restructured, and a great deal of non-Raspberry Pi specific documentation needed to be removed, while other areas were underserved and needed to be expanded. The documentation was created when there was a lot less third-party content around to support the Raspberry Pi, so a fair bit of it really isn’t that relevant anymore, and is better dealt with elsewhere on the web. And the structure was a spider’s web that, in places, made very little sense.

Frankly, it was all in a bit of a mess.

Enter the same team of folks that built the excellent PDF-based documentation for Raspberry Pi Pico and RP2040. The PDF documentation was built off an Asciidoc-based toolchain, and we knew from the outset that we’d want to migrate the Markdown-based documentation to Asciidoc. It’d offer us more powerful tools going forwards, and a lot more flexibility.

After working through the backlog of community pull requests, we took a snapshot of the current Markdown-based repository and built out a toolchain. A lot of which we intended to, and did, throw away after converting the Markdown to Asciidoc as our “source of truth.” This didn’t happen without a bit of a wrench; nobody throws working code away lightly. But it did mean we’d reached the point of no return.

The next generation of documentation

The result of our new documentation project launches today.

The new-look documentation

The new documentation site is built and deployed directly from the documentation repository using Github Actions when someone pushes to the master branch. However we’ll mostly be working on the develop branch in the repository, which is the default branch you’ll now get when you take a fresh checkout, and also the branch you should target for your pull requests.

We’ve always taken pull requests against the Markdown-based source behind our documentation site. Over the years as the documentation set has grown there have been hundreds of community contributors, who have made over 1,200 individual pull requests, ranging from fixing small typos, to contributing whole new sections.

With the introduction of the new site, we’re going to continue to take pull requests against the new Asciidoc-based documentation. However, we’re going to be a bit more targeted around what we’ll to accept into the documentation, and will be looking to keep the repository focussed on Raspberry Pi-specific things, rather than having generic Linux tutorial content.

The documentation itself will remain under a Creative Commons Attribution-Sharealike (CC BY-SA 4.0) license.

Product Information Portal

Supporting our customers in the best way we can when they build products around Raspberry Pi computers is important to us. A big part of this is being able to get customers access to the right documents easily. So alongside the new-look documentation, we have revamped how our customers (that’s you) get access to the documents you need for commercial applications of Raspberry Pi.

The Product Information Portal, or PIP as we’ve come to refer to it here at Pi Towers, is where documents such as regulatory paperwork, product change notices, and white papers will be stored and accessed from now on.

The new Product Information Portal (PIP)

PIP has three tiers of document type: those which are publicly available; restricted documents that require a customer to sign up for a free account; and confidential documents which require a customer’s company to enter into a confidentiality agreement with Raspberry Pi.

PIP will also be a way for customers to get updates on products, allowing customers with a user account to subscribe to products, and receive email updates should there be a product change, regulatory update, or white paper release.

The portal can be found at pip.raspberrypi.org and will be constantly updated as new documents become available.

Where next?

I’m hoping that everyone that has contributed to the documentation over the years will see the new site as a big step towards making our documentation more accessible – and, as ever, we accept pull requests. However, if you’re already a contributor, the easiest thing to do is to take a fresh checkout of the repository, because things have changed a lot today.

Big changes to the look-and-feel of the documentation site

This isn’t the end. Instead, it’s the beginning of a journey to try and pull together our documentation into something that feels a bit more cohesive. While the documentation set now looks, and feels, a lot better and is (I think) a lot easier to navigate if you don’t know it well, there is still a lot of pruning and re-writing ahead of me. But we’ve reached the stage where I’m happy, and want to, work on that in public so the community can see how things are changing and can help out.

The post Bring on the documentation appeared first on Raspberry Pi.

Code your own pinball game | Wireframe #53

via Raspberry Pi

Get flappers flapping and balls bouncing off bumpers. Mark Vanstone has the code in the new issue of Wireframe magazine, available now.

There are so many pinball video games that it’s become a genre in its own right. For the few of you who haven’t encountered pinball for some reason, it originated as an analogue arcade machine where a metal ball would be fired onto a sloping play area and bounce between obstacles. The player operates a pair of flippers by pressing buttons on each side of the machine, which will in turn ping the ball back up the play area to hit obstacles and earn points. The game ends when the ball falls through the exit at the bottom of the play area.

NES Pinball
One of the earliest pinball video games – it’s the imaginatively-named Pinball on the NES.


Recreating pinball machines for video games

Video game developers soon started trying to recreate pinball, first with fairly rudimentary graphics and physics, but with increasingly greater realism over time – if you look at Nintendo’s Pinball from 1984, then, say, Devil’s Crush on the Sega Mega Drive in 1990, and then 1992’s Pinball Dreams on PC, you can see how radically the genre evolved in just a few years. In this month’s Source Code, we’re going to put together a very simple rendition of pinball in Pygame Zero. We’re not going to use any complicated maths or physics systems, just a little algebra and trigonometry.


Let’s start with our background. We need an image which has barriers around the outside for the ball to bounce off, and a gap at the bottom for the ball to fall through. We also want some obstacles in the play area and an entrance at the side for the ball to enter when it’s first fired. In this case, we’re going to use our background as a collision map, too, so we need to design it so that all the areas that the ball can move in are black.

Pinball in Python
Here it is: your own pinball game in less than 100 lines of code.


Next, we need some flippers. These are defined as Actors with a pivot anchor position set near the larger end, and are positioned near the bottom of the play area. We detect left and right key presses and rotate the angle of the flippers by 20 degrees within a range of -30 to +30 degrees. If no key is pressed, then the flipper drops back down. With these elements in place, we have our play area and an ability for the player to defend the exit.


All we need now is a ball to go bouncing around the obstacles we’ve made. Defining the ball as an Actor, we can add a direction and a speed parameter to it. With these values set, the ball can be moved using a bit of trigonometry. Our new x-coordinate will move by the sin of the ball direction multiplied by the speed, and the new y-coordinate will move by the cos of the ball direction multiplied by speed. We need to detect collisions with objects and obstacles, so we sample four pixels around the ball to see if it’s hit anything solid. If it has, we need to make the ball bounce.

Get the code

Here’s Mark’s pinball code. To get it working on your system, you’ll need to install Pygame Zero. And to download the full code and assets, head here.

If you wanted more realistic physics, you’d calculate the reflection angle from the surface which has been hit, but in this case, we’re going to use a shortcut which will produce a rough approximation. We work out what direction the ball is travelling in and then rotate either left or right by a quarter of a turn until the ball no longer collides with a wall. We could finesse this calculation further to create a more accurate effect, but we’ll keep it simple for this sample. Finally, we need to add some gravity. As the play area is tilted downwards, we need to increase the ball speed as it travels down and decrease it as it travels up.

All of this should give you the bare bones of a pinball game. There’s lots more you could add to increase the realism, but we’ll leave you to discover the joys of normal vectors and dot products…

Get your copy of Wireframe issue 53

You can read more features like this one in Wireframe issue 53, available directly from Raspberry Pi Press — we deliver worldwide.

And if you’d like a handy digital version of the magazine, you can also download issue 53 for free in PDF format.

The post Code your own pinball game | Wireframe #53 appeared first on Raspberry Pi.

The Computers That Made Britain on sale now

via Raspberry Pi

TL;DR: Computer History nerds, we wrote you a book.

The Computers That Made Britain

The home computer boom of the 1980s brought with it now-iconic machines. Machines that would go on to inspire a generation, such as the ZX Spectrum, BBC Micro, and Commodore 64.

The Computers That Made Britain tells the story of those computers – and what happened behind the scenes during their creation. With dozens of new interviews discover the tales of missed deadlines, technical faults, business interference, and the unheralded geniuses behind all of it. Geniuses who brought to the UK everything from the Dragon 32 and ZX81, through to the Amstrad CPC 464 and the Commodore Amiga.

Get your copy now

You can order your copy of The Computers that Made Britain today online from the Raspberry Pi Press Store. Alternatively, you can buy it in the Raspberry Pi Store in Cambridge, and from other leading online highstreet booksellers, including Waterstones. As always, you can also download the book in PDF format, for free, directly from the Wireframe website.

The Computers That Made Britain hardback book

And now, a little word from our author, Tim Danton

It turns out that when you mention you’re writing a book about computers from the 1980s, you get two reactions. One is best paraphrased by “Awesome!” followed by a rapid check that their favourite is included. The second is a bemused expression and the question, “Why on Earth are you doing that?”

My initial reason for writing the book was simple: curiosity. I cut my computing teeth on the BBC Micro and the ZX Spectrum, but I knew little about their origins. My only recollection of the people behind the products was a hazy image of Sir Clive Sinclair driving a C5 down a busy road.

What I didn’t realise is how fascinating the stories behind these computers would turn out to be. And yes, I know there’s an element of “He would say that,” but as you’ll discover if you buy the book, it’s also 100% true.

It turns out that the 1980s was a boiling pot of controversy packed with all the passion, politics and deal-wrangling that Dallas brought to our TV screens. Except that this time, the power struggles were happening in America’s Silicon Valley and the UK’s Silicon Fen.

This book covers the stories of not just the computers, but the people behind them. Geniuses such as Sophie Wilson and Steve Furber, the co-creators of the ARM processor. Entrepreneurs like Alan Sugar, who applied his “mug’s eyeful” approach of building hi-fi units to computers, with astonishing effect. Industry legends such as Bill Gates and Steve Jobs, who it turns out were willing to play a little dirty to succeed.

The end result is a story of not just 19 computers that upgraded Britain to the digital age, but of the people behind them. It also captures a unique time in our history, when anything could happen. And often did.

But I realise I also need to answer the other question: is your favourite computer in there? Here’s the full list, so you can find out.

  • Acorn Archimedes
  • Acorn Electron
  • Apple II
  • Apple Macintosh
  • Amstrad CPC 464
  • Amstrad PCW 8256
  • Atari 520ST
  • BBC Micro
  • Commodore 64
  • Commodore Amiga
  • Commodore PET 2001
  • Commodore VIC-20
  • Dragon 32
  • IBM Personal Computer (5150)
  • Research Machines 380Z
  • Sinclair QL
  • Sinclair ZX80 and ZX81
  • Sinclair ZX Spectrum

The post The Computers That Made Britain on sale now appeared first on Raspberry Pi.

Weekend Projects to Get You Started with Arduino Cloud

via Arduino Blog

Weekend projects, as we like to call them, are often the most fun. We all have half-a-dozen unfinished projects that we need to work on. But weekend projects are the kind of things you want to work on. Something that isn’t a big commitment, doesn’t take too much effort, and offers a fun result.

As you probably know, the Arduino Cloud underwent a small renovation recently. The free tier got a lot of extra features, and you can even use it for ESP8266 and ESP32 devices now. So if you’d like to take a fun weekend project into the Arduino Cloud, we’ve got a few for you to try out.

Cloud-based TV Remote Control

Control a TV using Arduino

It almost feels like universal remote controls have had their day. They were super popular for a while, as our list of multimedia household gadgets started to grow. But then TV manufacturers stepped up their game, and universal remotes disappeared a bit.

Home automation fans are bringing the concept back, though. There’s still a lot of audio/visual gear that will only interface with you though infrared. So this great Arduino Nano 33 IoT project learns your remote control’s IR commands, and lets you control them through Arduino Cloud. And once it’s in the Cloud, there’s no limit to what you can do in terms of integrating any remote controlled household device into your home auto setup.


Cloud Doorbell Weekend Project

An Arduino Cloud doorbell project

This is an old project now, from back when the Arduino Cloud was just taking shape. But if you’re looking for a great weekend project, it’s still just as relevant as ever.

Although the project calls itself a doorbell, it’s really underselling itself. This is actually a connected access controller you can operate from anywhere. Like, anywhere in the world.

It gets you started by creating a wireless doorbell that plays a tune. But there’s also a relay at the door unit, which lets you control the lock. This could be a maglock, an electronic keep, a solenoid deadbolt, or any other electronic lock. What’s great is the lock itself doesn’t have to connected, or particularly fancy or clever. As long as it can be activated by a relay, this great weekend project makes it into a smart lock.


Integrate Alexa into Arduino Weekend Projects

Add Alexa to your Arduino weekend projects

Chances are you’ve already got lots of great maker projects around the house. And if you’re anything like us, you regularly tinker with them to make them better (or to break them). So a great weekend project doesn’t have to be brand new. You could just have fun adding new features to an old project.

Alexa, for example. This is a super easy way to add one of the world’s most advanced voice control functions to anything.

Follow along with the project to connect your Arduino Cloud account with Alexa. Once the skill is in place, you’ve effectively got a whole new way to easily interact with any project. Great for home auto devices, or you could even make your TV voice controlled if you combined it with the project above!


Get Your Sketches Organized in the Cloud

Import your sketches into Arduino Cloud the easy way

We make no secret that the Arduino Cloud Web Editor is the easiest, smoothest way to program your boards. All your boards; not just Arduinos. Once you’ve used it, it’s one of those features that you can’t imagine how you lived without.

But seasoned makers probably have a whole library of projects and sketches saved locally. It’s inevitable, after using the Arduino IDE for years. This weekend you could do what you’ve been promising yourself for a long time. Get organized with your work.

Moving your sketches and work into the Cloud is the first step in bringing a lot of awesome projects back to life. They’re instantly endowed with lots of new connectivity features, and the Web Editor makes it a pleasure to refine your old code.

Here’s how to import your work into Arduino Cloud the easy way. Then next weekend, you’ll be rich with ideas for what your next project will be!


Arduino Cloud Sensor Tower

Arduino Cloud sensor tower weekend project

If you’re looking for more ambitious weekend projects, a sensor tower is awesome. It’s something we’ve considered a few times, especially around home automation. When your heating or lighting is automated, you need sensors to give feed them data, or they’re useless. Which is fine, if you can get those sensors into the right location.

This Cloud-based project combines temperature, humidity, movement, luminosity and even a gas detector into one handy package. You don’t have to include them all, or you can add more. Totally up to you. What’s exciting about this is how it lets you locate the sensors in exactly the right place for optimal data collection.

Arduino Cloud’s device-to-device communication (which was added after this project was published) makes communication incredibly simple. Building the sensor box is one thing, but now you can harness the data in new and incredibly flexible ways. Build the tower this weekend, and spend next weekend integrating the data into your whole home auto setup.


Make sure you share your weekend projects with us on social media. And if you’re taking this opportunity to get started with the Arduino Cloud, here’s where you begin.

The post Weekend Projects to Get You Started with Arduino Cloud appeared first on Arduino Blog.

Raspberry Silicon update: RP2040 on sale now at $1

via Raspberry Pi

Back in January, we launched Raspberry Pi Pico. This was a new kind of product for us: our first microcontroller-class board, and the first to be built on RP2040, a chip designed here at Raspberry Pi. At the same time, we announced RP2040-based products from our friends at Adafruit, Arduino, Sparkfun, and Pimoroni.

Today, we’re announcing the logical next step: RP2040 chips are now available from our Approved Reseller partners in single-unit quantities, allowing you to build your own projects and products on Raspberry Silicon.

RP2040: the microcontroller, perfected

RP2040 is our idea of the perfect mid-range microcontroller, based on years of using other vendors’ devices in our own products and projects. It stands out in three key ways:

  • Two fast CPU cores. A pair of ARM Cortex-M0+ cores, clocked at 133 MHz, provide ample integer performance. Use one core to run application code, and the other to supervise hardware; or run application code on both cores with FreeRTOS or MicroPython.
  • Plenty of RAM. With 264KB of RAM, you can concentrate on implementing features, not optimising your application for size. A fully connected switch connects ARM cores and DMA engines to six independent RAM banks, allowing you to squeeze every last drop of performance out of the system.
  • Flexible I/O. We provide all the usual interfaces: hardware UARTs, SPI and I2C controllers, USB 1.1, and a four-channel ADC. But it’s the programmable I/O (PIO) subsystem that makes RP2040 stand out, enabling software implementations of protocols including SDIO, DPI, I2S, and even DVI-D.

All of this is packed into 2 mm² of 40 nm silicon, in a 7×7 mm QFN56 package.

Early progress

A lot has happened since January. We’ve shipped over 600,000 Raspberry Pi Picos, and have taken orders for 700,000 more. Graham has continued to build out the SDK, most recently adding FreeRTOS support. And hundreds of people have been in touch asking for RP2040 samples, many via our patented “Secret Twitter Samples Program”. Some of these are maker businesses that have found themselves effectively unable to build products this year due to the global semiconductor shortage.

Based on this experience, we’ve decided to pull about 40,000 units of RP2040 out of the supply chain and boot up single-unit sales via our Approved Resellers, roughly three months earlier than we’d intended. This will give people time to develop their projects and products, while we clear out the rest of the Pico backlog and scale up production of RP2040. In the autumn we’ll have some serious volume available for anyone who needs it.

Reely, reely good

The single-unit price of RP2040 is $1, giving you a lot of bang for your (literal) buck. We’re still figuring out what reel-scale pricing will look like in the autumn, but we expect it to be significantly lower than that.

So head on over to the product page to order your first chips. When you’re ready to take your RP2040-based project to scale, we’ll be waiting for you.

The post Raspberry Silicon update: RP2040 on sale now at $1 appeared first on Raspberry Pi.