Skip to content

Commit

Permalink
Merge branch 'ArmDeveloperEcosystem:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
KeilChris authored Feb 9, 2024
2 parents e3d5880 + aa6a129 commit 777e85b
Show file tree
Hide file tree
Showing 30 changed files with 834 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions content/install-guides/arduino-pico.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: Arduino core for the Raspberry Pi Pico
author_primary: Michael Hall
additional_search_terms:
- arduino
- raspberrypi
- pico

layout: installtoolsall
minutes_to_complete: 15
official_docs: https://docs.aws.amazon.com/greengrass/v2/developerguide/quick-installation.html
prerequisites: Arduino IDE
test_images:
- ubuntu:latest
tool_install: true
multi_install: false
multitool_install_part: false

weight: 1
---

You can install the Arduino IDE and Arduino core software for the Raspberry Pi Pico and the Raspberry Pi Pico W.

Arduino core is the software stack that powers Arduino devices and development boards. While the Raspberry Pi Pico isn't an Arduino board, it uses the same RP2040 SoC as the Arduino RP2040 Connect, and therefore can run the same Arduino core software.

## Install Arduino IDE

First, you need to install the Arduino IDE on your laptop or desktop. You can download it for your operating system from [the Arduino Software website](https://www.arduino.cc/en/software). Follow the provided instructions for installing the IDE.

Start the IDE by clicking the Arduino IDE icon.

## Install board support package

The Arduino software is comprised of the core libraries and a Board Support Package that is specific to your device. You need to install the `Arduino Mbed OS RP2040 Boards` package to support the Raspberry Pi Pico.

You can install this package by opening the `Boards Manager`.

From the menu select `Tools -> Board -> Boards Manager`.

When the `Boards Manager` opens search for `pico` and the `Arduino Mbed OS RP2040 Boards` will be displayed. Click the `Install` button to add it to the Arduino IDE.

![Arduino Board Manager](/install-guides/_images/arduino_rp2040_boards.png)

### Raspberry Pi Pico W

The `Boards Manager` package for for `Arduino Mbed OS RP2040 Boards` does not include the Raspberry Pi Pico W.

If you want to use the Pico W go to `File -> Preferences` (or `Arduino IDE -> Settings` on macOS) and enter the URL below into the `Additional Boards Manager URLs` field:

```console
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
```

Return to `Tools -> Board -> Boards Manager` and search for `pico` and you will see a new entry `Raspberry Pi Pico/RP2040`. Click the `Install` button to add it to the Arduino IDE.

## Select your board

Once the support package is installed, you need to tell the Arduino IDE which supported board you will be using. From the `Tools -> Board` menu, find and select `Raspberry Pi Pico` or `Raspberry Pi Pico W` depending on your board type.

![Arduino Board Selection](/install-guides/_images/arduino_rp2040_select.png)

## Upload to your board

Because the Raspberry Pi Pico doesn't come with the Arduino core software installed, the Arduino IDE won't recognize it.

To fix that, you must upload a sketch. A sketch is another name for an Arduino software application.

Go to `File -> Examples -> 01.Basics -> Blink` and load the sketch.

Click the upload button (right arrow icon) and wait for the sketch to be uploaded.

You should see the LED on your Raspberry Pi Pico blink on and off every second.

{{% notice Note %}}
If you have trouble uploading a sketch, unplug the board, press and hold the `BOOTSEL` button on the board, plug it in, and then release the button.
{{% /notice %}}

You are ready to start writing your own Arduino sketches for Raspberry Pi Pico.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions content/learning-paths/microcontrollers/arduino-pico/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "Embedded programming with the Raspberry Pi Pico"

minutes_to_complete: 10

who_is_this_for: This is an introductory topic for software developers interested in embedded programming.
minutes_to_complete: 60

learning_objectives:
- Understand the basics of embedded programming
- Know the differences between embedded and application development
- Write a simple embedded application
- Run your embedded application on a Raspberry Pi Pico

prerequisites:
- The [Arduino IDE with the RP2040 board support package](/install-guides/arduino-pico/) installed on your computer
- A [RaspberryPi Pico](https://www.raspberrypi.com/products/raspberry-pi-pico/) board
- A [PIR sensor](https://www.amazon.com/HiLetgo-HC-SR501-Infrared-Sensor-Arduino/dp/B07KZW86YR/ref=sr_1_3?keywords=pir+sensor&qid=1698432931&sr=8-3) for detecting motion
- A [peizo-electric buzzer](https://www.amazon.com/mxuteuk-Electronic-Computers-Printers-Components/dp/B07VK1GJ9X/ref=sr_1_4?crid=2FAXYI17HZKDB&keywords=piezo+buzzer&qid=1698432968&sprefix=peizo%2Caps%2C148&sr=8-4) for signaling motion

author_primary: Michael Hall

### Tags
skilllevels: Introductory
subjects: RTOS
armips:
- Cortex-M
tools_software_languages:
- Arduino


### FIXED, DO NOT MODIFY
# ================================================================================
weight: 1 # _index.md always has weight of 1 to order correctly
layout: "learningpathall" # All files under learning paths have this same wrapper
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
next_step_guidance: Now that you have some microcontroller experience, check out another programming environment for the Raspberry Pi Pico.

recommended_path: /learning-paths/microcontrollers/rpi_pico/

further_reading:
- resource:
title: Arduino-Pico
link: https://arduino-pico.readthedocs.io/en/latest/index.html
type: documentation
- resource:
title: Raspberry Pi Pico documentation
link: https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html
type: documentation

# ================================================================================
# FIXED, DO NOT MODIFY
# ================================================================================
weight: 21 # set to always be larger than the content in this path, and one more than 'review'
title: "Next Steps" # Always the same
layout: "learningpathall" # All files under learning paths have this same wrapper
---
67 changes: 67 additions & 0 deletions content/learning-paths/microcontrollers/arduino-pico/_review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
review:
- questions:
question: >
What makes embedded programming different from application programming?
answers:
- Embedded software requires the use of assembly language
- Embedded software doesn't use language constructs like classes and functions
- Embedded software typically runs on resource-limited hardware
correct_answer: 3
explanation: >
Fundamentally, there is no difference between embedded programming and application programming. The biggest difference is the hardware resources available to your program.
- questions:
question: >
You can only write Arduino code for Arduino brand devices.
answers:
- "True"
- "False"
correct_answer: 2
explanation: >
The Arduino core software works with board support packages that cover a number of boards, not all of these are Arduino branded. For example, the Raspberry Pi branded Pico board is not from Arduino.
- questions:
question: >
Which function of your sketch does Arduino core call when your board first starts up?
answers:
- main()
- setup()
- loop()
- delay()
correct_answer: 2
explanation: >
Arduino sketches don't have a main() function, instead Arduino core calls the setup() function at start.
- questions:
question: >
Which function of your sketch does Arduino core call continuously after it has started?
answers:
- main()
- setup()
- loop()
- delay()
correct_answer: 3
explanation: >
After startup, Arduino core calls loop() continuously.
- questions:
question: >
What happens when your loop() function completes?
answers:
- Your setup() function will be called again
- Your loop() function will be called again
- Your Sketch will stop running
- Your board will turn off
correct_answer: 2
explanation: >
Arduino core continuously calls loop() until you call exit() or the board loses power.
# ================================================================================
# FIXED, DO NOT MODIFY
# ================================================================================
title: "Review" # Always the same title
weight: 20 # Set to always be larger than the content in this path
layout: "learningpathall" # All files under learning paths have this same wrapper
---
43 changes: 43 additions & 0 deletions content/learning-paths/microcontrollers/arduino-pico/app_stack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# User change
title: "Application Programming"

weight: 3 # 1 is first, 2 is second, etc.

# Do not modify these elements
layout: "learningpathall"
---

# The application stack

Application developers will be familiar with this traditional computing stack, whether their target devices were desktops, mobile phones, or the cloud, it would be the same.

![Traditional stack](_images/traditional_stack.png)

## Hardware

At the bottom of the stack you have the physical hardware. As an application developer, the extent that you typically care about this layer is "how much and how fast". You know your application will need some amount of CPU, RAM, and storage, but beyond that you don't need to know or care about the specifics, because you'll never actually talk to the hardware directly.

## Firmware

One thing that made the PC revolution possible was the use of firmware, or BIOS, that could sit between the hardware layer and the software layer, and provide a set of interfaces for communication between them. This allows a single operating system image, like Windows or Ubuntu, to be installed on any PC, without the image having to be customized for that specific PC's hardware. It's the firmware that allows the OS to boot, discover what hardware is available, and provide an interface to talk to them.

If you've ever wondered why there's not a generic Android install image that you can use for any mobile phone, this is why, mobile phones don't have this firmware layer.

## Software

The software is everything that lives on the hard drive or flash storage, and gets loaded up onto the hardware to run. Most of us don't think of it as all being the same, the kernel and your application are very different in *kind* after all. In reality that distinction is just there to make our lives simpler, and the computing stack easier to understand, the underlying hardware and firmware see it as all the same thing.

### Kernel

Every modern operating system, whether it's Windows, Mac OS, or Linux, has at its core a kernel (hence the name). The kernel is what gets loaded first by the firmware, and it's responsible for running all other processes, including applications, and interactions between processes and the hardware. It's the kernel that will load your application's code into memory, and start executing it on the CPU. It provides interfaces to access the storage (hard drive or flash) via a filesystem, interfaces to peripherals like a monitor, mouse and keyboard, and even handles memory management for you.

### Operating System

Most people think of the kernel and the operating system as the same thing, but as any long-time Linux user will know the kernel is only part of it, you also need a large collection of code, libraries and programs to make up a complete operating system. All the standard command-line tools, system services, and the like, combined with a kernel, is what you typically think of as a complete operating system.

### Application

And only now do you get to an application. An application is a collection of code, sometimes a single binary file but more often a package of files, that can be executed by the operating system. This is the space that most of us work in, and it means you can largely ignore the operating system and kernel layers, and completely ignore the firmware and hardware layers.

But if you want to transition to the embedded space, things are going to look a little bit different.
Loading

0 comments on commit 777e85b

Please sign in to comment.