0% found this document useful (0 votes)
2 views10 pages

Week14_Lab

The document outlines guidelines for handling power-off recovery in embedded systems, emphasizing the importance of managing metadata during normal and sudden power-off scenarios. It provides specific strategies for writing and recovering metadata, as well as debugging tips for testing these scenarios. Additionally, it details the grading policy for projects related to embedded system design, including criteria for evaluation and weightage for different project components.

Uploaded by

hr.heidari60
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views10 pages

Week14_Lab

The document outlines guidelines for handling power-off recovery in embedded systems, emphasizing the importance of managing metadata during normal and sudden power-off scenarios. It provides specific strategies for writing and recovering metadata, as well as debugging tips for testing these scenarios. Additionally, it details the grading policy for projects related to embedded system design, including criteria for evaluation and weightage for different project components.

Uploaded by

hr.heidari60
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Project Q&A

Prof. Dongkun Shin ([email protected])


TA – Junho Lee ([email protected])
TA – Somm Kim ([email protected])
Embedded Software Laboratory
Sungkyunkwan University
http://nyx.skku.ac.kr

ICE3028: Embedded System Design, Fall 2019, Dongkun Shin ([email protected])


Power-Off Recovery

ICE3028: Embedded System Design, Fall 2019, Dongkun Shin ([email protected])


Normal Power-Off
• Store some metadata to NAND flash during NPO
(ftl_flush)
– NOT all of metadata should be stored!
– Some might be recovered with other metadata

• Recover metadata at boot time (ftl_open)


– Read metadata from NAND flash
– Recover other metadata with them

• Do not touch VBLK #0 (special purpose for bad-blk)


• Hint : GreedyFTL in OpenSSD project
ICE3028: Embedded System Design, Fall 2019, Dongkun Shin ([email protected]) 3
Sudden Power-Off
• Your FTL should handle sudden power loss
– Once sending completion acknowledgment to the host, the write
request should be persistent after sudden power loss
– Remind that SPO can be happened anytime, anywhere in your
code
• (That’s why it’s called ‘Sudden’ power-off)
• When ftl_write, nand_program, gc (merge), …
• Even when ftl_flush, ftl_open and recovering(!)
• You should consider following things
– Before SPO happens
• NAND_PROGRAM order (who comes first? data or metadata)
• What to store to flash memory (which metadata?)
– After SPO happens (recovery)
• How to recover metadata (SRAM, DRAM)
• Are up-to-date data available?

ICE3028: Embedded System Design, Fall 2019, Dongkun Shin ([email protected]) 4


Guideline in SPO
• Consider all cases that sudden VBLK #1

power off may happens N pages meta 0x01

meta 0x02

meta N 0x03

• For every ftl_write, do following meta 0x04

things meta 0x05

– Data write empty


empty
– Metadata write to special VBLK

– Mark written metadata as ‘up-to-date’ ᆞ

• Like a special marker ᆞ

ICE3028: Embedded System Design, Fall 2019, Dongkun Shin ([email protected]) 5


Guideline in SPO (cont’d)
VBLK #1
• Figure out whether NPO or SPO
N pages meta
– Read VBLK #1 from tail to head 0x01

meta
• Until finding valid mark 0x02

– If NPO, there’s no headache; just read meta meta N 0x03

– If SPO, do recovery meta 0x04

• Read written metadata at up-to-date zone meta 0x05

• With a recovered metadata, recover other metadata empty


empty
• Do not trust cur_write_page at SPO ᆞ

– What if power loss at NAND_PROGRAM? ᆞ

– You will need VBLK #2 for metadata


– What if power loss during recovery?
ICE3028: Embedded System Design, Fall 2019, Dongkun Shin ([email protected]) 6
Debugging Tips
• NPO
– Modify ftl_test.c to flush and load metadata
– Real tests will be done with real file system and real files

• SPO
– Make _fault_injection in your codes
• Simple _fault_injection function code

UINT32 _fault_injection (void)


{
uart_printf(“Fault_injection: Power-Off!”);
uart_printf(“Shutdown Jasmine board right now”);
while(1);
}
ICE3028: Embedded System Design, Fall 2019, Dongkun Shin ([email protected]) 7
Project Grading Policy

ICE3028: Embedded System Design, Fall 2019, Dongkun Shin ([email protected])


Project Grading Policy

• Project 1 (20%)
– Extra points (~11/6): 10%
– No delay
• Project II (50%)
– Extra points (~11/27): 20%
• Project III (30%)

• Subject to change

ICE3028: Embedded System Design, Fall 2019, Dongkun Shin ([email protected]) 9


Project III Grading Policy
• DFTL improvement (60)
– Design
• ex) New idea proposal, ...
– Implementation
• ex) Difficulty, Completeness, ...
– Evaluation
• ex) Use appropriate and diverse workloads, Comparison with existing
techniques, ...

• Additional function (30)

• Report & Presentation (10)

• You can also submit two firmwares.


ICE3028: Embedded System Design, Fall 2019, Dongkun Shin ([email protected]) 10

You might also like