Skip to content
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

fix pmem -> make backup_ram_t data members volatile #1135

Merged
merged 3 commits into from
Jun 9, 2023

Conversation

u-foka
Copy link
Contributor

@u-foka u-foka commented Jun 8, 2023

plus add calculated crc to the pmem debug screen

Soo the issue with pmem on newer gcc was that its data members werent declared volatile and seemingly writes to it got optimized out..

After adding volatile everything seems to work smooth.

We also loose some optimization potential as the cached settings use the same type (backup_ram_t) as what we use to read the p.mem area, which now also becomes volatile.

plus add calculated crc to the pmem debug screen
As this is how its refered to in the wiki and other screens
@u-foka
Copy link
Contributor Author

u-foka commented Jun 9, 2023

@Brumi-2021
Copy link
Contributor

Hello, thanks a lot @u-foka ,
I compiled your draft branch pmem-fix , commit 46d3b1a (HEAD -> pmem-fix, origin/pmem-fix), with my gcc-arm-... version 10.3 (gcc-arm-none-eabi 10.3_p202110) , and now you could solve my binary reflash problem from gcc-arm.. version 9.3 to 10.3 .

with your draft PR,
first time , that after been introduced that pmem PR #662 , my local compiled version with gcc-arm v 10.3 works well ,
(1) does not have any boot LED flashing pmem problems anymore.
(2) now it really stores the user settings in the pmem , (example , frequency , AMP , VGA, GAIN ,.. backlight timer off, show splash , add return key icon to the GUI , ...)

With that PR, we are fixing that boot problem related to pmem , using gcc-arm v 10.3 , and 12.2 , very good news !!!

Thanks @u-foka , I hope that this change has also no side effect to the other gcc 9.3 version (I can not test it ) .

Cheers,

@u-foka u-foka marked this pull request as ready for review June 9, 2023 11:53
@u-foka
Copy link
Contributor Author

u-foka commented Jun 9, 2023

Thanks @u-foka , I hope that this change has also no side effect to the other gcc 9.3 version (I can not test it ) .

Hey, here's a test build from this branch with gcc9.2 in docker https://discord.com/channels/719669764804444213/722101917135798312/1116705375975121007

@Brumi-2021
Copy link
Contributor

Brumi-2021 commented Jun 9, 2023

Hi thanks , @u-foka
Confirmed , Tested , this hash#46d3bb1a compiled with gcc-arm ...9.2 , works also perfectly .
Correct boot , correct write - read pmem UI settings .

So , you can finalise that draft and release that PR, very good job !!!!
It will help us to update and migrate in the future to higher gcc-arm.... versions .

(In fact that PR is the first gcc-arm-none-eabi common 10.3 and 12.2 related fixes
, beside the other #1138 specific to 12.2 version ), without that PR , persistent memory UI is not working from 10.3 onwards.

To me fully approved !
👌👏👏👏

Copy link
Member

@gullradriel gullradriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@gullradriel gullradriel merged commit b9de191 into portapack-mayhem:next Jun 9, 2023
3 checks passed
@@ -381,22 +382,35 @@ DebugMenuView::DebugMenuView(NavigationView& nav) {
{"Peripherals", ui::Color::dark_cyan(), &bitmap_icon_peripherals, [&nav]() { nav.push<DebugPeripheralsMenuView>(); }},
{"Temperature", ui::Color::dark_cyan(), &bitmap_icon_temperature, [&nav]() { nav.push<TemperatureView>(); }},
{"Buttons Test", ui::Color::dark_cyan(), &bitmap_icon_controls, [&nav]() { nav.push<DebugControlsView>(); }},
{"Pmem", ui::Color::dark_cyan(), &bitmap_icon_memory, [&nav]() { nav.push<DebugPmemView>(); }},
{"p.mem", ui::Color::dark_cyan(), &bitmap_icon_memory, [&nav]() { nav.push<DebugPmemView>(); }},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@u-foka Sorry for the late comment, but I would like to point out that Persistent Memory is called "P.Memory" in the "P.Memory Mgmt" app name on the Settings page, and personally I would have called it "P.Memory" on the Debug page too, for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

The original Pmem was definitely inconsistent, but this time I looked around and p.mem seemed to be the most common one :)

The app is called P.Memory Mgmt, the wiki page for it is the same, and thats all the references to P.Memory Mgmt I have found :)

Then theres P.MemMgmt in the wiki tree, P.Mem Mgmt on the title, PersistentMemory in the description and 4 p.mem -s on the ui :)

I'm all in for consistency, but I wonder how should it be achieved. Additionally from the UX standpoint I'd put more emphasis on the "Persistent" part somehow to make the purpose more clear. But its probably too long for most places. We come up with a completely different name like Config Store that could fit easier and could also be shortened while retaining the more of the meaning like Cfg. Store or similar, but that would confuse existing users..

What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with all your comments. Seems it's inconsistent everywhere... Something like "Config Mem" might convey the functionality better, but might be confusing for existing users (or developers since we call it persistent memory in the code). I would lean towards just calling the app "P.Memory" on the Debug page, but it's no big deal and I leave it totally up to you. :-)

@u-foka u-foka deleted the pmem-fix branch June 9, 2023 20:36
@Brumi-2021 Brumi-2021 mentioned this pull request Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants