tests: dma/chan_blen_transfer: relocate TX and RX buffers
This commit places the chan_blen_transfer DMA test's TX and RX buffers in a separate file that gets entirely relocated. This ensures that the buffers reside in the correct memory, without breaking other things due to relocation of test data/code. Fixes #75676. Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
This commit is contained in:
parent
b9f31c0e40
commit
3099491f3e
4 changed files with 28 additions and 5 deletions
|
@ -7,4 +7,6 @@ project(chan_blen_transfer)
|
|||
FILE(GLOB app_sources src/*.c)
|
||||
target_sources(app PRIVATE ${app_sources})
|
||||
|
||||
zephyr_code_relocate(FILES src/test_dma.c LOCATION ${CONFIG_DMA_LOOP_TRANSFER_RELOCATE_SECTION}_RODATA_BSS)
|
||||
if (CONFIG_DMA_LOOP_TRANSFER_RELOCATE_SECTION)
|
||||
zephyr_code_relocate(FILES src/test_buffers.c LOCATION ${CONFIG_DMA_LOOP_TRANSFER_RELOCATE_SECTION})
|
||||
endif()
|
||||
|
|
12
tests/drivers/dma/chan_blen_transfer/src/test_buffers.c
Normal file
12
tests/drivers/dma/chan_blen_transfer/src/test_buffers.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* Copyright (c) 2024 STMicroelectronics
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
|
||||
#include "test_buffers.h"
|
||||
|
||||
__aligned(32) char tx_data[TEST_BUF_SIZE] = "It is harder to be kind than to be wise........";
|
||||
__aligned(32) char rx_data[TEST_BUF_SIZE] = { 0 };
|
12
tests/drivers/dma/chan_blen_transfer/src/test_buffers.h
Normal file
12
tests/drivers/dma/chan_blen_transfer/src/test_buffers.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* Copyright (c) 2024 STMicroelectronics
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define TEST_BUF_SIZE (48)
|
||||
|
||||
extern char tx_data[TEST_BUF_SIZE];
|
||||
extern char rx_data[TEST_BUF_SIZE];
|
|
@ -20,10 +20,7 @@
|
|||
#include <zephyr/drivers/dma.h>
|
||||
#include <zephyr/ztest.h>
|
||||
|
||||
#define RX_BUFF_SIZE (48)
|
||||
|
||||
static __aligned(32) char tx_data[] = "It is harder to be kind than to be wise........";
|
||||
static __aligned(32) char rx_data[RX_BUFF_SIZE] = { 0 };
|
||||
#include "test_buffers.h"
|
||||
|
||||
static void test_done(const struct device *dma_dev, void *arg,
|
||||
uint32_t id, int status)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue