go4retro / TestSerial

test of rs232 routines
GNU General Public License v2.0
0 stars 0 forks source link

compile failure for Arduino Uno #1

Open classilla opened 2 months ago

classilla commented 2 months ago

I'll just post the session.

macbookair2:/Users/spectre/src/TestSerial/% make CONFIG=config-arduino clean all
Makefile:57: config-arduino: No such file or directory
sh: scripts/gcctest.pl: Permission denied
make: *** No rule to make target `config-arduino'.  Stop.
macbookair2:/Users/spectre/src/TestSerial/% cp ../HEXTIr/config-arduino .
macbookair2:/Users/spectre/src/TestSerial/% make CONFIG=config-arduino clean all 
sh: scripts/gcctest.pl: Permission denied
  CLEAN
rmdir: illegal option -- -
usage: rmdir [-pv] directory ...
make: [clean] Error 1 (ignored)
  MKDIR  obj-m328p-arduino/src/
  CONF2H config-arduino
  CC     src/main.c
In file included from src/main.c:28:
src/config.h:67:4: error: #error "CONFIG_HARDWARE_VARIANT is unset or set to an unknown value."
   67 | #  error "CONFIG_HARDWARE_VARIANT is unset or set to an unknown value."
      |    ^~~~~
src/main.c: In function 'init':
src/main.c:33:3: warning: implicit declaration of function 'board_init'; did you mean 'uart_init'? [-Wimplicit-function-declaration]
   33 |   board_init();
      |   ^~~~~~~~~~
      |   uart_init
make: *** [obj-m328p-arduino/src/main.o] Error 1
go4retro commented 2 months ago

Thanks.

Looks like you need to chmod u+x scripts/gcctest.pl

I don't think the rmdir error is a big deal, so let's not worry about it yet.

classilla commented 2 months ago

No, the issue is the compile error with src/config.h - it doesn't like me trying to compile with an Arduino Uno. But just for the record,

macbookair2:/Users/spectre/src/TestSerial/% chmod +x scripts/gcctest.pl
macbookair2:/Users/spectre/src/TestSerial/% make CONFIG=config-arduino clean all 
  CLEAN
rmdir: illegal option -- -
usage: rmdir [-pv] directory ...
make: [clean] Error 1 (ignored)
  CONF2H config-arduino
  CC     src/main.c
In file included from src/main.c:28:
src/config.h:67:4: error: #error "CONFIG_HARDWARE_VARIANT is unset or set to an unknown value."
   67 | #  error "CONFIG_HARDWARE_VARIANT is unset or set to an unknown value."
      |    ^~~~~
src/main.c: In function 'init':
src/main.c:33:3: warning: implicit declaration of function 'board_init'; did you mean 'uart_init'? [-Wimplicit-function-declaration]
   33 |   board_init();
      |   ^~~~~~~~~~
      |   uart_init
make: *** [obj-m328p-arduino/src/main.o] Error 1

The issue appears to be that config.h only has support for CONFIG_HARDWARE_VARIANT == 1. Is it still the same dummy board_init() function for other variants?

#if CONFIG_HARDWARE_VARIANT == 1
/* ---------- Hardware configuration: HEXTIr v1 ---------- */

static inline void board_init(void) {
}

#else
#  error "CONFIG_HARDWARE_VARIANT is unset or set to an unknown value."
#endif
go4retro commented 2 months ago

My apologies. Use:

make CONFIG=config clean all

I made the default config file the arduino build. You might need to adjust the COM and such in config to suit your board.

classilla commented 1 month ago

Okay, I misunderstood what you were doing here. I thought this was HEXTIr minus everything except the UART, but in this case it's really just the UART. How did you send the text file and monitor data_available?

(I did build and flash it to the Uno, so that much is working)

go4retro commented 1 month ago

I used RealTerminal and sent a large text file to the UNO, and then watched the RS232 output. Any terminal seems like it would work for this. I think I used 9600 to allow me to see the progress.

classilla commented 1 month ago

Okay, then I must have screwed up something, because all I'm getting from the TX/RX pins is garbage at any baud rate (tried 300, 600, 1200, 2400, 4800, 9600, 19200, 57600 and 115200). The lights blink on the Uno if I type keys, but the output is nonsense. Or is that what you saw?

More specifically at 9600bps I get just null bytes back, though it does appear to be transmitting them.

go4retro commented 1 month ago

When I boot the Arduino and direct mine to COM3 (USB) 300,8,n,1, and reset, it spits out:

TestSerial Version: 0.1.0.0PR

Jim

classilla commented 1 month ago

Okay, then there's something really wrong. At 300bps I can see it sending stuff at reset but it's all nonsense characters. I'll have to mess with it some more.