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

Support for efuses #12

Open
tehplague opened this issue Dec 29, 2017 · 2 comments
Open

Support for efuses #12

tehplague opened this issue Dec 29, 2017 · 2 comments

Comments

@tehplague
Copy link

Could you add support for setting efuses (e.g. for the ATmega168)?

@mkleemann
Copy link
Owner

mkleemann commented Jan 7, 2018

I'll look into it, but don't expect fast results. For a quickhack add the efuses into the call, i.e. for avrdude (I didn't check if it works!):

   # get fuses
   add_custom_target(
      get_fuses
      ${AVR_UPLOADTOOL} -p ${AVR_MCU} -c ${AVR_PROGRAMMER} -P ${AVR_UPLOADTOOL_PORT} -n
         -U lfuse:r:-:b
         -U hfuse:r:-:b
         -U efuse:r:-:b
      COMMENT "Get fuses from ${AVR_MCU}"
   )

   # set fuses
   add_custom_target(
      set_fuses
      ${AVR_UPLOADTOOL} -p ${AVR_MCU} -c ${AVR_PROGRAMMER} -P ${AVR_UPLOADTOOL_PORT}
         -U lfuse:w:${AVR_L_FUSE}:m
         -U hfuse:w:${AVR_H_FUSE}:m
         -U efuse:w:${AVR_E_FUSE}:m
         COMMENT "Setup: High Fuse: ${AVR_H_FUSE} Low Fuse: ${AVR_L_FUSE} Extended Fuse: ${AVR_E_FUSE}"
   )

For a real solution I would check the MCU type if it supports efuses at all. I also saw some forks cleaning up the stuff a little. Maybe some of them already provide the solution. Have to get into it again some time.

@rvalle
Copy link

rvalle commented Feb 14, 2019

I also need efuses... will try with the hack.

Here in our build scripts I have a note, efuses in atmega328p (at least) include 5 bits that are not used/reserved, some programmers require them to be passed as 1's i.e. atmelice_isp and other requires then as 0's like: avrispmkii

for example to setup BOD 1.8V I need to use 0x06 or 0xF6 depending on the programmer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants