Page 4 of 5

Re: [NEWS] Introducing MFS

Posted: Tue Apr 16, 2019 1:45 am
by 0x3333
I tested the LLD driver and it is working. Just a small modification to the address size from my last patch.

Patch attached.

I didn't test with MFS, just the functions:

Code: Select all

flashStartEraseSector
flashWaitErase
flashProgram
flashRead


I'll try MFS as soon as I set up a test case.

Re: [NEWS] Introducing MFS

Posted: Wed Apr 24, 2019 8:20 pm
by 0x3333
Did you have time to check the patch?

I'd like to know if it would eventually be upstreamed, or I should keep a branch for this mod.

Thanks

Re: [NEWS] Introducing MFS

Posted: Wed Apr 24, 2019 11:15 pm
by Giovanni
I will look into it.

Giovanni

Re: [NEWS] Introducing MFS

Posted: Sun Apr 28, 2019 9:52 am
by Giovanni
Hi,

I merged the patch as-is. Question, does it support F105/107 too?

Giovanni

Re: [NEWS] Introducing MFS

Posted: Mon Apr 29, 2019 12:33 pm
by 0x3333
Great news!

I tested only in F103, but I followed strictly the PM0075Programming manual, which states that:
This programming manual describes how to program the Flash memory of STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and STM32F107xx microcontrollers.


Also, I updated the os/hal/ports/STM32/STM32F1xx/stm32_registry.h file with the page size/length of all F1 devices.

I checked with the programming manual, and High Density devices have 1 bank with 2Kb pages, which my patch is incorrect. I'll create another patch with some changes to fix those devices.

Re: [NEWS] Introducing MFS

Posted: Mon Apr 29, 2019 12:52 pm
by Giovanni
OK thanks, need to update the other platform.mk then.

Giovanni

Re: [NEWS] Introducing MFS

Posted: Mon Apr 29, 2019 2:28 pm
by 0x3333
I checked all datasheets, and XL devices have a separated programming manual, PM0068, which I have no time to read now to check for compatibility, so I prefer to say it is not compatible. In the future, I'll check, probably it is the same.

Here is a patch with some minor fixes, I externalized to the registry the page size, which was hardcoded in the driver.

Did you added an error for efl_lld_start_erase_all when device cannot be erased? Currently I'm returning FLASH_ERROR_HW_FAILURE, but you said would add an different error(Here)

Should we allow whole device erase? They have a way to mass erase the device, but it would erase the program itself, I don't know if this should be a possibility, as the program can run from RAM.

If you believe we should add it, I'll create a patch.

Re: [NEWS] Introducing MFS

Posted: Sun May 19, 2019 1:52 pm
by Giovanni
Merged and added the new error code FLASH_ERROR_UNIMPLEMENTED.

Giovanni

Re: [NEWS] Introducing MFS

Posted: Sat Aug 24, 2019 5:26 pm
by rreignier
I have written an EFL driver for F3 devices based on the F1 version.
I have included a configuration for the Nucleo64 F302R8 in the EFL-MFS testhal but the MFS configuration has to be changed to something like the following to work:

Code: Select all

const MFSConfig mfscfg1 = {
  .flashp           = (BaseFlash *)&EFLD1,
  .erased           = 0xFFFFFFFFU,
  .bank_size        = 2048U,
  .bank0_start      = 25U,
  .bank0_sectors    = 2U,
  .bank1_start      = 27U,
  .bank1_sectors    = 2U
};


I am not sure of the
STM32_FLASH_WAIT_TIME_MS
value because I did not find it in the reference manual.

I have tested it with the EFL-MFS testhal and with flash* commands directly.

Romain

Re: [NEWS] Introducing MFS

Posted: Sat Aug 24, 2019 5:38 pm
by Giovanni
Thanks, I will look into it.

STM32_FLASH_WAIT_TIME_MS is the delay inserted during flash erase polling, 1mS is usually OK.

Giovanni