-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Adapt for FMU with only FRAM and EEPROM #23424
Conversation
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.
@niklaut Can we do the bmi changes as a separate PR single commit?
I would like to have a way to abstract the stack size change Maybe in board common define some 0 value defaults that will be added to values or replace them
#!defined(PX4_LOGGER_STACK_FS_ADJST)
#define PX4_LOGGER_STACK_FS_ADJST 0
#endif
PX4_STACK_ADJUSTED(3700+PX4_LOGGER_STACK_FS_ADJST),
Or
#!defined(PX4_LOGGER_STACK_SIZE)
#define PX4_LOGGER_STACK_SIZE 3700
#endif
PX4_STACK_ADJUSTED(PX4_LOGGER_STACK_SIZE),
5942b3e
to
0909e20
Compare
Removed the BMI changes, those can be done separately. Added a overridable logger stack define. |
Please let's just abstract the path rather than fake it. |
This could be moved to kconfig.
If there are any parts of the init scripting that are hard to adapt I'd propose pushing more of it into board/platform init code (driven by kconfig). I was planning to do this eventually either way. |
@@ -76,6 +76,10 @@ | |||
# endif | |||
#endif | |||
|
|||
#ifndef BOARD_SPI_RAMTRON_SPEED_MHZ | |||
#define BOARD_SPI_RAMTRON_SPEED_MHZ 10 |
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.
kconfig
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.
I tried to understand how the RAMTRON speed is set in the code:
- It's currently hardcoded to start initialization at 10MHz and if it fails tries 9 times again down to 1MHz.
- Once the initialization succeeds and the part is detected, the speed is taken from the table (Between 25 and 40MHz) and set to priv->speed.
- This table speed is then simply overwritten and set to between 1 and 10MHz.
So RAMTRON has is always running at slower than max speed.
I don't understand what the use case is for dynamically determining the max speed? The RAMTRON is not hot pluggable so unless your PCBs differ in quality, the max speed should always be the same.
I think the speed should be config option in the px4_mft_device_t
struct and defaulted to use the max device speed. But that seems to be a larger refactoring, so I now hacked it to start at 30MHz, since I spent my timebox on this already.
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.
I believe it was just desperation for the extremely rare case parameters were failing to restore in the field and we had nothing to go on.
I've merged #23003. |
It would break a lot of external code that has the |
0909e20
to
8b2aebe
Compare
We can de-hardcode |
Sure, but not in this PR and certainly not in the time I have allocated for this. :-( |
8b2aebe
to
cca47b4
Compare
Ping? |
cca47b4
to
ed5a7e6
Compare
ed5a7e6
to
ebe64d5
Compare
@niklaut I restarted https://github.com/PX4/PX4-Autopilot/actions/runs/10388157561/job/28763193102?pr=23424 |
@dagar CI is happy now. Ok to merge? |
@@ -172,7 +178,7 @@ else | |||
fi | |||
fi | |||
|
|||
if [ $SDCARD_AVAILABLE = yes ] | |||
if [ $STORAGE_AVAILABLE = yes ] |
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.
So this would now be exporting the parameters twice to the same storage?
I disagree with faking the path, but hopefully we'll still be able to untangle it later pushing more of this into board init and a parameter backend. |
Solved Problem
We built a smol FMU without SD card only with FRAM as minimal file system. Also doesn't have the revision resistors only EEPROM.
Solution
/mnt/microsd
and mounts it as/fs/microsd
. We chose to keep the paths the same for compatibility. ThercS
needs minor updates to allow the hardfault handler to still work.BOARD_SPI_RAMTRON_SPEED_MHZ
define to make that configurable.BOARD_HAS_ONLY_EEPROM_VERSIONING
define to enable that behavior.Changelog Entry
For release notes:
Alternatives
All changes are backward compatible, except for:
Test coverage