-
Notifications
You must be signed in to change notification settings - Fork 943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use non-absolute offset for Bluetooth TLV storage area in PICO_FLASH_BANK #1278
Milestone
Comments
It sounds like we should just make it runtime rather than build time configurable? |
peterharperuk
added a commit
to peterharperuk/pico-sdk
that referenced
this issue
Mar 1, 2023
Defaults to true. Can be set to false if the flash bank offset is dynamically generated, e.g. to be inside the binary itself. Fixes raspberrypi#1278
peterharperuk
added a commit
to peterharperuk/pico-sdk
that referenced
this issue
Mar 2, 2023
Fix static asserts so they don't fail to compile if the flash bank location is inside the binary itself. Fixes raspberrypi#1278
peterharperuk
added a commit
to peterharperuk/pico-sdk
that referenced
this issue
Mar 3, 2023
Allow the pico_flash_bank_get_offset function to be changed by defining pico_flash_bank_get_offset_func Fixes raspberrypi#1278
peterharperuk
added a commit
to peterharperuk/pico-examples
that referenced
this issue
Mar 3, 2023
peterharperuk
added a commit
to peterharperuk/pico-sdk
that referenced
this issue
Mar 3, 2023
Allow the pico_flash_bank_get_offset function to be changed by defining pico_flash_bank_get_offset_func Fixes raspberrypi#1278
peterharperuk
added a commit
to peterharperuk/pico-sdk
that referenced
this issue
Jun 6, 2023
Allow the pico_flash_bank_get_offset function to be changed by defining pico_flash_bank_get_offset_func Fixes raspberrypi#1278
peterharperuk
added a commit
to peterharperuk/pico-sdk
that referenced
this issue
Jun 6, 2023
Allow the pico_flash_bank_get_offset function to be changed by defining pico_flash_bank_get_offset_func Fixes raspberrypi#1278
merged into develop |
Thanks, @kilograham and @peterharperuk ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
By default the 2 Bluetooth TLV stores are placed at the last 2 sectors of flash.
Unfortunately, in my own framework many people already have data in those last two sectors, so I need to move them elsewhere. Dynamically would be best. So I'm attempting to do something like creating a "const" variable that can be overwritten at the proper alignment in app code
(the undef/redef in the real app is handled in the
Cmakefile
andbtstack_config.h
, this is just a self-contained snippet for simplicity)The problem is that the following static asserts fail due to the "non-constness" of the address-of operator. The compiler can't know the offset of the variable, only the linker knows that, so the asserts fail.
pico-sdk/src/rp2_common/pico_btstack/btstack_flash_bank.c
Lines 13 to 15 in 777cd52
I would ask to either remove those
static_assert
s or bracket them with, say, a new marker#if !defined(PICO_FLASH_BANK_DYNAMIC)
. There doesn't seem to be any further dependency on the values being compile-time constants, only these assertions.-- edit --
One additional runtime assert needs to be bracketed or removed as well (it's checking we don't overwrite the "app" with the flash TLV, but in this use case we actually expect to):
pico-sdk/src/rp2_common/pico_btstack/btstack_flash_bank.c
Line 140 in 777cd52
The text was updated successfully, but these errors were encountered: