Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8051

General • Re: How to make a universal firmware for all boards (LED issue)

$
0
0
There is no #if #endif guards, but switch/if directed by whats inside flash at address lets say aboard binary.
I guess I simply don't comprehend your proposed solution.

The Pico SDK is full of '#if' to tailor its functionality, is intended to be that way, so I don't understand how you can say there won't be any. Unless you are not using the Pico SDK.

Maybe you could provide some simple example to illustrate how you mean ?
Support for runtime configuration of pins (and therefore post-compilation configurability) has been added to the SDK CYW43 support
I hadn't realised that but the CYW43 driver code is still full of '#if" to tailor itself using conditional compilation, and seemingly wouldn't work if it needs to be tailored some other way for a different board.
I guess some other libraries that could benefit are stdio_uart ... and pico_status_led
If everything within Pico SDK were configurable by post-build adjustable settings that would be great, would allow creation of that linkable Pico SDK library which has eluded us so far.

Of course that would go against the current philosophy of the SDK; no having to lookup run-time settings, minimising execution time, minimising executable size.
I don't think there are any other 'pico_sdk_function' that use pins defined in the board header (although I might have missed something)
When I checked it seemed there were hundreds of case of that, where SDK compilation is conditional on board header settings.

I'll undertake a more rigorous and accurate check and will report back.

Note that it's more than just pin definitions which alter what executable is built and if they aren't dealt with you won't be able to clone just two builds to any other.

I gave up on trying to turn the conditionally compiled SDK into a post-build or run-time controlled linkable library as it seemed far too hard to do that. I don't believe anyone else succeeded either. With the Binary Info support for that it should be easier. I might see what I can do.

With a linkable post-build and run-time configurable library there would only be RP2040 and RP235X base builds needed. All the rest can be derived from those two.

Statistics: Posted by hippy — Thu Aug 07, 2025 2:54 pm



Viewing all articles
Browse latest Browse all 8051

Trending Articles