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

OTA single bank firmware swapping #2420

Closed
wants to merge 1 commit into from
Closed

Conversation

robertc2000
Copy link
Collaborator

No description provided.

@robertc2000 robertc2000 requested review from cpq and scaprile October 10, 2023 12:43
@@ -0,0 +1,3 @@
# Baremetal web device dashboard on NUCLEO-H743ZI
Copy link
Collaborator

Choose a reason for hiding this comment

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

723ZG

Comment on lines 39 to 48
mg_log_set(MG_LL_DEBUG); // Set log level
mg_ota_bootloader();

MG_INFO(("Chip revision: %c, max cpu clock: %u MHz", chiprev(),
(chiprev() == 'V') ? 480 : 400));
MG_INFO(("Starting, CPU freq %g MHz", (double) SystemCoreClock / 1000000));

struct mg_mgr mgr; // Initialise
mg_mgr_init(&mgr); // Mongoose event manager
mg_log_set(MG_LL_DEBUG); // Set log level
Copy link
Collaborator

Choose a reason for hiding this comment

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

mg_log_set is called twice with the same argument
Maybe first one is not needed ?

src/config.h Outdated
Comment on lines 7 to 10
#ifndef MG_ENABLE_CUSTOM_LOG
#define MG_ENABLE_CUSTOM_LOG 0 // Let user define their own MG_LOG
#endif

Copy link
Collaborator

Choose a reason for hiding this comment

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

git rebase master

Comment on lines 13 to +16
#define FLASH_CCR 0x14
#define FLASH_OPTSR_CUR 0x1c
#define FLASH_OPTSR_PRG 0x20
#define FLASH_SIZE_REG 0x1FF1E880
Copy link
Collaborator

Choose a reason for hiding this comment

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

I still prefer FLASH->CCR and so, though I understand it complicates things...

src/log.c Outdated
Comment on lines 29 to 32
#if MG_ENABLE_CUSTOM_LOG
// Let user define their own mg_log_prefix() and mg_log()
#else
bool mg_log_prefix(int level, const char *file, int line, const char *fname) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

rebase

src/ota.h Outdated
Comment on lines 17 to 23
#if defined(__GNUC__) && !defined(__APPLE__)
#undef MG_IRAM
#define MG_IRAM __attribute__((section(".iram")))
#endif

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see all ota functions (most ?) are prefixed with this.
Do all of them need to run in RAM ? Maybe not the case for dual bank devices, or are those not called/used with dual bank devices ?

Copy link
Collaborator Author

@robertc2000 robertc2000 Oct 11, 2023

Choose a reason for hiding this comment

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

Only if the device is single bank do they need to run in RAM. Perhaps we could add a condition on line 17 to also check if the device is single bank?

@robertc2000 robertc2000 force-pushed the ota-single-bank-1 branch 5 times, most recently from a05eed9 to 27b6397 Compare October 12, 2023 10:35
@cpq cpq closed this Nov 2, 2023
@scaprile scaprile deleted the ota-single-bank-1 branch November 3, 2023 16:48
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.

3 participants