Infineon / AIROC-Wi-Fi-Bluetooth-STM32

The STM32 Connectivity Expansion Pack is an extension of the CMSIS-Pack standard established by Arm to support Wi-Fi and Bluetooth LE application on STM32 MCUs with Infineon Wireless Combo devices.Infineon STM32 Connectivity Expansion Pack
Other
45 stars 9 forks source link

SDIO DMA of STM32H743 needs buffer to be in AXI SRAM #18

Open chep opened 3 months ago

chep commented 3 months ago

Description:

cyhal_sdio_bulk_transfer function uses a temp buffer declared static. This buffer is located in .bss section and, by default, this section is located in DTCMRAM. On STM32H743 the SDIO DMA cannot access this memory so the buffer is never filled (but no error is reported).

This can be fixed by modifying the linker script :

  /* Uninitialized data section */
  . = ALIGN(4);
  .bss :
  {
    /* This is used by the startup in order to initialize the .bss secion */
    _sbss = .;         /* define a global symbol at bss start */
    __bss_start__ = _sbss;
    *(.bss)
    *(.bss*)
    *(COMMON)

    . = ALIGN(4);
    _ebss = .;         /* define a global symbol at bss end */
    __bss_end__ = _ebss;
  } >RAM_D1

But it will be overwritten when re-generating code.

Steps to Reproduce:

  1. Generate a project for STM32H743 (or maybe other H7xx)

Expected Result: wifi scan

Actual Result: Chip id is 0 because DMA buffer is not filled

Frequency (1/1, 1/50, 1/100): 1/1

Build/Commit:

1.6.0

Target:

STM32H743 and CYW55573

Host OS and Version:

Arch Linux

Compiler:

Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-none-eabi/14.1.0/lto-wrapper
Target: arm-none-eabi
Configured with: /build/arm-none-eabi-gcc/src/gcc-14.1.0/configure --target=arm-none-eabi --prefix=/usr --with-sysroot=/usr/arm-none-eabi --with-native-system-header-dir=/include --libexecdir=/usr/lib --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-system-zlib --with-newlib --with-headers=/usr/arm-none-eabi/include --with-python-dir=share/gcc-arm-none-eabi --with-gmp --with-mpfr --with-mpc --with-isl --with-libelf --enable-gnu-indirect-function --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='Arch Repository' --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/arm-none-eabi-gcc/-/issues --with-multilib-list=rmprofile
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 14.1.0 (Arch Repository) 

Environment

FreeRTOS, Nucleo H743ZI2, chip connected on SDMMC1 with Murata hat.