Skip to content

Instructions for compiling #1

@alejomongua

Description

@alejomongua

Hello.

I think this is a very interesting project. I am particularly interested in compiling and programing attiny414 on Linux.

I cloned your project, chaged the BIN variable in makefile for /usr/bin (which is where avr-* executables are located) but Im not able to compile.

I have avr-g++ versión 9.3.0 and I'm using manjaro

I have the following output when i run make

/usr/bin/avr-g++ -mmcu=attiny414 -Os -o main.o -c main.cpp
In file included from /usr/avr/include/avr/interrupt.h:38,
                 from main.cpp:1:
/usr/avr/include/avr/io.h:581:6: warning: #warning "device type not defined" [-Wcpp]
  581 | #    warning "device type not defined"
      |      ^~~~~~~
main.cpp: In function 'void init()':
main.cpp:31:3: error: 'PORTA' was not declared in this scope; did you mean 'PORT0'?
   31 |   PORTA.DIRSET = PIN7_bm | PIN5_bm | PIN3_bm | PIN2_bm | PIN1_bm;
      |   ^~~~~
      |   PORT0
main.cpp:31:18: error: 'PIN7_bm' was not declared in this scope; did you mean 'PIN7'?
   31 |   PORTA.DIRSET = PIN7_bm | PIN5_bm | PIN3_bm | PIN2_bm | PIN1_bm;
      |                  ^~~~~~~
      |                  PIN7
main.cpp:31:28: error: 'PIN5_bm' was not declared in this scope; did you mean 'PIN5'?
   31 |   PORTA.DIRSET = PIN7_bm | PIN5_bm | PIN3_bm | PIN2_bm | PIN1_bm;
      |                            ^~~~~~~
      |                            PIN5
main.cpp:31:38: error: 'PIN3_bm' was not declared in this scope; did you mean 'PIN3'?
   31 |   PORTA.DIRSET = PIN7_bm | PIN5_bm | PIN3_bm | PIN2_bm | PIN1_bm;
      |                                      ^~~~~~~
      |                                      PIN3
main.cpp:31:48: error: 'PIN2_bm' was not declared in this scope; did you mean 'PIN2'?
   31 |   PORTA.DIRSET = PIN7_bm | PIN5_bm | PIN3_bm | PIN2_bm | PIN1_bm;
      |                                                ^~~~~~~
      |                                                PIN2
main.cpp:31:58: error: 'PIN1_bm' was not declared in this scope; did you mean 'PIN1'?
   31 |   PORTA.DIRSET = PIN7_bm | PIN5_bm | PIN3_bm | PIN2_bm | PIN1_bm;
      |                                                          ^~~~~~~
      |                                                          PIN1
main.cpp:32:3: error: 'PORTB' was not declared in this scope; did you mean 'PORT0'?
   32 |   PORTB.DIRSET = PIN2_bm | PIN1_bm | PIN0_bm;
      |   ^~~~~
      |   PORT0
main.cpp:32:38: error: 'PIN0_bm' was not declared in this scope; did you mean 'PIN0'?
   32 |   PORTB.DIRSET = PIN2_bm | PIN1_bm | PIN0_bm;
      |                                      ^~~~~~~
      |                                      PIN0
main.cpp:33:3: error: 'TCB0' was not declared in this scope
   33 |   TCB0.CTRLB = TCB_CCMPEN_bm | TCB_CNTMODE_PWM8_gc; // carrier
      |   ^~~~
main.cpp:33:16: error: 'TCB_CCMPEN_bm' was not declared in this scope
   33 |   TCB0.CTRLB = TCB_CCMPEN_bm | TCB_CNTMODE_PWM8_gc; // carrier
      |                ^~~~~~~~~~~~~
main.cpp:33:32: error: 'TCB_CNTMODE_PWM8_gc' was not declared in this scope
   33 |   TCB0.CTRLB = TCB_CCMPEN_bm | TCB_CNTMODE_PWM8_gc; // carrier
      |                                ^~~~~~~~~~~~~~~~~~~
main.cpp:34:3: error: 'TCA0' was not declared in this scope
   34 |   TCA0.SINGLE.INTCTRL = TCA_SINGLE_OVF_bm;
      |   ^~~~
main.cpp:34:25: error: 'TCA_SINGLE_OVF_bm' was not declared in this scope
   34 |   TCA0.SINGLE.INTCTRL = TCA_SINGLE_OVF_bm;
      |                         ^~~~~~~~~~~~~~~~~
main.cpp: In lambda function:
main.cpp:46:7: error: 'USART0' was not declared in this scope
   46 |   if (USART0.CTRLB) usart0(count);
      |       ^~~~~~
main.cpp:49:5: error: 'TCA0' was not declared in this scope
   49 |     TCA0.SINGLE.CTRLA = TCA_SINGLE_CLKSEL_DIV1_gc | TCA_SINGLE_ENABLE_bm;
      |     ^~~~
main.cpp:49:25: error: 'TCA_SINGLE_CLKSEL_DIV1_gc' was not declared in this scope
   49 |     TCA0.SINGLE.CTRLA = TCA_SINGLE_CLKSEL_DIV1_gc | TCA_SINGLE_ENABLE_bm;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:49:53: error: 'TCA_SINGLE_ENABLE_bm' was not declared in this scope
   49 |     TCA0.SINGLE.CTRLA = TCA_SINGLE_CLKSEL_DIV1_gc | TCA_SINGLE_ENABLE_bm;
      |                                                     ^~~~~~~~~~~~~~~~~~~~
main.cpp: In function 'void key(char)':
main.cpp:57:3: error: 'SLPCTRL' was not declared in this scope
   57 |   SLPCTRL.CTRLA = 0;
      |   ^~~~~~~
main.cpp: In function 'int main()':
main.cpp:61:3: error: 'TCA0' was not declared in this scope
   61 |   TCA0.SINGLE.CTRLA = TCA_SINGLE_CLKSEL_DIV1024_gc | TCA_SINGLE_ENABLE_bm;
      |   ^~~~
main.cpp:61:23: error: 'TCA_SINGLE_CLKSEL_DIV1024_gc' was not declared in this scope
   61 |   TCA0.SINGLE.CTRLA = TCA_SINGLE_CLKSEL_DIV1024_gc | TCA_SINGLE_ENABLE_bm;
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:61:54: error: 'TCA_SINGLE_ENABLE_bm' was not declared in this scope
   61 |   TCA0.SINGLE.CTRLA = TCA_SINGLE_CLKSEL_DIV1024_gc | TCA_SINGLE_ENABLE_bm;
      |                                                      ^~~~~~~~~~~~~~~~~~~~
main.cpp:64:26: error: 'TCA_SINGLE_OVF_bm' was not declared in this scope
   64 |   TCA0.SINGLE.INTFLAGS = TCA_SINGLE_OVF_bm;
      |                          ^~~~~~~~~~~~~~~~~
main.cpp:66:7: error: 'PORTB' was not declared in this scope; did you mean 'PORT0'?
   66 |   if (PORTB.IN & PIN3_bm) learn(); // learn() won't return
      |       ^~~~~
      |       PORT0
main.cpp:66:18: error: 'PIN3_bm' was not declared in this scope; did you mean 'PIN3'?
   66 |   if (PORTB.IN & PIN3_bm) learn(); // learn() won't return
      |                  ^~~~~~~
      |                  PIN3
main.cpp:67:3: error: 'PORTA' was not declared in this scope; did you mean 'PORT0'?
   67 |   PORTA.PIN6CTRL = PORT_PULLUPEN_bm | PORT_ISC_FALLING_gc;
      |   ^~~~~
      |   PORT0
main.cpp:67:20: error: 'PORT_PULLUPEN_bm' was not declared in this scope
   67 |   PORTA.PIN6CTRL = PORT_PULLUPEN_bm | PORT_ISC_FALLING_gc;
      |                    ^~~~~~~~~~~~~~~~
main.cpp:67:39: error: 'PORT_ISC_FALLING_gc' was not declared in this scope
   67 |   PORTA.PIN6CTRL = PORT_PULLUPEN_bm | PORT_ISC_FALLING_gc;
      |                                       ^~~~~~~~~~~~~~~~~~~
main.cpp:68:11: error: 'SLPCTRL' was not declared in this scope
   68 |   while ((SLPCTRL.CTRLA = SLPCTRL_SMODE_PDOWN_gc | SLPCTRL_SEN_bm)) {
      |           ^~~~~~~
main.cpp:68:27: error: 'SLPCTRL_SMODE_PDOWN_gc' was not declared in this scope
   68 |   while ((SLPCTRL.CTRLA = SLPCTRL_SMODE_PDOWN_gc | SLPCTRL_SEN_bm)) {
      |                           ^~~~~~~~~~~~~~~~~~~~~~
main.cpp:68:52: error: 'SLPCTRL_SEN_bm' was not declared in this scope
   68 |   while ((SLPCTRL.CTRLA = SLPCTRL_SMODE_PDOWN_gc | SLPCTRL_SEN_bm)) {
      |                                                    ^~~~~~~~~~~~~~
In file included from main.cpp:1:
main.cpp: In function 'void PORTA_PORT_vect()':
main.cpp:99:5: warning: 'PORTA_PORT_vect' appears to be a misspelled 'signal' handler, missing '__vector' prefix [-Wmisspelled-isr]
   99 | ISR(PORTA_PORT_vect) {
      |     ^~~~~~~~~~~~~~~
main.cpp:100:11: error: 'TCA0' was not declared in this scope
  100 |   count = TCA0.SINGLE.CNT;
      |           ^~~~
main.cpp:101:7: error: 'USART0' was not declared in this scope
  101 |   if (USART0.CTRLB) TCA0.SINGLE.CNT = 0;
      |       ^~~~~~
main.cpp:102:3: error: 'PORTA' was not declared in this scope; did you mean 'PORT0'?
  102 |   PORTA.INTFLAGS = PIN4_bm;
      |   ^~~~~
      |   PORT0
main.cpp:102:20: error: 'PIN4_bm' was not declared in this scope; did you mean 'PIN4'?
  102 |   PORTA.INTFLAGS = PIN4_bm;
      |                    ^~~~~~~
      |                    PIN4
main.cpp:103:25: error: 'PORT_PULLUPEN_bm' was not declared in this scope
  103 |   if (PORTA.PIN6CTRL == PORT_PULLUPEN_bm | PORT_ISC_FALLING_gc) {
      |                         ^~~~~~~~~~~~~~~~
main.cpp:103:44: error: 'PORT_ISC_FALLING_gc' was not declared in this scope
  103 |   if (PORTA.PIN6CTRL == PORT_PULLUPEN_bm | PORT_ISC_FALLING_gc) {
      |                                            ^~~~~~~~~~~~~~~~~~~
main.cpp:104:41: error: 'PORT_ISC_INTDISABLE_gc' was not declared in this scope
  104 |     PORTA.PIN6CTRL = PORT_PULLUPEN_bm | PORT_ISC_INTDISABLE_gc;
      |                                         ^~~~~~~~~~~~~~~~~~~~~~
main.cpp:105:5: error: 'SLPCTRL' was not declared in this scope
  105 |     SLPCTRL.CTRLA = 0;
      |     ^~~~~~~
In file included from main.cpp:1:
main.cpp: In function 'void TCA0_OVF_vect()':
main.cpp:110:5: warning: 'TCA0_OVF_vect' appears to be a misspelled 'signal' handler, missing '__vector' prefix [-Wmisspelled-isr]
  110 | ISR(TCA0_OVF_vect) {
      |     ^~~~~~~~~~~~~
main.cpp:111:3: error: 'TCA0' was not declared in this scope
  111 |   TCA0.SINGLE.INTFLAGS = TCA_SINGLE_OVF_bm;
      |   ^~~~
main.cpp:111:26: error: 'TCA_SINGLE_OVF_bm' was not declared in this scope
  111 |   TCA0.SINGLE.INTFLAGS = TCA_SINGLE_OVF_bm;
      |                          ^~~~~~~~~~~~~~~~~
make: *** [Makefile:35: main.o] Error 1

Steps to reproduce the problem:

  1. clone the repo
  2. cd to repo folder
  3. make clean
  4. make

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions