No rule to make target pb_common.o

My mesh dev kits arrived today and I’m super excited! :raised_hands:

However when I build the firmware, I got the following error:

nottheoilrig@debian:~$ git clone -b mesh-develop https://github.com/particle-iot/firmware.git
Cloning into 'firmware'...
remote: Enumerating objects: 168, done.
remote: Counting objects: 100% (168/168), done.
remote: Compressing objects: 100% (116/116), done.
remote: Total 82714 (delta 85), reused 99 (delta 52), pack-reused 82546
Receiving objects: 100% (82714/82714), 125.30 MiB | 3.98 MiB/s, done.
Resolving deltas: 100% (58617/58617), done.
nottheoilrig@debian:~$ cd firmware/modules
nottheoilrig@debian:~/firmware/modules (mesh-develop)$ make PLATFORM=xenon
  /home/nottheoilrig/firmware/modules/xenon/system-part1/makefile /home/nottheoilrig/firmware/modules/xenon/user-part/makefile
make -C /home/nottheoilrig/firmware/modules/xenon/system-part1/   PLATFORM=xenon
make[1]: Entering directory '/home/nottheoilrig/firmware/modules/xenon/system-part1'
make -C ../../../newlib_nano 
make[2]: Entering directory '/home/nottheoilrig/firmware/newlib_nano'
Building c file: src/malloc.c
Invoking: ARM GCC C Compiler
mkdir -p ../build/target/newlib_nano/platform-14-m/./src/
arm-none-eabi-gcc -DSTM32_DEVICE -DnRF52840 -DNRF52840_XXAA -DPLATFORM_THREADING=1 -DPLATFORM_ID=14 -DPLATFORM_NAME=xenon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD00E -DUSBD_PID_CDC=0xC00E -g3 -gdwarf-2 -Os -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DSOFTDEVICE_PRESENT=1 -DS140 -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-config-project.h\" -DENABLE_FEM=1 -DNRF_802154_PROJECT_CONFIG=\"openthread-platform-config.h\" -DRAAL_SOFTDEVICE=1 -D_WIZCHIP_=W5500 -DSYSTEM_VERSION_STRING=0.8.0-rc.25 -DRELEASE_BUILD -Werror -I../hal/inc -I../hal/shared -I../hal/src/xenon -I../hal/src/nRF52840 -I../hal/src/armv7 -I../third_party/lwip/lwip/src/include -I../third_party/freertos/freertos/FreeRTOS/Source/include -I/nrf5_sdk/external/freertos/portable/GCC/nrf52 -I/nrf5_sdk/external/freertos/portable/CMSIS/nrf52 -I../third_party/openthread/openthread/include -I../third_party/openthread/openthread/src/core -I../third_party/openthread/openthread/examples/platforms -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/hal -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/raal -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/raal/softdevice -I../third_party/wiznet_driver/wiznet_driver/Ethernet -I../gsm0710muxer/gsm0710muxer/include -I. -MD -MP -MF ../build/target/newlib_nano/platform-14-m/./src/malloc.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -Wundef -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DHAVE_MMAP=0 -Wno-unused-but-set-variable -Wno-unused-variable -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0xD4000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=324 -DMODULE_FUNCTION=4 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=2,0,101 -DMODULE_DEPENDENCY2=0,0,0 -D_WINSOCK_H -D_GNU_SOURCE  -Wno-pointer-sign -std=gnu99 -c -o ../build/target/newlib_nano/platform-14-m/./src/malloc.o src/malloc.c

Building target: ../build/target/newlib_nano/platform-14-m/libnewlib_nano.a
Invoking: ARM GCC Archiver
mkdir -p ../build/target/newlib_nano/platform-14-m/
arm-none-eabi-gcc-ar -cr ../build/target/newlib_nano/platform-14-m/libnewlib_nano.a ../build/target/newlib_nano/platform-14-m/./src/malloc.o

make[2]: Leaving directory '/home/nottheoilrig/firmware/newlib_nano'
make -C ../../../services 
make[2]: Entering directory '/home/nottheoilrig/firmware/services'
make -C ../third_party/nanopb 
make[3]: Entering directory '/home/nottheoilrig/firmware/third_party/nanopb'
make[3]: *** No rule to make target '../../build/target/nanopb/platform-14-m/./nanopb/pb_common.o', needed by '../../build/target/nanopb/platform-14-m/libnanopb.a'.  Stop.
make[3]: Leaving directory '/home/nottheoilrig/firmware/third_party/nanopb'
make[2]: *** [../build/recurse.mk:12: third_party/nanopb] Error 2
make[2]: Leaving directory '/home/nottheoilrig/firmware/services'
make[1]: *** [../../../build/recurse.mk:12: services] Error 2
make[1]: Leaving directory '/home/nottheoilrig/firmware/modules/xenon/system-part1'
make: *** [makefile:86: /home/nottheoilrig/firmware/modules/xenon/system-part1/makefile] Error 2
nottheoilrig@debian:~/firmware/modules (mesh-develop)$ 

I followed these instructions … How do I get it to build? What am I missing?

You probably need to do this (inside the firmware directory):

git submodule update --init
4 Likes

That’s what I was missing. Thank you! :+1:

It would be nice for someone to update https://docs.particle.io/support/particle-tools-faq/local-build/#installation-linux