Closed YPares closed 7 years ago
Hi!
I'll set up an ubuntu virtual machine, to see if I can replicate this. In the meantime, can you check whether avr-libc and binutils-avr are installed?
OK, I have recreated the crtm328p.o
error. This is provided by avr-libc, which seems to be an optional dependency. This should solve it:
$ sudo apt-get install avr-libc
Let me know if there are any further issues, and I will update the documentation...
Can't upload the result to my arduino right now but it has fixed the linking problem, yes. Thanks!
I've got another problem now:
$ microscheme BLINK.ms -m UNO -d /dev/ttyUSB0 -u
Microscheme 0.9.3, (C) Ryan Suchocki
Treeshaker: After 4 rounds: 89 globals purged! 22 bytes will be reserved.
18 lines compiled OK
Assembling...
Uploading...
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Note I tried both with my Duemilanove and my Nano. Same output. And it doesn't happen when I use arduino-mk or the arduino IDE And ttyUSB0 is the right device, as it appears only when I plug the board.
Hi. The simple answer is that each Arduino model is slightly different, and neither the Duemilanove nor the Nano are supported by microscheme yet. (This is mainly because I don't own them, so it's hard to make the necessary adjustments.) The supported models are Uno, Mega and Leonardo.
However, the Nano is very similar to the UNO, so it may be possible to use yours. (It depends on the version of the board, and whether it's an official board or a clone...)
I suggest you try again with the Nano, and experiment with pressing the physical reset pin (on the Nano) repeatedly, after microscheme has started to run.
Also, one of the reasons I made this project open source is because it would be impractical (and expensive!) for me to do development and testing on all the Arduino models, but hopefully other people can fill in those gaps over time.
I know it should be quite simple to support the Duemilanove, for example, but without one in front of me, I can only provide hints...
Okay! I understand, even if that's a bit puzzling as duemilanove & Uno are programmed in the same way by the Arduino IDE (you don't have to change options), same for the Mini Pro & Nano I also have a Mini Pro 5v, I can try with it. (Both my mini pro and my nano are unofficial)
2016-05-20 3:08 GMT+02:00 Ryan Suchocki notifications@github.com:
Also, one of the reasons I made this project open source is because it would be impractical (and expensive!) for me to do development and testing on all the Arduino models, but hopefully other people can fill in those gaps over time.
I know it should be quite simple to support the Duemilanove, for example, but without one in front of me, I can only provide hints...
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/ryansuchocki/microscheme/issues/27#issuecomment-220493011
You could try using microscheme with arduino-mk, on the Nano.
e.g., just run microscheme -m UNO BLINK.ms
.
This tells ms to compile the program, but not assemble or upload it. It will generate BLINK.s.
BLINK.s is an assembly source which can be passed to avr-gcc, just like any C source. So, in theory, arduino-mk should be able to handle the assembly and uploading process from there...
I can confirm that this works with my UNO.
I used a simple makefile:
BOARD_TAG = uno
MONITOR_PORT = /dev/ttyACM0
include /usr/share/arduino/Arduino.mk
Arduino-mk expects .S
extension, so I just ran:
$ microscheme -m UNO BLINK.ms
$ mv BLINK.s BLINK.S
$ make upload
Arduino-mk then successfully uploaded the program! I would be surpised if this doesn't work on your Nano :)
@ryansuchocki Thank you! I give you the Makefile I made, if you want to include it to docs re. support of other boards:
ARDUINO_DIR = /opt/arduino
BOARD_TAG = diecimila
BOARD_SUB = atmega328
include ../Arduino-Makefile/Arduino.mk
PROJ := BLINK
ms: $(PROJ).S upload
$(PROJ).S: $(PROJ).ms
microscheme -m UNO $(PROJ).ms
mv $(PROJ).s $(PROJ).S
And I just do make ms
to build/upload everything. The only problem I have with this approach is that Arduino.mk
wants some .S, .cpp or .ino to be present before everything. So I worked around it by creating a dummy.cpp
before running it.
Also the first time I have to run it twice or else it complains about setup
and loop
symbols not being defined.
I'm not the boss of Makefiles, I'm afraid...
Yeah, It is bizarre that Arduino-mk does all its checks immediately, rather than when a rule is invoked.
Anyway, I can't stand having dummy files lying around, so I found a way of telling Arduino-mk about the source file before it really exists. We just create an empty .s file, to be filled in by microscheme later. This forces it to accept the lower-case extension too:
BOARD_TAG = ...
MONITOR_PORT = ...
PROJ := BLINK
# Create an empty source file:
$(shell touch $(PROJ).s)
# This effectifely overrides line 770 in Arduino-mk:
LOCAL_AS_SRCS := $(PROJ).s $(wildcard *.S *.s)
include .........../Arduino.mk
ms: $(PROJ).s upload
# Since we created an empty PROJ.s, we must force it to be compiled for real:
$(PROJ).s: $(PROJ).ms FORCE
microscheme -m UNO $(PROJ).ms
FORCE:
Hi! I'm on Ubuntu 15.10 x64, I installed both
gcc-avr
andavrdude
, but when trying the example with./microscheme -m UNO -d /dev/ttyUSB0 -auc examples/BLINK.ms
I get