zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.44k stars 6.4k forks source link

ARC: Reset MPU apertures in openocd & mdb flashing script #44268

Open evgeniy-paltsev opened 2 years ago

evgeniy-paltsev commented 2 years ago

If we don't use HW CPU reset on the board than previous test execution can affect next test execution.

This was partially workaround by https://github.com/zephyrproject-rtos/zephyr/pull/28494, however we still bumping into it from time to time.

We need at least disable MPU, however we need to investigate if we need to reset regions as well.

Possible implementation (openocd):

--- a/boards/arc/em_starterkit/board.cmake
+++ b/boards/arc/em_starterkit/board.cmake
@@ -1,6 +1,8 @@
 # SPDX-License-Identifier: Apache-2.0

 board_runner_args(openocd "--use-elf")
+board_runner_args(openocd --cmd-pre-load "arc jtag set-aux-reg 0x409 0")
 board_runner_args(mdb-hw "--jtag=digilent")
 include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
 include(${ZEPHYR_BASE}/boards/common/mdb-hw.board.cmake)
zephyrbot commented 6 months ago

Hi @evgeniy-paltsev,

This issue, marked as an Enhancement, was opened a while ago and did not get any traction. Please confirm the issue is correctly assigned and re-assign it otherwise.

Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.

Thanks!