4 ms·
I hope one day Zig is capable of targeting AVR microcontrollers, all anyone seems to target with new languages for embedded these days is ARM. Great, exactly wh
by lloydatkinson 4y ago
I hope one day Zig is capable of targeting AVR microcontrollers, all anyone seems to target with new languages for embedded these days is ARM. Great, exactly what we need, another homogeneity in CPU architectures.
- grawp 4y agoZig doesn't support AVR? It's news to me since I was using Zig on Atemega328p a whole year ago and even with true debugging via debugwire in VSCode.
- kuon 4y agoZig will have a C back-end which will provide support for many of this kind of hardware. And I think you can make avr work at present but I do not know the state of the support.
- Ristovski 4y agoIIRC there is some rudimentary AVR5 support in https://github.com/ZigEmbeddedGroup/microzig https://github.com/ZigEmbeddedGroup/microzig (https://github.com/ZigEmbeddedGroup/microzig/blob/main/src/modules/cpus/avr/avr5.zig https://github.com/ZigEmbeddedGroup/microzig/blob/main/src/m...)
- grawp 4y agoSry but that is just some completely optional 3rd party library. Zig has been compiling to AVR targets sucessfully for a very long time.
- ikskuh 4y agoZig is not perfect on targeting AVR, but it's capable enough to not be a PITA. Since we've made microzig supporting AVR targets (currently atmega328p only, feel free to add more), i'm not using anything else. Oh and: We can target an ATtiny1616 without problems. avr-libc doesn't officially support the Tiny2 family yet.
- lloydatkinson 4y ago328p is what I was thinking of when writing this!
- ikskuh 4y agoThen you definitly should check out MicroZig! I will push my bugfixes for current master branch tomorrow or later, so you can directly play around!
- audunw 4y ago> all anyone seems to target with new languages for embedded these days is ARM .. and RISC-V. Zig does work with RISC-V, to some degree at least. I hope Zig support for AVR improves. For legacy reasons. But I don't think we need more AVR going forward. It's rather proprietary, no?
- ikskuh 4y agoIf everything goes according to plan, Zig will be the only language that is capable of actually utilizing the AVR 24 bit address space properly, while also allowing you to make nice optimizations with the smaller 16 bit address spaces (Zig has first class address spaces on memory) Also, RISC-V support is working quite fine, and i don't see much problems with that. > But I don't think we need more AVR going forward. It's rather proprietary, no? AVR is Arduino. It would be a bad action to basically say: "well, zig is not going to support the most widespread maker hardware on the market"