为什么?
这是我的flash nvm init
struct nvm_config nvm_cfg;
nvm_get_config_defaults(&nvm_cfg);
nvm_cfg.sleep_power_mode = NVMCTRL_CTRLB_SLEEPPRM_WAKEUPINSTANT_Val;
nvm_cfg.manual_page_write=false;
nvm_cfg.wait_states=0x8;
nvm_cfg.cache_readmode = NVM_CACHE_READMODE_DETERMINISTIC;
nvm_set_config(&nvm_cfg);
struct nvm_fusebits nvm_fuse;
nvm_get_fuses(&nvm_fuse);
if(nvm_fuse.wdt_always_on==true)
{
nvm_fuse.wdt_always_on=false;
nvm_fuse.wdt_enable=false;
nvm_set_fuses(&nvm_fuse);
}
我尝试使用defaut值init:
static inline void nvm_get_config_defaults(
struct nvm_config *const config)
{
/* Sanity check the parameters */
Assert(config);
/* Write the default configuration for the NVM configuration */
config->sleep_power_mode = NVM_SLEEP_POWER_MODE_WAKEONACCESS;
config->manual_page_write = true;
config->wait_states = NVMCTRL->CTRLB.bit.RWS;
config->disable_cache = false;
#if (SAMC20) || (SAMC21)
config->disable_rww_cache = false; //false=> disable_cache=2 et a 2 ou 3 bug errata
#endif
config->cache_readmode = NVM_CACHE_READMODE_NO_MISS_PENALTY;
}
有没有办法绕过这个,还是有最好的配置? 谢谢!