AnsweredAssumed Answered

Problem with EXT4 corruption on SD card on custom MX6Q board

Question asked by Duncan Crutchley on May 17, 2019
Latest reply on Jun 4, 2019 by Duncan Crutchley

Hi,

 

We are developing a custom board closely based on the MX6Q SabreSD dev board. There are some differences.

 

We currently do not have any networking capabilities on our rev 1 board but on rev 2 we are adding a Marvell PHY and will enable gigabit networking. We are using microSD instead of full-size SD. We have microSD on SD2 (currently not fitted except for a resistor pull-up), eMMC on SD3 and microSD on SD4. We are handling the power management ourselves so also don't use the PMIC.

 

We have ported the MX6Q sabre SD u-boot files and kernel device tree to accommodate our differences compared to the sabreSD board. So from u-boot we our own device with a board.c, board.h, board_common.h, board_defconfig, and mods to the KConfig files as appropriate. For the kernel we have our own device tree files similar to the sabre board.dts and board.dtsi.

 

At this point u-boot works and loads the kernel and we log into into our minimal OS via putty and have access to our root filesystem and can run various apps in the terminal. We are booting from a microSD card in SD4.

 

We thought all was going well but we tried to extract the contents of a large tar file (tar is 475MB approx) from the micro SD card which we booted from into a folder on the eMMC and part way through we saw some EXT4 filesystem errors flash by of the type "ext4-fs error (device mmcblk2p1): htree_dirblock_to_tree:1007: inode....." and then we see a message flash by reporting it is remounting our filesystem as read only. From this point on each file that is trying to be extracted from the tar file fails and it complains because now the file system is read only and actually it turns out to be corrupted. We have to reflash the SD card.

 

Has any one encountered this issue before? It happens every time we try to do too much I/OI from the SD card.

 

We have also built a sabre SD dev board compatible version of u-boot, the kernel and root filesystem from the same code base and used the same microSD card but in a micro to full SD converter to run the image on the SabreSD dev board. Performing the same tests repeatedly on the SabreSD board we get no errors everything works fine. We have also tried several microSD cards and we find that on the SabreSD dev board it all works on our board we get EXT4 filesystem corruption randomly occurring.

 

We are using U-Boot 2018.11 and Linux Kernel 4.19 RT and minimal Debian 9.9 stretch for our minimal OS and root filesystem. We create our image following the steps here: i.MX6q SABRE Board for Smart Devices - Linux on ARM - eewiki . We have tried Yocto in the past but wanted to move to a newer kernel and u-boot version. So I haven't yet tried a Yocto build for a while to see if we have the same issues with our board.

 

Any help/suggestions would be very much appreciated.

 

Kind regards

Duncan

Outcomes