Commit graph

328 commits

Author SHA1 Message Date
hathach
9539914038 change qtpy boot2 to w25q080_2_padded 2021-09-22 19:13:12 +07:00
Earle F. Philhower, III
adf1c88c27
Fix spelling and update readme. Prep for 1.9.5 (#319) 2021-09-19 13:43:26 -07:00
Dan Halbert
ad905ae992
Build libpico.a with PICO_XOSC_STARTUP_DELAY_MULTIPLIER=64 (#315)
Fixes #312
2021-09-19 13:31:39 -07:00
Leonardo La Rocca
608a5da480
Adds board variant definition for Melopero Shake RP2040 (#318) 2021-09-19 13:26:33 -07:00
Maximilian Gerhardt
3df3f0741a
Add PlatformIO support (#250)
* Add package.json

To make package easily integratable with PlatformIO

* Correct name back to original one

* Format package.json

* Add first shot at builder script

* Add USB stack flags, fix compile flags

* Formatting

* Add more link & USB flags

* Build Boot2 bootloader

* Formatting

* Generate linkerscript, linker fixes

* Fix linkflags, make firmware runnable

* Update USB flags and RAM size

* Correct USB flags, add dynamic sketch partitioning

* Restructure filesystem size and flash size logic into platform code

* Move C++ only flags to CXXFLAGS

* Add PlatformIO documentation

* Link to new platform.io document in the docs TOC

* Fix typos in platformio docs

* Fix one additional typo in platformio.rst

* Update docs

* Remove wrongly commited build folder
2021-09-13 21:28:07 -07:00
SirSydom
3585c58688
Reset the SDA and SCL pins to INPUT at Wire.end() to prevent multiple pins connected to I2C when changing pins (#302) 2021-09-03 08:40:18 -07:00
Earle F. Philhower, III
a8121f31d4
Fix pulseIn detection (#293)
Fixes #289
2021-08-30 12:40:38 -07:00
AustinMorris
38c005c208
Fix wire defines on feather (#281) 2021-08-23 20:45:12 -07:00
Pontus Oldberg
cd91d3ef0f
Added minimal HW support for onboard WiFi modem. (#287) 2021-08-23 20:34:25 -07:00
Pontus Oldberg
02e8577f45
Add support for reverse numbering of analog pins. (#283) 2021-08-17 09:44:28 -07:00
Earle F. Philhower, III
8451bc21ec
Don't use no-c++-exceptions version of libstdc++ (#280)
Per #276, #277, #274 there seems to be an issue with interrupts and some
other low-level ARM operations when using the distributed libstdc++.

Use the default libstdc++ built with the toolchain, instead.

Fixes #277
Fixes #276
Fixes #274
2021-08-12 12:50:39 -07:00
Earle F. Philhower, III
28fe90e504
Update README.md 2021-08-12 08:55:12 -07:00
Pontus Oldberg
2c29314578
Add support for our new Challenger RP2040 board with LTE modem. (#275)
* Adds support for Challenger RP2040 WiFi boards

* Added Challenger board to makeboards build script

* Adds new challenger board with LTE modem.

* Updated after getting approved PID from Raspberry Pi
2021-08-12 08:42:09 -07:00
Earle F. Philhower, III
e196db9645
Update README.md 2021-07-29 09:02:45 -07:00
Pontus Oldberg
733aca5ac3
Adds support for Challenger RP2040 WiFi boards (#268) 2021-07-29 08:59:27 -07:00
Earle F. Philhower, III
177a2d03a1
Update pull-request.yml 2021-07-29 07:56:10 -07:00
Earle F. Philhower, III
fec3ea882d
Minor paranoid nullptr checks in USB interface (#267)
Identify some spots that GCC's -fanalyzer noted might need nullptr
checks, and add them.
2021-07-28 18:11:25 -07:00
Earle F. Philhower, III
580970cd72
Use Stream::setTimeout to specify I2C TO (#263)
Use the existing Arduino Stream method of setTimeout to set the Wire
I2C timeout delay.

Fixes #260
2021-07-23 15:20:34 -07:00
Earle F. Philhower, III
c13bb1ec2b
Make multiple SDFS/LittleFS.begin calls noops (#262)
When LittleFS.begin() or SDFS.begin() is called after the filesystem is
already mounted, don't unmount/remount.  When an unmount happens, all old
Files become invalid (but the core doesn't know this), so you would end
up with random crashes in FS code.

Now, check for _mounted, and if so just return immediately from begin().
2021-07-23 14:16:57 -07:00
Ubi de Feo
c777dd1657
Fix JSON URL (#261)
you had "esrle" instead of "earle" in the GH URL :)
2021-07-23 08:17:32 -07:00
Earle F. Philhower, III
cb9931f3e8
Set available() to 0 when Wire.requestFrom fails (#259)
Wire::requestFrom() returns the number of bytes read from the slave.  In
the case of error, the slave can end up returning a very large integer
for PICO_GENERIC_ERROR which would then be used as the # of bytes read
causing crashes and errors.

Running TalkingToMyself without connecting the I2C ports would show
this behavior.

Now, when PICO_GENERIC_ERROR is returned, set the read-back buffer len
to 0 explicitly.
2021-07-21 18:59:24 -07:00
Giampiero Baggiani
6b6254e84a
Added missing SPI::setCS(pin) in docs (#256) 2021-07-20 03:45:01 -07:00
Maximilian Gerhardt
61c6305aa8
Fix upload file path escaping on Windows (#254) 2021-07-19 08:46:55 -07:00
Earle F. Philhower, III
b43056cd73
Avoid issues w/other installed Windows Pythons (#253)
When a Python MSI/etc. is installed under Windows, it sets a global
PYTHONHOME and other variables.  Our shipped Python can end up using
these variables and attempt to load the wrong PYC files and fail
to run.

Avoid by using -I isolated mode in Python calls

Fixes #252
2021-07-19 08:16:22 -07:00
Earle F. Philhower, III
e4c144829c
Remove exception handling code, save RAM and FLASH (#245)
Use a libstdc++ compiled with -fno-exceptions to avoid including the
code needed to unwind C++ exceptions.

Saves ~4K RAM and ~5K flash.
2021-07-17 10:55:47 -07:00
Earle F. Philhower, III
05356da2c5
Fix PWM frequency at low and high frequencies (#244)
The PWM HW can only divide 125MHZ sysclk by 1...256.  That's only down to
about 500khz.  If the max count of the PWM (analogWriteScale) is too low
then the actual PWM period will be much less than desired (and PWM frequency
of course much higher).

For example, at analogWriteFreq(100); analogWriteScale(256); the true
PWM period would be 125M / 256 (pwmdiv) / 256 (scale) = ~2khz.

Conversely, at high frequencies and large scales it is impossible to achieve
the requested frequency and a much lower one would be generated.  For
example: freq(60K), scale(32768). PWM period = 125M / 1 (pwmdiv) / 32768 =
~4kHz.

Avoid this by adjusting the analogWrite scale in the core to either increase
the PWM count for low frequencies, or decrease it for high frequencies.
This is done behind the scenes and code is not required to be changed.

The PWM frequency will still not be perfcetly exact due to the divider HW
and clocks involved, but it will be very close across the whole range.

Fixes #234
2021-07-15 08:34:53 -07:00
majbthrd
47a4d9f803
Add pico-debug support (#239) 2021-07-07 12:55:03 -07:00
Earle F. Philhower, III
e4185ce4ce
Update toolchain, add CMSIS-DAP to OpenOCD (#241)
Enable use of the included openocd binary with pico-debug
2021-07-05 19:29:47 -07:00
Earle F. Philhower, III
c539742e13
Disable ignored-qualifier warning in SDK (#238)
The Pico SDK has some magic with const pointers that generates lots of
"ignored qualifer" warnings on the more pedantic modes.  To clean the
normal builds up, disable this warning for now.  At some point a PR to
the PICO-SDK may be indicated.
2021-07-04 13:46:50 -07:00
Earle F. Philhower, III
ebd2289971
Add warning flags to build, catch missing return (#237)
Fixes #236

Compiler warning flags were completely ignored/missed in platform.txt.
Add them, as normal, and include -Werror=return-type because GCC will
produce crashing apps when a function return value is missing.
2021-07-04 12:30:59 -07:00
Earle F. Philhower, III
d67329a2b8
Rename assembly dir to boot2, only has boot2.Ss (#230) 2021-06-30 08:42:13 -07:00
Ha Thach
3a9703fc20
Update tinyusb 1.3.0 (#228)
* update included tinyusb to 1.2.0

move tusb_config.h from core to library for more portability

* pump tinyusb

* update tinyusb to 1.3.0

* try to fix ci warning
2021-06-30 08:22:36 -07:00
Earle F. Philhower, III
856b105ab9
Clean up include paths, remove duplicates/invalids (#229) 2021-06-30 08:13:19 -07:00
Earle F. Philhower, III
03e740a511
Add CPU cycle counter accessors (#226)
Use the 24-bit SYSTICK peripheral, wrapped in logic to extend it to a
full 32 or 64bits.  W/o the wrapper, SYSTICK will wrap around in ~100ms.

Adds rp2040.getCycleCount() and rp2040.getCycleCount64()

Clean up the libpico build process as crt0.S from the pico-sdk should
be directly used.

Clean up the keywords file.
2021-06-28 20:53:40 -07:00
Earle F. Philhower, III
e628c8e211
Upgrade Newlib to include 64-bit/8-bit %llu/%hhd (#227) 2021-06-28 20:46:08 -07:00
Ha Thach
7eca6c609f
Use correct tusb_config.h for built-in usb (pico-sdk) (#219)
Fix issue with usbd_desc_cfg value may not be initialized as zero.
2021-06-26 09:37:41 -07:00
Earle F. Philhower, III
f299120798 Remove accidental debug message 2021-06-25 18:47:02 -07:00
Earle F. Philhower, III
aac8146f00 Clear I2C status on short slave reads
Fixes #222

The HW needs to have the TXC_ABRT flag cleared when a slave transmission is
cut short by the master, or else it will effectively break the I2C bus and
never recover.
2021-06-25 18:39:44 -07:00
Earle F. Philhower, III
35c974d4c0
Fix file creation on SD and SDFS (#216)
The O_CREAT/etc. flags on the Pico are a full 32-bits in size, but the
core was generating a flag for SdFat using an 8-bit type, so all the
O_CREAT, O_TRUNC, O_APPEND, etc. flags got cut off.

Fix the flag size.

Fixes #214
2021-06-19 12:15:11 -07:00
Earle F. Philhower, III
27476815ab
Fix SerialUART flush (#215)
Serial1.flush/Serial2.flush was not waiting for the proper FIFO to clear.
Use the proper call from the Pico SDK.

Thanks to Peter Remias for noting it.
2021-06-16 08:25:24 -07:00
Earle F. Philhower, III
b02b9c4be8
Add PDM library for Arduino Nano RP2040 Connect (#213)
* Add PDM library for Arduino Nano RP2040 Connect

* No PDM test in CI, only works on Arduino Nano RP2040
2021-06-16 08:17:09 -07:00
Earle F. Philhower, III
6afcf5881d
Initial Arduino Nano RP2040 Connect support (#212)
Thanks to @Claupio for the bringup!
Reference #208
2021-06-14 08:59:52 -07:00
Earle F. Philhower, III
30704a7c5e
Obey timeout value on SerialUART.read/.peek (#211)
Fixes a hang when reading from the Serial UART ports because before the
core would pause indefinitely for the next character.

Now, wait up to Serial.setTimeout() milliseconds and if it times out
return -1 to the app.

Fixes #210
2021-06-13 14:11:23 -07:00
Earle F. Philhower, III
08b6748d79
Update to PICO-SDK version 1.2.0 (#207)
Minor rev to the tinyUSB version used, new ID function.
2021-06-11 12:48:09 -07:00
Earle F. Philhower, III
bedfbda372
Clear PIO FIFOs when updating Tone and Servos (#206)
The PIO programs that generate tone() and Servo() use the TX FIFO to
receive updates to the period/duty cycle.

The original code would push into the FIFO (potentially blocking the
app if the FIFO was full) and generate at least one cycle of every
value written into the control.  Basically, the output would
lag the changes by 1 cycle or more (which could be 20ms+ on Servo).

Fix this by clearing any old, ungrabbed values from the FIFO before
sending a new one to the program.  Instead of a FIFO, there is
effectively now just a control register and updates will be immediate.

Update the Siren.ino example with delays because now the tone() calls
will not block and run 10x+ faster.
2021-06-11 12:27:48 -07:00
Earle F. Philhower, III
9fbf6ab35d
Clean up Arduino.h header, remove duplicates (#205)
Many functions are defined inside the api/Common.h, so remove them from
the Arduino.h header to have them appear only once.

Fix up the abs() macro to avoid macro problems, add round()
2021-06-11 12:23:23 -07:00
Earle F. Philhower, III
793496da98
Set GPIO digital output on digitalWrite (#203)
Fixes #202
2021-06-10 07:58:09 -07:00
Earle F. Philhower, III
81cbf8357d
Update README.md 2021-06-08 08:39:58 -07:00
Earle F. Philhower, III
55a260e4e8
Update README.md 2021-06-08 08:35:32 -07:00
Earle F. Philhower, III
5c71564844
Add PIOASM online tool link, thanks @jake653! (#197) 2021-06-08 08:34:53 -07:00