Commit Graph

423 Commits

Author SHA1 Message Date
envirocoder
887c0b8443
IRQ on CYW43_PIN_WL_HOST_WAKE not gpio13 (#1069)
fix bug #1068 where the raw irq handler that was added masked on IO_IRQ_BANK0 (defined as 13) and not the gpio connected to the CYW43 i.e.  CYW43_PIN_WL_HOST_WAKE

Co-authored-by: andrew arm <armdev@openlx.org.uk>
2022-11-24 08:42:25 -06:00
Nicolas Pouillon
586850e66f
binary_info/structure.h: Fix pins_with_func format comment (#1070) 2022-11-22 18:26:16 -06:00
andygpz11
5258ee640b
Add new DMA sniffer's API (#887) 2022-11-02 09:25:27 -05:00
Lord-Lucan
e4da37cf0c
Fix for cyw43 driver working with SMs other than 0 (#1080) 2022-10-27 16:06:33 -05:00
Engineer_Will
6d15974e96
Add some definition files for waveshare board. (#984)
* src/boards/include: Change the default I2C interface of RP2040_lcd_0.96.

* src/boards/include: Add some definition files for waveshare board.
2022-10-21 09:01:10 -05:00
Timo Kokkonen
e50e107d91
Fix unexpected (CMake) behavior with PICO_BOARD variable. (#1050)
* Fix unexpected (CMake) behaviour with PICO_BOARD variable.

Changing PICO_BOARD value from "pico_w" to "pico" did not
unset PICO_CYW43_SUPPORTED variable. Which could lead
CYW43 driver included in builds for "pico".

solution: make PICO_CYW43_SUPPORTED a non cache variable

Co-authored-by: Graham Sanderson <graham.sanderson@raspberrypi.com>
2022-10-21 08:59:02 -05:00
James Peach
16ab2b21ba
Remove incorrect override for LWIP_PLATFORM_ASSERT (#1064)
* Remove incorrect override for LWIP_PLATFORM_ASSERT

LWIP_PLATFORM_ASSERT macro is used by lwip driver implementations to specify the behavior of the assertions in lwip code.

The previous override of this macro incorrectly assumed that the parameter to the function macro was the condition to check. However this is incorrect. The parameter is actually a message string defining what failed. 

This mistake caused all assertions to be ignored. ( and myself to loose many hours of debugging time )

By removing this, we restore the default behavior specified by lwip which is to use `printf` to log the message.

* I think i prefer to use panic (which doesn't pull in fflush etc)

Co-authored-by: Graham Sanderson <graham.sanderson@gmail.com>
2022-10-21 08:57:21 -05:00
Graham Sanderson
b0294d6bf4
fix build without mbedtls submodule initialized, and fix deoptimized debug build (#1067) 2022-10-17 11:34:10 -05:00
Peter Pettersson
3bd7a829db
Some optimizations for the hardware divider (#1033)
* Remove unnecessary wait in pico_divider.

There is no need to wait if there is more than 8 cycles between setup and result readout.
Dividend/divisor readout should be correct without delay. Update comment to reflect that.

* Optimize hw_divider_save_state/hw_divider_restore_state.

Doing multiple pushes to avoid stack usage is faster.
The wait loop in hw_divider_save_state had an incorrect branch in the wait loop.
This didn't matter since the wait wasn't necessary to begin with.

* Remove pointless aligns in hardware_divider.

The regular_func_with_section inserts a new section so if aligning
is desired it should be placed in the macro after section start.

* Save a few bytes in hardware_divider.

Signed and unsigned code can use the same exit code.
Branching to the common code is free since we need the 8 cycle
delay anyway.
2022-10-16 17:40:22 -05:00
Jonathan Reichelt Gjertsen
587ac803c5
Avoid compound assignment with volatile left operand as described in #1017 (#1018)
also move to use of hw_set_bits where appropriate
2022-10-16 17:24:23 -05:00
Peter Harper
719d5e41a2
Add mbedtls to pico-sdk (#894)
* Add mbedtls as a submodule

Checked out on branch mbedtls-2.28

* Add mbedtls to pico-sdk

Link your code to pico_lwip_mbedtls and pico_mbedtls.
See tls_client example in pico-examples

Fixes https://github.com/raspberrypi/pico-sdk/issues/893
2022-10-16 16:41:21 -05:00
Jan Niehusmann
8e014e6b5d
Make sure OUT_STICKY is not set when setting pins / pindirs (#989) 2022-10-16 16:39:44 -05:00
Peter Harper
c4f37b2e44
Lwip build fixes (#1011)
Only build lwip acd.c if it exists (after 2.1.3)
Some mdns files only exist in 2.2.x

Fixes #1009
2022-10-16 16:38:42 -05:00
alastairpatrick
24bb3627cf
PLL REFDIV values > 1 considered by vcocalc.py (#952) 2022-10-05 19:06:26 -05:00
Graham Sanderson
3ed9e2fb1e
Avoid initializing full stdio_stack_buffer object with zeros (#992) 2022-09-26 11:49:16 -05:00
alastairpatrick
98aba25e64
Make __get_current_exception inline (#1016)
not `static` inline, so we keep an implementation around if needed (someone might have called it from assembly)
2022-09-12 15:28:18 -05:00
Jeremy Grosser
849cdf8a30
Typo in float_aeabi.S: srqtf => sqrtf (#702) 2022-09-12 13:44:38 -05:00
Flaviu Tamas
5e9eb27ac2
Implement whole-buffer write semihosting (#1013)
* Implement whole-buffer write semihosting

Each semihosting call is very slow, so doing it for each character
does not provide an ideal developer experience.

This change allows the entire buffer to be printed out in a single call.
2022-09-12 13:20:30 -05:00
Ha Thach
a4ec3c4848
fix wconversion warning (#981) 2022-09-06 11:02:45 -05:00
bruelltuete
189d377be2
Only include mutex header if necessary (#991) 2022-09-06 11:00:51 -05:00
Zachary Kohnen
07e5caf341
Supress -Wunused-parameter when PICO_STDIO_ENABLE_CRLF_SUPPORT is unset (#998) 2022-09-06 10:59:48 -05:00
Peter Harper
0041f4b7fd
set CYW43_WIFI_NVRAM_INCLUDE_FILE allowing user override 2022-09-01 14:10:06 -05:00
David Thacher
89bce613ae
Remove hw_set_bits from pio->irq (#978)
It is not known if this is required. This is done for consistency purposes. Related to #974
2022-08-18 08:14:40 -05:00
NomiChirps
830e867211
Fix dma_irqn_acknowledge_channel (#977)
Also dma_channel_acknowledge_irq0 and dma_channel_acknowledge_irq1.
Using hw_set_bits acked every channel because INTS0/1 are WC registers.

Fixes #974.
2022-08-17 14:37:50 -05:00
Graham Sanderson
00780f0de9
Make sure stack is 8 byte aligned in shared IRQ handlers (#971) 2022-08-17 10:25:23 -05:00
Mr. Green's Workshop
80cde7276d
Enable/disable connection check made with DTR (#932)
* Enable/disable connection check made with DTR
this gives users the option to disable DTR check.

Co-authored-by: Graham Sanderson <graham.sanderson@gmail.com>
2022-08-10 09:16:44 -05:00
Attila Wagner
a33a11ea16
Call cyw43_deinit() from cyw43_arch_deinit() to release the DMA channels and power off the WLAN chip (#965) 2022-08-10 07:55:54 -05:00
Graham Sanderson
2dfaa1ab4c
Fix various stdio_usb issues, add stdio_init_all return code, and add alarm_pool_core_num() API (#918)
This issue addresses possible starvation issues when using `getchar()` with `stdio_usb` and also fixes possible missing of IRQs as a result of #871
2022-08-08 10:12:54 -05:00
Thomas Roberts
150be75aa4
Add pico_lwip_mqtt library (#948) 2022-08-08 09:14:01 -05:00
Attila Wagner
2ebba462ac
Properly terminate cyw43 task when cyw43_arch_deinit() is called (#962) 2022-08-08 07:48:29 -05:00
Graham Sanderson
fe7849d645
fix delayed_by_us and delayed_by_ms to not return times > at_the_end_of_time (#936) 2022-08-08 07:42:52 -05:00
Andrew Scheller
49d7d9edfb
typo (#905) 2022-08-02 07:29:08 -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
Mr. Green's Workshop
de8f857de4
fix typo datsheet -> datasheet (#942)
fix typo datsheet -> datasheet
2022-08-02 07:26:04 -05:00
Graham Sanderson
0fa3e7247d
Some PIO setup was using SM 0 rather than the allocated SM (#940) 2022-07-27 08:24:42 -05:00
graham sanderson
5e9a5e827b Add Pico W and lwIP support 2022-06-30 00:46:13 -05:00
Graham Sanderson
bc5d1b8485
Add channel_config_set_high_priority (#888) 2022-06-29 20:56:45 -05:00
Earle F. Philhower, III
e7267f99fe
Fix GPIO # callback parameter (#880)
Fixes #879
2022-06-24 03:58:36 -05:00
Earle F. Philhower, III
4c49427bf3
Fix auto_init_recursive_mutex definition for C++ (#875)
Co-authored-by: Graham Sanderson <graham.sanderson@gmail.com>
2022-06-20 12:47:46 -05:00
Liam Fraser
33818dd0bd
Increase PLL min VCO from 400MHz to 750MHz for improved stability across operating conditions (#869)
Co-authored-by: graham sanderson <graham.sanderson@raspberrypi.com>
2022-06-20 10:28:03 -05:00
Graham Sanderson
8f09099757
sem_acquire has no reason to do a notify! (#857) 2022-06-20 09:52:43 -05:00
Graham Sanderson
9644399993
Suppress new GCC 12 warning (#842) 2022-06-20 09:52:25 -05:00
Graham Sanderson
b3c56e7169
Add stderr support and remove 1us timeout for timeouts of 0us (#858) 2022-06-20 09:52:06 -05:00
Graham Sanderson
7858601a58
stdio_usb improvements (#871)
Use shared IRQ if available to avoid 1ms timer. Allow use of stdio_usb with user's tinyusb setup if it has CDC
2022-06-20 09:51:51 -05:00
Datanoise
0bdd463898
Add DatanoiseTV DSP Board. (#866) 2022-06-17 18:03:46 -05:00
arturo182
7daa20ce4c
Add board definition for the RP2040 Stamp Round Carrier (#837) 2022-06-17 12:58:13 -05:00
Earle F. Philhower, III
705b5cedcd
Wrap realloc() call with malloc_mutex in multicore (#864)
Protect against heap corruption by mutex-protecting the realloc() call
(like malloc/free are already).

Fixes #863
Fixes https://github.com/maxgerhardt/platform-raspberrypi/issues/7
Fixes https://github.com/earlephilhower/arduino-pico/issues/614
2022-06-17 09:50:53 -05:00
Luke Wren
bdd9746635
Don't copy .data for NO_FLASH binaries, as it's loaded in-place (#859) 2022-06-17 09:50:12 -05:00
Andrew Scheller
babc4a1794
Remove 'default=none' from PICO_CONFIG lines (#865) 2022-06-13 09:49:43 -05:00
Graham Sanderson
672e48e9e9
Add sem_try_acquire(). Fixes #846 (#856)
Co-authored-by: Geoff Simmons <geoff@uplex.de>
2022-06-08 13:23:36 -05:00
Graham Sanderson
ef47dfeeaf
Add new GPIO APIs for adding shared GPIO handlers, and improve docs (#850)
Co-authored-by: Adam Nielsen <malvineous@shikadi.net>
2022-06-08 13:03:11 -05:00
Graham Sanderson
6389927cf9
Add some optional header includes, to make per-target changes to config easier (#851) 2022-06-08 12:59:45 -05:00
Graham Sanderson
d3dcbb8292
Add new user_irq claim APIs to make it easier for independent code using them to interoperate (#854) 2022-06-07 14:27:38 -05:00
Graham Sanderson
f3c446ae14
move get_core_num() into platform.h (#852) 2022-06-06 08:20:00 -05:00
Graham Sanderson
1e6c122fc9
gate inclusion of pico.h in binary info, so as not to break picotool builds (#836) 2022-05-18 10:39:17 -05:00
Andrew Scheller
7880405292
Doxygen typo (#835) 2022-05-17 19:26:00 -05:00
Andrew Scheller
530204ec0c
Small tweak to busy_wait_at_least_cycles doxygen (#834) 2022-05-17 19:24:52 -05:00
Graham Sanderson
b2ad632c24
Minor additions to PIO documentation (#831) 2022-05-17 13:04:38 -05:00
Graham Sanderson
658a21b946
Update rtc_set_datetime docs to point out that the written value may not be immediately visible (#832) 2022-05-17 12:59:00 -05:00
Graham Sanderson
e44d2c0010
Add busy_wait_at_least_cycles method (#830) 2022-05-16 16:45:39 -05:00
Graham Sanderson
159d552150
Fix bug in irq_remove_shared_handler and add test #823 (#825)
* Fix bug in irq_remove_shared_handler and add test #823

* Add comments to irq_handler_chain.S

Co-authored-by: Luke Wren <wren6991@gmail.com>
2022-05-16 13:44:15 -05:00
Andrew Scheller
3a3d5fe6c4
Small IRQ doxygen tweaks (#824) 2022-05-15 15:02:13 -05:00
Graham Sanderson
5e22c09660
convert unlikely panic to hard_assert to not waste space for string (#826) 2022-05-15 15:01:44 -05:00
Graham Sanderson
4e62c26a2c
Add documentation to dma_channel_abort regarding errata RP2040-E13 (#816)
Co-authored-by: Luke Wren <wren6991@gmail.com>
2022-05-11 19:24:42 -05:00
Graham Sanderson
5a927792ef
Suppress false GCC 11 warning on TinyUSB (#819) 2022-05-11 14:49:57 -05:00
Graham Sanderson
60a6fea534
Fix list management in stdio_set_driver_enabled so drivers can be freely added and removed (#822) 2022-05-11 10:44:41 -05:00
eskimo-software
f260477802
Adapt assembler syntax to eliminate Clang errors. (LLVM 14.0.0) (#798)
Co-authored-by: jeremyd <>
2022-05-09 15:11:59 -05:00
Graham Sanderson
e1c5fd34e4
PLL setup check bug (#796) (#806) 2022-05-09 14:52:38 -05:00
Eunkyoung Kim
0c501c246a
Add wiznet_w5100s_evb_pico support (#666) 2022-05-04 16:35:06 -05:00
Graham Sanderson
259da19660
Include structs/iobank0.h from hardware/gpio.h (#733) (#807) 2022-05-04 16:34:11 -05:00
ZodiusInfuser
5325008956
Added board definition for upcoming Pimoroni motor driver (#795) 2022-05-04 16:21:30 -05:00
Andrew Scheller
510ca47c92
Additional PWM validation and small tidy-up (#801)
See #768 for discussion / inspiration
2022-05-04 15:29:26 -05:00
ZodiusInfuser
d5121dc880
Removed unnecessary ifdefs from Pimoroni boards (#802)
* Removed unnecessary ifdefs from Pim boards
* Re-ordered some pins
2022-05-04 15:26:55 -05:00
Andrew Scheller
3c450011da
Additional param-validation for PIO (#805)
The RP2040 datasheet says "If INT is 0, FRAC must also be 0."
2022-05-04 15:25:43 -05:00
Ryan Hartlage
6149b9e4ec
Add board definition for Seeed Xiao RP2040 (#691)
* Add board definition for Seeed Xiao RP2040

https://www.seeedstudio.com/XIAO-RP2040-v1-0-p-5026.html
https://wiki.seeedstudio.com/XIAO-RP2040/
2022-05-03 12:40:40 -05:00
bruelltuete
8554fc4ea1
Add is_at_the_end_of_time() method (#784) 2022-05-03 11:55:01 -05:00
ZodiusInfuser
01290c4cb3
Added int_frac function for configuring PWM (#768) 2022-05-03 11:54:46 -05:00
Andrew Scheller
8d43364cfb
Small typos (#776) 2022-05-03 11:47:48 -05:00
bruelltuete
76c1830aeb
Add gpio_deinit (#793) 2022-05-03 11:46:27 -05:00
Andrew Scheller
c66a2c1c3b
Remove implicit grouping for PIO defines (#779) 2022-05-03 11:46:10 -05:00
Akiyuki Okayasu
e4a2aa7262
Fix typo in binary_info description (#788) 2022-05-03 11:43:42 -05:00
Andrew Scheller
fc86203f49
comment typo (#794) 2022-05-03 11:41:10 -05:00
Andrew Scheller
6619a2d329
Typo (#799)
Remove superfluous apostrophes in Doxygen comments
2022-05-03 11:34:46 -05:00
Graham Sanderson
5a427fbf1f
irq_add_shared_handler assertion fix #724 (#747) 2022-04-29 14:34:20 -05:00
ZodiusInfuser
bb5a2a3906
Added definition for Badger RP2040 board (#735) 2022-04-04 16:10:32 -05:00
Graham Sanderson
8291f1013a
add #ifdef guards to vgaboard.h to allow user overrides (#746) 2022-04-04 16:08:53 -05:00
Kai
e90f831756
add board definition of eetree gamekit rp2040 (#732) 2022-04-04 16:08:30 -05:00
Graham Sanderson
541f93541c
improve comment (#658) 2022-04-04 16:08:12 -05:00
Andrew Scheller
17d53af105
Allow 252-byte binaries to be checksummed (#764)
Fixes #740
2022-04-04 15:46:34 -05:00
Doug Rabson
1896b1491b
fix __ctzdi2 for values with non-zero low 32 bits (fixes #765) (#766) 2022-04-04 15:45:01 -05:00
ZodiusInfuser
3d45276423
Added board definition for upcoming Pimoroni servo driver (#769) 2022-04-04 15:31:52 -05:00
Andrew Scheller
d35083b3f7
Fix typo in SIO register description (#770) 2022-04-04 15:30:13 -05:00
Brian Murphy
d54104a1e5
fix when PICO_NO_BINARY_INFO is set (#693)
Co-authored-by: Brian Murphy <brm@robotize.com>
2022-03-22 17:53:32 -05:00
Stefan Kerkmann
bc3484e793
Mark __aeabi_lmul section as allocatable and executable (#722)
When using a linker script which does not provide a .time_critical.
section that is marked "ax" and wrongly define
PICO_INT64_OPS_IN_RAM=1 this would generate a malformed
executable with strange runtime bugs in the worst case.
2022-03-22 17:51:24 -05:00
Andrew Scheller
bf9848eaf9
Updated DMA CTRL_TRIG.CHAIN_TO reset values (#743) 2022-03-04 16:47:41 -06:00
Akiyuki Okayasu
ae7ef546a6
Fix typo in Doxygen comment (#731) 2022-02-14 12:03:47 -06:00
Stephen Robinson
b3cf3e8f6f
Correct comment in time.h (#715)
There was `microseconds` written where there should have been `milliseconds`.

Co-authored-by: Stephen <stephen@drsudo.com>
2022-01-22 19:57:47 -06:00
bobsayshilol
25a3b36793
Fix assert in adc_set_round_robin() (#698)
The mask passed in shouldn't already be shifted by ADC_CS_RROBIN_LSB
(16) otherwise the shift in the call to hw_write_masked() would shift
all of the bits off the end of the mask, hence we should be asserting
not against ADC_CS_RROBIN_BITS (0x1f0000) but against the number of ADC
channels available.
2022-01-19 09:34:18 -06:00
Daniel KJ
96afce8ece
Add board definition for Adafruit Macropad (#684)
* added board header for adafruit macropad rp2040

Co-authored-by: Daniel Kenyon-Jones <mail@dlkj.co.uk>
2022-01-19 09:32:17 -06:00
Andrew Scheller
5bcf4ed83a
Clarify header-comments about pico_enable_stdio_ CMake-functions (#705) 2022-01-19 09:30:21 -06:00