This commit is contained in:
SandPox 2015-06-30 22:13:12 +00:00
commit bd523278e8
3 changed files with 10 additions and 9 deletions

View File

@ -19,7 +19,7 @@ Pi-FM-RDS, depends on the `sndfile` library. To install this library on Debian-l
Then clone the source repository and run `make` in the `src` directory: Then clone the source repository and run `make` in the `src` directory:
```bash ```bash
git clone https://github.com/ChristopheJacquet/PiFmRds.git git clone https://github.com/SandPox/PiFmRds.git
cd PiFmRds/src cd PiFmRds/src
make make
``` ```

View File

@ -4,8 +4,8 @@ STD_CFLAGS = -Wall -std=gnu99 -c -g -O3
# Enable ARM-specific options only on ARM, and compilation of the app only on ARM # Enable ARM-specific options only on ARM, and compilation of the app only on ARM
UNAME := $(shell uname -m) UNAME := $(shell uname -m)
ifeq ($(UNAME), armv6l) ifeq ($(UNAME), armv7l)
CFLAGS = $(STD_CFLAGS) -march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math CFLAGS = $(STD_CFLAGS) -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -ffast-math
app: rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o app: rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o
$(CC) -o pi_fm_rds rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o -lm -lsndfile $(CC) -o pi_fm_rds rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o -lm -lsndfile

View File

@ -119,13 +119,13 @@
#define DMA_CONBLK_AD (0x04/4) #define DMA_CONBLK_AD (0x04/4)
#define DMA_DEBUG (0x20/4) #define DMA_DEBUG (0x20/4)
#define DMA_BASE 0x20007000 #define DMA_BASE 0x3F007000 // Pi 2 Ready
#define DMA_LEN 0x24 #define DMA_LEN 0x24
#define PWM_BASE 0x2020C000 #define PWM_BASE 0x3F20C000 // Pi 2 Ready
#define PWM_LEN 0x28 #define PWM_LEN 0x28
#define CLK_BASE 0x20101000 #define CLK_BASE 0x3F101000 // Pi 2 Ready
#define CLK_LEN 0xA8 #define CLK_LEN 0xA8
#define GPIO_BASE 0x20200000 #define GPIO_BASE 0x3F200000 // Pi 2 Ready
#define GPIO_LEN 0xB4 #define GPIO_LEN 0xB4
@ -245,7 +245,7 @@ mem_phys_to_virt(uint32_t phys)
} }
} }
fatal("Failed to reverse map phys addr %08x\n", phys); fatal("Failed to reverse map phys addr %08x\n", phys);
// FIXME!!! Failed with code 0x5a004a20 and 0x00000000 sometime
return 0; return 0;
} }
@ -257,7 +257,8 @@ map_peripheral(uint32_t base, uint32_t len)
if (fd < 0) if (fd < 0)
fatal("Failed to open /dev/mem: %m\n"); fatal("Failed to open /dev/mem: %m\n");
vaddr = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, base); //vaddr = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, base);
vaddr = mmap(NULL, 0x002FFFFF, PROT_READ|PROT_WRITE, MAP_SHARED, fd, base);
if (vaddr == MAP_FAILED) if (vaddr == MAP_FAILED)
fatal("Failed to map peripheral at 0x%08x: %m\n", base); fatal("Failed to map peripheral at 0x%08x: %m\n", base);
close(fd); close(fd);