diff --git a/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/_index.md b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/_index.md new file mode 100644 index 0000000000..1e88d07fcf --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/_index.md @@ -0,0 +1,62 @@ +--- +title: Migrate applications between ARM platforms with AI assistance + +minutes_to_complete: 60 + +who_is_this_for: This learning path is for developers migrating applications between ARM platforms using Kiro's ARM SoC Migration Power. Learn the workflow through a practical example migrating from AWS Graviton to Raspberry Pi 5. + +learning_objectives: + - Install and configure Kiro's ARM SoC Migration Power for any ARM SoC migration + - Understand the migration workflow applicable to various ARM platforms + - Use AI-guided migration to identify platform-specific code + - Create Hardware Abstraction Layers with power assistance + - Validate migrations with automated analysis + +prerequisites: + - Access to source and target ARM platforms (example uses AWS Graviton and Raspberry Pi 5) + - Basic understanding of C programming + - Familiarity with embedded systems or cloud computing concepts + +author: Daniel Schleicher + +### Tags +skilllevels: Advanced +subjects: Migration to Arm +armips: + - Neoverse-V1 + - Cortex-A76 +operatingsystems: + - Linux +tools_software_languages: + - Kiro + - AWS EC2 + - GCC + - C + - CMake + +further_reading: + - resource: + title: Kiro ARM SoC Migration Power Documentation + link: https://kiro.dev/powers/arm-soc-migration + type: documentation + - resource: + title: AWS Graviton Technical Guide + link: https://aws.amazon.com/ec2/graviton/ + type: documentation + - resource: + title: Raspberry Pi 5 Documentation + link: https://www.raspberrypi.com/documentation/ + type: documentation + - resource: + title: Arm Architecture Reference + link: https://developer.arm.com/documentation + type: documentation + - resource: + title: BCM2712 Peripherals Datasheet + link: https://datasheets.raspberrypi.com/bcm2712/bcm2712-peripherals.pdf + type: documentation + +### FIXED, DO NOT MODIFY +weight: 1 +layout: learningpathall +--- diff --git a/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/_next-steps.md b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/_next-steps.md new file mode 100644 index 0000000000..c3db0de5a2 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/_next-steps.md @@ -0,0 +1,8 @@ +--- +# ================================================================================ +# FIXED, DO NOT MODIFY THIS FILE +# ================================================================================ +weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation. +title: "Next Steps" # Always the same, html page title. +layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing. +--- diff --git a/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/graviton-development.md b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/graviton-development.md new file mode 100644 index 0000000000..04514412c4 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/graviton-development.md @@ -0,0 +1,84 @@ +--- +title: Develop on source platform +weight: 3 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Develop application on source ARM platform + +This section demonstrates developing an application on your source ARM platform. The example uses AWS Graviton as the source platform, but the principles apply to any ARM SoC migration (e.g., from Raspberry Pi 4 to Pi 5, from i.MX8 to Jetson, etc.). + +The workflow keeps your development environment (Kiro IDE) local while using the Graviton instance as a test platform. This mirrors real-world scenarios where you develop locally and deploy to remote ARM systems. + +### Download Application on Local Machine + +Download the sensor-monitor application to your local machine where Kiro IDE is running. This allows you to inspect the code and use Kiro's migration tools. + +```bash +wget https://github.com/ArmDeveloperEcosystem/arm-learning-paths/raw/main/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/projects/sensor-monitor.tar.gz +tar -xzf sensor-monitor.tar.gz +cd sensor-monitor +``` + +The package includes complete source code, Makefile, and platform-specific implementations. + +### Upload to Graviton Instance for Testing + +Transfer the application to your Graviton instance to verify it works on the source ARM platform before migration. + +Upload the application to your Graviton instance: + +```bash +scp -i graviton-migration-key.pem sensor-monitor.tar.gz ec2-user@$(aws ec2 describe-instances --filters "Name=tag:Name,Values=graviton-migration-source" "Name=instance-state-name,Values=running" --query 'Reservations[0].Instances[0].PublicIpAddress' --output text):~ +``` + +### Build and Test on Graviton + +Now verify the application builds and runs correctly on the Graviton platform. This establishes your baseline before migration. + +SSH to your Graviton instance and build the application: + +```bash +ssh -i graviton-migration-key.pem ec2-user@$(aws ec2 describe-instances --filters "Name=tag:Name,Values=graviton-migration-source" "Name=instance-state-name,Values=running" --query 'Reservations[0].Instances[0].PublicIpAddress' --output text) +``` + +On the Graviton instance: + +```bash +tar -xzf sensor-monitor.tar.gz +cd sensor-monitor +make +./sensor_monitor +``` + +### Application Overview + +The sensor-monitor application demonstrates a typical embedded/IoT pattern: + +**Project Structure:** +``` +sensor-monitor/ +├── src/main.c # Main application logic +├── include/sensor.h # Sensor interface +├── platform/graviton/sensor_graviton.c # Graviton implementation +├── platform/rpi5/ # Target platform (created during migration) +├── Makefile # Build configuration +└── README.md # Documentation +``` + +**Key Components:** + +`src/main.c` - Main application that reads sensor data in a loop +`include/sensor.h` - Hardware abstraction interface +`platform/graviton/sensor_graviton.c` - Simulated sensor for cloud development + +## Expected Output + +You should see: +- Working application on your source ARM platform (Graviton in this example) +- Simulated sensor readings +- Validated business logic + +This establishes your baseline application before migration to the target platform. diff --git a/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/migration.md b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/migration.md new file mode 100644 index 0000000000..c5fbf3bd78 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/migration.md @@ -0,0 +1,188 @@ +--- +title: Migrate using ARM SoC Migration Power +weight: 4 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Use ARM SoC Migration Power for AI-guided migration + +This section demonstrates how to use the ARM SoC Migration Power to migrate your application between ARM SoCs. The example shows migration from AWS Graviton to Raspberry Pi 5, but the workflow applies to any ARM-to-ARM migration. + +### Initiate Migration + +Open Kiro and tell the ARM SoC Migration Power about your migration. Specify your source and target platforms: + +**Example prompt:** +``` +I want to use the ARM SoC Migration Power to migrate my sensor monitoring +application from AWS Graviton3 to Raspberry Pi 5 (BCM2712). The application +currently uses simulated sensors on Graviton and needs to work with real +GPIO and SPI hardware on the Pi 5. +``` + +**General pattern:** +``` +I want to migrate my [application type] from [source ARM SoC] to [target ARM SoC]. +The application uses [source-specific features] and needs [target-specific features]. +``` + +### Discovery Phase + +The power will prompt you for information about your platforms: + +**Example for Graviton → Raspberry Pi 5:** +``` +Source Platform: AWS Graviton3 (Neoverse-V1, cloud development) +Target Platform: Raspberry Pi 5 (BCM2712, Cortex-A76, edge deployment) +Hardware Requirements: GPIO for LEDs, SPI for temperature sensor +``` + +Then ask the power to scan your codebase: + +**Example:** +``` +Scan my codebase for Graviton-specific code that needs migration to BCM2712. +Focus on sensor interfaces and any cloud-specific assumptions. +``` + +**General pattern:** +``` +Scan my codebase for [source platform]-specific code that needs migration to [target platform]. +Focus on [platform-specific features]. +``` + +### Architecture Analysis + +Ask the power to compare your source and target platforms: + +**Example:** +``` +Compare Graviton3 and BCM2712 architecture capabilities. What are the key +differences I need to handle for cloud-to-edge migration? +``` + +**Example output for Graviton → Pi 5:** +- CPU differences (Neoverse-V1 vs Cortex-A76) +- Memory constraints (cloud 64GB+ vs edge 4-8GB) +- SIMD capabilities (SVE vs NEON) +- Peripheral requirements (none vs GPIO/SPI/I2C) + +The power analyzes architecture differences for any ARM SoC pair and identifies migration challenges. + +### HAL Design + +Ask the power to design a Hardware Abstraction Layer for your platforms: + +**Example:** +``` +Help me design a HAL layer that supports both Graviton (cloud mocks) and +BCM2712 (real hardware). I need GPIO and SPI abstraction. +``` + +**General pattern:** +``` +Help me design a HAL layer that supports both [source platform] and [target platform]. +I need [feature] abstraction. +``` + +The power will guide you to create platform-agnostic interfaces. Example `hal/sensor.h`: + +```c +typedef struct { + int (*init)(void); + float (*read_temperature)(void); + void (*cleanup)(void); +} sensor_hal_t; + +extern const sensor_hal_t *sensor_hal; +``` + +### Implementation + +Ask the power for target platform-specific implementation: + +**Example:** +``` +Help me refactor my sensor code for BCM2712 compatibility. Show me how to +implement real SPI sensor communication for the Pi 5. +``` + +**General pattern:** +``` +Help me implement [feature] for [target platform]. Show me how to [specific requirement]. +``` + +The power will provide target platform-specific code. Example for `platform/bcm2712/sensor_bcm2712.c`: + +```c +#include "hal/spi.h" + +int sensor_init(void) { + return spi_init(0, 1000000); // SPI bus 0, 1MHz +} + +float sensor_read_temperature(void) { + uint8_t data[2]; + spi_read(data, 2); + // Convert raw SPI data to temperature + int16_t raw = (data[0] << 8) | data[1]; + return raw * 0.0625; // Typical temp sensor conversion +} + +void sensor_cleanup(void) { + spi_cleanup(); +} +``` + +### Build Configuration + +Ask the power to update your build system for multi-platform support: + +**Example:** +``` +Update my build system for dual Graviton/BCM2712 support with proper +platform selection and cross-compilation. +``` + +**General pattern:** +``` +Update my build system for [source platform]/[target platform] support with proper +platform selection and cross-compilation. +``` + +The power will generate a platform-aware build configuration. Example `CMakeLists.txt`: + +```cmake +cmake_minimum_required(VERSION 3.16) +project(sensor_monitor) + +set(TARGET_PLATFORM "GRAVITON" CACHE STRING "Target Platform") +set_property(CACHE TARGET_PLATFORM PROPERTY STRINGS "GRAVITON" "BCM2712") + +# Common sources +set(COMMON_SOURCES src/main.c) + +# Platform-specific sources +if(TARGET_PLATFORM STREQUAL "GRAVITON") + set(PLATFORM_SOURCES platform/graviton/sensor_graviton.c) +elseif(TARGET_PLATFORM STREQUAL "BCM2712") + set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) + set(PLATFORM_SOURCES + platform/bcm2712/sensor_bcm2712.c + platform/bcm2712/spi_bcm2712.c) +endif() + +add_executable(sensor_monitor ${COMMON_SOURCES} ${PLATFORM_SOURCES}) +``` + +## Expected Output + +After this section, you should have: +- Power-analyzed architecture differences between your source and target platforms +- Power-designed HAL interfaces that abstract platform differences +- Power-generated platform-specific code for both platforms +- Power-configured build system with platform selection + +This workflow applies to any ARM SoC migration, not just Graviton to Raspberry Pi 5. diff --git a/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/projects/README.md b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/projects/README.md new file mode 100644 index 0000000000..6767d0db3b --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/projects/README.md @@ -0,0 +1,32 @@ +# ARM SoC Migration Learning Path - Project Files + +This directory contains downloadable project files for the ARM SoC Migration Learning Path. + +## sensor-monitor.tar.gz + +Complete sensor monitoring application for the migration tutorial. + +**Contents:** +- Source code for sensor monitoring application +- Platform-specific implementations (Graviton and Raspberry Pi 5) +- Makefile for easy building +- Complete project structure + +**Usage on Graviton EC2:** +```bash +wget https://github.com/ArmDeveloperEcosystem/arm-learning-paths/raw/main/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/projects/sensor-monitor.tar.gz +tar -xzf sensor-monitor.tar.gz +cd sensor-monitor +make +./sensor_monitor +``` + +**What's included:** +- `src/main.c` - Main application logic +- `include/sensor.h` - Sensor hardware abstraction interface +- `platform/graviton/sensor_graviton.c` - Graviton-specific implementation +- `platform/rpi5/` - Directory for Raspberry Pi 5 target (populated during migration) +- `Makefile` - Build configuration +- `README.md` - Detailed documentation + +This pre-built package eliminates manual file creation and lets users focus on the migration workflow. diff --git a/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/projects/sensor-monitor.tar.gz b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/projects/sensor-monitor.tar.gz new file mode 100644 index 0000000000..315a25c667 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/projects/sensor-monitor.tar.gz differ diff --git a/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/setup.md b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/setup.md new file mode 100644 index 0000000000..e060dfa163 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/setup.md @@ -0,0 +1,125 @@ +--- +title: Install ARM SoC Migration Power +weight: 2 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Install and configure Kiro's ARM SoC Migration Power + +This section guides you through installing Kiro IDE, the ARM SoC Migration Power, and setting up the required development tools. These steps apply to any ARM SoC migration project. + +### Install Kiro IDE + +Kiro IDE provides AI-powered development assistance and hosts the ARM SoC Migration Power that will guide you through the migration process. + +Download and install Kiro IDE for your platform: + +**macOS:** +```bash +brew install --cask kiro +``` + +**Windows and Linux:** +Download from [https://kiro.dev](https://kiro.dev) + +Launch Kiro IDE after installation. + +### Install the Power in Kiro + +The ARM SoC Migration Power extends Kiro with specialized knowledge and tools for migrating applications between ARM platforms. + +1. Open Kiro IDE +2. Navigate to Powers panel. Press Cmd + Shift + P (Mac) or Ctrl + Shift + P (Windows) +3. Click on the ARM SoC Migration Power in the Reocommended section +4. Click Install + +### Verify Installation + +Test the power by saying: "I just installed the arm-soc-migration power and want to use it." + +The power will guide you through any additional setup needed and supports migrations between various ARM SoCs including AWS Graviton, Raspberry Pi, NVIDIA Jetson, NXP i.MX, and more. + +### Install Prerequisites + +The ARM SoC Migration Power uses an MCP (Model Context Protocol) server to provide specialized ARM migration capabilities. This server runs via Docker. + +Install Docker (required for ARM MCP server): + +**macOS:** +```bash +brew install --cask docker +``` + +**Linux:** +```bash +# Ubuntu/Debian +sudo apt-get update +sudo apt-get install -y docker.io + +# Or use Docker's official installation script +curl -fsSL https://get.docker.com -o get-docker.sh +sudo sh get-docker.sh +``` + +**Windows:** +Download Docker Desktop from [https://www.docker.com/products/docker-desktop](https://www.docker.com/products/docker-desktop) + +Verify installation: +```bash +docker --version +``` + +{{% notice Note %}} +Ensure Docker is running before using the ARM SoC Migration Power. The power will automatically pull and run the ARM MCP server container when needed. +{{% /notice %}} + +### Launch AWS Graviton Instance (Source Platform) + +{{% notice Note %}} +Before proceeding, ensure you are authenticated with AWS CLI. You must have valid AWS credentials configured to create and manage EC2 instances. + +Verify your AWS CLI authentication: +```bash +aws sts get-caller-identity +``` + +If you see an error or need to configure AWS CLI, follow the [AWS CLI Configuration Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) to set up your credentials. +{{% /notice %}} + +We'll use an AWS Graviton instance as our source platform to demonstrate the migration workflow. Graviton provides a cloud-based ARM environment that's easy to set up and tear down. + +Create an SSH key, security group, and launch a c7g.medium Graviton instance: + +```bash +aws ec2 create-key-pair --key-name graviton-migration-key --query 'KeyMaterial' --output text > graviton-migration-key.pem && chmod 400 graviton-migration-key.pem && SG_ID=$(aws ec2 create-security-group --group-name graviton-migration-sg --description "Security group for ARM SoC migration" --query 'GroupId' --output text) && aws ec2 authorize-security-group-ingress --group-id $SG_ID --protocol tcp --port 22 --cidr 0.0.0.0/0 && aws ec2 run-instances --image-id $(aws ec2 describe-images --owners amazon --filters "Name=name,Values=al2023-ami-2023*-arm64" "Name=state,Values=available" --query 'reverse(sort_by(Images, &CreationDate))[0].ImageId' --output text) --instance-type c7g.medium --key-name graviton-migration-key --security-group-ids $SG_ID --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=graviton-migration-source}]' --query 'Instances[0].InstanceId' --output text +``` + +Wait ~30 seconds for the instance to start, then get the SSH command: + +```bash +echo "ssh -i graviton-migration-key.pem ec2-user@$(aws ec2 describe-instances --filters "Name=tag:Name,Values=graviton-migration-source" "Name=instance-state-name,Values=running" --query 'Reservations[0].Instances[0].PublicIpAddress' --output text)" +``` + +Copy and paste the output to connect to your instance. + +### Install Development Tools on Graviton Instance + +The Graviton instance needs basic build tools (gcc, make) to compile the sensor-monitor application. We'll also install wget and tar for downloading and extracting files. + +Once connected to your Graviton instance, install the required build tools: + +```bash +sudo dnf install -y gcc make wget tar +``` + +## Expected Output + +After completing this section, you should have: +- Kiro IDE installed locally with ARM SoC Migration Power active +- AWS Graviton c7g.medium instance running with build tools installed +- SSH key saved locally for secure access +- Ready to develop and test on the source platform + +Next, you'll download the sample application locally and deploy it to the Graviton instance for testing. diff --git a/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/validation.md b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/validation.md new file mode 100644 index 0000000000..3ad309dfec --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/arm-soc-migration-learning-path/validation.md @@ -0,0 +1,124 @@ +--- +title: Validate migration with testing +weight: 5 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Validate migration using power's testing recommendations + +This section guides you through validating your ARM SoC migration using the ARM SoC Migration Power's testing recommendations. The example shows Graviton to Raspberry Pi 5, but the validation approach applies to any ARM platform migration. + +### Source Platform Build Verification + +Ask the power to verify your source platform build: + +**Example:** +``` +Help me verify my Graviton build still works after adding BCM2712 support. +``` + +**General pattern:** +``` +Help me verify my [source platform] build still works after adding [target platform] support. +``` + +Follow the power's guidance. Example for Graviton: + +```bash +cmake -DTARGET_PLATFORM=GRAVITON -B build-graviton +cmake --build build-graviton +./build-graviton/sensor_monitor +``` + +### Cross-Compilation for Target Platform + +Ask the power for cross-compilation guidance: + +**Example:** +``` +Guide me through cross-compiling for BCM2712 and deploying to Raspberry Pi 5. +``` + +**General pattern:** +``` +Guide me through cross-compiling for [target platform] and deploying to [target device]. +``` + +Follow the power's commands. Example for Raspberry Pi 5: + +```bash +cmake -DTARGET_PLATFORM=BCM2712 -B build-bcm2712 +cmake --build build-bcm2712 + +# Deploy to target device +scp build-bcm2712/sensor_monitor pi@raspberrypi5:~/ +``` + +### Target Platform Testing + +Ask the power for platform-specific tests: + +**Example:** +``` +What tests should I run on the Raspberry Pi 5 to validate the migration? +``` + +**General pattern:** +``` +What tests should I run on [target platform] to validate the migration from [source platform]? +``` + +The power will recommend platform-appropriate tests. Example for Raspberry Pi 5: +- GPIO functionality tests +- SPI communication validation +- Real sensor reading verification +- Timing consistency checks + +Run the application on your target platform. Example: + +```bash +ssh pi@raspberrypi5 +./sensor_monitor +``` + +### Performance Comparison + +Ask the power to compare platform performance: + +**Example:** +``` +Compare performance between Graviton development and BCM2712 deployment. +``` + +**General pattern:** +``` +Compare performance between [source platform] and [target platform] for my application. +``` + +The power will analyze platform-specific characteristics. Example analysis: +- CPU performance differences +- Memory usage comparison +- I/O timing characteristics +- Power consumption differences + +## Expected Output + +After completing validation, you should have: +- Validated source platform build +- Cross-compiled target platform binary +- Power-verified platform-specific tests passing +- Performance comparison report + +## Key Takeaways + +1. **AI-Assisted Migration is Powerful** - The ARM SoC Migration Power provides expert guidance for any ARM-to-ARM migration, with automated architecture analysis and code generation following best practices. + +2. **Platform Abstraction is Essential** - HAL layers enable development on one platform while maintaining compatibility with others. The same business logic runs across different ARM SoCs. + +3. **The Power Enforces Safety** - It preserves functional behavior during migration, validates architecture compatibility, and recommends proper testing strategies for your specific platforms. + +4. **Workflow is Universal** - Discovery → Analysis → Planning → Implementation → Validation applies to any ARM SoC migration, whether cloud-to-edge, edge-to-edge, or cloud-to-cloud. + +5. **Example is Adaptable** - While this learning path uses Graviton to Raspberry Pi 5 as an example, the same workflow applies to migrations like i.MX8 to Jetson, Raspberry Pi 4 to Pi 5, or any other ARM platform combination.