Open foldedtoad opened 4 months ago
Hi @foldedtoad! We appreciate you submitting your first issue for our open-source project. š
Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. š¤š
@foldedtoad with #62669 do you still see the issue? This sounds like a similar problem, but that fix should be in 3.6
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
Hard-Fault due to Alignment issues in SD Subsystem when build for RPI-PICO.
Project: USB-MSC backed by SDcard zephyr/samples/subsys/usb/mass starting point Platform: Raspberry-Pi Pico and Pico-w SDCard: 2GB SDCard
Taken from ARM's online documentation for Cortex-M0+
"There is no support for unaligned accesses on the Cortex-M0 processor. Any attempt to perform an unaligned memory access operation results in a HardFault exception."
There are two locations where alignment-faults happen for this sample project when built for the rpi_pico or rpi_pico_w.
1: In zephyr/subsys/sd/sdmmc.c Zephyr V3.5 circa line 186 Zephyr V3.6 circa line 186
2: In zephyr/subsys/sd/sd_ops.c
Zephyr V3.5 circa line 219
Zephyr V3.6 circa line 231
In zephyr/include/zephyr/sd/sd.h (see member of struct)
A possible solution suggestion. This worked for the rpi_pico/SDcard project.
This solution sets CONFIG_SDHC_BUFFER_ALIGNMENT to __aligned(4) for RPI_PICO.
In file zephyr/drivers/sdhc/Kconfig
In file zephyr/drivers/sdhc/Kconfig.rpi_pico_sdhc (a new config file)