Multipe versions of vgaboard.h #755
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk#755
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It would be useful if there were three different versions of the vgaboard,h board definition file for the Pimoroni VGA Demo board:
vgaboard_serial.h - For when the SD card is not being used. This would not define any of the PICO_SD macros.
vgaboard_sd.h - For when the SD card is being used. This would not define any of the PICO_DEFAULT_UART macros.
vgaboard_cut.h - For when the tracks between the Pico and SD Data 1 & 2 have been cut (or the links on the prototype board removed). This would define both the PICO_DEFAULT_UART and PICO_SD macros, but with PICO_DAT_PIN_COUNT=1.
This would make it easier to write code which has to be able to compile for any of these configurations.
I believe the
vgaboard.hwas added to reflect the VGA Demo Board example design in https://datasheets.raspberrypi.com/rp2040/hardware-design-with-rp2040.pdfIf the Pimoroni VGA Demo board works differently, then it's up to them to provide appropriate board-definition files.
ping @ZodiusInfuser (who added many of the previous Pimoroni board definition files)
It has been a while since I've looked at the VGA Demo board but my understanding is that our VGA Demo board uses the reference design of the example you link to above?
You can create your own board header files.
Just set the
PICO_BOARD_HEADER_DIRSto point to the directory where you keep them, either in your environment, on the cmake command line or at the top of yourCMakeLists.txtWith the reference board design, there are at least two hardware configurations, GPIO 20 & 21 (J7) links-in or links-out. If the links are in (or on the Pimoroni board the links are not cut) the user has to decide whether their design will use the SD card, or use the serial port as it is not possible to use both in this configuration. Hence the three board definitions.
I know that I can create my own board definitions, but ideally I would like to create a repository containing a CMake file that will compile for any user selected board. This would require being able to specify a search path for the board files, i.e. first look for any custom board definitions, and if not found there look in the standard board definitions.
I have just re-read the relevant section of the documentation and discovered that PICO_BOARD_HEADER_DIRS is a search path, not a single folder so I can create my own board definition files and have either these or the standard ones used.
I still think that my argument that there should be three different files is valid.
Wouldn't it be simpler to just have a bunch of
#if / #elif / #endifdirectives in the existingvgaboard.h? 🤔That would work. I don't know whether it would be simpler.
vgaboard.hyou have to both specify that board definition, and set the#definesneeded to choose the particular configuration.