1

Edit: Probably solved

  1. I can successfully change the fuse bits in the GUI.

I know this because I can read the values of the fuse bits of the chip. I can change them, then read them later, and they are the same as when I wrote them

  1. I know the values that each bit is supposed to be.

I know this because the GUI has a button to copy to clipboard. This is what is copied to my clipboard...

ADC0_BIASCOMP = 0x07
ADC0_BIASREFBUF = 0x07
ADC0_BIASR2R = 0x07
ADC1_BIASCOMP = 0x07
ADC1_BIASREFBUF = 0x07
ADC1_BIASR2R = 0x07
USB_TRANSN = 0x09
USB_TRANSP = 0x19
USB_TRIM = 0x06
ROOM_TEMP_VAL_INT = 0x1E
ROOM_TEMP_VAL_DEC = 0x00
HOT_TEMP_VAL_INT = 0x68
HOT_TEMP_VAL_DEC = 0x09
ROOM_INT1V_VAL = 0xFF
HOT_INT1V_VAL = 0xFF
ROOM_ADC_VAL_PTAT = 0xAE8
HOT_ADC_VAL_PTAT = 0xD96
ROOM_ADC_VAL_CTAT = 0xB6B
HOT_ADC_VAL_CTAT = 0x949
BOD33_DIS = [ ]
BOD33USERLEVEL = 0x2A
BOD33_ACTION = RESET
BOD33_HYST = 0x0A
NVMCTRL_BOOTPROT = 0
NVMCTRL_SEESBLK = 0x00
NVMCTRL_SEEPSZ = 0x00
RAMECC_ECCDIS = [X]
WDT_ENABLE = [X]
WDT_ALWAYSON = [ ]
WDT_PER = CYC4096
WDT_WINDOW = CYC8
WDT_EWOFFSET = CYC8
WDT_WEN = [ ]
NVMCTRL_REGION_LOCKS = 0x12345678

SW0_WORD_0 = 0x1FF07FD (modified)
SW0_WORD_1 = 0x1B29 (unknown)
TEMP_LOG_WORD_0 = 0xFF96801E (unknown)
TEMP_LOG_WORD_1 = 0xD96AE8FF (unknown)
TEMP_LOG_WORD_2 = 0xFF949B6B (unknown)
USER_WORD_0 = 0xFE9AD254 (valid)
USER_WORD_1 = 0x8025FF80 (valid)
USER_WORD_2 = 0x12345678 (valid)
  1. I can successfully erase the chip.

I know this because I can read the chip and they are all zeroes after I erase it.

  1. I can "successfully" change the fuse bits.

Following the documentation on atmel's website, the template is atprogram -t <tool> -i <interface> -d <device> write -fs --values <fuse value> and the example is atprogram –t avrdragon –i pdi –d atxmega16A4 write –fs --values 4200ff00feef. I have a atsame54p19a device, using a samice tool with a swd interface. For the "fuse value" I thought I should just concatenate the values from "SW0_WORD_0" to "USER_WORD_2" together to create the line atprogram --tool samice -i swd -d atsame54p19a write -fs --values 01FF07FD00001B29FF96801ED96AE8FFFF949B6BFE9AD2548025FF80eeeeeeee Then it says Write completed successfully. But when I read the fuse bytes, they have not changed.

  1. I have little to no experience with this. I normally use arduino for hobbies and stuff, but this is to help out a coworker

  2. So to specifically ask a question,

How do I change the fuse bits?

Do I not understand how to create the payload for values?

Is there some common problem that I have succumbed to?

Any help would be appreciated, thank you!

Google hasnt been very helpfull (more like I havent been using it correctly probably). My prediction is that I am writing it to the wrong place or wrong way or something, IDK.

Edit: I think I needed to give an offset. I needed to add -o <address> to make atprogram --tool samice -i swd -d atsame54p19a -f write -o 0x804000 -fs --values 54d29afe80ff258012345678

Zeno
  • 105
  • 1
  • 2
  • 8

1 Answers1

1

I believe that the issue was that i was writing to the wrong place. The fuse bits started at 0x0 for fuse bits. But the "USER_PAGE" that the fuses were named after were at address 0x804000. So changing the location of from where I was writing to the correct location solved the issue.

Zeno
  • 105
  • 1
  • 2
  • 8
  • Things appear to be more complicated and they've changed between AtmelStudio 6 and 7. The old one (6.x) always required an offset (`-o`). The new one apparently tries to imply the offset, at least for some chips, so they've changed documentation in some places to exclude -o (but not in the others). The fact is, on my `at32uc3c2512c` it throws up if I specify the correct offset, but works correctly if I don't - almost the opposite to what you found. The 6.1 just silently did the wrong thing without the offset, like in your case. – Zeus Feb 21 '23 at 03:31