Code Monkey home page Code Monkey logo

Comments (2)

thomaschandler avatar thomaschandler commented on August 16, 2024

I found out that reading/writing the USERROW is possible using normal read/write (-r/-w) arguments, but the chip must be in programming mode in order for the read/write to succeed.

ie. ./cupdi -c /dev/ttyUSB0 -d tiny3217 -v 6 -u --read="1300:64"

I missed this part in the datasheet:

Section 6.6 User Row: The CPU can write and read this memory as normal EEPROM and the UPDI can write and read it as a normal EEPROM memory if the part is unlocked.

The user row is dumped successfully when using --dump because nvm_enter_progmode is called implicitly. Tests below:

GDB invoked with: gdb --args ./cupdi --dump -c /dev/ttyUSB0 -d tiny3217 -v 6 -f out.hex

Stepping through cupdi.c:

234         if (write || fuses || flag) {
(gdb) p flag
$1 = 256
(gdb) n  
235             result = nvm_enter_progmode(nvm_ptr);

I'm going to try to auto-enter progmode in the event that the user row region is read similar to the way --dump auto-enters progmode.

from cupdi.

PitterL avatar PitterL commented on August 16, 2024

Hi, Thomas:
Yes, any action for UPDI accessing chip memory, it should execute the unlock operation first. After that
Userorw area could be read by address access directly, and written by the nvm_write_userrow() function call by nvm_write_auto() <= updi_program().

Of cause you could export the interface of nvm_read_userrow/nvm_write_userrow individually by yourselves.

Best Regards.

from cupdi.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.