Comments (12)
from dhara.
Hello Daniel,
Thanks for reply.
I forgot to mention that I have added a log to nand prog function to track writes to pages.
Here is the log before error happen.
[00:34:21.724,609] file_srv: Write 64 bytes on file [123.bin]
[00:34:21.724,609] file_srv: Open file: 123.bin [0x20031540]
[00:34:21.745,117] file_srv: File opened
[00:34:21.745,117] file_srv: Writing file [0x20031540] 64 bytes
[00:34:21.745,117] file_srv: Write 64 bytes to file, bytes written 64, op time 0 mS
[00:34:21.745,117] file_srv: Close file [0x20031540]..
[00:34:21.746,093] FRL_NAND: DHARA writing to page: 41552
[00:34:21.754,882] FRL_NAND: DHARA writing to page: 41553
[00:34:21.761,718] FRL_NAND: DHARA copy from: 41261 to 41554
[00:34:21.783,203] FRL_NAND: DHARA copy from: 41262 to 41555
[00:34:21.804,687] FRL_NAND: DHARA copy from: 41266 to 41556
[00:34:21.826,171] FRL_NAND: DHARA copy from: 41267 to 41557
[00:34:21.847,656] FRL_NAND: DHARA copy from: 41268 to 41558
[00:34:21.868,164] FRL_NAND: DHARA copy from: 41269 to 41559
[00:34:21.889,648] FRL_NAND: DHARA copy from: 41270 to 41560
[00:34:21.911,132] FRL_NAND: DHARA copy from: 41271 to 41561
[00:34:21.931,640] FRL_NAND: DHARA copy from: 41272 to 41562
[00:34:21.952,148] FRL_NAND: DHARA copy from: 41273 to 41563
[00:34:21.972,656] FRL_NAND: DHARA copy from: 41274 to 41564
Logs dropped (1)
[00:34:21.994,140] FRL_NAND: DHARA copy from: 41275 to 41565
Logs dropped (1)
[00:34:22.015,625] FRL_NAND: DHARA copy from: 41276 to 41566
Logs dropped (1)
[00:34:22.035,156] FRL_NAND: DHARA writing to page: 41567
[00:34:22.041,015] file_srv: File closed
[00:34:22.041,992] MEM_TST: DHARA:journal root is: 41566
[00:34:22.042,968] MEM_TST: BOOTSECTOR IS MAPPED TO PAGE 41394
[00:34:22.044,921] file_srv: write string to file done, writen 64 bytes
Logs dropped (1)
[00:34:22.044,921] MEM_TST: 6354
[00:34:22.054,687] file_srv: Write 64 bytes on file [123.bin]
[00:34:22.054,687] file_srv: Open file: 123.bin [0x20031540]
[00:34:22.074,218] file_srv: File opened
[00:34:22.074,218] file_srv: Writing file [0x20031540] 64 bytes
[00:34:22.074,218] file_srv: Write 64 bytes to file, bytes written 64, op time 0 mS
[00:34:22.074,218] file_srv: Close file [0x20031540]..
[00:34:22.075,195] FRL_NAND: DHARA writing to page: 41568
[00:34:22.083,984] FRL_NAND: DHARA writing to page: 41569
[00:34:22.090,820] FRL_NAND: DHARA copy from: 41277 to 41570
[00:34:22.112,304] FRL_NAND: DHARA copy from: 41278 to 41571
[00:34:22.133,789] FRL_NAND: DHARA copy from: 41346 to 41572
[00:34:22.155,273] FRL_NAND: DHARA copy from: 41347 to 41573
[00:34:22.176,757] FRL_NAND: DHARA copy from: 41348 to 41574
[00:34:22.198,242] FRL_NAND: DHARA copy from: 41349 to 41575
[00:34:22.219,726] FRL_NAND: DHARA copy from: 41350 to 41576
[00:34:22.240,234] FRL_NAND: DHARA copy from: 41351 to 41577
[00:34:22.261,718] FRL_NAND: DHARA copy from: 41352 to 41578
[00:34:22.283,203] FRL_NAND: DHARA copy from: 41354 to 41579
[00:34:22.303,710] FRL_NAND: DHARA copy from: 41355 to 41580
[00:34:22.325,195] FRL_NAND: DHARA copy from: 41356 to 41581
[00:34:22.346,679] FRL_NAND: DHARA copy from: 41357 to 41582
[00:34:22.366,210] FRL_NAND: DHARA writing to page: 41583
[00:34:22.371,093] file_srv: File closed
Logs dropped (1)
[00:34:22.373,046] MEM_TST: DHARA:journal root is: 41582
Logs dropped (1)
[00:34:22.374,023] MEM_TST: BOOTSECTOR IS MAPPED TO PAGE 41353
Logs dropped (1)
[00:34:22.375,976] MEM_TST: BOOT SECTOR IS INVALID****
[00:34:22.378,906] MEM_TST: BOOT SECTOR IS INVALID REP****
Logs dropped (1)
So the boot sector was mapped to 41394. After file close it became mapped to page 41353.
But there was no any writes and copy to that page.
And obviously the boot sector is not valid because it was not rewritten and or copyied.
What else should i check?
Thanks,
from dhara.
from dhara.
from dhara.
Hello,
Thanks for help. I will try to check on a simulaor.
I have noticed a strange thing. When i create several files so that almost 80% of the space is used i delete one file.
So there is more that 50% free space available.
After that i create a new file and write to it.
But writing now takes much longer than it was after format.
Is that relates to dhara gc or something else?
from dhara.
from dhara.
Hello,
I have tested today with simulator on Visual studio.
My test sequence looks the following
- format_flahs with DHARA initialization
- create_file_100MB --------------------takes 610 MS
- create_file_100MB --------------------takes 609 MS
- create_file_100MB --------------------takes 609 MS
- delete file 1 file using f_unlink
- create_file_100MB --------------------takes 34313 MS
The file creation after delete takes 34 seconds.
I initialize Dhara map on format.
The garbage ratio is set to 4.
The size of the flash is 385 MB.
So that happens because GC is working? Because when 3 files are created they occupy 300MB. And there 85MB left.
I have checked that when i create only two files and delete one and create another. It is created fast enough.
I will check whether trim can be used.
from dhara.
from dhara.
Hello,
You could also set GC_RATIO to something much lower
I see that when i set larger value for GC ratio (It is the last parameter in dhara_map_init function) the file is created much faster after delete. Why do you recommend to set lower ratio?
but then you will have a corresponding drop in usable space
Does that mean that on initialization more space will be reserved for dhara structures or more space will be consumed durint writing and deletion.
There is not any good detailed description on dhara internal mechanism so i am a bit confused how everything works under the hood.
from dhara.
from dhara.
@gedworker did you ever figure out what was happening? I was struggling with what seems to be the exact same problem this week. I create a FAT32 partition, write a file close the file, unmount and remount. It works sometimes but eventually it fails to read the boot sector. If you found a solution that would be wonderful.
I added a bunch of debugging including verifying all writes/ and copies by reading back and from what I can tell my NAND driver is working fine.
Thanks,
-Brett
from dhara.
Hello bbrother ,
That issue with invalid boot sector solved after i have rewritten the functions for dhara (copy,erase,mark bad,check bad).
I can't say exactly what was the reason for that.
I suggest for you to check your spi interface, check all functions which require dhara. For instance check if copy bock function works fine.
If you are still getting invalid boot sector and really see that it is remapped without a copy let me know. I will check my old project.
You can also use a simulator. I have set up it with visual studio. Works fine and helps to debug easily.
from dhara.
Related Issues (20)
- Can dhara be used for NOR flash? HOT 1
- Can dhara be detected by linux as a device file? HOT 1
- tests/jfill failure HOT 7
- Very aggressive garbage collection --- a configuration problem? HOT 6
- Performance Tuning HOT 7
- journal.c: cp_free does an illegal dhara_nand_is_free if on last group and none of the pages are free HOT 6
- When the bad block appears in the read ECC error, dhara cannot be processed HOT 4
- example HOT 1
- Using a different GC ratio with an existing flash map HOT 2
- Garbage Collection Instrumentation HOT 2
- Using dhara for nor and nand flash - some questions HOT 5
- Using Dhara in Zephyr HOT 10
- Map Sync Time HOT 6
- `dhara_journal_enqueue` can fail with `DHARA_E_NONE` HOT 1
- `try_delete` sets an alt pointer twice
- Handling of ECC error HOT 1
- dhara_map_capacity returns inconsistent values HOT 4
- How to generate LLR for soft LDPC decoder in nand flash via multiple reads?
- gc fails if checkpoint page is corrupted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dhara.