AS7: ATtiny fuses and user_row in main.c

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hi,

 

I am using Atmel Studio 7.0 with an ATtiny1614. Compilation uses avr-gcc and programming a simple, external USB-UART device via UPDI as detailed here: https://pypi.org/project/pymcuprog/

I am trying to define the fuse values as well as the content of the user_row within main.c; code below; I already looked extensively at published examples. Everything compiles OK.

#include <avr/eeprom.h> //includes avr/io.h which will further include avr/fuse.h

FUSES = {
    .WDTCFG  = 0x05,  // Watchdog Configuration
    .BODCFG  = 0x00,  // BOD Configuration
    .OSCCFG  = 0x82,  // Oscillator Configuration
    .TCD0CFG = 0x00,  // TCD0 Configuration
    .SYSCFG0 = 0xF7,    // System Configuration 0
    .SYSCFG1 = 0x07,  // 64ms start-up time between power-on and code execution
    .APPEND  = 0x00,  // Application Code Section End
    .BOOTEND = 0x00,  // Boot Section End
};

typedef struct {
    uint16_t to;
    uint16_t pm1;
    uint16_t pm2;
    uint16_t wl;
    uint16_t wu;
    uint8_t  s;
} datablock_t;
__attribute((section(".USER_SIGNATURES"))) const datablock_t eevars = { 1200, 120, 300, 531, 743, 30 };

But when I look at the generated eep file, it's empty and when I look at the generated elf file (with avr-readelf -S), it seems these values are not included:

Section Headers:

  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al

  [ 0]                   NULL            00000000 000000 000000 00      0   0  0

  [ 1] .data             PROGBITS        00803800 00107d 000020 00  WA  0   0  1

  [ 2] .text             PROGBITS        00000000 0000d4 000f0c 00  AX  0   0  2

  [ 3] .rodata           PROGBITS        00008f0c 000fe0 00009d 01 AMS  0   0  1

  [ 4] .bss              NOBITS          00803820 00109d 0000df 00  WA  0   0  1

  [ 5] .eeprom           PROGBITS        00810000 00109d 000050 00  WA  0   0  1

  [ 6] .comment          PROGBITS        00000000 0010ed 00005c 01  MS  0   0  1

  [ 7] .note.gnu.avr.dev NOTE            00000000 00114c 000040 00      0   0  4

  [ 8] .debug_aranges    PROGBITS        00000000 001190 0003e8 00      0   0  8

  [ 9] .debug_info       PROGBITS        00000000 001578 0066ad 00      0   0  1

  [10] .debug_abbrev     PROGBITS        00000000 007c25 002b7f 00      0   0  1

  [11] .debug_line       PROGBITS        00000000 00a7a4 0020bb 00      0   0  1

  [12] .debug_frame      PROGBITS        00000000 00c860 0007e8 00      0   0  4

  [13] .debug_str        PROGBITS        00000000 00d048 002b1e 00      0   0  1

  [14] .debug_loc        PROGBITS        00000000 00fb66 001519 00      0   0  1

  [15] .debug_ranges     PROGBITS        00000000 01107f 0002d8 00      0   0  1

  [16] .shstrtab         STRTAB          00000000 012e0b 0000c4 00      0   0  1

  [17] .symtab           SYMTAB          00000000 011358 001200 10     18 155  4

  [18] .strtab           STRTAB          00000000 012558 0008b3 00      0   0  1

 

Also, when entering debugging (simulator), the values are not shown and instead some unrelated values are shown:

 

What am I doing wrong?

Isn't the elf file supposed to contain these sections? Do I need to alter some compiler settings?

And for the debugger simulator, how to make sure the intended values are loaded into the simulator?

 

Thank you for your help