Skip to content

Commit b144c1a

Browse files
authored
Merge branch 'develop' into low-power-new
2 parents 09e2857 + 34bb4a4 commit b144c1a

50 files changed

Lines changed: 4275 additions & 467 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/Doxyfile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ PREDEFINED = __not_in_flash_func(x)= \
6363
__no_inline_not_in_flash(x)= \
6464
__attribute__(x)= \
6565
DOXYGEN_GENERATION= \
66+
PICO_DOCS=1 \
6667
@DOXY_PREDEFINED@
6768

6869
ENABLED_SECTIONS = @DOXY_ENABLED_SECTIONS@
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/*
2+
* Copyright (c) 2024 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+
// Board definition for the Soldered NULA Max RP2350
12+
//
13+
// This header may be included by other board headers as "boards/soldered_nula_max_rp2350.h"
14+
15+
#ifndef _BOARDS_SOLDERED_NULA_MAX_RP2350_H
16+
#define _BOARDS_SOLDERED_NULA_MAX_RP2350_H
17+
18+
pico_board_cmake_set(PICO_PLATFORM, rp2350)
19+
pico_board_cmake_set(PICO_CYW43_SUPPORTED, 1)
20+
21+
// For board detection
22+
#define SOLDERED_NULA_MAX_RP2350
23+
24+
// --- RP2350 VARIANT ---
25+
#define PICO_RP2350A 0 // 1 for RP2350A, 0 for RP2350B
26+
27+
// --- BOARD SPECIFIC ---
28+
#define SOLDERED_NULA_MAX_RP2350_USER_BTN 27
29+
#define SOLDERED_NULA_MAX_RP2350_HDMI_CLK_N 12
30+
#define SOLDERED_NULA_MAX_RP2350_HDMI_CLK_P 13
31+
#define SOLDERED_NULA_MAX_RP2350_HDMI_D0_N 14
32+
#define SOLDERED_NULA_MAX_RP2350_HDMI_D0_P 15
33+
#define SOLDERED_NULA_MAX_RP2350_HDMI_D1_N 16
34+
#define SOLDERED_NULA_MAX_RP2350_HDMI_D1_P 17
35+
#define SOLDERED_NULA_MAX_RP2350_HDMI_D2_N 18
36+
#define SOLDERED_NULA_MAX_RP2350_HDMI_D2_P 19
37+
38+
// --- UART ---
39+
#ifndef PICO_DEFAULT_UART
40+
#define PICO_DEFAULT_UART 1
41+
#endif
42+
#ifndef PICO_DEFAULT_UART_TX_PIN
43+
#define PICO_DEFAULT_UART_TX_PIN 40
44+
#endif
45+
#ifndef PICO_DEFAULT_UART_RX_PIN
46+
#define PICO_DEFAULT_UART_RX_PIN 41
47+
#endif
48+
49+
// --- LED ---
50+
#ifndef PICO_DEFAULT_WS2812_PIN
51+
#define PICO_DEFAULT_WS2812_PIN 26
52+
#endif
53+
54+
// --- I2C --- Qwiic connector is on these pins
55+
#ifndef PICO_DEFAULT_I2C
56+
#define PICO_DEFAULT_I2C 0
57+
#endif
58+
#ifndef PICO_DEFAULT_I2C_SDA_PIN
59+
#define PICO_DEFAULT_I2C_SDA_PIN 8
60+
#endif
61+
#ifndef PICO_DEFAULT_I2C_SCL_PIN
62+
#define PICO_DEFAULT_I2C_SCL_PIN 9
63+
#endif
64+
65+
// --- SPI ---
66+
#ifndef PICO_DEFAULT_SPI
67+
#define PICO_DEFAULT_SPI 0
68+
#endif
69+
#ifndef PICO_DEFAULT_SPI_SCK_PIN
70+
#define PICO_DEFAULT_SPI_SCK_PIN 38
71+
#endif
72+
#ifndef PICO_DEFAULT_SPI_TX_PIN
73+
#define PICO_DEFAULT_SPI_TX_PIN 35
74+
#endif
75+
#ifndef PICO_DEFAULT_SPI_RX_PIN
76+
#define PICO_DEFAULT_SPI_RX_PIN 36
77+
#endif
78+
#ifndef PICO_DEFAULT_SPI_CSN_PIN
79+
#define PICO_DEFAULT_SPI_CSN_PIN 37
80+
#endif
81+
82+
// --- FLASH ---
83+
84+
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
85+
86+
#ifndef PICO_FLASH_SPI_CLKDIV
87+
#define PICO_FLASH_SPI_CLKDIV 2
88+
#endif
89+
90+
pico_board_cmake_set_default(PICO_FLASH_SIZE_BYTES, (16 * 1024 * 1024))
91+
#ifndef PICO_FLASH_SIZE_BYTES
92+
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
93+
#endif
94+
95+
// Soldered NULA Max has an SD Card.
96+
#ifndef PICO_SD_CLK_PIN
97+
#define PICO_SD_CLK_PIN 2
98+
#endif
99+
#ifndef PICO_SD_CMD_PIN
100+
#define PICO_SD_CMD_PIN 0
101+
#endif
102+
#ifndef PICO_SD_DAT0_PIN
103+
#define PICO_SD_DAT0_PIN 3
104+
#endif
105+
#ifndef PICO_SD_DAT3_PIN
106+
#define PICO_SD_DAT3_PIN 1 // DAT3 of the SD card is the chip select pin
107+
#endif
108+
#ifndef PICO_SD_DAT_PIN_COUNT
109+
#define PICO_SD_DAT_PIN_COUNT 1
110+
#endif
111+
112+
pico_board_cmake_set_default(PICO_RP2350_A2_SUPPORTED, 1)
113+
#ifndef PICO_RP2350_A2_SUPPORTED
114+
#define PICO_RP2350_A2_SUPPORTED 1
115+
#endif
116+
117+
// --- CYW43 ---
118+
119+
#ifndef CYW43_WL_GPIO_COUNT
120+
#define CYW43_WL_GPIO_COUNT 3
121+
#endif
122+
123+
#ifndef CYW43_WL_GPIO_LED_PIN
124+
#define CYW43_WL_GPIO_LED_PIN 0
125+
#endif
126+
127+
// cyw43 SPI pins can't be changed at runtime
128+
#ifndef CYW43_PIN_WL_DYNAMIC
129+
#define CYW43_PIN_WL_DYNAMIC 0
130+
#endif
131+
132+
// gpio pin to power up the cyw43 chip
133+
#ifndef CYW43_DEFAULT_PIN_WL_REG_ON
134+
#define CYW43_DEFAULT_PIN_WL_REG_ON 23u
135+
#endif
136+
137+
// gpio pin for spi data out to the cyw43 chip
138+
#ifndef CYW43_DEFAULT_PIN_WL_DATA_OUT
139+
#define CYW43_DEFAULT_PIN_WL_DATA_OUT 24u
140+
#endif
141+
142+
// gpio pin for spi data in from the cyw43 chip
143+
#ifndef CYW43_DEFAULT_PIN_WL_DATA_IN
144+
#define CYW43_DEFAULT_PIN_WL_DATA_IN 24u
145+
#endif
146+
147+
// gpio (irq) pin for the irq line from the cyw43 chip
148+
#ifndef CYW43_DEFAULT_PIN_WL_HOST_WAKE
149+
#define CYW43_DEFAULT_PIN_WL_HOST_WAKE 24u
150+
#endif
151+
152+
// gpio pin for the spi clock line to the cyw43 chip
153+
#ifndef CYW43_DEFAULT_PIN_WL_CLOCK
154+
#define CYW43_DEFAULT_PIN_WL_CLOCK 29u
155+
#endif
156+
157+
// gpio pin for the spi chip select to the cyw43 chip
158+
#ifndef CYW43_DEFAULT_PIN_WL_CS
159+
#define CYW43_DEFAULT_PIN_WL_CS 25u
160+
#endif
161+
162+
#endif // _BOARDS_SOLDERED_NULA_MAX_RP2350_H

src/common/boot_picoboot_headers/include/boot/picoboot_constants.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99

1010
#define REBOOT2_TYPE_MASK 0x0f
1111

12-
// note these match REBOOT_TYPE in pico/bootrom_constants.h
12+
// --- note these match BOOT_TYPE_ constants in pico/bootrom_constants.h
1313
// values 0-7 are secure/non-secure
1414
#define REBOOT2_FLAG_REBOOT_TYPE_NORMAL 0x0 // param0 = diagnostic partition
1515
#define REBOOT2_FLAG_REBOOT_TYPE_BOOTSEL 0x2 // param0 = gpio_pin_number, param1 = flags
1616
#define REBOOT2_FLAG_REBOOT_TYPE_RAM_IMAGE 0x3 // param0 = image_region_base, param1 = image_region_size
1717
#define REBOOT2_FLAG_REBOOT_TYPE_FLASH_UPDATE 0x4 // param0 = update_base
18-
1918
// values 8-15 are secure only
2019
#define REBOOT2_FLAG_REBOOT_TYPE_PC_SP 0xd
2120

2221
#define REBOOT2_FLAG_REBOOT_TO_ARM 0x10
2322
#define REBOOT2_FLAG_REBOOT_TO_RISCV 0x20
23+
// ---
2424

2525
#define REBOOT2_FLAG_NO_RETURN_ON_SUCCESS 0x100
2626

src/host/hardware_gpio/gpio.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ uint32_t PICO_WEAK_FUNCTION_IMPL_NAME(gpio_get_all)(void) {
224224
return 0;
225225
}
226226

227-
PICO_WEAK_FUNCTION_DEF(gpio_get_all46)
227+
PICO_WEAK_FUNCTION_DEF(gpio_get_all64)
228228
uint64_t PICO_WEAK_FUNCTION_IMPL_NAME(gpio_get_all64)(void) {
229229
return 0;
230230
}
@@ -244,7 +244,6 @@ void PICO_WEAK_FUNCTION_IMPL_NAME(gpio_set_mask_n)(__unused uint n, __unused uin
244244

245245
}
246246

247-
248247
PICO_WEAK_FUNCTION_DEF(gpio_clr_mask)
249248
void PICO_WEAK_FUNCTION_IMPL_NAME(gpio_clr_mask)(__unused uint32_t mask) {
250249

src/host/pico_platform/include/pico/platform.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
extern "C" {
2222
#endif
2323

24+
#ifndef __XSTRING
25+
#define __XSTRING(s) __STRING(s)
26+
#endif
27+
2428
#define __not_in_flash(group)
2529
#define __not_in_flash_func(func) func
2630
#define __no_inline_not_in_flash_func(func) func

src/rp2040/pico_platform/include/pico/platform/cpu_regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define arm_cpu_hw m0plus_hw
2424
#include "hardware/structs/nvic.h"
2525
#include "hardware/structs/scb.h"
26+
#include "hardware/structs/systick.h"
2627
#endif
2728

2829
#endif

src/rp2350/pico_platform/include/pico/platform/cpu_regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#define arm_cpu_hw m33_hw
2626
#include "hardware/structs/nvic.h"
2727
#include "hardware/structs/scb.h"
28+
#include "hardware/structs/systick.h"
2829
#endif
2930
#endif
3031
#endif

src/rp2_common/boot_bootrom_headers/include/boot/bootrom_constants.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,19 @@
7070
// note this is deliberately > MAX_PARTITIONs is likely to be, and also -1 as a signed byte
7171
#define PARTITION_TABLE_NO_PARTITION_INDEX 0xff
7272

73-
// todo these are duplicated in picoboot_constants.h
73+
// values returned from \ref rom_get_last_boot_type()
74+
// --- note these match the REBOOT2_FLAG_REBOOT_TYPE_ constants in pico/bootrom_constants.h
7475
// values 0-7 are secure/non-secure
7576
#define BOOT_TYPE_NORMAL 0
7677
#define BOOT_TYPE_BOOTSEL 2
7778
#define BOOT_TYPE_RAM_IMAGE 3
7879
#define BOOT_TYPE_FLASH_UPDATE 4
79-
8080
// values 8-15 are secure only
8181
#define BOOT_TYPE_PC_SP 0xd
8282

8383
// ORed in if a bootloader chained into the image
8484
#define BOOT_TYPE_CHAINED_FLAG 0x80
85+
// ---
8586

8687
// call from NS to S
8788
#ifndef __riscv

src/rp2_common/hardware_powman/include/hardware/powman.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void powman_timer_set_ms(uint64_t time_ms);
8585
/*! \brief Set an alarm at an absolute time in ms
8686
* \ingroup hardware_powman
8787
*
88-
* Note, the timer is stopped and then restarted as part of this function. This only controls the alarm
88+
* Note, the alarm is disabled and then re-enabled as part of this function. This only controls the alarm;
8989
* if you want to use the alarm to wake up powman then you should use \ref powman_enable_alarm_wakeup_at_ms
9090
*
9191
* \param alarm_time_ms time at which the alarm will fire
@@ -325,4 +325,4 @@ static inline void powman_set_debug_power_request_ignored(bool ignored) {
325325
}
326326
#endif
327327

328-
#endif
328+
#endif

src/rp2_common/pico_async_context/async_context_threadsafe_background.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ static void process_under_lock(async_context_threadsafe_background_t *self) {
264264
if (self->alarm_id > 0) {
265265
alarm_pool_cancel_alarm(self->alarm_pool, self->alarm_id);
266266
self->alarm_id = 0;
267+
self->alarm_pending = false;
267268
}
268269
break;
269270
}

0 commit comments

Comments
 (0)