Skip to content

Async UART API example not working on STM32U585 due to buffers not being in nocache memory region. #95712

@Scrath1

Description

@Scrath1

Describe the bug

The Async UART API causes an EFAULT error when used on the STM32U585 chip due to the buffers allegedly being in a cached memory region.

The same problem was reported in #75032 but the workaround of setting CONFIG_DCACHE=n does not work anymore as the config option is overwritten during the build process.

The only way I can get the example to work is by changing the default value of CONFIG_DCACHE to disabled directly in zephyr/soc/st/stm32/stm32u5x/Kconfig.defconfig.

Regression

  • This is a regression.

Steps to reproduce

  1. Create board overlay for Async UART API example
  2. Build the project west build -p -b b_u585i_iot02a
  3. Flash the project west flash
  4. See the error in the debug log

Relevant log output

Debug Log:
============================================================================================
*** Booting Zephyr OS build v4.1.0-5189-g34f5f8d55646 ***
[00:00:05.000,000] <inf> sample: Loop 0: Sending 4 packets
[00:00:05.000,000] <err> uart_stm32: Tx buffer should be placed in a nocache memory region
[00:00:05.000,000] <err> sample: Unknown error (-14)
[00:00:05.000,000] <err> uart_stm32: Tx buffer should be placed in a nocache memory region
[00:00:05.000,000] <err> sample: Unknown error (-14)
[00:00:05.000,000] <err> uart_stm32: Tx buffer should be placed in a nocache memory region
[00:00:05.000,000] <err> sample: Unknown error (-14)
[00:00:05.000,000] <err> uart_stm32: Tx buffer should be placed in a nocache memory region
[00:00:05.000,000] <err> sample: Unknown error (-14)
[00:00:05.000,000] <err> uart_stm32: Rx buffer should be placed in a nocache memory region
[00:00:05.000,000] <inf> sample: RX is now enabled


Build Log warning about DCACHE setting being overwritten:
============================================================================================
warning: DCACHE (defined at
C:/Users/steitobi/zephyrproject/zephyr/soc/st/stm32\stm32h5x\Kconfig.defconfig:13,
C:/Users/steitobi/zephyrproject/zephyr/soc/st/stm32\stm32u5x\Kconfig.defconfig:16,
C:/Users/steitobi/zephyrproject/zephyr/soc/renesas/ra\ra8d1\Kconfig.defconfig:19,
C:/Users/steitobi/zephyrproject/zephyr/soc/nxp/imxrt\imxrt5xx\Kconfig.defconfig:96,
C:/Users/steitobi/zephyrproject/zephyr/soc/mediatek/mt8xxx/Kconfig.defconfig:36,
C:/Users/steitobi/zephyrproject/zephyr/soc/ambiq\apollo5x\Kconfig.defconfig:15, arch/Kconfig:1038)
was assigned the value 'n' but got the value 'y'. See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_DCACHE and/or look up DCACHE in the
menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values,
and Kconfig - Tips and Best Practices sections of the manual might be helpful too.


Build Log warning about NOCACHE_MEMORY setting being overwritten:
============================================================================================
warning: NOCACHE_MEMORY (defined at
C:/Users/steitobi/zephyrproject/zephyr/soc/mediatek/mt8xxx/Kconfig.defconfig:43, arch/Kconfig:410)
was assigned the value 'y' but got the value 'n'. Check these unsatisfied dependencies:
(SOC_FAMILY_MTK || ARCH_HAS_NOCACHE_MEMORY_SUPPORT) (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_NOCACHE_MEMORY and/or look up
NOCACHE_MEMORY in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.

Impact

Functional Limitation – Some features not working as expected, but system usable.

Environment

Additional Context

Board overlay file:

/ {
	chosen {
		/* USART 1 is the debug USB port */
		zephyr,console = &usart1;
		zephyr,shell-uart = &usart1;
	};
};

&gpdma1 {
	status = "okay";
};

// Debug USB port UART
&usart1 {
	status = "okay";
	current-speed = <115200>;
	dmas = <&gpdma1 2 35 (STM32_DMA_MODE_NORMAL | STM32_DMA_PRIORITY_HIGH |
				STM32_DMA_PERIPH_8BITS | STM32_DMA_MEM_8BITS)>,
			<&gpdma1 3 34 (STM32_DMA_MODE_NORMAL | STM32_DMA_PRIORITY_HIGH |
				STM32_DMA_PERIPH_8BITS | STM32_DMA_MEM_8BITS)>;
			dma-names = "tx", "rx";
};

Metadata

Metadata

Assignees

Labels

bugThe issue is a bug, or the PR is fixing a bugplatform: STM32ST Micro STM32priority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions