We seem to not understand each other. My propositions:
1) rename os/hal/src/emcnand.c to nand.c
2) in os/hal/src/nand.c store NAND-specific calls (nandErase(), nandWritePage(), nandReadPage() etc.)
3) write in os/hal/src/nand.c ECC correction routine using Hamming code (is it really need?)
4) rename os/hal/ports/STM32/LLD/emc_lld.c to fsmc_lld.c and store in it common code for different FSMC slave devices
5) delete os/hal/src/emc.c
6) rename os/hal/ports/STM32/LLD/emcnand_lld.c to nand_lld.c and rename API from emcnand_lld_XXX to nand_lld_XXX
FSMC NAND
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: FSMC NAND
Please put the FSMC code in a module simply named ./os/hal/port/STM32/LLD/FSMC_v1/fsmc.c|.h. Put in this directory also nand_lld.c|.h because the driver implementation goes through FSMC.
The _lld is only required for drivers split in high and low parts, this is not the case of FSMC because it is a platform-specific driver.
I don't know about the Hamming code, it depends on the driver requirements, is it something you would usually expect from a driver of this kind?
Giovanni
The _lld is only required for drivers split in high and low parts, this is not the case of FSMC because it is a platform-specific driver.
I don't know about the Hamming code, it depends on the driver requirements, is it something you would usually expect from a driver of this kind?
Giovanni
Re: FSMC NAND
Giovanni wrote: is it something you would usually expect from a driver of this kind?
Yes. Hamming the most used ECC algorithm for NAND. In most caces its calculation realized in hardware, but correction hard to realize in hardware so it must be written in software.
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: FSMC NAND
I saw the commits, what is needed in order to test the driver? I need the tests to run on some standard HW.
Giovanni
Giovanni
Re: FSMC NAND
Giovanni wrote: what is needed in order to test the driver?
Change NAND ICs related constants in beginning of the main.c, flash board and wait until programm goes to final while(true) loop. Any error cause panic. Optionally at the end you can take a look at measured execution times.
What board you want to use for tests? I will change code specially for that board. Code needs some polishing in any way. And my next question is about time measurement facilities (tmStartMeasurement, etc.) because NAND test performs some benchmarking. Are you plan to simply port v2.6 code to v3, or you want to deeply rewrite it?
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: FSMC NAND
The RT counter and the time measurement is now part of the kernel so the HAL no more supports that. The functionality is equivalent with some extensions.
About the board, users will have most likely a Discovery so that would be optimal.
Giovanni
About the board, users will have most likely a Discovery so that would be optimal.
Giovanni
Re: FSMC NAND
Giovanni wrote:Discovery
Not a problem but you can not test driver on stock Discovery because it has not NAND. Are you suppose that users will solder NAND to Discovery by themself?
Giovanni wrote:The RT counter and the time measurement is now part of the kernel
Ah, found it in chstats.c.
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: FSMC NAND
Hard to do... I imagine those signals cannot be connected by simply wiring them using floating wiring. I will verify if one of those more expensive ST boards has a flash on board, they try to get at least one.
Giovanni
Giovanni
Re: FSMC NAND
http://www.wvshare.com/product/Open407V-D-Standard.htm this is very interesting tool set for development
Who is online
Users browsing this forum: No registered users and 21 guests