Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to the very latest SDK w/GP15 restore #4141

Merged
merged 1 commit into from
Feb 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ports/raspberrypi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ INC += -I. \
-isystem sdk/src/rp2_common/pico_platform/include/ \
-isystem sdk/src/rp2_common/pico_runtime/printf/include/ \
-isystem sdk/src/rp2_common/pico_bootrom/include/ \
-isystem sdk/src/rp2_common/pico_unique_id/include/ \
-Isdk_config \
-I../../lib/tinyusb/src \
-I../../supervisor/shared/usb \
Expand Down Expand Up @@ -184,6 +185,7 @@ SRC_SDK := \
src/rp2_common/pico_printf/printf.c \
src/rp2_common/pico_runtime/runtime.c \
src/rp2_common/pico_stdio/stdio.c \
src/rp2_common/pico_unique_id/unique_id.c \

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

Expand Down
13 changes: 2 additions & 11 deletions ports/raspberrypi/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,11 @@
*/
#include "background.h"

#include "supervisor/filesystem.h"
#include "supervisor/shared/tick.h"
#include "supervisor/usb.h"

#include "py/runtime.h"
#include "shared-module/network/__init__.h"
#include "supervisor/shared/stack.h"
#include "supervisor/port.h"

#if CIRCUITPY_DISPLAYIO
#include "shared-module/displayio/__init__.h"
#endif

void port_start_background_task(void) {}
void port_finish_background_task(void) {}

void port_background_task(void) {}
void port_background_task(void) {
}
39 changes: 21 additions & 18 deletions ports/raspberrypi/bs2_default_padded_checksummed.S
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
// Padded and checksummed version of: /Users/graham/dev/mu/pico_sdk/cmake-build-debug-mu/src/rp2_common/boot_stage2/bs2_default.bin
// Padded and checksummed version of: /home/pi/pico/pico-examples/build/pico-sdk/src/rp2_common/boot_stage2/bs2_default.bin

.section .boot2, "a"
.cpu cortex-m0plus
.thumb

.byte 0x00, 0xb5, 0x2f, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60
.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2b, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61
.byte 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x28, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20
.byte 0x00, 0xf0, 0x3e, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0
.byte 0x2e, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0
.byte 0x26, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x29, 0xf8, 0x01, 0x21
.byte 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x18, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60
.byte 0x17, 0x49, 0x18, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21
.byte 0x19, 0x66, 0x00, 0xf0, 0x0c, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x13, 0x49, 0x11, 0x48, 0x01, 0x60
.byte 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd1, 0x10, 0x48, 0x00, 0x47, 0x03, 0xb5
.byte 0x99, 0x6a, 0x04, 0x20, 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd
.byte 0x02, 0xb5, 0x18, 0x66, 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd
.byte 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00
.byte 0x21, 0x22, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x01, 0x01, 0x00, 0x10
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x27, 0x2a, 0x60
.section .boot2, "ax"

.byte 0x00, 0xb5, 0x32, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60
.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2e, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61
.byte 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x2b, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20
.byte 0x00, 0xf0, 0x44, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0
.byte 0x34, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0
.byte 0x2c, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21
.byte 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x1b, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60
.byte 0x1a, 0x49, 0x1b, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21
.byte 0x19, 0x66, 0x00, 0xf0, 0x12, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x16, 0x49, 0x14, 0x48, 0x01, 0x60
.byte 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x12, 0x48, 0x13, 0x49
.byte 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x03, 0xb5, 0x99, 0x6a, 0x04, 0x20
.byte 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66
.byte 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, 0x00, 0x00, 0x02, 0x40
.byte 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00, 0x21, 0x22, 0x00, 0x00
.byte 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0xb2, 0x4e, 0x7a
10 changes: 4 additions & 6 deletions ports/raspberrypi/common-hal/microcontroller/Processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

#include <math.h>
#include <string.h>

#include "py/mphal.h"
#include "common-hal/microcontroller/Processor.h"
Expand Down Expand Up @@ -53,12 +54,9 @@ uint32_t common_hal_mcu_processor_get_frequency(void) {
}

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

mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) {
Expand Down
4 changes: 3 additions & 1 deletion ports/raspberrypi/common-hal/microcontroller/Processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H

#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 16
#include "src/rp2_common/pico_unique_id/include/pico/unique_id.h"

#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH PICO_UNIQUE_BOARD_ID_SIZE_BYTES

#include "py/obj.h"

Expand Down
11 changes: 6 additions & 5 deletions ports/raspberrypi/link.ld
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@ SECTIONS
*/

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

/* Check if data + heap + stack exceeds RAM limit */
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed")

ASSERT( __binary_info_header_end - __logical_binary_start <= 256, "Binary info must be in first 256 bytes of the binary")
/* todo assert on extra code */
}
2 changes: 1 addition & 1 deletion ports/raspberrypi/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ CIRCUITPY_AUDIOIO = 0

INTERNAL_LIBM = 1

USB_SERIAL_NUMBER_LENGTH = 32
USB_SERIAL_NUMBER_LENGTH = 16

USB_NUM_EP = 8
2 changes: 1 addition & 1 deletion ports/raspberrypi/sdk
Submodule sdk updated 73 files
+1 −1 .gitmodules
+1 −1 CMakeLists.txt
+34 −34 README.md
+1 −1 docs/CMakeLists.txt
+2 −2 docs/Doxyfile.in
+6 −6 docs/DoxygenLayout.xml
+1 −0 docs/index.h
+8 −8 docs/mainpage.md
+5 −5 docs/weblinks_page.md
+6 −6 external/pico_sdk_import.cmake
+4 −4 pico_sdk_init.cmake
+1 −1 pico_sdk_version.cmake
+2 −2 src/board_setup.cmake
+2 −2 src/boards/generic_board.cmake
+1 −1 src/common/pico_base/include/pico.h
+1 −1 src/common/pico_stdlib/include/pico/stdlib.h
+1 −2 src/common/pico_sync/include/pico/mutex.h
+5 −10 src/common/pico_sync/mutex.c
+7 −3 src/common/pico_time/include/pico/time.h
+0 −8 src/common/pico_time/time.c
+1 −1 src/host/hardware_gpio/include/hardware/gpio.h
+60 −10 src/rp2040/hardware_regs/include/hardware/regs/clocks.h
+56 −0 src/rp2040/hardware_regs/include/hardware/regs/dma.h
+63 −10 src/rp2040/hardware_regs/rp2040.svd
+2 −23 src/rp2040/hardware_structs/include/hardware/structs/dma.h
+1 −1 src/rp2040/hardware_structs/include/hardware/structs/systick.h
+1 −0 src/rp2_common/CMakeLists.txt
+13 −12 src/rp2_common/boot_stage2/CMakeLists.txt
+28 −0 src/rp2_common/boot_stage2/asminclude/boot2_helpers/exit_from_boot2.S
+30 −0 src/rp2_common/boot_stage2/asminclude/boot2_helpers/read_flash_sreg.S
+26 −0 src/rp2_common/boot_stage2/asminclude/boot2_helpers/wait_ssi_ready.S
+5 −54 src/rp2_common/boot_stage2/boot2_generic_03h.S
+28 −65 src/rp2_common/boot_stage2/boot2_is25lp080.S
+6 −0 src/rp2_common/boot_stage2/boot2_usb_blinky.S
+6 −49 src/rp2_common/boot_stage2/boot2_w25q080.S
+20 −43 src/rp2_common/boot_stage2/boot2_w25x10cl.S
+3 −1 src/rp2_common/boot_stage2/pad_checksum
+1 −1 src/rp2_common/hardware_divider/include/hardware/divider.h
+19 −0 src/rp2_common/hardware_dma/include/hardware/dma.h
+80 −0 src/rp2_common/hardware_flash/flash.c
+19 −0 src/rp2_common/hardware_flash/include/hardware/flash.h
+8 −8 src/rp2_common/hardware_gpio/gpio.c
+0 −2 src/rp2_common/hardware_gpio/include/hardware/gpio.h
+1 −1 src/rp2_common/hardware_interp/include/hardware/interp.h
+0 −1 src/rp2_common/hardware_pio/include/hardware/pio.h
+6 −0 src/rp2_common/hardware_pio/pio.c
+3 −3 src/rp2_common/hardware_pwm/include/hardware/pwm.h
+6 −0 src/rp2_common/hardware_spi/include/hardware/spi.h
+1 −0 src/rp2_common/hardware_uart/include/hardware/uart.h
+10 −8 src/rp2_common/hardware_uart/uart.c
+31 −7 src/rp2_common/pico_fix/rp2040_usb_device_enumeration/rp2040_usb_device_enumeration.c
+10 −0 src/rp2_common/pico_platform/include/pico/platform.h
+10 −0 src/rp2_common/pico_platform/platform.c
+4 −0 src/rp2_common/pico_runtime/runtime.c
+46 −32 src/rp2_common/pico_standard_link/crt0.S
+7 −6 src/rp2_common/pico_standard_link/memmap_blocked_ram.ld
+7 −6 src/rp2_common/pico_standard_link/memmap_copy_to_ram.ld
+7 −6 src/rp2_common/pico_standard_link/memmap_default.ld
+12 −8 src/rp2_common/pico_standard_link/memmap_no_flash.ld
+1 −1 src/rp2_common/pico_stdio_usb/stdio_usb_descriptors.c
+9 −0 src/rp2_common/pico_unique_id/CMakeLists.txt
+64 −0 src/rp2_common/pico_unique_id/include/pico/unique_id.h
+28 −0 src/rp2_common/pico_unique_id/unique_id.c
+2 −2 test/kitchen_sink/CMakeLists.txt
+1 −1 tools/CMakeLists.txt
+14 −2 tools/elf2uf2/main.cpp
+1 −1 tools/extract_configs.py
+1 −1 tools/pioasm/c_sdk_output.cpp
+3 −3 tools/pioasm/main.cpp
+6 −2 tools/pioasm/output_format.h
+2 −3 tools/pioasm/pio_assembler.cpp
+2 −2 tools/pioasm/pio_disassembler.cpp
+1 −1 tools/pioasm/python_output.cpp