Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5704

General • Re: Forced and EXEC’d Instructions

$
0
0
The program did print out "Loaded program at 30" but I didn't really understand what that offset means. I keep thinking that the program will be load from address 0 but looks like the compiler actually aligns the program to the top of the SM address space.
The SDK seems to load programs starting at the end of the SM address space and (if you load more than one program) working back towards zero. I don't know why it was done that way, but in any case you can't assume a program is loaded at a particular offset - unless I suppose if it's a 32-instruction program and fills the entire address space so there's only one place it can be loaded.
Is there any way to make the labels in PIO program show up in *.pio.h file so that we can use them in C program?
Yes!

Code:

.wrap_target    wait 1 irq 1PUBLIC next:    irq wait 0.wrap
That will get you the symbol instr_offset_next into instr.pio.h (ie. it prefixes the symbol name with the name of the program and '_offset_').

Statistics: Posted by arg001 — Thu Aug 15, 2024 7:15 pm



Viewing all articles
Browse latest Browse all 5704

Trending Articles