Coder Social home page Coder Social logo

Comments (7)

will-v-pi avatar will-v-pi commented on August 23, 2024 1

This should be fixed with that commit - literally just needed . changed to _ in the target name…

from pico-examples.

matsobdev avatar matsobdev commented on August 23, 2024

Same here (CMake 3.19.8), but for RISC-V Embedded (riscv32-unknown-elf) on Windows 7 SP1 x64 finishes mostly ok:

In function 'ip_reass_dequeue_datagram',
    inlined from 'ip4_reass' at E:/Download/Pico_2/pico-sdk-2.0.0/lib/lwip/src/core/ipv4/ip4_frag.c:663:5:
E:/Download/Pico_2/pico-sdk-2.0.0/lib/lwip/src/core/ipv4/ip4_frag.c:326:16: warning: potential null pointer dereference [-Wnull-dereference]
  326 |     prev->next = ipr->next;
      |     ~~~~~~~~~~~^~~~~~~~~~~
In function 'ip_reass_dequeue_datagram',
    inlined from 'ip4_reass' at E:/Download/Pico_2/pico-sdk-2.0.0/lib/lwip/src/core/ipv4/ip4_frag.c:684:5:
E:/Download/Pico_2/pico-sdk-2.0.0/lib/lwip/src/core/ipv4/ip4_frag.c:326:16: warning: null pointer dereference [-Wnull-dereference]
  326 |     prev->next = ipr->next;
      |     ~~~~~~~~~~~^~~~~~~~~~~

but "it's only a glitch".

from pico-examples.

ndabas avatar ndabas commented on August 23, 2024

@matsobdev that looks like a completely separate issue. Would be good to create a new issue, because like I clarified, the problem I see is not specific to Windows.

from pico-examples.

lurch avatar lurch commented on August 23, 2024

Edit: I first tried this on Windows but this is also failing on Linux platforms. So not a Windows-specific issue. It's the same error on Linux too.

Looks like it might be specific to Ninja?

On Ubuntu 24.04 if I run cmake with:

cmake .. -DPICO_SDK_PATH=../../pico-sdk -DPICO_BOARD=pico2

then cmake completes successfully, and running make (eventually) completes successfully too.
But if I create a separate build-directory and invoke cmake with:

cmake .. -DPICO_SDK_PATH=../../pico-sdk -DPICO_BOARD=pico2 -GNinja

then I get exactly the same error as you do above about multiple rules generate bootloaders/encrypted/enc_bootloader.ld πŸ˜• I'm running cmake 3.22.1 and ninja 1.10.1

Ahhh.... but if I create yet another build directory and run:

cmake .. -DPICO_SDK_PATH=../../pico-sdk -DPICO_BOARD=pico -GNinja

then this time cmake completes successfully, and running ninja builds all the examples. So looks like there's something specific about the linker scripts for RP2350 that Ninja doesn't like, but Make is perfectly happy with?

from pico-examples.

ndabas avatar ndabas commented on August 23, 2024

Yes, true:

  • Generating Makefiles and building with make works fine for all targets;
  • Building my own projects with PICO_BOARD=pico2 works fine with both make and ninja;
  • Building pico-examples with Ninja and PICO_BOARD=pico2 fails.

The build.ninja contains these two definitions to build the target in question:

#############################################
# Utility command for enc_bootloader.ld

build bootloaders/encrypted/enc_bootloader.ld: phony bootloaders/encrypted/CMakeFiles/enc_bootloader.ld bootloaders/encrypted/enc_bootloader.ld
#############################################
# Custom command for bootloaders\encrypted\enc_bootloader.ld

build bootloaders/encrypted/enc_bootloader.ld | ${cmake_ninja_workdir}bootloaders/encrypted/enc_bootloader.ld: CUSTOM_COMMAND C$:/Program$ Files/Raspberry$ Pi/Pico$ SDK$ v2.0.0/pico-sdk/src/rp2_common/pico_crt0/rp2350/memmap_no_flash.ld
  COMMAND = C:\Windows\system32\cmd.exe /C "cd /D C:\Users\WDAGUtilityAccount\Documents\Pico-v2.0.0\pico-examples\build-pico2\bootloaders\encrypted && "C:\Program Files\Raspberry Pi\Pico SDK v2.0.0\cmake\bin\cmake.exe" "-DPICO_LINKER_SCRIPT_PATH:PATH=C:/Program Files/Raspberry Pi/Pico SDK v2.0.0/pico-sdk/src/rp2_common/pico_crt0/rp2350" -Dorigin="0x20070000" -Dlength="64k" -Doutput_file:FILEPATH=C:/Users/WDAGUtilityAccount/Documents/Pico-v2.0.0/pico-examples/build-pico2/bootloaders/encrypted/enc_bootloader.ld -P C:/Users/WDAGUtilityAccount/Documents/Pico-v2.0.0/pico-examples/build-pico2/bootloaders/encrypted/make_linker_script.cmake"
  DESC = Generating enc_bootloader.ld
  restat = 1

I guess these are generated by these lines in the source:

add_custom_target(${target}.ld DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${target}.ld)

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}.ld

I'm not really sure if this is a bug in CMake's Ninja generator, but it is a problem for building these examples on Windows, if I don't want to use nmake from Visual Studio or similar. Ninja is just a lot faster + easier to install.

from pico-examples.

kilograham avatar kilograham commented on August 23, 2024

fixed in develop

from pico-examples.

ndabas avatar ndabas commented on August 23, 2024

@will-v-pi @kilograham great, thanks!

from pico-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.