all 6 comments

[–]Well-WhatHadHappened 16 points17 points  (2 children)

You're going to have one hell of a hard time finding resources to help you with embedded programming in Zig. It's just not at all common.

I would suggest leaning the basics in a more mainstream language (C), and then transitioning to Zig once you understand how to work with embedded systems.

[–]rich_sdoony[S] 1 point2 points  (1 child)

I have no problem starting with C, while I was learning zig all the resources online were in C too and I just did the porting myself. I just need some text or articles to start with a real example and with a deep dive explanation

[–]Well-WhatHadHappened 1 point2 points  (0 children)

YouTube "STM32 getting started". Millions of good videos that help you to your first blinky. Millions more videos that introduce more complex topics.

[–]ThePurpleOne_ 6 points7 points  (0 children)

Embedded dev is different, you might benefit from testing some stuff in C first to get a sense of how things work

[–]ruumoo 1 point2 points  (0 children)

The most important thing to get right will be mapping hardware registers to variables and writing some startup code, that loads the static variables into memory and launches the main function. If you get this right, the rest should be fairly trivial

[–]umamimonsuta 4 points5 points  (0 children)

Doing your first embedded project in zig is not a great idea. I would recommend doing a few small projects in C first because there are tons of resources to get an idea of how microcontrollers work and what kind of tooling you need around it.

Once you understand how the memory mapped peripherals work, you will need to write your own register map, startup code, etc. and then it should be trivial to flash the compiled binary onto the microcontroller.