cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Nucleo F767ZI board Zephyr Project, DMA configuration

digitalone
Visitor

I am trying to get this sample working on my STM32 Nucleo F767ZI board:
zephyr/samples/drivers/uart/async_api/

I created an overlay file.

nucleo_f767zi.overlay

dut: &usart3 {
dmas = <&dma1 2 STM32_DMA_PERIPH_TX>,
<&dma1 3 STM32_DMA_PERIPH_RX>;
dma-names = "tx", "rx";
};

&dma1 {
status = "okay";
};

Building and running the sample I get the following output:

*** Booting Zephyr OS build v4.3.0-929-g1d6e0d533a81 ***
[00:00:05.000,000] <inf> sample: Loop 0: Sending 3 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] <inf> sample: RX is now enabled

I then updated my prj.conf adding nocache support:
prj.conf

CONFIG_LOG=y
CONFIG_NET_BUF=y
CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_NOCACHE_MEMORY=y

I then pulled over the macro definition for this line:

NET_BUF_POOL_DEFINE(tx_pool, LOOP_ITER_MAX_TX, MAX_TX_LEN, 0, NULL);

And changed:

static uint8_t __noinit net_buf_data_##_name[_count][_data_size] __net_buf_align;

to:

static uint8_t __nocache net_buf_data_##_name[_count][_data_size] __net_buf_align;

Thus putting the Tx buffer in nocache memory, but now I am getting these errors:

*** Booting Zephyr OS build v4.3.0-929-g1d6e0d533a81 ***
[00:00:05.000,000] <inf> sample: Loop 0: Sending 3 packets
[00:00:05.000,000] <err> dma_stm32: Memcopy not supported for device dma@40026000
[00:00:05.000,000] <err> uart_stm32: dma tx config error!
[00:00:05.000,000] <err> sample: Unknown error (-22)
[00:00:05.000,000] <dbg> sample: main: Queuing buffer 0x20022458
[00:00:05.000,000] <dbg> sample: main: Queuing buffer 0x20022470
[00:00:05.000,000] <inf> sample: RX is now enabled
[00:00:06.044,000] <dbg> sample: uart_callback: EVENT: 0
[00:00:06.044,000] <dbg> sample: uart_callback: TX complete 0
[00:00:06.044,000] <err> dma_stm32: Memcopy not supported for device dma@40026000
[00:00:06.044,000] <err> uart_stm32: dma tx config error!
[00:00:06.044,000] <err> sample: TX from ISR failed (-22)
[00:00:07.076,000] <dbg> sample: uart_callback: EVENT: 0

I also noticed in my build output the messages:

/home/myuser/Projects/uart_async_api/build/primary/zephyr/zephyr.dts:550.4-551.31: Warning (dmas_property): /soc/serial@40004800:dmas: cell 5 is not a phandle reference
/home/myuser/Projects/uart_async_api/build/primary/zephyr/zephyr.dts:550.4-551.31: Warning (dmas_property): /soc/serial@40004800:dmas: Could not get phandle node for (cell 5)

Is the above related to the issues I am seeing?

Does the STM32 Zephyr driver support the UART Async API?
If so, how can I get it working?

Thank you.

0 REPLIES 0