Skip to content

Commit a10ce39

Browse files
authored
Merge pull request adafruit#4141 from tannewt/update_picosdk
Update to the very latest SDK w/GP15 restore
2 parents e12d38c + 22dc7d5 commit a10ce39

File tree

8 files changed

+40
-43
lines changed

8 files changed

+40
-43
lines changed

ports/raspberrypi/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ INC += -I. \
9999
-isystem sdk/src/rp2_common/pico_platform/include/ \
100100
-isystem sdk/src/rp2_common/pico_runtime/printf/include/ \
101101
-isystem sdk/src/rp2_common/pico_bootrom/include/ \
102+
-isystem sdk/src/rp2_common/pico_unique_id/include/ \
102103
-Isdk_config \
103104
-I../../lib/tinyusb/src \
104105
-I../../supervisor/shared/usb \
@@ -184,6 +185,7 @@ SRC_SDK := \
184185
src/rp2_common/pico_printf/printf.c \
185186
src/rp2_common/pico_runtime/runtime.c \
186187
src/rp2_common/pico_stdio/stdio.c \
188+
src/rp2_common/pico_unique_id/unique_id.c \
187189

188190
SRC_SDK := $(addprefix sdk/, $(SRC_SDK))
189191

ports/raspberrypi/background.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,11 @@
2525
*/
2626
#include "background.h"
2727

28-
#include "supervisor/filesystem.h"
29-
#include "supervisor/shared/tick.h"
30-
#include "supervisor/usb.h"
31-
3228
#include "py/runtime.h"
33-
#include "shared-module/network/__init__.h"
34-
#include "supervisor/shared/stack.h"
3529
#include "supervisor/port.h"
3630

37-
#if CIRCUITPY_DISPLAYIO
38-
#include "shared-module/displayio/__init__.h"
39-
#endif
40-
4131
void port_start_background_task(void) {}
4232
void port_finish_background_task(void) {}
4333

44-
void port_background_task(void) {}
34+
void port_background_task(void) {
35+
}
Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
// Padded and checksummed version of: /Users/graham/dev/mu/pico_sdk/cmake-build-debug-mu/src/rp2_common/boot_stage2/bs2_default.bin
1+
// Padded and checksummed version of: /home/pi/pico/pico-examples/build/pico-sdk/src/rp2_common/boot_stage2/bs2_default.bin
22

3-
.section .boot2, "a"
3+
.cpu cortex-m0plus
4+
.thumb
45

5-
.byte 0x00, 0xb5, 0x2f, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60
6-
.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2b, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61
7-
.byte 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x28, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20
8-
.byte 0x00, 0xf0, 0x3e, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0
9-
.byte 0x2e, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0
10-
.byte 0x26, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x29, 0xf8, 0x01, 0x21
11-
.byte 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x18, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60
12-
.byte 0x17, 0x49, 0x18, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21
13-
.byte 0x19, 0x66, 0x00, 0xf0, 0x0c, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x13, 0x49, 0x11, 0x48, 0x01, 0x60
14-
.byte 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd1, 0x10, 0x48, 0x00, 0x47, 0x03, 0xb5
15-
.byte 0x99, 0x6a, 0x04, 0x20, 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd
16-
.byte 0x02, 0xb5, 0x18, 0x66, 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd
17-
.byte 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00
18-
.byte 0x21, 0x22, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x01, 0x01, 0x00, 0x10
19-
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20-
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x27, 0x2a, 0x60
6+
.section .boot2, "ax"
7+
8+
.byte 0x00, 0xb5, 0x32, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60
9+
.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2e, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61
10+
.byte 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x2b, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20
11+
.byte 0x00, 0xf0, 0x44, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0
12+
.byte 0x34, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0
13+
.byte 0x2c, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21
14+
.byte 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x1b, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60
15+
.byte 0x1a, 0x49, 0x1b, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21
16+
.byte 0x19, 0x66, 0x00, 0xf0, 0x12, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x16, 0x49, 0x14, 0x48, 0x01, 0x60
17+
.byte 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x12, 0x48, 0x13, 0x49
18+
.byte 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x03, 0xb5, 0x99, 0x6a, 0x04, 0x20
19+
.byte 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66
20+
.byte 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, 0x00, 0x00, 0x02, 0x40
21+
.byte 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00, 0x21, 0x22, 0x00, 0x00
22+
.byte 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0
23+
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0xb2, 0x4e, 0x7a

ports/raspberrypi/common-hal/microcontroller/Processor.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*/
2626

2727
#include <math.h>
28+
#include <string.h>
2829

2930
#include "py/mphal.h"
3031
#include "common-hal/microcontroller/Processor.h"
@@ -53,12 +54,9 @@ uint32_t common_hal_mcu_processor_get_frequency(void) {
5354
}
5455

5556
void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
56-
// TODO: get the unique id from the flash. The chip itself doesn't have one.
57-
// for (int i=0; i<4; i++) {
58-
// for (int k=0; k<4; k++) {
59-
// raw_id[4 * i + k] = (*(id_addresses[i]) >> k * 8) & 0xff;
60-
// }
61-
// }
57+
pico_unique_board_id_t retrieved_id;
58+
pico_get_unique_board_id(&retrieved_id);
59+
memcpy(raw_id, retrieved_id.id, COMMON_HAL_MCU_PROCESSOR_UID_LENGTH);
6260
}
6361

6462
mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) {

ports/raspberrypi/common-hal/microcontroller/Processor.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
2828
#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
2929

30-
#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 16
30+
#include "src/rp2_common/pico_unique_id/include/pico/unique_id.h"
31+
32+
#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH PICO_UNIQUE_BOARD_ID_SIZE_BYTES
3133

3234
#include "py/obj.h"
3335

ports/raspberrypi/link.ld

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,11 @@ SECTIONS
5959
*/
6060

6161
.text : {
62-
__reset_start = .;
63-
KEEP (*(.reset))
64-
. = ALIGN(256);
65-
__reset_end = .;
66-
ASSERT(__reset_end - __reset_start == 256, "ERROR: reset section should only be 256 bytes");
62+
__logical_binary_start = .;
6763
KEEP (*(.vectors))
64+
KEEP (*(.binary_info_header))
65+
__binary_info_header_end = .;
66+
KEEP (*(.reset))
6867
/* TODO revisit this now memset/memcpy/float in ROM */
6968
/* bit of a hack right now to exclude all floating point and time critical (e.g. memset, memcpy) code from
7069
* FLASH ... we will include any thing excluded here in .data below by default */
@@ -246,5 +245,7 @@ SECTIONS
246245

247246
/* Check if data + heap + stack exceeds RAM limit */
248247
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed")
248+
249+
ASSERT( __binary_info_header_end - __logical_binary_start <= 256, "Binary info must be in first 256 bytes of the binary")
249250
/* todo assert on extra code */
250251
}

ports/raspberrypi/mpconfigport.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ CIRCUITPY_AUDIOIO = 0
4242

4343
INTERNAL_LIBM = 1
4444

45-
USB_SERIAL_NUMBER_LENGTH = 32
45+
USB_SERIAL_NUMBER_LENGTH = 16
4646

4747
USB_NUM_EP = 8

ports/raspberrypi/sdk

Submodule sdk updated 73 files

0 commit comments

Comments
 (0)