Hi Jason, reduced the given example to a minimum, should toggle P8.45. It doesn't work. Log of make: root@beaglebone-ln:/media/SD32/home/ln/Programme/Puls_neu/source# make CC puls_gen.c "puls_gen.c", line 82: warning #112-D: statement is unreachable "puls_gen.c", line 70: warning #179-D: variable "i" was declared but never referenced "puls_gen.c", line 70: warning #179-D: variable "j" was declared but never referenced LD gen/puls_gen.obj CC puls_gen.c "puls_gen.c", line 82: warning #112-D: statement is unreachable "puls_gen.c", line 70: warning #179-D: variable "i" was declared but never referenced "puls_gen.c", line 70: warning #179-D: variable "j" was declared but never referenced LD gen/decay95.obj - Generated firmwares are : gen/puls_gen.out gen/decay95.out root@beaglebone-ln:/media/SD32/home/ln/Programme/Puls_neu/source#* config-pin overlay cape-universala* root@beaglebone-ln:/media/SD32/home/ln/Programme/Puls_neu/source# *config-pin p8.45 pruout* root@beaglebone-ln:/media/SD32/home/ln/Programme/Puls_neu/source# *config-pin -q p8.45* *P8_45 Mode: pruout* root@beaglebone-ln:/media/SD32/home/ln/Programme/Puls_neu/source# make run - copying firmware file gen/puls_gen.out to /lib/firmware/am335x-pru1-fw /bin/sh: 1: cannot create /sys/bus/platform/drivers/pru-rproc/unbind: Permission denied /bin/sh: 1: cannot create /sys/bus/platform/drivers/pru-rproc/bind: Permission denied - rebooting pru core 0 - pru core 1 is now loaded with gen/puls_gen.out root@beaglebone-ln:/media/SD32/home/ln/Programme/Puls_neu/source#
My C-code:
#include <stdint.h>
#include <pru_cfg.h>
#include <pru_ctrl.h>
#include "resource_table_empty.h"
#define INS_PER_US 200 // 5ns per instruction
#define INS_PER_DELAY_LOOP 2 // two instructions per delay loop
#define DELAY_CYCLES_US (INS_PER_US / INS_PER_DELAY_LOOP)
#define GPIO1 0x4804C000
#define GPIO_CLEARDATAOUT 0x190
#define GPIO_SETDATAOUT 0x194
#define USR0 (1<<21)
#define USR1 (1<<22)
#define USR2 (1<<23)
#define USR3 (1<<24)
unsigned int volatile * const GPIO1_CLEAR = (unsigned int *) (GPIO1 +
GPIO_CLEARDATAOUT);
unsigned int volatile * const GPIO1_SET = (unsigned int *) (GPIO1 +
GPIO_SETDATAOUT);
volatile register unsigned int __R30;
volatile register unsigned int __R31;
#define PRU0_GPIO (1<<2)
#ifndef DECAY_RATE
#define DECAY_RATE 100
#endif
#ifndef DELAY_CYCLES
#define DELAY_CYCLES DELAY_CYCLES_US
#endif
const int decay = DECAY_RATE;
void main(void) {
int i, j;
/* Clear SYSCFG[STANDBY_INIT] to enable OCP master port */
CT_CFG.SYSCFG_bit.STANDBY_INIT = 0;
//
* while (1) { __R30 |= 0x00000001; // toggle
P8_45 __R30 &= 0xFFFFFFFE; }*
__halt();
}
Makefile is attached.
At the moment it works .... and I know why .... I can do the next step.
What is wrong or missing?
Thanks for help and have a good day
Kasimir
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/4ab1c928-c21a-4005-a8a2-05b24f0a268e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Makefile
Description: Binary data
