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

STM32F4x SD-based settings storage #14808

Merged
merged 5 commits into from
Aug 2, 2019

Conversation

yangwenxiong
Copy link
Contributor

Requirements

 1.Add SD card to simulate eeprom to store data drive file .

Description

 1.Add sd card to simulate eeprom driver
 2.Modify SKR Pro V1.1 pin file, support SRAM, Flash, SD card simulation Eeprom storage data, three options
 3.If there is not perfect place, can help optimize, thank you

Benefits

   1.An external eeprom chip or module is not required

Related Issues

@yangwenxiong yangwenxiong changed the title Support SD card to simulate eeprom to store data STM32F4x Support SD card to simulate eeprom to store data Aug 2, 2019
@tpruvot
Copy link
Contributor

tpruvot commented Aug 2, 2019

I think you should apply #14809 to this PR

@thinkyhead
Copy link
Member

Rebased and squashed. To update your working copy use the Git console and:

git checkout bugfix-2.0.x
git fetch origin
git reset --hard origin/bugfix-2.0.x

@thinkyhead thinkyhead changed the title STM32F4x Support SD card to simulate eeprom to store data STM32F4x SD-based settings storage Aug 2, 2019
@thinkyhead thinkyhead merged commit 6132cf9 into MarlinFirmware:bugfix-2.0.x Aug 2, 2019
if (!file.open(&root, EEPROM_FILENAME, O_RDONLY))
return false;

int16_t bytes_read = file.read(HAL_eeprom_data, HAL_STM32F4_EEPROM_SIZE);
Copy link
Contributor

Choose a reason for hiding this comment

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

you left some HAL_STM32F4_EEPROM_SIZE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#define HAL_STM32F4_EEPROM_SIZE (E2END + 1) // 16KB

#define _ALIGN(x) attribute ((aligned(x))) // SDIO uint32_t* compat.
static char _ALIGN(4) HAL_eeprom_data[HAL_STM32F4_EEPROM_SIZE];
@tpruvot You should fix this

Copy link
Contributor

Choose a reason for hiding this comment

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

will try, but ive no boards using "STM32" hal

Copy link
Contributor

Choose a reason for hiding this comment

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

done, in PR #14844 ... the alignment is for the SDIO transferts, but unsure the STM32 has ported it...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems that in the latest firmware, stm32f103xxx chip board, using SD to simulate EEPROM seems to have a bug, that is, it needs to create a new EEPROM.DAT file in SD card first.But there is nothing wrong with the previous download. I am not sure what changes you have made

Copy link
Contributor

Choose a reason for hiding this comment

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

see #14845

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants