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
STM32H750 as a standard target #11957
Conversation
We need to support the EXST file format to be downloaded by boot loaders as used on H750 FCs. |
I was just pointed at this after making some comments regarding the catch-22 situation that exists in the config storage subsystem initilazation. Please see my comment here: #11110 (comment) SdCard - https://github.com/betaflight/betaflight/blob/master/src/main/fc/init.c#L302-L319 The problem:
Some of the above CAN be detected at runtime, some CANNOT as assumptions would have to be made. Solution: i.e. you build a 'unified target' and then 'inject' the subsystem config into the firmware, then the firmware can read from itself, which it can obviously already do as it's already running. the offset from the start of the firmware for the unified target can be known at compile time and thus the linker can be used to calculate it. example layout: The definition of a unified target would thus then include 3 things:
In the case of memory mapped flash targets, the external storage configuration would also need to include the JEDEC id of the external flash chip used by target due to the requirement that you need to know how to disable SIOO and you can't do that unless you know the JEDEC ID of the flash first. Note also: The JEDEC ID is what BF uses to decide how to use the flash. This means that memory mapped unified target manufactures MUST NOT change the flash chip if the new flash chip doesn't allow SIOO to be disabled in the same way as the old one. Once SIOO is disabled and QUAD/OCTOSPI memory mapped mode is disabled BF firmware is then able to re-detect the flash chip and re-enable SIOO mode and memory mapped mode as required. Thus it /would/ be possible to have a single unified target for a H730 board that uses a 2MB flash that is then changed in a later production run to an 8MB flash in the same family with the same SIOO configuration. The boot process is then:
Technical notes:
The benefit of all this is that there is ZERO interaction with ANY bootloader from ANY vendor and BF controls and owns the entire boot process once the handover to BF code is done. |
Given that our new cloud build system effectively customises the unified builds per target it should be possible to select from my mutually exclusive set of storage options for an H750. |
@hydra you can put the necessary defines for activating the SPI for SDCARD etc in the unified target file. The build system will use those defines in the EXTRA_FLAGS passed on the cli. Which I think essentially achieves the "baking in the config" option you have presented. |
Of course I will need to modify the system to support downloading a bin file :) |
AUTOMERGE: (FAIL)
|
@blckmn no .bin file is needed for distribution, just the hex file. but the process of building a an EXST .hex file has the extra steps that perform hashing and EXST block injection. As noted in other conversations, a .bin file is no good for distribution as it doesn't contain a start address, .hex files can contains non-contiguous blocks which is what we need. For reference PX4 uses a json file with descriptions, dates, etc, an encoded and compressed firmware file and can contain multiple images which is much more useful. @blckmn I'm rebasing my H7RF branch on Can you please re-open #11110 and I'll update the issue and PR to include an H730 target. |
Reopened! :) great news about the HEX file, as it will mean I do not need to add additional support for alternative file formats to the build API. And yes - please follow the convention here for H730. The unified target config file can have the defines needed to bake in the storage medium used at compile time. |
@blckmn I'll give this a whirl soon. Did you re-create the SPRacingH7EXTREME/NANO/ZERO universal targets or does that still need to be done? |
|
||
ifneq ($(EXST),) | ||
EXST = yes | ||
EXST_ADJUST_VMA = 0x97CE0000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The EXST_ADJUST_VMA
setting always needs to be specified but should be in the universal target cloud-build files as it is bootloader and flash-chip specific.
I'll do a PR to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hydra please add merge request in unified targets repo for H7EXTREME/NANO/ZERO.
* STM32H750 * Adding additional files needed, and removing custom defaults. * Removed unnecessary define. * Corrected indentation * As per feedback * Aligned with target cleanup
No description provided.