Skip to content

Commit bed8352

Browse files
author
sidart
committed
Summary: Add Initial support to pico2 (Arm Cortex M)
Test Plan: TBD Reviewers: Subscribers: Tasks: Tags:
1 parent 4744ff5 commit bed8352

File tree

9 files changed

+396
-0
lines changed

9 files changed

+396
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ install(FILES tools/cmake/Utils.cmake tools/cmake/executorch-config.cmake
494494

495495
if(EXECUTORCH_BUILD_ARM_BAREMETAL)
496496
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/arm)
497+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/examples/arm/rp_pi)
497498
endif()
498499

499500
if(EXECUTORCH_BUILD_CADENCE)

examples/arm/rp_pi/CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
# Copyright 2023-2025 Arm Limited and/or its affiliates.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
cmake_minimum_required(VERSION 3.10)
9+
project(pico)
10+
11+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
12+
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../)
13+
14+
15+
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/arm-cortex-m0plus-toolchain.cmake)
16+
17+
# Only include here, NOT in arm-cortex-m0plus-toolchain.cmake
18+
include(${CMAKE_SOURCE_DIR}/tools/cmake/Codegen.cmake)
19+
20+
target_sources(executorch_core PRIVATE ${CMAKE_CURRENT_LIST_DIR}/syscall_stubs.c)
21+
#gen_selected_ops(LIB_NAME "portable_ops_lib" ROOT_OPS "aten::add.out")

examples/arm/rp_pi/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## Overview
2+
This document outlines the steps required to run a simple Add Module on the Pico2 microcontroller using executorch.
3+
## Steps
4+
5+
### (Pre-requisistes) Prepare the Environment for Arm
6+
1. See <a href="docs/source/backends-arm-ethos-u.md"/> for instructions on setting up the environment for Arm.
7+
2. Make sure you have the toolchain configured correctly.
8+
```bash
9+
which arm-none-eabi-gcc
10+
``` should return something like 'executorch/examples/arm/ethos-u-scratch/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc'
11+
12+
### 1. Cross Compile Executorch for Arm Cortex M Target
13+
To begin, navigate to the executorch root directory and execute the following commands:
14+
```bash
15+
mkdir baremetal_build
16+
cd baremetal_build
17+
cmake .. -DCMAKE_TOOLCHAIN_FILE=./examples/arm/rp_pi/pico2/arm-cortex-m0plus-toolchain.cmake -DEXECUTORCH_BUILD_ARM_BAREMETAL=ON -DCMAKE_BUILD_TYPE=Release -DROOT_OPS=aten::add.out
18+
cmake --build . -j$(nproc)
19+
```
20+
21+
### 2. Export PICO_SDK_PATH
22+
Download the Pico SDK from GitHub: https://github.com/raspberrypi/pico-sdk and set the PICO_SDK_PATH environment variable:
23+
```bash
24+
export PICO_SDK_PATH=<path_to_local_pico_sdk_folder>
25+
```
26+
27+
### 3. Build the example for Pico2
28+
Go to the example directory and initiate the build process:
29+
```bash
30+
cd examples/arm/rp_pi/pico2/
31+
rm -rf build
32+
mkdir build
33+
cd build
34+
cmake .. -DPICO_BOARD=pico2 -DCMAKE_BUILD_TYPE=Release
35+
cmake --build . -j$(nproc)
36+
```
37+
This will generate the firmware file executorch_pico.uf2.
38+
39+
### 4. Flash the Firmware
40+
Press and hold the BOOTSEL button on the Pico2.
41+
Connect the Pico2 to your computer; it should mount as RPI-RP2.
42+
Copy the executorch_pico.uf2 file to the mounted drive.
43+
44+
### 5. Verify the Firmware
45+
Check that the Pico2's LED blinks 10 times to confirm successful firmware execution.
46+
47+
### 6. (Optional) Check USB Logs on Mac
48+
To view USB logs, use the following command (as an example):
49+
```bash
50+
screen /dev/tty.usbmodem1101 115200
51+
```
52+
53+
These steps complete the process required to run the simple Add Module on the Pico2 microcontroller using executorch.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
# Copyright 2023-2025 Arm Limited and/or its affiliates.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
# cortex-m0plus cmake
9+
10+
if(NOT DEFINED EXECUTORCH_BUILD_ARM_BAREMETAL)
11+
# If not defined, assume we're building standalone
12+
set(EXECUTORCH_BUILD_ARM_BAREMETAL ON)
13+
endif()
14+
set(CMAKE_SYSTEM_NAME Generic)
15+
set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)
16+
17+
if(NOT DEFINED CMAKE_C_COMPILER)
18+
set(CMAKE_C_COMPILER arm-none-eabi-gcc CACHE STRING "C compiler")
19+
endif()
20+
21+
if(NOT DEFINED CMAKE_CXX_COMPILER)
22+
set(CMAKE_CXX_COMPILER arm-none-eabi-g++ CACHE STRING "C++ compiler")
23+
endif()
24+
25+
set(CPU_FLAGS "-mcpu=cortex-m0plus -mthumb -mfloat-abi=soft")
26+
# C flags (no RTTI or exceptions here, since RTTI is C++-only)
27+
set(CMAKE_C_FLAGS "${CPU_FLAGS} -O2 -ffunction-sections -fdata-sections -fno-exceptions -fno-unwind-tables")
28+
29+
# C++ flags (RTTI-related flags go here)
30+
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -fno-use-cxa-atexit -ffunction-sections -fdata-sections")
31+
32+
# Linker flags
33+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections -nostartfiles -flto")
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
cmake_minimum_required(VERSION 3.13)
2+
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
3+
project(executorch_pico C CXX ASM)
4+
pico_sdk_init()
5+
6+
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../../..)
7+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
8+
9+
# Replace xxx_pte.c with your model's pte file
10+
add_executable(executorch_pico main.cpp simple_addmodule_pte.c)
11+
pico_enable_stdio_usb(executorch_pico 1)
12+
pico_enable_stdio_uart(executorch_pico 0)
13+
14+
target_include_directories(executorch_pico PRIVATE
15+
${EXECUTORCH_ROOT}/executorch/runtime/core/portable_type/c10
16+
)
17+
add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS)
18+
19+
# Set correct flags for Pico (Cortex-M0+)
20+
target_compile_options(executorch_pico PRIVATE
21+
-mcpu=cortex-m0plus
22+
-mfloat-abi=soft
23+
-mthumb
24+
)
25+
26+
set(BAREMETAL_BUILD_DIR ${EXECUTORCH_ROOT}/executorch/baremetal_build/)
27+
# Link Executorch and Pico libraries
28+
target_link_libraries(executorch_pico
29+
PRIVATE
30+
${BAREMETAL_BUILD_DIR}/libexecutorch.a
31+
${BAREMETAL_BUILD_DIR}/libexecutorch_core.a
32+
-Wl,--whole-archive
33+
${BAREMETAL_BUILD_DIR}/kernels/portable/libportable_ops_lib.a
34+
-Wl,--no-whole-archive
35+
${BAREMETAL_BUILD_DIR}/kernels/portable/libportable_kernels.a
36+
pico_stdlib
37+
pico_stdio_usb
38+
)
39+
40+
# Include Executorch and third-party headers
41+
target_include_directories(executorch_pico PRIVATE
42+
${EXECUTORCH_ROOT}
43+
${EXECUTORCH_ROOT}/executorch/third-party/
44+
# Add other include paths as needed
45+
)
46+
47+
#set(CMAKE_C_FLAGS "-Os -ffunction-sections -fdata-sections")
48+
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections")
49+
50+
pico_add_extra_outputs(executorch_pico)

examples/arm/rp_pi/pico2/main.cpp

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
#include "pico/stdio_usb.h"
2+
#include "pico/stdlib.h"
3+
4+
#include <executorch/extension/data_loader/buffer_data_loader.h>
5+
#include <executorch/runtime/core/portable_type/scalar_type.h>
6+
#include <executorch/runtime/executor/method.h>
7+
#include <executorch/runtime/executor/program.h>
8+
#include <executorch/runtime/platform/runtime.h>
9+
10+
// Declare your model data (from simple_addmodule_pte.c)
11+
extern const uint8_t model_pte[] __attribute__((aligned(8)));
12+
extern const unsigned int model_pte_len;
13+
14+
// Define GPIO pins for indicators
15+
const uint INDICATOR_PIN_1 = 25; // Onboard LED
16+
const uint INDICATOR_PIN_2 = 22; // External LED
17+
const uint INDICATOR_PIN_3 = 23; // Onboard LED
18+
19+
static uint8_t method_allocator_pool[1024];
20+
static uint8_t activation_pool[512];
21+
22+
void blink_indicator(uint pin, int times, int delay_ms = 100) {
23+
gpio_init(pin);
24+
gpio_set_dir(pin, GPIO_OUT);
25+
for (int i = 0; i < times; ++i) {
26+
gpio_put(pin, 1);
27+
sleep_ms(delay_ms);
28+
gpio_put(pin, 0);
29+
sleep_ms(delay_ms);
30+
}
31+
}
32+
33+
int main() {
34+
using namespace executorch::extension;
35+
using namespace executorch::runtime;
36+
using executorch::aten::Tensor;
37+
using executorch::aten::TensorImpl;
38+
using ScalarType = executorch::runtime::etensor::ScalarType;
39+
using executorch::runtime::runtime_init;
40+
41+
stdio_init_all();
42+
43+
// Give host time to enumerate USB serial
44+
sleep_ms(1000);
45+
46+
int retry_usb_count= 0;
47+
while (!stdio_usb_connected() && retry_usb_count++ < 10) {
48+
printf("Retry again! USB not connected \n");
49+
sleep_ms(100); // Check every 100 ms
50+
}
51+
runtime_init();
52+
53+
executorch::extension::BufferDataLoader loader(model_pte, model_pte_len);
54+
MemoryAllocator method_allocator(sizeof(method_allocator_pool), method_allocator_pool);
55+
method_allocator.enable_profiling("method allocator");
56+
57+
Span<uint8_t> memory_planned_buffers[1]{{activation_pool, sizeof(activation_pool)}};
58+
HierarchicalAllocator planned_memory({memory_planned_buffers, 1});
59+
60+
MemoryManager memory_manager(&method_allocator, &planned_memory);
61+
auto program_result = Program::load(&loader);
62+
if (!program_result.ok()) {
63+
printf("Failed to load model: %d\n", (int)program_result.error());
64+
blink_indicator(INDICATOR_PIN_1, 10);
65+
return 1;
66+
}
67+
Program program = std::move(*program_result);
68+
69+
const char* method_name = nullptr;
70+
// Get method name (usually "forward")
71+
auto method_name_result = program.get_method_name(0);
72+
if (!method_name_result.ok()) {
73+
printf("Failed to get method name: %d\n", (int)method_name_result.error());
74+
blink_indicator(INDICATOR_PIN_1, 10);
75+
return 1;
76+
}
77+
78+
method_name = *method_name_result;
79+
// Load method
80+
auto method_result = program.load_method(method_name, &memory_manager);
81+
if (!method_result.ok()) {
82+
printf("Failed to load method: %d\n", (int)method_result.error());
83+
blink_indicator(INDICATOR_PIN_1, 10);
84+
return 1;
85+
}
86+
printf("Method loaded [%s]\n", method_name);
87+
88+
auto method = std::move(*method_result);
89+
// Prepare input tensor
90+
float input_data_0[4] = {4.0, 109.0, 13.0, 123.0};
91+
float input_data_1[4] = {9.0, 27.0, 11.0, 8.0};
92+
TensorImpl::SizesType sizes[1] = {4};
93+
TensorImpl::DimOrderType dim_order[] = {0};
94+
TensorImpl impl0(ScalarType::Float, 1, sizes, input_data_0, dim_order);
95+
TensorImpl impl1(ScalarType::Float, 1, sizes, input_data_1, dim_order);
96+
Tensor input0(&impl0);
97+
Tensor input1(&impl1);
98+
99+
// Set input
100+
auto set_input_error0 = method.set_input(input0, 0);
101+
auto set_input_error1 = method.set_input(input1, 1);
102+
if (set_input_error0 != Error::Ok || set_input_error1 != Error::Ok) {
103+
printf("Failed to set input(s)\n");
104+
blink_indicator(INDICATOR_PIN_1, 10);
105+
return 1;
106+
}
107+
108+
// Run inference
109+
auto exec_error = method.execute();
110+
if (exec_error != Error::Ok) {
111+
printf("Failed to execute: %d\n", (int)exec_error);
112+
blink_indicator(INDICATOR_PIN_1, 10);
113+
return 1;
114+
}
115+
116+
// Get output
117+
const EValue& output = method.get_output(0);
118+
if (output.isTensor()) {
119+
const auto& out_tensor = output.toTensor();
120+
const float* out_data = out_tensor.const_data_ptr<float>();
121+
printf("Output: %f, %f, %f, %f\n", out_data[0], out_data[1], out_data[2], out_data[3]);
122+
} else {
123+
printf("Output is not a tensor!\n");
124+
blink_indicator(INDICATOR_PIN_1, 10);
125+
}
126+
127+
blink_indicator(INDICATOR_PIN_1, 100, 100); // Blink onboard LED 10 times (~10 secs) to indicate success
128+
return 0;
129+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* Copyright (c) Meta Platforms, Inc. and affiliates.
2+
* All rights reserved.
3+
* Copyright 2023-2025 Arm Limited and/or its affiliates.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
#include "simple_addmodule_pte.h"
10+
11+
const uint8_t model_pte[] __attribute__((aligned(8))) = {
12+
0x1c, 0x00, 0x00, 0x00, 0x45, 0x54, 0x31, 0x32, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x18, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x14, 0x00, 0x10, 0x00, 0x00, 0x00,
13+
0x44, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
14+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
15+
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x28, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x14, 0x00, 0x18, 0x00, 0x1c, 0x00,
16+
0x20, 0x00, 0x24, 0x00, 0x16, 0x00, 0x00, 0x00, 0x9c, 0x03, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00,
17+
0x24, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
18+
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x38, 0xfe, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x6f, 0x75, 0x74, 0x00,
19+
0x09, 0x00, 0x00, 0x00, 0x61, 0x74, 0x65, 0x6e, 0x3a, 0x3a, 0x61, 0x64, 0x64, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00,
20+
0x08, 0x00, 0x0c, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0xff, 0xff, 0xff,
21+
0x00, 0x00, 0x00, 0x01, 0x0c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
22+
0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
23+
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
24+
0x44, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
25+
0x00, 0x00, 0x00, 0x00, 0x68, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x05, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x16, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x00, 0x00,
26+
0x00, 0x00, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x24, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x04, 0x00,
27+
0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x08, 0x00,
28+
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x04, 0x00, 0x00, 0x00, 0xba, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x06, 0x20, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
29+
0x8c, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0e, 0x00,
30+
0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x14, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x00, 0x00,
31+
0x00, 0x00, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x20, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xe4, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
32+
0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00,
33+
0x48, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x5b, 0x31, 0x2c, 0x20, 0x7b, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x20, 0x22,
34+
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x20, 0x22, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x22, 0x3a,
35+
0x20, 0x5b, 0x5d, 0x7d, 0x5d, 0x00, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, 0x5b, 0x31, 0x2c, 0x20, 0x7b, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69,
36+
0x6e, 0x73, 0x2e, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x6e, 0x75, 0x6c, 0x6c, 0x22, 0x2c, 0x20, 0x22, 0x63,
37+
0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x22, 0x3a, 0x20, 0x5b, 0x7b, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69,
38+
0x6e, 0x73, 0x2e, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3a, 0x20, 0x22, 0x6e, 0x75, 0x6c, 0x6c, 0x22, 0x2c, 0x20, 0x22, 0x63,
39+
0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x22, 0x3a, 0x20, 0x5b, 0x7b, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x20, 0x22,
40+
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x20, 0x22, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x22, 0x3a,
41+
0x20, 0x5b, 0x5d, 0x7d, 0x2c, 0x20, 0x7b, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x20, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3a, 0x20,
42+
0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x20, 0x22, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x22, 0x3a, 0x20, 0x5b, 0x5d, 0x7d, 0x5d, 0x7d, 0x2c, 0x20, 0x7b, 0x22,
43+
0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x73, 0x2e, 0x64, 0x69, 0x63, 0x74, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,
44+
0x22, 0x3a, 0x20, 0x22, 0x5b, 0x5d, 0x22, 0x2c, 0x20, 0x22, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x22, 0x3a, 0x20, 0x5b, 0x5d, 0x7d, 0x5d, 0x7d, 0x5d,
45+
0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x00, };
46+
47+
const unsigned int model_pte_len = sizeof(model_pte);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* Copyright (c) Meta Platforms, Inc. and affiliates.
2+
* All rights reserved.
3+
* Copyright 2023-2025 Arm Limited and/or its affiliates.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
#pragma once
10+
#include <stdint.h>
11+
12+
#ifdef __cplusplus
13+
extern "C" {
14+
#endif
15+
16+
extern const uint8_t model_pte[] __attribute__((aligned(8)));
17+
extern const unsigned int model_pte_len;
18+
19+
#ifdef __cplusplus
20+
}
21+
#endif

0 commit comments

Comments
 (0)