Page MenuHomePhabricator

code error in system_reset_cfg function
Closed, ResolvedPublic

Description

There is some mistake in the following function.

void system_reset_cfg(void)

{

struct sysctrl_t *sysctrl = (struct sysctrl_t *)CMSDK_SYSCTRL_BASE_S;

uint32_t reg_value = SCB->AIRCR;

/* Enable system reset request for CPU 0, to be triggered via

  • NVIC_SystemReset function.

    */

    sysctrl->resetmask |= ENABLE_CPU0_SYSTEM_RESET_REQUEST;

/* Enable system reset request only to the secure world */

reg_value |= (uint32_t)(SCB_AIRCR_WRITE_MASK | SCB_AIRCR_SYSRESETREQS_Msk);

SCB->AIRCR = reg_value;

}

reg_value |= (uint32_t)(SCB_AIRCR_WRITE_MASK | SCB_AIRCR_SYSRESETREQS_Msk);

In this line, the top 2 bytes of reg_value will be 0xffff, but not 0x05fa. So the write will be ignored.

Event Timeline

matt2048 triaged this task as High priority.Nov 19 2018, 10:03 AM
matt2048 created this task.
wmnt added a subscriber: wmnt.Nov 19 2018, 10:19 AM

Hi @matt2048,

Thanks to report this issue.

The fix associated with this task is:
https://review.trustedfirmware.org/#/c/trusted-firmware-m/+/374/

The patch has been reviewed and merged.

mmorenobarm closed this task as Resolved.Nov 23 2018, 11:46 AM