Commit graph

587 commits

Author SHA1 Message Date
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
Peter Harper
bc7d9ce95a
Fix some header dependencies in bluetooth (#1294)
If you just want to link to pico_btstack_flash_bank_headers to include
the header file you also have to link to pico_btstack_base_headers.

ENABLE_CLASSIC and ENABLE_BLE are used in header files so should be
added by the headers library

Fixes #1271
2023-03-01 13:12:55 -06:00
Peter Harper
d9c88c6306
Make sure BT device address is set. (#1284)
* Make sure BT device address is set.
* Change cyw43_hal_generate_laa_mac to match MicroPython
2023-02-27 11:12:20 -06:00
Andrew Scheller
b1d4ba570e
Doxygen formatting fixes (#1283) 2023-02-26 17:05:39 -06:00
Andrew Scheller
777cd52e21
Git rid of some errant apostrophes in Doxygen / code comments (#1275) 2023-02-23 07:37:56 -06:00
Graham Sanderson
d172067f47
Add Raspberry Pi BTstack license (#1273) 2023-02-22 10:43:54 -06:00
Mr. Green's Workshop
37c8e9f0b2
typo fix (#1264) 2023-02-17 09:07:39 -06:00
Graham Sanderson
1331c47c9e
Add missing busy_wait_ms functino to host platform (#1254) 2023-02-13 15:22:03 -06:00
Andrew Scheller
c2af4e8bf4
Fix various Doxygen errors (#1251)
Co-authored-by: Peter Harper <peter.harper@raspberrypi.com>
2023-02-13 11:45:54 -06:00
Graham Sanderson
d30b97ab79
remove unnecessary headers - particular pico_stdlib.h which should not be included by libraries (#1250) 2023-02-13 10:40:46 -06:00
Andrew Scheller
226374a364
Documentation typos (#1249) 2023-02-13 09:40:26 -06:00
Graham Sanderson
e763cb8e99
Fix typo in pico_rand breaking randomness when PICO_RAND_ENTROPY_SRC_BUS_PERF_COUNTER=1 (#1246) 2023-02-12 10:51:08 -06:00
Andrew Scheller
5abb4eb911
Fix typos in the PICO_CONFIG settings (#1242) 2023-02-11 09:42:21 -06:00
Graham Sanderson
0121007c85
Improve SPI set-up: Don't change the config whilst it is enabled (#1227)
Co-authored-by: David Thacher <davidethacher@gmail.com>
2023-02-10 19:02:46 -06:00
graham sanderson
c8ccefb972 Add Bluetooth support
Co-authored-by: Peter Harper <77111776+peterharperuk@users.noreply.github.com>
2023-02-10 18:27:23 -06:00
Peter Harper
d07abf3ac0
Setup clock pin when starting SPI comms. (#1236)
Because the clock pin (29) also has to be used to read vsys,
its properties might be changed.
So reset when starting a spi transaction.

Fixes #1141
2023-02-10 10:18:34 -06:00
andygpz11
756c4f24a4
Remove duplicated comment line in header (#1237) 2023-02-09 12:06:16 -06:00
andygpz11
f54ca1a42e
Add/tidy API doxygen for the new pico_i2c_slave library (#1233) 2023-02-08 10:48:02 -06:00
Graham Sanderson
8c8006d457
Fix build backwards-incompatibilities with LIB_XXX defines, and add fix pico_time in host mode (#1232)
* restore original setters of LIB_PICO_ as some external code depends on it

* add __get_current_exception to host
2023-02-07 16:39:37 -06:00
Graham Sanderson
18b97fcba0
add new pcio_I2c_slave library (#1205)
* add (slightly modified) pico_i2c_slave library from https://github.com/vmilea/pico_i2c_slave
* introduce VTABLE_FIRST_IRQ constant
2023-02-07 07:47:01 -06:00
Andrew Scheller
66bd4d8aab
Comment typos (#1231) 2023-02-06 18:48:44 -06:00
Graham Sanderson
5eff1726c2
revert use of pico_add_library in pico_usb_reset_interface which is used by picotool and included directly as _headers library by SDK anyway (#1230) 2023-02-06 18:07:16 -06:00
Graham Sanderson
cc169ddd68
stdio hardening + new mutex API (#1224)
* * Harden stdio_usb and stdio in general against deadlocks which could otherwise result from doing printfs from within IRQs
* Add a test for the above
* Add mutex_try_enter_block_until API.
* Make best_effort_wfe_or_timeout not use alarms if called from within IRQ
2023-02-06 16:27:39 -06:00
Peter Harper
7ef7ec8491
Fix Windows build warning (#1228) 2023-02-06 16:13:26 -06:00
Graham Sanderson
ab18927533
Various Documentation Updates + bump version to SDK1.5.0-develop (#1220)
* minor cleanup of lwip+tinyusb docs, and bump sdk verison number to 1.5.0-develop
* Update cyw43_arch docs for async_context_use
* remove accidental copy of some comments
2023-02-06 15:07:37 -06:00
Brad S
a916761e7d
issue 1219, minor improvements to doxygen comments (#1223) 2023-02-05 19:00:26 -06:00
Graham Sanderson
7e305a70b0
fix typo (#1217) 2023-02-03 10:21:40 -06:00
Peter Harper
c05c97d338
Fix PICO_STDIO_USB_SUPPORT_CHARS_AVAILABLE_CALLBACK (#1216)
It's being used in the wrong place
2023-02-03 09:23:17 -06:00
Graham Sanderson
fff2c6b467
add thread info to pico_rand docs (#1214) 2023-02-02 12:29:06 -06:00
Peter Harper
31780aed2c
Add stdio_set_chars_available_callback (#1213)
There's currently no way to be notified in a "stdio" agnostic way
whether there's an incoming character available. You can poll with
getchar_timeout_us, but that's far from ideal.

Add a method that takes a callback to notify that a character might be
available.
2023-01-31 15:47:36 -06:00
Graham Sanderson
0e4e25a343
Rework build targets such that: (#1211)
1. Make sure Pico SDK libraries have the correct dependencies on other SDK libraries
2. Pico SDK libraries all have _headers variants to include the headers. This may facilitate building user STATIC libraries without
   pulling in SDK code, though care will still need to be taken w.r.t. values of #defines
3. Make sure the _headers versions also have the correct dependencies

Note: There are a few exceptions to 1. for some non code libraries like pico_standard_link and pico_cxx_options
2023-01-30 10:56:03 -06:00
Peter Harper
0b0931a9a2
Bssid (#1212)
* Add BSSID connection options to PicoW

When working with a mesh or multiple APs with the same SSID, it is often
necessary to specify which of the APs to connect to in order to maximize
the WiFi strength.

Add BSSID options to the SDK's PicoW cyw43_arch_wifi_connect_XXX APIs.

Fixes #1090

Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2023-01-29 16:56:58 -06:00
Sencer
c852a65ecc
define option to disable cpp allocation overrides (#1145)
Setting `PICO_CXX_DISABLE_ALLOCATION_OVERRIDES=1` will prevent `new` etc. operators being overridden
2023-01-29 12:40:01 -06:00
Peter Harper
1552324a64
Add mbedtls_hardware_poll implementation to pico_mbedtls 2023-01-27 11:15:22 -06:00
Graham Sanderson
45d2dc4c95
add missing pico_rand dependency (#1203) 2023-01-27 10:48:20 -06:00
Andrew Scheller
729c7f4326
Tweaks to section-attribute stuff in platform.h (#1202) 2023-01-27 08:05:11 -06:00
Liam Fraser
36ba9e64bc
Add NVIC struct. Fixes #947 (#1199) 2023-01-26 16:07:20 -06:00
Graham Sanderson
fefb6b6d1e
Move more code from pico_cyw43_arch to pico_cyw43_driver (#1201)
Basically the integration code (cyw43_config.h and related implementations) are now in the driver.
cyw43_arch now just has
  * async_context creation per CYW43_ARCH_TYPE
  * pre-existing cyw43_arch methods for connect etc.
2023-01-26 16:05:29 -06:00
andygpz11
b70f984f2a
Add pico_rand library (#1111)
Add a general purpose random number generator via pico_rand library. which tries to use as much real entropy as possible mixed into a PRNG

Co-authored-by: graham sanderson <graham.sanderson@raspberrypi.com>
2023-01-26 13:25:27 -06:00
Peter Harper
67af83f069
Fix compile issue with clock_t conversion (#1200)
We don't enable -Wconversion on the kitchen-sink build. But it's
enabled for some tinyusb examples.
2023-01-26 13:11:42 -06:00
Peter Harper
b979395c5e
Keep retrying if cyw43_wifi_join fails (#1195)
Currently, if the network can't be found we fail almost immediately.
Also fix error codes.

Fixes #1054
2023-01-26 11:28:04 -06:00
P33M
260df95e44
tinyusb: enable workaround for RP2040-E15 (#1137)
This sets the compile-time flag for tinyusb's dcd_rp2040 driver by
default. Applications that won't ever be plugged into a Pi 4 or Pi 400
can optionally disable this.
2023-01-25 17:19:23 -06:00
Graham Sanderson
9a5eae111b
fix compiler warning (#1193) 2023-01-25 11:41:45 -06:00
Graham Sanderson
248fc72f96
Remove (legacy) direct inclusion of 'pico/platform.h' and 'pico/config.h' (#1190)
* Remove (legacy) direct inclusion of 'pico/platform.h' which potentially skip config/board setup
* also fix direct use of pico/config.h which predated pico.h being assembly includable
2023-01-24 12:03:48 -06:00
Graham Sanderson
a540ca905a
Add new async_context abstraction and refactor cyw43_arch to use it (#1177)
* Extract all poll/threadsafe_background/freertos from cyw43_arch into new abstraction async_context:
* provides support for asynchronous events (timers/IRQ notifications) to be handled in a safe context.
* now guarantees all callbacks happen on a single core.
* is reusable by multiple different libraries (stdio_usb can now be ported to this but hasn't been yet).
* supports multiple independent instances (independent instances will not block each other).
* cyw43_arch libraries cleaned up to use the new abstraction. Note each distinct cyw43_arch type is now a very thin layer that creates the right type of context and adds cyw43_driver and lwip support as appropriate.

Additionally,

* Add new pico_time and hardware_alarm APIs
* Add from_us_since_boot()
* Add alarm_pool_create_with_unused_hardware_alarm()
* Add alarm_pool_add_alarm_at_force_in_context()
* Add hardware_alarm_claim_unused()
* Add hardware_alarm_force_irq()
* Added panic_compact() and some minor comment cleanup; moved FIRST_USER_IRQ define to platform_defs.h
2023-01-24 12:01:24 -06:00
Liam Fraser
c578422528
Remove PLL postdiv assert. Fixes #1047 (#1189) 2023-01-24 09:10:05 -06:00
Graham Sanderson
177b0303dd
SYS funcs and GCC12 fixes (#1186)
* SYS functions and GCC 12 fixes

* Add implementation of _gettimeofday and settimeofday, _times
* Remove some GCC warnings about unimplemented SYS functions (e.g. _open) by making weak implementations that return errors.
* Removed _exit from crt0.S since we have a weak version in runtime.c and we don't want two weak impls since the linker can't pick. If the user omits runtime.c then they'll need to provide _exit or get the error
* Add sys/time.h to arch/cc.h for lwIP as it seems under GCC12 this is not getting included
2023-01-24 09:00:26 -06:00
Graham Sanderson
a66ba7a942
user_irqs should be claimed globally not per core, since vector tabes are shared (#1183) 2023-01-24 08:58:01 -06:00
Graham Sanderson
8b8778c59b
compile issue seems to have snuck thru (#1184) 2023-01-20 16:47:23 -06:00
Howard Su
aaf0828250
change clock_gpio_init to take float and add clock_gpio_init_int_frac (#1178) 2023-01-20 15:45:18 -06:00