The entire rom fits into 16K, so the USB code can't get too elaborate.
git clone https://github.com/raspberrypi/pico-bootrom cd pico-bootrom git submodule update --init (clones pico-bootrom/pico_sdk) mkdir build cd build cmake .. makeSounds nice, but it doesn't work:
[100%] Built target generate [ 25%] No install step for 'generator' [ 28%] Completed 'generator' [ 28%] Built target generator [ 32%] Generating /u1/Projects/rp2040/pico-bootrom/build/generated.h [ 32%] Built target generate_header [ 35%] Generating /u1/Projects/rp2040/pico-bootrom/build/git_info.h [ 35%] Built target update_git_info [ 39%] Building ASM object CMakeFiles/bootrom.dir/bootrom/bootrom_rt0.S.obj [ 42%] Building ASM object CMakeFiles/bootrom.dir/bootrom/bit_functions.S.obj [ 46%] Building C object CMakeFiles/bootrom.dir/bootrom/bootrom_main.c.obj [ 50%] Building ASM object CMakeFiles/bootrom.dir/bootrom/bootrom_misc.S.obj [ 53%] Building C object CMakeFiles/bootrom.dir/bootrom/program_flash_generic.c.obj [ 57%] Building C object CMakeFiles/bootrom.dir/bootrom/usb_boot_device.c.obj [ 60%] Building C object CMakeFiles/bootrom.dir/bootrom/virtual_disk.c.obj [ 64%] Building C object CMakeFiles/bootrom.dir/bootrom/async_task.c.obj [ 67%] Building ASM object CMakeFiles/bootrom.dir/bootrom/mufplib.S.obj [ 71%] Building ASM object CMakeFiles/bootrom.dir/bootrom/mufplib-double.S.obj [ 75%] Building C object CMakeFiles/bootrom.dir/usb_device_tiny/runtime.c.obj [ 78%] Building C object CMakeFiles/bootrom.dir/usb_device_tiny/usb_device.c.obj [ 82%] Building C object CMakeFiles/bootrom.dir/usb_device_tiny/usb_msc.c.obj [ 85%] Building C object CMakeFiles/bootrom.dir/usb_device_tiny/usb_stream_helper.c.obj [ 89%] Building C object CMakeFiles/bootrom.dir/pico_sdk/src/rp2_common/pico_platform/platform.c.obj [ 92%] Building C object CMakeFiles/bootrom.dir/pico_sdk/src/rp2_common/hardware_sync/sync.c.obj [ 96%] Building C object CMakeFiles/bootrom.dir/pico_sdk/src/rp2_common/hardware_claim/claim.c.obj [100%] Linking C executable bootrom.elf /usr/lib/gcc/arm-none-eabi/13.2.0/../../../../arm-none-eabi/bin/ld: bootrom.elf section `.text' will not fit in region `ROM' /usr/lib/gcc/arm-none-eabi/13.2.0/../../../../arm-none-eabi/bin/ld: region `ROM' overflowed by 16384 bytes collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/bootrom.dir/build.make:349: bootrom.elf] Error 1 make[1]: *** [CMakeFiles/Makefile2:764: CMakeFiles/bootrom.dir/all] Error 2 make: *** [Makefile:91: all] Error 2No telling why the code won't fit. Perhaps/probably I am using a different compiler than was used by the engineers. The Makefile isn't giving me verbose output, so I can't really see what the build process is doing. Typing "make VERBOSE=1" gives more, but nothing that sheds light on the code being too big.
They say the version on the chip was built using GCC 9.3.1 . It is curious that the error message says the size was overflowed by 16384 (exactly 16K). 16K is the size of the ROM region it is expected to fit in.
We will ignore this and press on.
Tom's electronics pages / [email protected]