Skip to content
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

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

Closed
mnkp opened this issue May 11, 2021 · 2 comments
Closed

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

mnkp opened this issue May 11, 2021 · 2 comments
Assignees
Labels
area: ARM ARM (32-bit) Architecture bug The issue is a bug, or the PR is fixing a bug platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) priority: high High impact/importance bug
Milestone

Comments

@mnkp
Copy link
Member

mnkp commented May 11, 2021

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
@mnkp mnkp added bug The issue is a bug, or the PR is fixing a bug area: ARM ARM (32-bit) Architecture platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) labels May 11, 2021
@mnkp mnkp added this to the v2.6.0 milestone May 11, 2021
@galak galak added the priority: medium Medium impact/importance bug label May 11, 2021
@galak galak added priority: high High impact/importance bug and removed priority: medium Medium impact/importance bug labels May 13, 2021
@galak
Copy link
Collaborator

galak commented May 13, 2021

Looks like M7 is having issue in general due to commit d6b5023

@galak
Copy link
Collaborator

galak commented May 18, 2021

Fixed by #35258

@galak galak closed this as completed May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture bug The issue is a bug, or the PR is fixing a bug platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) priority: high High impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants