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

incorrect eeprom emulation page transfer #27

Closed
hercek opened this issue Oct 6, 2016 · 1 comment
Closed

incorrect eeprom emulation page transfer #27

hercek opened this issue Oct 6, 2016 · 1 comment

Comments

@hercek
Copy link

hercek commented Oct 6, 2016

I think you need this patch for eeprom emulation in flash to properly transfer a page:

--- a/conf_general.c
+++ b/conf_general.c
@@ -42,7 +42,7 @@ void conf_general_init(void) {
    memset(VirtAddVarTab, 0, sizeof(VirtAddVarTab));

    int ind = 0;
-   for (unsigned int i = 0;i < (sizeof(app_configuration) / 2);i++) {
+   for (unsigned int i = 0;i < (sizeof(mc_configuration) / 2);i++) {
        VirtAddVarTab[ind++] = EEPROM_BASE_MCCONF + i;
    }

Also you should ensure that NB_OF_VAR has at least the size of:
((sizeof(mc_configuration)+1)/2 + (sizeof(app_configuration)+1)/2)

@vedderb
Copy link
Owner

vedderb commented Oct 7, 2016

You are right, I didn't notice that. Thanks! I also set NB_OF_VAR using sizeof now, which is the obvious thing to do of course.

@vedderb vedderb closed this as completed Oct 7, 2016
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

No branches or pull requests

2 participants