make compiler error clpru

Hello,
I have been working on building off (exploringBB/chp15/pru at version2 · derekmolloy/exploringBB · GitHub)/ledFlashASM / and the project have been working as they should until I ran into a clock skew problem. I tried update/upgrade thinking maybe it was software bug. Now after update/upgrade “sudo make” gives me the following error

 ************************************************************
Building project: ledFlashASM

Building file: main.c
Invoking: PRU Compiler
/usr/bin/clpru --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include/am335x -v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=gen --pp_directory=gen -ppd -ppa -fe gen/main.object main.c
"main.c", line 36: fatal error #1965: cannot open source file "stdint.h"
1 catastrophic error detected in the compilation of "main.c".
Compilation terminated.

>> Compilation failure
make: *** [Makefile:73: gen/main.object] Error 1

I have tried downloading a new repository and it still give me this error. When I tried the other project they compile correctly such as ledflash.c and perfmem.

you didn’t mention that you modified this file and put it in your local directory, so I’m going to guess that it should be <stdint.h> as Derek Molloy specified in listing 15-2 of the excellent book that you mentioned.

curious what a ‘clock shew’ problem is, and why you would update/upgrade as a result of it.

gomer

I only change the ledFlashASM.asm file(adding loops and mem pushing). I downloaded a new repository and ran ledFlashC.c without a problem. When I try to make a fresh ledFlashASM I get this error. (fyi I meant “skew” not “shew”)
Update:
I am able to compile ledFlashC and perfTestASM once, then the same errors appear after changing the delay by 1 zero.


debian@beaglebone:~/EBB/chp15/pru/ledFlashASM$ ls
AM335x_PRU.cmd  gen  ledFlashASM.asm  main.c  Makefile  resource_table_empty.h
debian@beaglebone:~/EBB/chp15/pru/ledFlashASM$ sudo make

************************************************************
Building project: ledFlashASM

Building file: ledFlashASM.asm
Invoking: PRU Compiler
/usr/bin/clpru --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include/am335x -v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=gen --pp_directory=gen -ppd -ppa -fe gen/ledFlashASM.object ledFlashASM.asm
"/home/debian/EBB/chp15/pru/ledFlashASM/main.c", line 37: fatal error #1965: cannot open source file "stdint.h"
Compilation terminated.
"ledFlashASM.asm", WARNING! at line 1: [E1000] error while processing C code in
                                               .cdecls directive
	        .cdecls "main.c"

No Assembly Errors, 1 Assembly Warning
LD	gen/main.object gen/ledFlashASM.object
error: cannot find file "libc.a"
warning: automatic RTS selection:  attempt to automatically link in index
   library "libc.a" failed; file not found
warning: entry-point symbol "_c_int00" undefined
warning: no suitable entry-point found; setting to 0
error: errors encountered during linking; "gen/ledFlashASM.out" not built
make: *** [Makefile:66: gen/ledFlashASM.out] Error 1
debian@beaglebone:~/EBB/chp15/pru/ledFlashASM$

debian@beaglebone:~/exploringbb/chp15/pru/ledFlashC$ sudo make

************************************************************
Building project: ledFlashC

Finished building project: ledFlashC
************************************************************

debian@beaglebone:~/exploringbb/chp15/pru/ledFlashC$ sudo make install_PRU0

Stopping current PRU0 application (/sys/class/remoteproc/remoteproc1)
stop
Installing firmware
Deploying firmware
am335x-pru0-fw
Starting new PRU0 application
start
debian@beaglebone:~/exploringbb/chp15/pru/ledFlashC$ ls
AM335x_PRU.cmd  gen  ledFlash.c  Makefile  resource_table_empty.h
debian@beaglebone:~/exploringbb/chp15/pru/ledFlashC$ nano ledFlash.c 
debian@beaglebone:~/exploringbb/chp15/pru/ledFlashC$ nano ledFlash.c 
debian@beaglebone:~/exploringbb/chp15/pru/ledFlashC$ sudo make

************************************************************
Building project: ledFlashC

Building file: ledFlash.c
Invoking: PRU Compiler
/usr/bin/clpru --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include --include_path=/usr/lib/ti/pru-software-support-package/include/am335x -v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=gen --pp_directory=gen -ppd -ppa -fe gen/ledFlash.object ledFlash.c
"ledFlash.c", line 37: fatal error #1965: cannot open source file "stdint.h"
1 catastrophic error detected in the compilation of "ledFlash.c".
Compilation terminated.

>> Compilation failure
make: *** [Makefile:80: gen/ledFlash.object] Error 1

fine, skew then… what was that about? and why would you update/upgrade to address it?

Problem solved:
Solutions to all my problem were found in: https://opencoursehub.cs.sfu.ca/bfraser/grav-cms/cmpt433/guides/files/PRUGuide.pdf

The first problem ( fatal error #1965: cannot open source file “stdint.h” ) was solved with:

When compiling if you see the error:
"ledFun.c", line 2: fatal error #1965: cannot open source file "stdint.h"
It likely means that the PRU compiler cannot find the headers on the board. You need to add
the following to the INCLUDE define in the project’s Makefile (the one being executed on
the BBG):
--include_path=/usr/share/ti/cgt-pru/include

The second problem I had was ( error: cannot find file “libc.a” ) not being found this solution was also found in this document:

Makefile changed to:
“--search_path=/usr/share/ti/cgt-pru/lib/” before --library=libc.a
“--include_path=/usr/share/ti/cgt-pru/include” at end of INCLUDE define

After changing these make commands my code compiled without error and is working. The skew problem isnt present anymore. The solution to the skew problem can also be found in this document:

When compiling the program, if you see the error:
make: warning: Clock skew detected. Your build may be incomplete.
It means that your BBG’s clock is not in sync with your host. Get your BBG access to the
internet (see previous guides; test with ping google.com) and the network time protocol
(NTP) on the BBG should then automatically update your BBG’s time.

Thanks to Brian Fraser for the PRU guide doc