Boot from NAND with SD card plugged in


I am using a i.mx6ull evk NAND version board. After booting from the SD card, I flashed the firmware on the NAND flash, set the correct pin config on the pinout to boot from NAND and then reboot the board. When the board boots it boots again from the SD card even though the pins are saying to boot from NAND. I remove the SD card and then boot again and it boots from NAND.

I formatted the SD card and inserted it to the board and rebooted but it gets stuck because it is trying to boot from the empty SD card instead of booting from NAND. Only when the SD card is not physically present it boots from NAND.

Any ideas why?

Also when the board is up and running and it was booted from the NAN, I insert an empty SD card to it but it is not detected. I cannot see /dev/mmcblk…

Any help would be greatly aprpeciated.