Device with Linux embedded system on NAND flash memory. I did memory dump of some MTD devices partitions use serial console, from U-boot bootloader use available commands. First I read MTD partition to address in the memory, then dumped memory from that address to the terminal window. For example, MTD partition 0x01d60000-0x01e60000 : "FPAR" MTD partition size is 0x00100000 = 1048576 bytes
nand read 0x20000000 0x01d60000 0x00100000 NAND read: device 0 offset 0x1d60000, size 0x100000 1048576 bytes read: OK md.b 0x20000000 0x00100000 Then saved log file with dump as text file, cut out extra stuff before and after the dump and coverted it to binary use
xxd -r -p dump.txt dump.bin Resulting bin file size 1,310,860 bytes is mismatching MTD partion size (1,048,576 bytes), its much larger. Is the problem related to hex data conversion or the dump process have errors? I understand that MTD partion size of 1048576 bytes is size assigned to the whole MTD partition, the actual data on partition takes much smaller space, the large space filled with hex 'ff' values. Additionally, can anyone advice good utility for hex to bin data conversion?
Edit: I tried the same steps with 64 bytes data size, edited dump with gedit:and used Raw log session mode, after trimming extra stuff, the resulting ascii file size =is 318 bytes. So gedit corruptsAfter dump conversion, the filebin size is 87 bytes. When I open saved log with Gedit, it show alert:
'There20000000: wasa0 a7c problem4f openingfa the62 file61 “/home/../Documents/64bytes-test75 64 72 61 74 65 3d 31 31 35 .log|O. baudrate=115 The20000010: file32 you30 opened30 has00 some65 invalid74 characters.68 If61 you64 continue64 editing72 this3d file46 you46 could3a corrupt46 this document. 200.ethaddr=FF:F You20000020: can46 also3a choose46 another46 character3a encoding46 and46 try3a again.46 Character46 encoding3a 46 46 00 6e 65 F:FF:FF:FF:FF.ne 20000030: Current74 locale6d (UTF-8)'61 73 6b 3d 32 35 35 2e 32 35 35 2e 32 35 tmask=255.255.25 So probably I have to redirect raw serial data to disk.