Skip to content

Atmel SAM E70 / Cortex-M7 fails to boot if CONFIG_NOCACHE_MEMORY=y #35107

@mnkp

Description

@mnkp

Describe the bug
If the application is compiled with CONFIG_NOCACHE_MEMORY=y it crashes early during the Zephyr's boot process. No log output can be observed. In case of Atmel SAM platform it may reboot successfully after watchdog reset, which happens after about 20 s. After the first successful boot the subsequent reboots often run without any issues.

The crash happens before the logger subsystem is initialized, however analyzing z_arm_fault reveals that it takes place when executing

        SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) |
                       ((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk)  );

in SCB_CleanInvalidateDCache() located in zephyrproject/modules/hal/cmsis/CMSIS/Core/Include/cachel1_armv7.h:306

The issue was introduced by d6b5023 commit. Reverting the commit fixes the issue.

To Reproduce
Steps to reproduce the behavior:

  1. west build -b sam_e70_xplained -- -DCONFIG_NOCACHE_MEMORY=y samples/hello_world/
  2. west flash
  3. Power cycle the board, i.e. cut off power supply for several seconds and then turn it on.
  4. No "Hello World!" message can be seen in the terminal.

Impact
This is a show stopper for any application that requires CONFIG_NOCACHE_MEMORY=y. The option is required by e.g. Atmel SAM Ethernet driver.

Atmel SAM is using standard ARM MPU module. It is likely that other ARM families face the same issue.

Environment

  • OS: Linux
  • Toolchain zephyr 0.12.4
  • Version v2.6.0-rc1

Metadata

Metadata

Assignees

Labels

area: ARMARM (32-bit) ArchitecturebugThe issue is a bug, or the PR is fixing a bugplatform: Microchip SAMMicrochip SAM Platform (formerly Atmel SAM)priority: highHigh impact/importance bug

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions