Commit Graph

17 Commits

Author SHA1 Message Date
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
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
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
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
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
Koji KITAYAMA
e22807bc2e
Add a compile option to suppress fopen deprecated warning (#1035) 2022-10-16 17:22:25 -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
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
260128a725
fixup elf2uf2 to allow blocked_ram (flash) binaries (#294) 2021-04-01 15:03:04 -05:00
Peter Lawrence
173d63ef8d elf2uf2: fix address range bug 2021-03-04 21:22:48 -06:00
graham sanderson
1822d113d9 elf2uf2: fix breakage for no_flash builds; removep 0xFFFFFFFF constantds and error messsage 2021-03-04 21:22:48 -06:00
Peter Lawrence
cfff23c5a3 elf2uf2: determine entry address selected by Boot ROM (Plan B) 2021-03-04 21:22:48 -06:00
Peter Lawrence
ef030701c9 elf2uf2: determine entry address selected by Boot ROM 2021-03-04 21:22:48 -06:00
majbthrd
76b385bc26 elf2uf2: add the cache memory range described in Section 2.8.4.2 (#14)
* elf2uf2: add the cache memory range described in Section 2.8.4.2 of datasheet

* elf2uf2: update memory region nomenclature

* elf2uf2: update ROM size

* elf2uf2: use existing metadata to evaluate ram_style

Authored-by: Peter Lawrence <12226419+majbthrd@users.noreply.github.com>
2021-02-01 14:46:45 -06:00
graham sanderson
26653ea81e Initial Release 2021-01-20 10:44:27 -06:00