Closed VedantParanjape closed 4 years ago
#include "resource_table_0.h" #include <pru/io.h> volatile register uint32_t __R30; int main(void) { write_r30(0xffff); __R30 = 0x0000; int test = 4; int add = test + 5; return 0; }
This code fails on compilation with pru-gcc command: pru-gcc test.c -o test.pru0 -mmcu=am335x.pru0
pru-gcc test.c -o test.pru0 -mmcu=am335x.pru0
test.c:3:28: error: register name not specified for '__R30' 3 | volatile register uint32_t __R30; | ^~~~~
debian@beaglebone:~/test-pru$ pru-gcc -v Using built-in specs. COLLECT_GCC=pru-gcc COLLECT_LTO_WRAPPER=/home/debian/pru-gcc-arm32/bin/../libexec/gcc/pru/10.1.0/lto-wrapper Target: pru Configured with: /home/gnupru/src/gcc/configure --target=pru --prefix=/home/arm-gcc-pru-toolchain --disable-nls --with-newlib --with-bugurl=https://github.com/dinuxbg/gnupru/issues --without-headers --enable-languages=c : (reconfigured) /home/gnupru/src/gcc/configure --target=pru --prefix=/home/arm-gcc-pru-toolchain --disable-nls --with-newlib --with-bugurl=https://github.com/dinuxbg/gnupru/issues --enable-languages=c,c++ Thread model: single Supported LTO compression algorithms: zlib gcc version 10.1.0 (GCC)
pru/io.h
Sorry, this is not supported in GCC C.
There are predefined R30 and R31 if you use C++, though: https://github.com/dinuxbg/pru-gcc-examples/blob/master/blinking-led%2B%2B/main.cpp
Thanks for the help :)
code
This code fails on compilation with pru-gcc command:
pru-gcc test.c -o test.pru0 -mmcu=am335x.pru0
output
GCC version
pru/io.h
header ? or inling assembly ?