Граф коммитов

11 коммитов

Автор SHA1 Сообщение Дата
Ayke van Laethem
df888acd5e avr: drop GNU toolchain dependency
- Use compiler-rt and picolibc instead of avr-libc.
  - Use ld.lld instead of avr-ld (or avr-gcc).

This makes it much easier to get started with TinyGo on AVR because
installing these extra tools (gcc-avr, avr-libc) can be a hassle.
It also opens the door for future improvements such as ThinLTO.

There is a code size increase but I think it's worth it in the long run.
The code size increase can hopefully be reduced with improvements to the
LLVM AVR backend and to compiler-rt.
2022-11-06 09:05:05 +01:00
Ayke van Laethem
bd56636d58 all: make emulator command a string instead of a []string
This matches the flash-command and is generally a bit easier to work
with.
This commit also prepares for allowing multiple formats to be used in
the emulator command, which is necessary for the esp32.
2022-04-28 07:50:03 +02:00
Ayke van Laethem
9c8ef5c48f digispark: split off attiny85 target
This split is similar to the atmega328p/arduino split and may be helpful
for adding other attiny85 boards or using the attiny85 without a board.
2021-02-12 01:10:06 +01:00
Ayke van Laethem
aa3481e06a avr: fix target triple
It was `avr-atmel-none`, which is incorrect. It must be
`avr-unknown-unknown`.

Additionally, there is no reason to specify the target triple per chip,
it can be done for all AVR chips at once as it doesn't vary like
Cortex-M chips.
2020-06-30 20:48:42 +02:00
Ayke van Laethem
66afcb3b39 avr: pass the correct -mmcu flag to the linker
It does not appear to be necessary for these devices but might result in
more appropriate libraries to be linked in.

It is best to _not_ specify the exact MCU because otherwise a few other
settings (such as startfiles and some linker script configs) also get
set, which we do manually anyway and should not be interfered with.

I discovered this while working on support for the atmega1284.
2020-03-17 14:46:56 +01:00
Ayke van Laethem
e83d1a02b6 avr: support tinygo run with simavr
This commit adds support for running both the Arduino Uno and the
DigiSpark under a simulator.
2020-02-26 19:50:54 +01:00
Ayke van Laethem
1cbe09ee89 compileopts: add linkerscript key
Setting the linker script as one property (instead of as part of the
generic ldflags property) allows it to be overriden.

This is important for the SoftDevice on Nordic chips, because the
SoftDevice takes up a fixed part of the flash/RAM and the application
must be flashed at a different position. With this linkerscript option,
it is possible to create (for example) a pca10040-s132v6 that overrides
the default linker script.
2019-11-04 16:21:59 +01:00
Ayke van Laethem
2a71aa90bc targets: refactor flash/gdb target configuration
Instead of specifying explicit commands, most of these commands have
been replaced by more specific properties.

This is work that will be necessary for an eventual -programmer flag to
the compiler, with which it is possible to select which programmer to
use to flash or debug a chip. That's not very useful for boards that
already include a programmer or bootloader for that purpose, but is very
useful for novel boards or single-purpose boards that are not already
included in TinyGo.
2019-10-14 16:44:33 +02:00
Ayke
873c1c3b4d Reduce code size for AVR (#116)
* all: add support for specifying target CPU in target config
* avr: specify the chip name in the target CPU

This reduces code size by a large margin. For examples/blinky, it
reduces code size from 1360 to 1266 when compiling for the Arduino Uno
(94 bytes, or ~7%).
2019-01-04 14:58:35 +01:00
Ayke van Laethem
62d74d8329
all: compile and link using clang, where possible 2018-11-22 16:20:10 +01:00
Ayke van Laethem
9392ef900d
avr: add support for the digispark
Blinking the on-board LED works. Nothing else has been tested yet.
2018-11-20 18:50:24 +01:00