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

Building fail for Arduino Leonardo/ProMicro (Atmega32u4) #72

Open
AKTanara opened this issue Aug 30, 2023 · 4 comments
Open

Building fail for Arduino Leonardo/ProMicro (Atmega32u4) #72

AKTanara opened this issue Aug 30, 2023 · 4 comments

Comments

@AKTanara
Copy link

I knew I'd have issues while trying to upload my code using Pro Mico as UPDI programmer, but I didn't think I'd have issues programming the programmer itself!
While compiling in Arduino IDE 1.8 for any of the boards (Leonardo, Pro Micro, Fio v3, ...) all having Atmega32U4 chip, returns this ERROR:

Compiling 'jtag2updi' for 'Arduino Leonardo'
Error compiling project sources
 
 
Build failed for project 'jtag2updi'
sys.cpp:10: In file included from
io.h:99: In file included from
JICE_io.cpp:9: from
 
 
sys.cpp: In function void SYS::init()
JICE_io.cpp: In function uint8_t JICE_io::put(char)
 
 
sys.h: 55:27: error: 'PORTUPDI_PORT' was not declared in this scope
sys.h: 346:32: error: 'UCSRHOST_USARTA' was not declared in this scope
   # define PORT(x) CONCAT(PORT,x)
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
sys.h:39: note  in definition of macro CONCAT
sys.h:40: note  in expansion of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
   #define XCONCAT(A,B) CONCAT(A,B)        \\ expand and concatenate
sys.cpp:38: note  in expansion of macro PORT
   ^~~~~~
   PORT(UPDI_PORT) = 1<<UPDI_PIN
sys.h:346: note  in expansion of macro XCONCAT
   ^~~~
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
   ^~~~~~~
 
JICE_io.cpp:59: note  in expansion of macro HOST_UCSRA
   loop_until_bit_is_set(HOST_UCSRA, UDRE)
 
updi_io_soft.cpp:10: In file included from
   ^~~~~~~~~~
sys.cpp: 38:26: error: 'UPDI_PIN' was not declared in this scope
sys.h:346: note  suggested alternative  HOST_UCSRA
   PORT(UPDI_PORT) = 1<<UPDI_PIN
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
   ^~~~~~~~
sys.h:40: note  in expansion of macro CONCAT
sys.cpp:38: note  suggested alternative  USB_PID
   #define XCONCAT(A,B) CONCAT(A,B)        \\ expand and concatenate
   PORT(UPDI_PORT) = 1<<UPDI_PIN
 
   ^~~~~~
   ^~~~~~~~
sys.h:346: note  in expansion of macro XCONCAT
   USB_PID
updi_io_soft.cpp: In function uint8_t UPDI_io::get()
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
   ^~~~~~~
 
JICE_io.cpp:59: note  in expansion of macro HOST_UCSRA
 
sys.cpp:10: In file included from
   loop_until_bit_is_set(HOST_UCSRA, UDRE)
sys.h: 56:26: error: 'DDRUPDI_PORT' was not declared in this scope
   ^~~~~~~~~~
   # define DDR(x) CONCAT(DDR,x)
sys.h:39: note  in definition of macro CONCAT
 
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h: 56:26: error: 'DDRLED_PORT' was not declared in this scope
 
updi_io_soft.cpp:54: note  in expansion of macro DDR
   # define DDR(x) CONCAT(DDR,x)
   DDR(UPDI_PORT)  &= ~(1 << UPDI_PIN)
sys.h: 333:26: error: 'UDREHOST_USART' was not declared in this scope
sys.h:39: note  in definition of macro CONCAT
   ^~~
   #define UDRE XCONCAT(UDRE, HOST_USART)
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:40: note  in expansion of macro CONCAT
sys.cpp:42: note  in expansion of macro DDR
   #define XCONCAT(A,B) CONCAT(A,B)        \\ expand and concatenate
   DDR(LED_PORT) |= (1 << LED_PIN)
   ^~~~~~
   ^~~
sys.h:333: note  in expansion of macro XCONCAT
   #define UDRE XCONCAT(UDRE, HOST_USART)
 
   ^~~~~~~
JICE_io.cpp:59: note  in expansion of macro UDRE
 
updi_io_soft.cpp: 54:35: error: 'UPDI_PIN' was not declared in this scope
   loop_until_bit_is_set(HOST_UCSRA, UDRE)
   DDR(UPDI_PORT)  &= ~(1 << UPDI_PIN)
sys.cpp: 42:26: error: 'LED_PIN' was not declared in this scope
   ^~~~
   ^~~~~~~~
   DDR(LED_PORT) |= (1 << LED_PIN)
sys.h:333: note  suggested alternative  HOST_UCSRA
updi_io_soft.cpp:54: note  suggested alternative  USB_PID
   ^~~~~~~
   #define UDRE XCONCAT(UDRE, HOST_USART)
   DDR(UPDI_PORT)  &= ~(1 << UPDI_PIN)
sys.h:40: note  in expansion of macro CONCAT
   ^~~~~~~~
   #define XCONCAT(A,B) CONCAT(A,B)        \\ expand and concatenate
   USB_PID
   ^~~~~~
sys.h:333: note  in expansion of macro XCONCAT
 
   #define UDRE XCONCAT(UDRE, HOST_USART)
   ^~~~~~~
sys.cpp:10: In file included from
JICE_io.cpp:59: note  in expansion of macro UDRE
   loop_until_bit_is_set(HOST_UCSRA, UDRE)
 
   ^~~~
 
updi_io_soft.cpp:10: In file included from
sys.cpp: In function void SYS::setLED()
 
 
JTAG2.h:12: In file included from
sys.h: 55:27: error: 'PORTUPDI_PORT' was not declared in this scope
JICE_io.h:13: from
   # define PORT(x) CONCAT(PORT,x)
JICE_io.cpp:10: from
 
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h: 55:27: error: 'PORTLED_PORT' was not declared in this scope
updi_io_soft.cpp:56: note  in expansion of macro PORT
   # define PORT(x) CONCAT(PORT,x)
   PORT(UPDI_PORT) &= ~(1 << UPDI_PIN)
sys.h:39: note  in definition of macro CONCAT
   ^~~~
   #define CONCAT(A,B) A##B                \\ concatenate
 
sys.cpp:58: note  in expansion of macro PORT
   PORT(LED_PORT) |= 1 << LED_PIN
sys.h: 338:25: error: 'TXCHOST_USART' was not declared in this scope
   ^~~~
   #define TXC XCONCAT(TXC, HOST_USART)
sys.h:39: note  in definition of macro CONCAT
 
   #define CONCAT(A,B) A##B                \\ concatenate
 
sys.h:338: note  in expansion of macro XCONCAT
io.h:99: In file included from
   #define TXC XCONCAT(TXC, HOST_USART)
sys.cpp: 58:26: error: 'LED_PIN' was not declared in this scope
sys.h:11: from
   ^~~~~~~
   PORT(LED_PORT) |= 1 << LED_PIN
updi_io_soft.cpp:10: from
JICE_io.cpp:60: note  in expansion of macro TXC
   ^~~~~~~
   HOST_UCSRA|=1<<TXC
   ^~~
 
 
sys.h:338: note  suggested alternative  HOST_UCSRA
sys.h: 54:26: error: 'PINUPDI_PORT' was not declared in this scope
sys.cpp:10: In file included from
   #define TXC XCONCAT(TXC, HOST_USART)
   # define PIN(x) CONCAT(PIN,x)
sys.h:39: note  in definition of macro CONCAT
sys.h:54: note  in expansion of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
   # define PIN(x) CONCAT(PIN,x)
sys.h:338: note  in expansion of macro XCONCAT
   ^~~~~~
   #define TXC XCONCAT(TXC, HOST_USART)
updi_io_soft.cpp:102: note  in expansion of macro PIN
 
   ^~~~~~~
   [uart_port] "i" (_SFR_IO_ADDR(PIN(UPDI_PORT)))
JICE_io.cpp:60: note  in expansion of macro TXC
sys.cpp: In function void SYS::clearLED()
   ^~~
   HOST_UCSRA|=1<<TXC
   ^~~
 
 
sys.h: 55:27: error: 'PORTLED_PORT' was not declared in this scope
updi_io_soft.cpp:10: In file included from
 
   # define PORT(x) CONCAT(PORT,x)
sys.h:39: note  in definition of macro CONCAT
sys.h: 348:30: error: 'UDRHOST_USART' was not declared in this scope
   #define CONCAT(A,B) A##B                \\ concatenate
   #define HOST_UDR XCONCAT(UDR, HOST_USART)
sys.cpp:62: note  in expansion of macro PORT
sys.h:39: note  in definition of macro CONCAT
   PORT(LED_PORT) &= ~(1 << LED_PIN)
   #define CONCAT(A,B) A##B                \\ concatenate
 
   ^~~~
sys.h:348: note  in expansion of macro XCONCAT
updi_io_soft.cpp: In function uint8_t UPDI_io::put(char)
   #define HOST_UDR XCONCAT(UDR, HOST_USART)
   ^~~~~~~
JICE_io.cpp:61: note  in expansion of macro HOST_UDR
 
 
   return HOST_UDR = c
sys.cpp: 62:28: error: 'LED_PIN' was not declared in this scope
sys.h: 56:26: error: 'DDRUPDI_PORT' was not declared in this scope
   ^~~~~~~~
   PORT(LED_PORT) &= ~(1 << LED_PIN)
   # define DDR(x) CONCAT(DDR,x)
sys.h:348: note  suggested alternative  HOST_UCSRA
   ^~~~~~~
sys.h:39: note  in definition of macro CONCAT
   #define HOST_UDR XCONCAT(UDR, HOST_USART)
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:39: note  in definition of macro CONCAT
updi_io_soft.cpp:175: note  in expansion of macro DDR
   #define CONCAT(A,B) A##B                \\ concatenate
   DDR(UPDI_PORT) |= (1 << UPDI_PIN)
sys.h:348: note  in expansion of macro XCONCAT
   ^~~
   #define HOST_UDR XCONCAT(UDR, HOST_USART)
   ^~~~~~~
JICE_io.cpp:61: note  in expansion of macro HOST_UDR
 
   return HOST_UDR = c
   ^~~~~~~~
updi_io_soft.cpp: 175:33: error: 'UPDI_PIN' was not declared in this scope
   DDR(UPDI_PORT) |= (1 << UPDI_PIN)
   ^~~~~~~~
 
updi_io_soft.cpp:175: note  suggested alternative  USB_PID
JICE_io.cpp:10: In file included from
   DDR(UPDI_PORT) |= (1 << UPDI_PIN)
   ^~~~~~~~
   USB_PID
 
JICE_io.cpp: In function uint8_t JICE_io::get()
 
io.h:99: In file included from
 
sys.h:11: from
updi_io_soft.cpp:10: from
sys.h: 346:32: error: 'UCSRHOST_USARTA' was not declared in this scope
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
JICE_io.h:18: note  in definition of macro loop_until_bit_set_or_host_timeout
 
   checkTimeouts() & WAIT_FOR_HOST)))
sys.h: 55:27: error: 'PORTUPDI_PORT' was not declared in this scope
   ^~~~~~~~
   # define PORT(x) CONCAT(PORT,x)
sys.h:40: note  in expansion of macro CONCAT
sys.h:55: note  in expansion of macro CONCAT
   #define XCONCAT(A,B) CONCAT(A,B)        \\ expand and concatenate
   # define PORT(x) CONCAT(PORT,x)
   ^~~~~~
   ^~~~~~
sys.h:346: note  in expansion of macro XCONCAT
updi_io_soft.cpp:220: note  in expansion of macro PORT
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
   [uart_port] "i" (_SFR_IO_ADDR(PORT(UPDI_PORT)))
   ^~~~~~~
   ^~~~
JICE_io.cpp:72: note  in expansion of macro HOST_UCSRA
   loop_until_bit_set_or_host_timeout(HOST_UCSRA, RXC)
   ^~~~~~~~~~
 
sys.h:346: note  suggested alternative  HOST_UCSRA
updi_io_soft.cpp:10: In file included from
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
JICE_io.h:18: note  in definition of macro loop_until_bit_set_or_host_timeout
   checkTimeouts() & WAIT_FOR_HOST)))
 
   ^~~~~~~~
sys.h:40: note  in expansion of macro CONCAT
updi_io_soft.cpp: In function void send_break()
   #define XCONCAT(A,B) CONCAT(A,B)        \\ expand and concatenate
   ^~~~~~
sys.h:346: note  in expansion of macro XCONCAT
 
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
sys.h: 56:26: error: 'DDRUPDI_PORT' was not declared in this scope
   ^~~~~~~
   # define DDR(x) CONCAT(DDR,x)
JICE_io.cpp:72: note  in expansion of macro HOST_UCSRA
sys.h:39: note  in definition of macro CONCAT
   loop_until_bit_set_or_host_timeout(HOST_UCSRA, RXC)
   #define CONCAT(A,B) A##B                \\ concatenate
   ^~~~~~~~~~
updi_io_soft.cpp:236: note  in expansion of macro DDR
   DDR(UPDI_PORT) |= (1 << UPDI_PIN)
   ^~~
 
sys.h: 337:25: error: 'RXCHOST_USART' was not declared in this scope
 
   #define RXC XCONCAT(RXC, HOST_USART)
JICE_io.h:18: note  in definition of macro loop_until_bit_set_or_host_timeout
updi_io_soft.cpp: 236:33: error: 'UPDI_PIN' was not declared in this scope
   checkTimeouts() & WAIT_FOR_HOST)))
   DDR(UPDI_PORT) |= (1 << UPDI_PIN)
   ^~~~~~
   ^~~~~~~~
sys.h:40: note  in expansion of macro CONCAT
updi_io_soft.cpp:236: note  suggested alternative  USB_PID
   #define XCONCAT(A,B) CONCAT(A,B)        \\ expand and concatenate
   DDR(UPDI_PORT) |= (1 << UPDI_PIN)
   ^~~~~~
   ^~~~~~~~
sys.h:337: note  in expansion of macro XCONCAT
   USB_PID
   #define RXC XCONCAT(RXC, HOST_USART)
   ^~~~~~~
JICE_io.cpp:72: note  in expansion of macro RXC
 
   loop_until_bit_set_or_host_timeout(HOST_UCSRA, RXC)
updi_io_soft.cpp:10: In file included from
   ^~~
sys.h:337: note  suggested alternative  HOST_UCSRA
 
   #define RXC XCONCAT(RXC, HOST_USART)
JICE_io.h:18: note  in definition of macro loop_until_bit_set_or_host_timeout
sys.h: 55:27: error: 'PORTUPDI_PORT' was not declared in this scope
   checkTimeouts() & WAIT_FOR_HOST)))
   # define PORT(x) CONCAT(PORT,x)
   ^~~~~~
sys.h:39: note  in definition of macro CONCAT
sys.h:40: note  in expansion of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
   #define XCONCAT(A,B) CONCAT(A,B)        \\ expand and concatenate
updi_io_soft.cpp:243: note  in expansion of macro PORT
   ^~~~~~
   PORT(UPDI_PORT) &= ~(1 << UPDI_PIN)
sys.h:337: note  in expansion of macro XCONCAT
   ^~~~
   #define RXC XCONCAT(RXC, HOST_USART)
   ^~~~~~~
JICE_io.cpp:72: note  in expansion of macro RXC
   loop_until_bit_set_or_host_timeout(HOST_UCSRA, RXC)
   ^~~
 
JTAG2.h:12: In file included from
JICE_io.h:13: from
JICE_io.cpp:10: from
 
sys.h: 348:30: error: 'UDRHOST_USART' was not declared in this scope
   #define HOST_UDR XCONCAT(UDR, HOST_USART)
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:348: note  in expansion of macro XCONCAT
   #define HOST_UDR XCONCAT(UDR, HOST_USART)
   ^~~~~~~
JICE_io.cpp:73: note  in expansion of macro HOST_UDR
   return HOST_UDR
   ^~~~~~~~
sys.h:348: note  suggested alternative  HOST_UCSRA
   #define HOST_UDR XCONCAT(UDR, HOST_USART)
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:348: note  in expansion of macro XCONCAT
   #define HOST_UDR XCONCAT(UDR, HOST_USART)
   ^~~~~~~
JICE_io.cpp:73: note  in expansion of macro HOST_UDR
   return HOST_UDR
   ^~~~~~~~
 
JICE_io.cpp: In function void JICE_io::init()
 
sys.h: 346:32: error: 'UCSRHOST_USARTA' was not declared in this scope
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:346: note  in expansion of macro XCONCAT
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
   ^~~~~~~
JICE_io.cpp:88: note  in expansion of macro HOST_UCSRA
   HOST_UCSRA = (1<<U2X)
   ^~~~~~~~~~
sys.h:346: note  suggested alternative  HOST_UCSRA
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:346: note  in expansion of macro XCONCAT
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
   ^~~~~~~
JICE_io.cpp:88: note  in expansion of macro HOST_UCSRA
   HOST_UCSRA = (1<<U2X)
   ^~~~~~~~~~
 
sys.h: 334:25: error: 'U2XHOST_USART' was not declared in this scope
   #define U2X XCONCAT(U2X, HOST_USART)
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:334: note  in expansion of macro XCONCAT
   #define U2X XCONCAT(U2X, HOST_USART)
   ^~~~~~~
JICE_io.cpp:88: note  in expansion of macro U2X
   HOST_UCSRA = (1<<U2X)
   ^~~
sys.h:334: note  suggested alternative  HOST_UCSRA
   #define U2X XCONCAT(U2X, HOST_USART)
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:334: note  in expansion of macro XCONCAT
   #define U2X XCONCAT(U2X, HOST_USART)
   ^~~~~~~
JICE_io.cpp:88: note  in expansion of macro U2X
   HOST_UCSRA = (1<<U2X)
   ^~~
 
sys.h: 356:33: error: 'UBRRHOST_USARTL' was not declared in this scope
   #define HOST_UBRR XCONCAT(UBRR, XCONCAT(HOST_USART, L))
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:356: note  in expansion of macro XCONCAT
   #define HOST_UBRR XCONCAT(UBRR, XCONCAT(HOST_USART, L))
   ^~~~~~~
JICE_io.cpp:90: note  in expansion of macro HOST_UBRR
   HOST_UBRR = baud_reg_val(19200)
   ^~~~~~~~~
 
sys.h: 347:32: error: 'UCSRHOST_USARTB' was not declared in this scope
   #define HOST_UCSRB XCONCAT(UCSR, XCONCAT(HOST_USART, B))
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:347: note  in expansion of macro XCONCAT
   #define HOST_UCSRB XCONCAT(UCSR, XCONCAT(HOST_USART, B))
   ^~~~~~~
JICE_io.cpp:92: note  in expansion of macro HOST_UCSRB
   HOST_UCSRB = (1<<RXEN)|(1<<TXEN)
   ^~~~~~~~~~
sys.h:347: note  suggested alternative  HOST_UCSRB
   #define HOST_UCSRB XCONCAT(UCSR, XCONCAT(HOST_USART, B))
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:347: note  in expansion of macro XCONCAT
   #define HOST_UCSRB XCONCAT(UCSR, XCONCAT(HOST_USART, B))
   ^~~~~~~
JICE_io.cpp:92: note  in expansion of macro HOST_UCSRB
   HOST_UCSRB = (1<<RXEN)|(1<<TXEN)
   ^~~~~~~~~~
 
sys.h: 336:26: error: 'RXENHOST_USART' was not declared in this scope
   #define RXEN XCONCAT(RXEN, HOST_USART)
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:336: note  in expansion of macro XCONCAT
   #define RXEN XCONCAT(RXEN, HOST_USART)
   ^~~~~~~
JICE_io.cpp:92: note  in expansion of macro RXEN
   HOST_UCSRB = (1<<RXEN)|(1<<TXEN)
   ^~~~
sys.h:336: note  suggested alternative  HOST_UCSRA
   #define RXEN XCONCAT(RXEN, HOST_USART)
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:336: note  in expansion of macro XCONCAT
   #define RXEN XCONCAT(RXEN, HOST_USART)
   ^~~~~~~
JICE_io.cpp:92: note  in expansion of macro RXEN
   HOST_UCSRB = (1<<RXEN)|(1<<TXEN)
   ^~~~
 
sys.h: 335:26: error: 'TXENHOST_USART' was not declared in this scope
   #define TXEN XCONCAT(TXEN, HOST_USART)
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:335: note  in expansion of macro XCONCAT
   #define TXEN XCONCAT(TXEN, HOST_USART)
   ^~~~~~~
JICE_io.cpp:92: note  in expansion of macro TXEN
   HOST_UCSRB = (1<<RXEN)|(1<<TXEN)
   ^~~~
sys.h:335: note  suggested alternative  HOST_UCSRA
   #define TXEN XCONCAT(TXEN, HOST_USART)
sys.h:39: note  in definition of macro CONCAT
   #define CONCAT(A,B) A##B                \\ concatenate
sys.h:335: note  in expansion of macro XCONCAT
   #define TXEN XCONCAT(TXEN, HOST_USART)
   ^~~~~~~
JICE_io.cpp:92: note  in expansion of macro TXEN
   HOST_UCSRB = (1<<RXEN)|(1<<TXEN)
   ^~~~
 
JICE_io.cpp:10: In file included from
 
JICE_io.cpp: In function void JICE_io::flush()
 
sys.h: 346:32: error: 'UCSRHOST_USARTA' was not declared in this scope
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
JICE_io.h:18: note  in definition of macro loop_until_bit_set_or_host_timeout
   checkTimeouts() & WAIT_FOR_HOST)))
   ^~~~~~~~
sys.h:40: note  in expansion of macro CONCAT
   #define XCONCAT(A,B) CONCAT(A,B)        \\ expand and concatenate
   ^~~~~~
sys.h:346: note  in expansion of macro XCONCAT
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
   ^~~~~~~
JICE_io.cpp:108: note  in expansion of macro HOST_UCSRA
   loop_until_bit_set_or_host_timeout(HOST_UCSRA, TXC)
   ^~~~~~~~~~
sys.h:346: note  suggested alternative  HOST_UCSRA
   #define HOST_UCSRA XCONCAT(UCSR, XCONCAT(HOST_USART, A))
@nhansendev
Copy link

nhansendev commented Oct 19, 2023

I had this same error and was able to get around it by editing the sys.h file to reflect the expected values from iom32u4.h. I think the problem is related to the board not being recognized correctly, so "AVR_ATmega32" is not defined and then "AVR_ATmega_Mighty" is not defined, which leads to many other things not being defined properly...

Many definitions simply needed a "1" added to the name. Ex:

    #define UDRE UDRE1
    #define U2X U2X1
    #define TXEN TXEN1
    #define RXEN RXEN1
    #define RXC RXC1
    #define TXC TXC1

    #define HOST_UCSRA UCSR1A
    #define HOST_UCSRB UCSR1B
    #define HOST_UDR UDR1

    #define HOST_UBRR UBRR1

However, I am still having communication issues with my board so I can't confirm whether this actually worked beyond stopping the error from appearing.

I suspect the port/pin definitions aren't right either, but I haven't figured it out what they should be yet:

# ifndef HOST_USART
#   define HOST_USART 0
# endif

# ifndef UPDI_PORT
#   define UPDI_PORT C
# endif

# ifndef UPDI_PIN
#   define UPDI_PIN 7
# endif

# ifndef LED_PORT
#   define LED_PORT B
# endif

# ifndef LED_PIN
#   define LED_PIN 7
# endif

Hopefully this helps the author create a fix.

@Tomassmits
Copy link

@nhansendev Have you had any success in getting it to work? I'm attempting the same (on a DFR0282 Beetle) without much luck.

@nhansendev
Copy link

@nhansendev Have you had any success in getting it to work? I'm attempting the same (on a DFR0282 Beetle) without much luck.

Unfortunately, no. I decided it wasn't worth the hassle and switched to the typical Arduino Nano as my programmer instead.

@Tomassmits
Copy link

@nhansendev Have you had any success in getting it to work? I'm attempting the same (on a DFR0282 Beetle) without much luck.

Unfortunately, no. I decided it wasn't worth the hassle and switched to the typical Arduino Nano as my programmer instead.

Thanks. Same here; it's not worth the time, and the ATmega328 variants are still well available (and supported) anyway.

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