Commit Graph

14 Commits

Author SHA1 Message Date
Daniel Schaefer 3c66a55341 raspberrypi: Allow build without audio
Signed-off-by: Daniel Schaefer <dhs@frame.work>
2023-08-09 17:28:41 +08:00
Jeff Epler 385366128f
Don't use "cookie" variable/function name 2023-06-27 09:59:02 -05:00
Jeff Epler b4be2317cb
rp2040: Avoid screeches due to audio underflow during flash writes
By pausing audio during flash writes, the worst screeching of #8121
is avoided. I don't consider this a full fix, but it greatly improves
the by far most common scenario in which the problem occurs.

Tested on rp2040 prop feather with a midi synth playing arpeggios. When
writing to the flash e.g., with
```
dd bs=512 count=32 if=/dev/zero of=/media/jepler/CIRCUITPY/boop
```
the audio goes "tap tap tap tap" during the flash write instead of the
squawking.

This isn't a 100% fix; it will still glitch out, including during USB
enumeration which must be taking a long time without servicing background
tasks. Add a delay if not usb-connected at startup ameliorates this
greatly.
2023-06-26 10:34:29 -05:00
Jeff Epler a388a59543
rp2040: fix audio glitch at soft-reload
The internal flash cache wasn't being properly used, because
`write_blocks` unconditionally performed the flash write.

Fixing this so that the write's not done until `internal_flash_flush`
fixes the problem in my test program with i2sout & synthio.

as a future optimization, `flash_read_blocks` could learn to read out
of the cache, but that's probably not super important.
2023-05-04 08:41:23 -05:00
Jeff Epler 644d293641
Fix CIRCUITPY drive offset in flash correctly, accounting for NVM
.. and fix nvm to read/right the correct area.

.. putting a comment in link.ld to explain it all

Closes #7012
2022-10-06 12:39:46 -05:00
Jeff Epler 2bd50673b6
Finish adapting flash storage size
Before this, CIRCUITPY would start at 1MB anyway. This appeared to work
only because I hadn't checked the actual size of the CIRCUITPY drive,
and because until now the flash hadn't actually crossed that 1MB
boundary into CIRCUITPY storage.

WARNING: on pico_w, upgrading/downgrading CircuitPython across this commit
boundary will erase the CIRCUITPY filesystem. After this commit,
switching between pico and pico_w firmware will erase the CIRCUITPY
filesystem
2022-10-05 10:02:38 -05:00
Jeff Epler 621953c960
Additional missing-prototypes fixes
I think this correctly enables missing-prototypes in atmel-samd
and raspberrypi ports.
2021-11-10 10:55:53 -06:00
Scott Shawcroft 109bd2886b
Fix Arduino RP2040 flash size
For RP2040 boards, we now change the default flash size based on
the configured flash. We will still try to read the size from the
flash first.

Fixes #4874
2021-07-21 11:02:55 -07:00
Scott Shawcroft f200e6a21e
Fix doc build and address feedback 2021-03-22 15:24:27 -07:00
Scott Shawcroft 5d2b60cbf6
Redo RP2040 flash settings
This switches stage2 to C and uses Jinja to change the C code based
on flash settings from https://github.com/adafruit/nvm.toml. It
produces the fastest settings for the given set of external flashes.
Flash size is no longer hard coded so switching flashes with similar
capabilities but different sizes should *just work*.

This PR also places "ITCM" code in RAM to save the XIP cache for
code execution. Further optimization is possible. A blink code.py
still requires a number of flash fetches every blink.

Fixes #4041
2021-03-18 16:55:42 -07:00
microDev a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Scott Shawcroft 3fdf29e773
More parens 2021-02-22 18:35:09 -08:00
Scott Shawcroft 0aafeac209
Board specific flash sizes for RP2040
Stop-gap solution for #4041. Comment is there to provide info
needed in the future. (We currently run the generic "safe" settings.)
2021-02-22 17:19:18 -08:00
Scott Shawcroft 733094aead
Add initial RP2040 support
The RP2040 is new microcontroller from Raspberry Pi that features
two Cortex M0s and eight PIO state machines that are good for
crunching lots of data. It has 264k RAM and a built in UF2
bootloader too.

Datasheet: https://pico.raspberrypi.org/files/rp2040_datasheet.pdf
2021-01-20 19:16:56 -08:00