Commit Graph

65 Commits

Author SHA1 Message Date
graham sanderson
efe2103f9b SDK 2.0.0 release
Some checks failed
CMake / build (push) Has been cancelled
Build on macOS / build (push) Has been cancelled
Build on Windows / build (push) Has been cancelled
Multi GCC / build (push) Has been cancelled
2024-08-08 08:54:38 -05:00
Andrew Scheller
45984e276f
Small tweak to extract_configs.py (#1776)
Some checks failed
CMake / build (push) Has been cancelled
Build on macOS / build (push) Has been cancelled
Build on Windows / build (push) Has been cancelled
Always write the path as "abosolute" (relative to the root of pico-sdk) as that makes searching for it (when building the RP2040 datasheet) much faster. This matches the behaviour of extract_build_defines.py and extract_cmake_configs.py
2024-07-25 15:13:00 -05:00
Andrew Scheller
9f85f25640
Add extra checks to check_board_header.py (#1775)
* Small whitespace fixup

* typo bugfix

* Small refactoring of check_board_header.py

* Make structure of rp2040_interface_pins.json more explicit, so that it can be more easily extended

* Move definition of valid-pins from python to json

* Check that each interface includes all (minimally) expected pins
Note that UART_CTS, UART_RTS & SPI_CSN are classed as optional

* Split "expected_functions" into "required" (all of these pins must be present) and "one_of" (at least one of these pins must be present)
2024-07-25 09:47:26 -05:00
Andrew Scheller
0e5cef3ffa
Boards header updates (#1724)
* Add script to automatically validate board header files

* Fix small automatically-found inconsistencies in various board header files

* Tweak and add board header file from abandoned PR #1174
2024-06-21 14:26:45 -05:00
armandomontanez
6ff3e4fab2
Expand bazel build to include configuration options and broader support. (#1731)
* Add host Bazel build

Updates target_compatible_with across the repo to ensure that wildcard
builds for both host and rp2040 succeed.

* Get unit tests building

* Add Python script to identify build system differences

Uses the build system tags to make it easier to identify differences
between the CMake and Bazel builds.

* Temporarily disable pico divider test

* Support PICO_BARE_METAL in Bazel

* Support PICO_NO_GC_SECTIONS in Bazel

* Support boot2 configuration in Bazel

Adds support for PICO_DEFAULT_BOOT_STAGE2 and
PICO_DEFAULT_BOOT_STAGE2_FILE in the Bazel build.

* Allowlist some CMake-only options

* Support CXX configuration options in Bazel

* Move multiple_choice_flag.bzl

* Support all pico boards

* Support linking multiple stdio implementations

Changes the Bazel build so stdio implementations are no longer mutually
exclusive.

* Add PICO_BOOT_STAGE2_LINK_IMAGE

* Support PICO_CMSIS_PATH in Bazel

* Support PICO_USE_DEFAULT_MAX_PAGE_SIZE in Bazel

* Silence PICO_CMSIS_VENDOR and PICO_CMSIS_DEVICE differences

* Support PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS in Bazel

* Properly support version defines

* Support embedding binary info in Bazel

* Embed build type in binary

* Support different linker scripts in Bazel build

* Finish out missing PICO_BUILD_DEFINE in Bazel build

* Support PICO_NO_TARGET_NAME

* Reorganize initial configuration options in Bazel

Cleans up and reorganizes some of the initial configuration options
added to the Bazel build so everything is consistent.

* Add builds for pioasm and elf2uf2

* Use Python rules from rules_python

* Actually link in output formats in pioasm tool

* Make tools have public visibility

* Add UF2 Bazel aspect

* Add TODOs for pioasm/uf2 helpers

* Fix compile flag typo

* Update Bazel SDK configuration strings to match recent CMake changes

* Fix pico_divider test

* Clean up straggling TODOs

* Clarify pico_stdio_test compatibility

* Initial Bazel Pico W support

* Add new files from develop

* Clean up compatibility expressions in Bazel build

* Clean up rp2 constraint handling in Bazel

* More Bazel docs cleanup

* Format Bazel build files

* Consolidate transitions in the Pico SDK

* Make every _allowlist_function_transition explicit

* More docs cleanup

* Add a few missing defines

* Improve PICO_CONFIG_HEADER correctness in Bazel

* Minor docs clarifications
2024-06-13 09:50:04 -05:00
Andrew Scheller
115eae7c66
Add scripts to extract PICO_CMAKE_CONFIG and PICO_BUILD_DEFINE entries (#1708)
Tidy up a couple of PICO_CMAKE_CONFIG and PICO_BUILD_DEFINE entries
2024-06-04 19:59:28 -05:00
Andrew Scheller
a6c65b426d
Small kitchen-sink fixes (#1707)
- tweak CMakeLists.txt and kitchen_sink.c to be in a more similar order
- add some "missing" headers to kitchen_sink.c
2024-05-19 19:26:30 -05:00
Andrew Scheller
dcc2241a16
Add a script to create a header file including all other header files (#319) 2024-05-19 17:44:03 -05:00
Patrick Plenefisch
7d238ea2cc
[pioasm] Fix build warning due to extra parameters (#1625) 2024-05-19 16:48:53 -05:00
Patricio Whittingslow
a0f4cd4096
Implement Pioasm for Go (TinyGo) (#1604)
Co-authored-by: Kenneth Bell <ken@netleap.io>
Co-authored-by: Christian Ege <ch@ege.io>
2024-05-07 17:39:28 -05:00
timg236
c9cce7a312
pico_generate_pio_header: Create OUTPUT_DIR (#1610)
Previously, if a custom OUTPUT_DIR was specified but didn't exist
then this command would fail.

Fixes: https://github.com/raspberrypi/pico-sdk/issues/1609
2024-01-19 08:57:16 -06:00
Timo Kokkonen
3274cc8aec
Fix CWE-686 in tools/elf2uf2/main.cpp:132 (#1585)
* Fix CWE-686: This argument should be of type 'void *' but is of type 'unsigned int'.

* Switch %p to %08x.
2024-01-08 12:33:21 -06:00
Ghorban M. Tavakoly
e5e30b40fd
CMake cmake_minimum_required Deprecation Warning (#1546)
* Add ...3.27 to the cmake_minimum_required, and make minimum 3.13 everywhere


Signed-off-by: Ghorban M. Tavakoly <gmt3141@gmail.com>
Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
2023-12-15 13:45:42 +00:00
Patrick Plenefisch
8787bc9b4d
pioasm: Add JSON output format for machine consumption (#1394) 2023-12-14 11:37:01 +00:00
Stefan Becker
f85d67961c
tools: fix CMake deprecation warnings (#1477)
Running a build with a newer CMake version results in a deprecation
warning from the tools subdirectory

    [13/108] Performing configure step for 'PioasmBuild'
    loading initial cache file /.../build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/tmp/PioasmBuild-cache-Release.cmake
    CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 3.5 will be removed from a future version of
      CMake.

      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.

Raise the minimum version requirement for the tools to the same version
that is required in the top-level CMakeLists.txt anyway.
2023-08-17 11:02:18 -05:00
Graham Sanderson
8188adf98b
avoid calling find_package for pico-sdk-tools over and over again (#1403) 2023-06-06 10:46:17 -05:00
djazz
7070d230c0
GCC 13 update. Move #include <cstdint> to header. Fixes #1363 (#1367) 2023-05-24 07:51:59 -05:00
arjunak234
be4c80d355
include cstdint (#1318)
This fixes build on newer versions of GCC(13.0.1)
2023-03-20 16:48:48 -05:00
Graham Sanderson
1ac90374e3
Various small fixes towards building with other compilers (#1285)
* Fix various non-GCC warnings (no effect on GCC)
* Reduce use of typeof since non GCC compilers may not support it
* Introduce PICO_C_COMPILER_IS_GNU, PICO_C_COMPILER_IS_CLANG, PICO_C_COMPILER_IS_IAR to CMake as if (CMAKE_C_COMPILER_ID STREQUAL "xxx") is a bit verbose
* Use "unified_asm" macro for all inline asm (it is "volatile __asm" on GNU with a .syntex unified)
* Use NOLOAD instead of COPY in linker scripts (arguably more correct anyway)
* Use the same style for setting _etext in all 4 linker scripts (to the beginning of .data). Clang aligns .data on a 16 byte boundary. Note ideally we'd
  add a new symbol __data_source, however that would break backwards compatibility with existing user linker scripts
* Use "a" for .stack, .heap sections because clang complains otherwise, and they are explicitly NOLOAD anyway
* Avoid duplicating __sev, __wfe, __wfi which Clang sometimes seems to provide as built-ins
* Add missing kitchen_sink_blocked_ram binary
* Allow build with LLVM Embedded Toolchain Form ARM v 14.0.0 (unsupported atm)
2023-03-01 15:10:18 -06:00
Nikhil Dabas
795d021ca6
Allow external pico-sdk-tools package (#1221)
This will enable builds to use pre-compiled copies of pioasm and elf2uf2, instead of requiring a native compiler.
2023-02-05 18:05:54 -06:00
Graham Sanderson
78d7a2522f
elf2uf2: Use LMA (instead of VMA) of entry_point to determine whether binary is flash/RAM (#1187) 2023-01-26 10:04:48 -06:00
Peter Harper
0b52603667
Fix build issues with spaces and parentheses (#1136)
Add VERBATIM to add_custom_command

Fixes #1043
2022-12-06 18:45:57 -05:00
Daniel Treffenstädt
a88baafc16
Implemented ARCHIVE_OUTPUT_DIRECTORY for uf2 output in CMake. Fixes #1012 (#1036)
* Added ARCHIVE_OUTPUT_DIRECTORY to uf2 output in CMake

This Commit enables the use of the ARCHIVE_OUTPUT_DIRECTORY target
properties in CMake for the generation of uf2 files.

The changeset in lines 47..51 is necessary due to CMake not
automatically creating the ARCHIVE_OUTPUT_DIRECTORY if no archive target
is present.

* rework cmake changes to make it friendler for non absolute paths

Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
2022-10-21 09:01:55 -05:00
Pedro Tôrres
2d4e3baa82
Set CMAKE_MAKE_PROGRAM when building ELF2UF2 and PIOASM (#935) 2022-10-16 17:31:58 -05:00
Koji KITAYAMA
e22807bc2e
Add a compile option to suppress fopen deprecated warning (#1035) 2022-10-16 17:22:25 -05:00
Koji KITAYAMA
8c6963d7ed
Fix compile errors when building with clang x86_64-pc-windows-msvc (#1038) 2022-10-16 17:22:06 -05:00
Patrick Plenefisch
6f1fc56833
pioasm: python output incorrectly rendered mov x, ~x as nop() (#1053)
This affects all move operations where source and destination are the same
but with an operation applied, ex: mov y, ::y, mov osr, ~osr, etc
2022-10-09 12:59:52 -05:00
Andrew Scheller
17c759b6e9
Fix various typos in CMake CONFIG lines. Also add a script that found some of these errors. (#907) 2022-08-02 07:28:37 -05:00
Andrew Scheller
6c19d20aa5
Fix up filename displayed by extract_config.py when an invalid attribute is found (#853)
(and tidy up the code a bit at the same time)
2022-06-13 09:48:01 -05:00
Ferdinand Bachmann
43a5593e8f
Pass PIOASM_EXTRA_SOURCE_FILES to Pioasm sub-cmake and add OUTPUT_FORMAT option (fixes #827) (#828) 2022-05-16 14:20:41 -05:00
Graham Sanderson
792813926d
Make pioasm accept windows CRLF input (#829) 2022-05-16 13:44:42 -05:00
Graham Sanderson
0d2591e1f1
Pad all but last sector in flash binary to write whole of sector (#800) 2022-05-10 13:03:44 -05:00
Andrew Scheller
5d422deed1
Add extra info about address_range defined values (#652) 2022-05-04 16:36:21 -05:00
Michael Olson
d831eff5a2
fix pioasm python output (#694) (#695)
Issue:
    irq wait 0
    irq 0
are translated as:
    irq(wait, 0)                          # 0
    irq(nowait, 0)                        # 1
wait/nowait are incorrect, should be block or ommited (alt: noblock).

After change:
    irq(block, 0)                         # 0
    irq(0)                                # 1
2022-01-08 13:55:23 -06:00
Graham Sanderson
db47fba48d
respect OUTPUT_NAME target property when generating supplemental files (#592) 2021-10-12 09:08:44 -05:00
Graham Sanderson
0a32023aac
fix arg parsing segfault (#595) 2021-10-08 09:01:56 -05:00
Philip Howard
e12713d70b
pio_assembler: typo fix (#538)
Change pleaced to placed
2021-10-04 13:11:03 -05:00
graham sanderson
a6a436b1fe use PUBLIC for pio headers on any target except INTERFACE library 2021-07-19 12:09:57 +01:00
Gabriel Wang
ccc0ba5649
elf2uf2: correctly parse ELF files where the program header is not directly following the file header
fixes #506
2021-07-14 15:59:09 -05:00
graham sanderson
529d7087eb fix operatore precedence of */ vs +- in pioasm 2021-07-06 16:00:02 +01:00
Uri Shaked
4328b2c75f
fix pioasm python output (#479)
While working on the [online pioasm](https://wokwi.com/tools/pioasm), I found several PIO instructions that result in invalid python code. Here is a small program that demonstrate the issue:

```
.program python_issue

    push block
    wait 0 irq 1 rel
    irq clear 1 rel
```

And the resulting Python program:

```python
# -------------------------------------------------- #
# This file is autogenerated by pioasm; do not edit! #
# -------------------------------------------------- #

import rp2
from machine import Pin
# ----------- #
# python_test #
# ----------- #

@rp2.asm_pio()
def python_test():
    wrap_target()
    push(, block)                         # 0
    wait(0, irq, 1 rel)                   # 1
    irq(clear 1 rel)                      # 2
    wrap()
```

After this fix, the above program compiles to a valid python syntax:

```python
# -------------------------------------------------- #
# This file is autogenerated by pioasm; do not edit! #
# -------------------------------------------------- #

import rp2
from machine import Pin
# ----------- #
# python_test #
# ----------- #

@rp2.asm_pio()
def python_test():
    wrap_target()
    push(block)                           # 0
    wait(0, irq, rel(1))                  # 1
    irq(clear, rel(1))                    # 2
    wrap()
```
2021-06-07 22:02:04 -05:00
Jonathan Reichelt Gjertsen
a531123080
Prevent the literal string DEBUG from being appended to some messages in CMake < 3.15 (#433)
Fixes issue #422
2021-05-25 17:10:55 -05:00
Graham Sanderson
b6f812f647
Change various (confusing to user) message to be DEBUG only (#365) 2021-05-04 08:01:11 -05:00
Graham Sanderson
fd16563f8f
Merge pull request #299 from raspberrypi/back-merge-1.1.1
Back merge 1.1.1
2021-04-01 17:32:02 -05:00
Graham Sanderson
260128a725
fixup elf2uf2 to allow blocked_ram (flash) binaries (#294) 2021-04-01 15:03:04 -05:00
Christian Flach
090c5cd83b
pio: Add 'pragma once' to generated header files (#237)
We can't really use traditional include guards, because the header file may be piped to stdout (which means we might not have a file name).
2021-03-08 12:21:36 -06:00
Andrew Scheller
20b9823aca
Delete some redundant CMake parts (#240) 2021-03-08 12:02:22 -06:00
Andrew Scheller
f3ee2f311c Modify extract_configs.py to deal with _u(X) macros (#222) 2021-03-04 21:22:48 -06:00
Andrew Scheller
1413a4f470 Fixup PICO_CONFIG entries (#208)
* remove default=undefined
 * fix a couple of typos / syntax "errors"
 * perform even better default-value-checking in extract_configs.py
2021-03-04 21:22:48 -06:00
Andrew Scheller
a53b3a2ff0 extract_configs: Do better matching-up of default values (regex was too strict)
also error if PICO_CONFIG says there's a default but no matching #define is found
2021-03-04 21:22:48 -06:00