Error compiling librf24-bcm for Serial gateway directly to Rpi2
-
this is the error it spits:
error: invalid suffix "x" on integer constant bcm2835.h:350:28 note: in expansion of macro ‘BCM2835_PERI_BASE’Well actually there are many erros, but all are the same. Looks like defining like this:
#define BCM2835_GPIO_PADS (BCM2835_PERI_BASE + 0x3000)is causing some error.
Do you see anything wrong here?
-
There isn't anything wrong w/ the #define - it's where it's being used. The #define is just a text replacer - you'll have to check the bcm2835.h line 350 to see what's going on. I'm not sure why it would think the constant ends at the x but maybe seeing where it's being compiled in might help.
-
The define is the line 350 of bcm2835.h, that's why I was puzzled. I won't be able to have a look at it again until monday. I'll see where it's being used and get back with the observations.
Thanks!
-
this is the error it spits:
error: invalid suffix "x" on integer constant bcm2835.h:350:28 note: in expansion of macro ‘BCM2835_PERI_BASE’Well actually there are many erros, but all are the same. Looks like defining like this:
#define BCM2835_GPIO_PADS (BCM2835_PERI_BASE + 0x3000)is causing some error.
Do you see anything wrong here?
-
@Viper_Scull said:
#define BCM2835_GPIO_PADS (BCM2835_PERI_BASE + 0x3000)
Shot in the dark: could be a matter of braces.
Try:#define BCM2835_GPIO_PADS ((BCM2835_PERI_BASE) + 0x3000)@Yveaux said:
@Viper_Scull said:
#define BCM2835_GPIO_PADS (BCM2835_PERI_BASE + 0x3000)
Shot in the dark: could be a matter of braces.
Try:#define BCM2835_GPIO_PADS ((BCM2835_PERI_BASE) + 0x3000)It doesn't work. Same errors.
The defines are used in bcm2835.c like this:
bcm2835_pads = (volatile uint32_t *)mapmem("pads", BCM2835_BLOCK_SIZE, memfd, BCM2835_GPIO_PADS);A few more things:
·The compiler is called with these options:gcc -Wall -fPIC -Ofast -mfpu=vfp -mfloat-abi=hard -mtune=arm1176jzf-s -march=armv7-a -D BCM2835_PERI_BASE=0x -c bcm2835.cand in bcm2835.h we have:
#ifndef BCM2835_PERI_BASE #define BCM2835_PERI_BASE 0x20000000 #endifI checked the Makefile to see the flags and:
CCFLAGS += -D BCM2835_PERI_BASE=0x${IOBASE}So, if I'm not mistaken, it's not getting anything from $(IOBASE) and it's defining BCM2835_PERI_BASE as 0x, and that's what causes the compilation to fail, right?
Checking what IOBASE is we find :
IOBASE := $(shell cat /proc/iomem | grep bcm2708_vcio | cut -f 1 -d "-")but in /proc/iomem there's no bcm2708_vcio. This is the result:
00000000-3affffff : System RAM 00008000-00775ccf : Kernel code 007de000-0092378b : Kernel data 3f006000-3f006fff : dwc_otg 3f007000-3f007eff : /soc/dma@7e007000 3f00b840-3f00b84e : /soc/vchiq 3f00b880-3f00b8bf : /soc/mailbox@7e00b800 3f200000-3f2000b3 : /soc/gpio@7e200000 3f201000-3f201fff : /soc/uart@7e201000 3f201000-3f201fff : uart-pl011 3f204000-3f204fff : /soc/spi@7e204000 3f300000-3f3000ff : /soc/mmc@7e300000 3f980000-3f98ffff : dwc_otgAny ideas on this bcm2708_vcio??
-
I am having the same issue. Just with my old B version, but changing from Wheezy to Jessie image. It just worked when on wheezy..
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login