flash-memory

When do I use xdata?

感情迁移 提交于 2019-12-09 16:49:30
问题 I am new at embedded system programming. I am working on a device that uses an 8051 chipset. I have noticed in the sample programs that when defining variables, sometimes they use the keyword xdata. like this... static unsigned char xdata PatternSize; while other times the xdata keyword is omitted. My understanding is that the xdata keyword instructs the compiler that that variable is to be stored in external, flash, memory. In what cases should I store variables externally with xdata?

unable to attach ubi to mtd partition

 ̄綄美尐妖づ 提交于 2019-12-07 04:13:56
问题 We are using MT29F8G08ABABA in our DM365 based custom board. We are using NAND boot. RootFS is in UBIFS format, Below is basic achitecture of the NAND. I am using following commands to create ubifs, $(UBIFS_PATH)/mkfs.ubifs -r $(TARGET_FS) -m 4096 -e 520192 -c 75 -o ubifs.img $(UBIFS_PATH)/ubinize -o $(SYSTEM_CFG)_$(HARDWARE_CFG)_ubifs -m 4096 -p 512KiB $(HARDWARE_CFG)_ubinize.cfg dm368_ubinize.cfg content is as follows, [ubifs] mode=ubi image=ubifs.img vol_id=0 vol_size=37888KiB vol_type

NAND flash programming: granularity of writes?

ⅰ亾dé卋堺 提交于 2019-12-06 10:47:44
is someone in the kow about write accesses on nowadays large NAND flash chips? What is the minimal granularity for writes? I have a microcontroller flash here which requires at least 1 and at most 4 words (16-bit words that is) to be fed to the write statemachine at once. I think that the large (> 1 Gbit) flashes behave differently here for write performance reasons. slarti So to be clear, to write a 1 bit you have to clear a whole block of memory, to write a 0 bit you only have to write one memory location. Are you talking about a one time write (changing some of the bits from a 1 to a 0

Can't write to flash memory after erase

拟墨画扇 提交于 2019-12-06 01:16:43
问题 So I can't write to internal flash memory directly after erasing it. If there's no erase operation before write operation, then I can. Any ideas as to why? Programming function returns 'successful write' value, but when looking at memory, no data is written. Here's the code: uint32_t pageAddress = 0x08008000; uint16_t buffer = 0xAAAA; HAL_FLASH_Unlock(); FLASH_PageErase(pageAddress); HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, pageAddress, buffer); HAL_FLASH_Lock(); I've tried locking the memory

unable to attach ubi to mtd partition

送分小仙女□ 提交于 2019-12-05 11:42:38
We are using MT29F8G08ABABA in our DM365 based custom board. We are using NAND boot. RootFS is in UBIFS format, Below is basic achitecture of the NAND. I am using following commands to create ubifs, $(UBIFS_PATH)/mkfs.ubifs -r $(TARGET_FS) -m 4096 -e 520192 -c 75 -o ubifs.img $(UBIFS_PATH)/ubinize -o $(SYSTEM_CFG)_$(HARDWARE_CFG)_ubifs -m 4096 -p 512KiB $(HARDWARE_CFG)_ubinize.cfg dm368_ubinize.cfg content is as follows, [ubifs] mode=ubi image=ubifs.img vol_id=0 vol_size=37888KiB vol_type=dynamic vol_name=rootfs vol_flags=autoresize Then i put this ubifs to NAND using following commands, loady

What is a good filesystem for embedded NAND drives?

╄→尐↘猪︶ㄣ 提交于 2019-12-05 00:51:17
I am working on an embedded application that uses NAND flash for storage. As it looks now, we won't use Linux or any other RTOS. The application must handle unexpected power downs. We have been looking on different file system solutions, including YAFFS2, JFFS2, FAT+FTL as well as solutions from HCC Embedded . I have heard FAT+FTL is a normal choice, but I am worried about data loss in case of unexpected power downs as well as performance. Would be grateful if anyone could share insights and experience about this FAT-FTL is a "normal choice", but not necessarily a good choice. YAFFS2 is newer

Write on a mtd block device

眉间皱痕 提交于 2019-12-04 07:53:44
问题 I'm trying to write on a NAND flash memory using MTD block device but I don't understand everything. As I read here mtdblockN is the read only block device N mtdN is the read/write char device N mtdNro is the read only char device N But I'd like to directly write bytes to the partition using a simple write in C and I don't understand how it works (I read somewhre that I first must erase the sectors I want to write on). Which device should I use and how to write on this device? 回答1: Reading

Can't write to flash memory after erase

孤者浪人 提交于 2019-12-04 06:49:24
So I can't write to internal flash memory directly after erasing it. If there's no erase operation before write operation, then I can. Any ideas as to why? Programming function returns 'successful write' value, but when looking at memory, no data is written. Here's the code: uint32_t pageAddress = 0x08008000; uint16_t buffer = 0xAAAA; HAL_FLASH_Unlock(); FLASH_PageErase(pageAddress); HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, pageAddress, buffer); HAL_FLASH_Lock(); I've tried locking the memory between erasing and programming it, creating a delay between these operations, that doesn't help. The

When do I use xdata?

孤者浪人 提交于 2019-12-04 03:59:52
I am new at embedded system programming. I am working on a device that uses an 8051 chipset. I have noticed in the sample programs that when defining variables, sometimes they use the keyword xdata. like this... static unsigned char xdata PatternSize; while other times the xdata keyword is omitted. My understanding is that the xdata keyword instructs the compiler that that variable is to be stored in external, flash, memory. In what cases should I store variables externally with xdata? Accessing those variables takes longer, right? Values stored using xdata do not remain after a hard reset of

Circular Buffer in Flash

末鹿安然 提交于 2019-12-03 20:05:14
问题 I need to store items of varying length in a circular queue in a flash chip. Each item will have its encapsulation so I can figure out how big it is and where the next item begins. When there are enough items in the buffer, it will wrap to the beginning. What is a good way to store a circular queue in a flash chip? There is a possibility of tens of thousands of items I would like to store. So starting at the beginning and reading to the end of the buffer is not ideal because it will take time