Spurious failures were observed with a SanDisk Ultra 32GB card that no
longer occur with the increased timeouts.
Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
Move hardware-specifics (pin assignments, power management) to
hwconfig_*.py.
The build system will build a firmware image
firmware-filesystem-$variant.uf2 for all variants for which a
hwconfig_$variant.py file exits. Inside the filesystem image, the
selected variants hwconfig_$variant.py file will always be named
hwconfig.py.
At runtime, main.py will attempt to import hwconfig which will load the
configuration for the correct variant.
Currently, the hwconfig_* modules are expected to define the pin mapping
and implement a board_init method.
Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
- Old SDSC cards could have a native blocksize != 512 bytes, but they
should support the SET_BLOCKLEN command to set the blocksize to 512.
Use that so we can just assume 512 everywhere else.
- SDSC cards used byte addresses, not sector numbers, for the argument
of READ_BLOCK and WRITE_BLOCK. Check the card type and multiply the
sector number with 512 if necessary.
Tested with a noname chinese 128 MiB-ish card.
Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
Migrated all patches from the previous version.
A change in the Findpicotool.cmake script in the pico-sdk led to a
downgrade of picotool, which incorporated mbedtls into the build, which
itself is not buildable with cmake versions < 3.5.
The commit which made this isolated change was reverted. Future versions
of micropython will use pico-sdk 2.2.0 or newer, where this problem is
fixed, and picotool is pinned to a release version.
In theory, the FIFO interrupt could occur after getting the
fifo_read_value and reenabling interrupts, but before __wfi is called,
causing a deadlock. Fix this by calling __wfi with interrupts still
disabled. It will return immediately if an interrupt is pending.
Add two __nop to ensure that the CPU has enough instructions between
enabling interrupts and disabling them again at the top of the loop.
Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
Add write support to rp2_sd driver.
Cleanup standalone-mp3 test tool and add write test mode.
Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
The python and C modules that are supposed to be built into the firmware
image (i.e. those that are in manifest.py or in USER_C_MODULES) have
been moved to the software/modules directory.
The software/src directory should now only contain python scripts and
other files that should be installed to the Picos flash filesystem. The
idea is that these should be those scripts that implement the
application behaviour, as these are the ones that a user who does not
want to build the whole firmware themself wants to modify.