For those interested, updated my porting guide to be better organized + include a section on project organization using packages (and Zig’s package system) as well as calling Zig code from C and vice-versa!
6 Likes
Thank you for the awesome guide!
I tried to follow steps to produce a blinky program for my nucleo-64 board.
At the moment it compiles and produces a binary, but it fails to flash onto my device.
- Standard
Makefilewitharm-none-eabi-gcccompiler/linker: Compiles and flashes - Modified
Makefilewithzig ccas the compiler/linker: Compiles and flashes fine - Equivalent
build.zigfile: compiles, but fails flashing to the board
I’m new to both zig and embedded so I’m not exactly sure what steps i can take to debug this.
Did it compile & flash properly when you tried step 3 of the guide?
@fixer I didn’t try to flash when i went through step 03.
I went back now and recreated step three here.
Step 03 builds and flashes fine ![]()
One fix is to add the line:
blinky_exe.setLinkerScriptPath(b.path("stm32_hal/STM32F401RETx_FLASH.ld"));
To the build.zig of the zig program too.
1 Like