-
Notifications
You must be signed in to change notification settings - Fork 8.3k
tests: dma/chan_blen_transfer: relocate TX and RX buffers #75895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: dma/chan_blen_transfer: relocate TX and RX buffers #75895
Conversation
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 zephyrproject-rtos#75676. Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
3cb13d7 to
6a9a715
Compare
|
Testing on NXP boards - which are the only other users of code relocation for this sample, and should have probably been broken by #75125 too - would be appreciated. |
@hakehuang Would you be able to have a look ? |
@erwango let me run some regression test on this, the code seems good to me, will feedback soon. I meet a problem in mimxrt1024_evk/mimxrt1050_evk/mimxrt1060_evk the mainline code is ok |
Trace isn't very informative since assertion was raised by zephyr/lib/libc/picolibc/libc-hooks.c Lines 222 to 226 in 704000e
This is invoked by picolibc assert if _ASSERT_VERBOSE is not set:https://github.com/zephyrproject-rtos/picolibc/blob/764ef4e401a8f4c6a86ab723533841f072885a5b/newlib/libc/include/assert.h#L46-L54 I assume the kernel panic comes from CODE_UNREACHABLE generating an undefined instruction.
However, I do not see any use of C zephyr/subsys/testsuite/ztest/include/zephyr/ztest_assert.h Lines 34 to 43 in 704000e
Thus I am quite puzzled as to where this assertion failure comes from 🤔. Could you run the tests with
Interesting. Could you run the tests again with the following patch applied (i.e., with code relocation disabled)? Maybe it was only needed because the i.MX DMA has a limitation similar to STM32WB0's that was worked around...? 🤷♂️
- CONFIG_CODE_DATA_RELOCATION=y
CONFIG_MEM_ATTR_HEAP=y
- CONFIG_DMA_LOOP_TRANSFER_RELOCATE_SECTION="ITCM" Marking as DNM until this is worked out. |
will try it and feedback once done. @mathieuchopstm I find it is the ITCM which can not be accessed by DMA, so if I change below, then it works the impacted platforms are: boards/mimxrt1050_evk.conf:3:CONFIG_DMA_LOOP_TRANSFER_RELOCATE_SECTION="ITCM" can you help to update those platform as what I changed for mimxrt1050_evk in your PR? below is the test log |
This commit moves the test buffer from ITCM (not accessible by DMA) to DTCM on several NXP boards, to make the test successful. Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
|
Hi @hakehuang, I have added a commit that updates all affected boards and should fix the issue. Could you run a test again with updated PR contents to confirm everything is good? |
hakehuang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR 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 (tested on Nucleo-H743ZI) without introducing regression of #75125 (tested on Nucleo-WB09KE).