FSMC NAND

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: FSMC NAND

Postby barthess » Wed Aug 06, 2014 8:57 am

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

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

Re: FSMC NAND

Postby Giovanni » Wed Aug 06, 2014 10:04 am

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

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: FSMC NAND

Postby barthess » Wed Aug 06, 2014 3:00 pm

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.

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: FSMC NAND

Postby barthess » Thu Aug 07, 2014 9:56 am

Changes finished. Hardware tests passed. Critics are welcome.

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

Re: FSMC NAND

Postby Giovanni » Thu Aug 07, 2014 9:59 am

I saw the commits, what is needed in order to test the driver? I need the tests to run on some standard HW.

Giovanni

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: FSMC NAND

Postby barthess » Thu Aug 07, 2014 8:31 pm

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?

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

Re: FSMC NAND

Postby Giovanni » Thu Aug 07, 2014 8:34 pm

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

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: FSMC NAND

Postby barthess » Thu Aug 07, 2014 8:57 pm

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.

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

Re: FSMC NAND

Postby Giovanni » Thu Aug 07, 2014 9:01 pm

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

User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Location: Minsk, Belarus
Been thanked: 7 times

Re: FSMC NAND

Postby barthess » Thu Aug 07, 2014 9:04 pm

http://www.wvshare.com/product/Open407V-D-Standard.htm this is very interesting tool set for development


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 1 guest