[NEWS] Introducing MFS

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome.
0x3333
Posts: 57
Joined: Thu Mar 07, 2019 10:19 pm
Has thanked: 7 times
Been thanked: 6 times

Re: [NEWS] Introducing MFS

Postby 0x3333 » Tue Apr 16, 2019 1:45 am

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.
Attachments
driver_f1.diff.zip
(4.38 KiB) Downloaded 23 times

0x3333
Posts: 57
Joined: Thu Mar 07, 2019 10:19 pm
Has thanked: 7 times
Been thanked: 6 times

Re: [NEWS] Introducing MFS

Postby 0x3333 » Wed Apr 24, 2019 8:20 pm

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

User avatar
Giovanni
Site Admin
Posts: 12177
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 570 times
Been thanked: 487 times
Contact:

Re: [NEWS] Introducing MFS

Postby Giovanni » Wed Apr 24, 2019 11:15 pm

I will look into it.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 12177
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 570 times
Been thanked: 487 times
Contact:

Re: [NEWS] Introducing MFS

Postby Giovanni » Sun Apr 28, 2019 9:52 am

Hi,

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

Giovanni

0x3333
Posts: 57
Joined: Thu Mar 07, 2019 10:19 pm
Has thanked: 7 times
Been thanked: 6 times

Re: [NEWS] Introducing MFS

Postby 0x3333 » Mon Apr 29, 2019 12:33 pm

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.
Last edited by 0x3333 on Mon Apr 29, 2019 1:12 pm, edited 1 time in total.

User avatar
Giovanni
Site Admin
Posts: 12177
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 570 times
Been thanked: 487 times
Contact:

Re: [NEWS] Introducing MFS

Postby Giovanni » Mon Apr 29, 2019 12:52 pm

OK thanks, need to update the other platform.mk then.

Giovanni

0x3333
Posts: 57
Joined: Thu Mar 07, 2019 10:19 pm
Has thanked: 7 times
Been thanked: 6 times

Re: [NEWS] Introducing MFS

Postby 0x3333 » Mon Apr 29, 2019 2:28 pm

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.
Attachments
driver_f1.zip
(994 Bytes) Downloaded 16 times

User avatar
Giovanni
Site Admin
Posts: 12177
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 570 times
Been thanked: 487 times
Contact:

Re: [NEWS] Introducing MFS

Postby Giovanni » Sun May 19, 2019 1:52 pm

Merged and added the new error code FLASH_ERROR_UNIMPLEMENTED.

Giovanni

rreignier
Posts: 7
Joined: Sat Apr 15, 2017 11:49 pm
Has thanked: 2 times
Been thanked: 3 times

Re: [NEWS] Introducing MFS

Postby rreignier » Sat Aug 24, 2019 5:26 pm

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
Attachments
Add-EFL-driver-for-F3.zip
(14.6 KiB) Downloaded 4 times

User avatar
Giovanni
Site Admin
Posts: 12177
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 570 times
Been thanked: 487 times
Contact:

Re: [NEWS] Introducing MFS

Postby Giovanni » Sat Aug 24, 2019 5:38 pm

Thanks, I will look into it.

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

Giovanni


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 2 guests