Skip to content

Commit 0b0ca8c

Browse files
authored
Merge branch 'develop' into ns-alpha
2 parents 2c4e1f6 + 1cc19a2 commit 0b0ca8c

File tree

31 files changed

+850
-106
lines changed

31 files changed

+850
-106
lines changed

MODULE.bazel

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,54 @@ http_archive(
1616
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
1717
sha256 = "8fd8b4a0a8d44ab2e195ccfbeef42223dfb3ede29d80f14dcf2183c34b8d199a",
1818
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-eabi",
19-
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz",
19+
urls = [
20+
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz",
21+
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz",
22+
],
2023
)
2124

2225
http_archive(
2326
name = "arm_gcc_linux-x86_64",
2427
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
2528
sha256 = "6cd1bbc1d9ae57312bcd169ae283153a9572bd6a8e4eeae2fedfbc33b115fdbb",
2629
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi",
27-
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
30+
urls = [
31+
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
32+
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
33+
],
2834
)
2935

3036
http_archive(
3137
name = "arm_gcc_win-x86_64",
3238
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
3339
sha256 = "51d933f00578aa28016c5e3c84f94403274ea7915539f8e56c13e2196437d18f",
3440
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi",
35-
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
41+
urls = [
42+
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
43+
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
44+
],
3645
)
3746

3847
http_archive(
3948
name = "arm_gcc_mac-x86_64",
4049
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
4150
sha256 = "075faa4f3e8eb45e59144858202351a28706f54a6ec17eedd88c9fb9412372cc",
4251
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-x86_64-arm-none-eabi",
43-
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
52+
urls = [
53+
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
54+
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
55+
],
4456
)
4557

4658
http_archive(
4759
name = "arm_gcc_mac-aarch64",
4860
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
4961
sha256 = "39c44f8af42695b7b871df42e346c09fee670ea8dfc11f17083e296ea2b0d279",
5062
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-arm64-arm-none-eabi",
51-
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
63+
urls = [
64+
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
65+
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
66+
],
5267
)
5368

5469
http_archive(
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright (c) 2024 Raspberry Pi (Trading) Ltd.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef _BOARDS_RASPBERRY_PI_PI500_RP2040_H
8+
#define _BOARDS_RASPBERRY_PI_PI500_RP2040_H
9+
10+
pico_board_cmake_set(PICO_PLATFORM, rp2040)
11+
12+
// For board detection
13+
#define RASPBERRY_PI_PI500_RP2040
14+
15+
// --- FLASH ---
16+
// Pi 500 uses the same flash as the original Pi Pico (W25Q16JVUXIQ) but only DSPI pins are connected
17+
#define PICO_BOOT_STAGE2_CHOOSE_W25X10CL 1
18+
19+
#ifndef PICO_FLASH_SPI_CLKDIV
20+
#define PICO_FLASH_SPI_CLKDIV 2
21+
#endif
22+
23+
pico_board_cmake_set_default(PICO_FLASH_SIZE_BYTES, (2 * 1024 * 1024))
24+
#ifndef PICO_FLASH_SIZE_BYTES
25+
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
26+
#endif
27+
28+
29+
#ifndef PICO_RP2040_B0_SUPPORTED
30+
#define PICO_RP2040_B0_SUPPORTED 0
31+
#endif
32+
33+
// Keyboard CAPS Lock indicator LED as default
34+
#define PI500_RP2040_CAPS_LOCK_LED_PIN 25
35+
#ifndef PICO_DEFAULT_LED_PIN
36+
#define PICO_DEFAULT_LED_PIN PI500_RP2040_CAPS_LOCK_LED_PIN
37+
#endif
38+
39+
// --- PI 500 POWER MANAGEMENT ---
40+
// Power button control (critical for Pi 500 power management)
41+
#define PI500_RP2040_POWER_BUTTON_PIN 19 //DO NOT SCAN OR YOU WON'T BE ABLE TO TURN THE PI500 ON!
42+
// Power key detection (shared with matrix pins but scanned separately)
43+
#define PI500_RP2040_POWER_KEY_COL_PIN 20 // Also matrix col 11
44+
#define PI500_RP2040_POWER_KEY_ROW_PIN 6 // Also matrix row 6
45+
46+
// --- UART ---
47+
#ifndef PICO_DEFAULT_UART
48+
#define PICO_DEFAULT_UART 0
49+
#endif
50+
#ifndef PICO_DEFAULT_UART_TX_PIN
51+
#define PICO_DEFAULT_UART_TX_PIN 16
52+
#endif
53+
54+
// --- KEYBOARD MATRIX PINS ---
55+
// Matrix row pins (8 pins)
56+
#define PI500_RP2040_MATRIX_ROW_0_PIN 0
57+
#define PI500_RP2040_MATRIX_ROW_1_PIN 1
58+
#define PI500_RP2040_MATRIX_ROW_2_PIN 2
59+
#define PI500_RP2040_MATRIX_ROW_3_PIN 3
60+
#define PI500_RP2040_MATRIX_ROW_4_PIN 4
61+
#define PI500_RP2040_MATRIX_ROW_5_PIN 5
62+
#define PI500_RP2040_MATRIX_ROW_6_PIN 6
63+
#define PI500_RP2040_MATRIX_ROW_7_PIN 7
64+
65+
// Matrix column pins (18 pins)
66+
#define PI500_RP2040_MATRIX_COL_0_PIN 27
67+
#define PI500_RP2040_MATRIX_COL_1_PIN 8
68+
#define PI500_RP2040_MATRIX_COL_2_PIN 9
69+
#define PI500_RP2040_MATRIX_COL_3_PIN 10
70+
#define PI500_RP2040_MATRIX_COL_4_PIN 11
71+
#define PI500_RP2040_MATRIX_COL_5_PIN 12
72+
#define PI500_RP2040_MATRIX_COL_6_PIN 13
73+
#define PI500_RP2040_MATRIX_COL_7_PIN 14
74+
#define PI500_RP2040_MATRIX_COL_8_PIN 23
75+
#define PI500_RP2040_MATRIX_COL_9_PIN 24
76+
#define PI500_RP2040_MATRIX_COL_10_PIN 22
77+
#define PI500_RP2040_MATRIX_COL_11_PIN 20
78+
#define PI500_RP2040_MATRIX_COL_12_PIN 29
79+
#define PI500_RP2040_MATRIX_COL_13_PIN 18
80+
#define PI500_RP2040_MATRIX_COL_14_PIN 15
81+
#define PI500_RP2040_MATRIX_COL_15_PIN 21
82+
#define PI500_RP2040_MATRIX_COL_16_PIN 28
83+
#define PI500_RP2040_MATRIX_COL_17_PIN 26
84+
85+
#endif
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
// -----------------------------------------------------
8+
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
9+
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
10+
// -----------------------------------------------------
11+
12+
// This header may be included by other board headers as "boards/waveshare_rp2350_pizero.h"
13+
14+
#ifndef _BOARDS_WAVESHARE_RP2350_PIZERO_H
15+
#define _BOARDS_WAVESHARE_RP2350_PIZERO_H
16+
17+
pico_board_cmake_set(PICO_PLATFORM, rp2350)
18+
19+
// For board detection
20+
#define WAVESHARE_RP2350_PIZERO
21+
22+
// --- RP2350 VARIANT ---
23+
#define PICO_RP2350A 0
24+
25+
// --- UART ---
26+
#ifndef PICO_DEFAULT_UART
27+
#define PICO_DEFAULT_UART 1
28+
#endif
29+
#ifndef PICO_DEFAULT_UART_TX_PIN
30+
#define PICO_DEFAULT_UART_TX_PIN 4
31+
#endif
32+
#ifndef PICO_DEFAULT_UART_RX_PIN
33+
#define PICO_DEFAULT_UART_RX_PIN 5
34+
#endif
35+
36+
// --- I2C ---
37+
#ifndef PICO_DEFAULT_I2C
38+
#define PICO_DEFAULT_I2C 1
39+
#endif
40+
#ifndef PICO_DEFAULT_I2C_SDA_PIN
41+
#define PICO_DEFAULT_I2C_SDA_PIN 2
42+
#endif
43+
#ifndef PICO_DEFAULT_I2C_SCL_PIN
44+
#define PICO_DEFAULT_I2C_SCL_PIN 3
45+
#endif
46+
47+
// --- SPI ---
48+
#ifndef PICO_DEFAULT_SPI
49+
#define PICO_DEFAULT_SPI 1
50+
#endif
51+
#ifndef PICO_DEFAULT_SPI_SCK_PIN
52+
#define PICO_DEFAULT_SPI_SCK_PIN 10
53+
#endif
54+
#ifndef PICO_DEFAULT_SPI_TX_PIN
55+
#define PICO_DEFAULT_SPI_TX_PIN 11
56+
#endif
57+
#ifndef PICO_DEFAULT_SPI_RX_PIN
58+
#define PICO_DEFAULT_SPI_RX_PIN 12
59+
#endif
60+
#ifndef PICO_DEFAULT_SPI_CSN_PIN
61+
#define PICO_DEFAULT_SPI_CSN_PIN 13
62+
#endif
63+
64+
// --- FLASH ---
65+
66+
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
67+
68+
#ifndef PICO_FLASH_SPI_CLKDIV
69+
#define PICO_FLASH_SPI_CLKDIV 2
70+
#endif
71+
72+
pico_board_cmake_set_default(PICO_FLASH_SIZE_BYTES, (16 * 1024 * 1024))
73+
#ifndef PICO_FLASH_SIZE_BYTES
74+
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
75+
#endif
76+
77+
pico_board_cmake_set_default(PICO_RP2350_A2_SUPPORTED, 1)
78+
#ifndef PICO_RP2350_A2_SUPPORTED
79+
#define PICO_RP2350_A2_SUPPORTED 1
80+
#endif
81+
82+
#endif

src/common/pico_base_headers/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ cc_library(
9292
includes = ["include"],
9393
visibility = [
9494
"//src/common:__subpackages__",
95+
"//src/host/hardware_irq:__pkg__",
9596
"//src/host/hardware_sync:__pkg__",
9697
"//src/host/hardware_timer:__pkg__",
9798
"//src/host/pico_platform:__pkg__",
99+
"//src/host/pico_unique_id:__pkg__",
98100
"//src/rp2040/boot_stage2:__pkg__",
99101
"//src/rp2040/pico_platform:__pkg__",
100102
"//src/rp2350/boot_stage2:__pkg__",

src/common/pico_sync/include/pico/critical_section.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ __force_inline static void critical_section_exit(critical_section_t *crit_sec) {
8484
void critical_section_deinit(critical_section_t *crit_sec);
8585

8686
/*! \brief Test whether a critical_section has been initialized
87-
* \ingroup mutex
87+
* \ingroup critical_section
8888
*
8989
* \param crit_sec Pointer to critical_section structure
9090
* \return true if the critical section is initialized, false otherwise

src/host.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ include (${CMAKE_DIR}/no_hardware.cmake)
3838
pico_add_subdirectory(${HOST_DIR}/pico_stdio)
3939
pico_add_subdirectory(${HOST_DIR}/pico_stdlib)
4040
pico_add_subdirectory(${HOST_DIR}/pico_time_adapter)
41+
pico_add_subdirectory(${HOST_DIR}/pico_unique_id)
4142

4243
unset(CMAKE_DIR)
4344
unset(COMMON_DIR)

src/host/hardware_gpio/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ cc_library(
88
target_compatible_with = ["//bazel/constraint:host"],
99
deps = [
1010
"//src/common/pico_binary_info:LIB_PICO_BINARY_INFO",
11+
"//src/host/hardware_irq",
1112
"//src/host/pico_platform",
1213
],
1314
)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
pico_simple_hardware_target(gpio)
1+
pico_simple_hardware_target(gpio)
2+
target_link_libraries(hardware_gpio INTERFACE hardware_irq)

0 commit comments

Comments
 (0)