Open nock24 opened 3 months ago
Would you please share a snippet of the code you're having issues with
It seems manually filling the buffer with a for loop also causes this issue.
Thanks for sharing code.
I think it's likely that the serial buffer just isn't being reliably flushed before you enter your infinite loop. You'll probably need to explicitly flush it to have it reliably print before entering your loop.
Printing to serial works completely reliably before defining the buffer.
can you demonstrate that the machine code being produced here is problematic?
This is the assembly where a 10 length u8 buffer is made and then I change the first element to 1:
adrp x8, 101f000 <compiler_rt.rem_pio2_large.rem_pio2_large+0x600>
add x8, x8, #0x732
ldr x9, [x8]
str x9, [sp]
ldrh w8, [x8, #8]
strh w8, [sp, #8]
mov w8, #0x1 // #1
strb w8, [sp]
ldrb w8, [sp]
sub x0, x29, #0x1
sturb w8, [x29, #-1]
I also noticed that if I don't change any elements in the buffer then it works.
Zig Version
0.13
Steps to Reproduce and Observed Behavior
I'm writing bare metal code for the raspberry pi 3b and when using the double star initialization syntax it seems to get stuck in an endless loop and all code after it being used doesn't run. Using
@memset()
works as expectedIn this other case it seems like I get the same issue but instead with
@memset
.