Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Error compiling librf24-bcm for Serial gateway directly to Rpi2

Error compiling librf24-bcm for Serial gateway directly to Rpi2

Scheduled Pinned Locked Moved Troubleshooting
8 Posts 6 Posters 3.0k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Viper_Scull
    wrote on last edited by Viper_Scull
    #1

    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?

    Y 1 Reply Last reply
    0
    • T Offline
      T Offline
      TD22057
      Hardware Contributor
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Viper_Scull
        wrote on last edited by
        #3

        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!

        1 Reply Last reply
        0
        • E Offline
          E Offline
          ericvdb
          wrote on last edited by
          #4

          I also had this error when I did an update and upgrade on Pi. Try again with the downloaded image without update and upgrade.

          1 Reply Last reply
          0
          • V Viper_Scull

            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?

            Y Offline
            Y Offline
            Yveaux
            Mod
            wrote on last edited by
            #5

            @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)
            

            http://yveaux.blogspot.nl

            V 1 Reply Last reply
            0
            • Y Yveaux

              @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)
              
              V Offline
              V Offline
              Viper_Scull
              wrote on last edited by Viper_Scull
              #6

              @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.c
              

              and in bcm2835.h we have:

              #ifndef BCM2835_PERI_BASE
              #define BCM2835_PERI_BASE               0x20000000
              #endif
              

              I 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_otg
              

              Any ideas on this bcm2708_vcio??

              1 Reply Last reply
              0
              • Sander TeunissenS Offline
                Sander TeunissenS Offline
                Sander Teunissen
                wrote on last edited by
                #7

                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..

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  doc12
                  wrote on last edited by doc12
                  #8

                  Hi,

                  I had the same problem on my Raspberry Pi 2.

                  Maybe its not a very nice way but I just changed BCM2835_PERI_BASE=0x to BCM2835_PERI_BASE=0x3F000000 in the Makefile and now it works.

                  (On Raspi 1 it should be BCM2835_PERI_BASE=0x20000000)

                  1 Reply Last reply
                  0

                  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
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  14

                  Online

                  12.0k

                  Users

                  11.2k

                  Topics

                  113.4k

                  Posts


                  Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • MySensors
                  • OpenHardware.io
                  • Categories
                  • Recent
                  • Tags
                  • Popular