Samd21E, devices programming fuses with SAM-ICE J-link LITE

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, i want to change the fuse value NVMCTRL_EEPROM_SIZE from default value 0x07 to another. When i go to device Programming on Atmel Studio and try to change this value and program the devices, i got an error "WriteRegister() failed to write at 804000".  Can anybody help me?

 

nios

Last Edited: Wed. Jun 14, 2017 - 02:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

Try with the below link which may be useful for your Problem.

 

Link: https://www.avrfreaks.net/forum/a...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for replay....

 

Is possible to brick the devices when i try to change the fuses by program? I used nvm_get_fuses and nvm_set_fuses like in the next code. After programming the code i couldnt run another program. 

if (error_code == STATUS_ERR_NO_MEMORY) {
        while (true) {
                struct nvm_fusebits fusebits;
                nvm_get_fuses(&fusebits);
                fusebits.eeprom_size = NVM_EEPROM_EMULATOR_SIZE_0;
                nvm_set_fuses(&fusebits);
                port_pin_set_output_level(PIN_PA16, true);
                eeprom_emulator_init();
            /* No EEPROM section has been set in the device's fuses */
        }
    }
//! [check_init_ok]
//! [check_re-init]
    else if (error_code != STATUS_OK) {
        /* Erase the emulated EEPROM memory (assume it is unformatted or
         * irrecoverably corrupt) */
        eeprom_emulator_erase_memory();
        eeprom_emulator_init();
    }

 

If then i go to Tools->devices programming now i can change the fuse settings but nothing  run. It is possible to come back to fab version?... Im using samd21e in my own board.

nios

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I also had some problems writing fuses to samw25 using the fuse section of Device programming. Some devices became unusable after failed attempts to write fuses. This was resolved by updating Atmel studio. After updating I was able to recover the damaged units.

 

Writing fuses from software also works for me. Nios code above has a loop that writes the fuses over and over, that may be the reason it broke the device (but I'm just speculating). The modified code below works for me:

 

struct nvm_fusebits fusebits;
nvm_get_fuses(&fusebits);
if(fusebits.eeprom_size !=  NVM_EEPROM_EMULATOR_SIZE_2048){
fusebits.eeprom_size =NVM_EEPROM_EMULATOR_SIZE_2048;

nvm_set_fuses(&fusebits);

while(true){

//wait for user to reset device.

//Could do software reset here to load the new fuse value automaticly

}

}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Where is the documentation on Sam D20/21 fuse setting? Please.

Stay Calm and Listen to the Grateful Dead