Since you're building AT91Bootstrap for an atypical use (i.e. not for loading U-Boot), you need to pay attention to the configuration.
The DRAM start address used by the examples in the Software Package is 0x20000000, so that is what is needed for the `External Ram Address`.

The `Image Name` is no longer "u-boot.bin". Something like "softpack.bin" is appropriate.

BlackMesa wrote:I used Putty to see board output in terminal when board starts (With all IAR and GNU examples I got the same output):

It's not obvious (to me anyway) where you're going wrong.
The AT91Bootstrap that you built detects but is not properly recognizing the NAND flash chip, e.g. it is ONFI compliant and has nonzero ID codes.
Erasing the NAND wasn't the best idea.

You may be best off by "trying to get basic (getting-started and pwm) bare metal examples working" in smaller steps.

Boot from SDcard until you have validated your build environment.
Reconfigure AT91Bootstrap for Memory selection ---> Flash Memory Technology (NAND flash) ---> SD card;
change the Image Name to "softpack.bin".
Follow the instructions at SD Card Boot up to step 6. Instead of step 6, copy the pre-built getting-started-ddram.bin to the FAT partition, and rename it softpack.bin.

If that works, then progress to the smc_nandflash example in the Softpack.

No, I suggested that you reduce the number of unknowns in this problem, and all you did is provide useless experimentation.

BlackMesa wrote: All these versions gave the same output ( p.s. I didn't forgot to erase NAND, bootstrap compilation time was different ):
...
Softpack file in SD card is named exactly softpack.bin and it is only one file in card. Card is formatted to FAT32.

If the "three" experiments produced the exact "same" results, then I contend that you performed just one experiment three times.
Since you claim that softpack.bin is the only file on the SDcard, then that means you never tested the third experiment, "bootstrap in SD card".
In order to boot from the SDcard, the bootstrap program would have to exist on the SDcard as a file named boot.bin, which means that there would have to be two files on the SDcard (which you have already denied).

The single boot log seems to indicate that the board is always booting from NAND, and then fails to find the target file.
Obviously you did not follow the instructions from the web page on making a bootable SDcard.

Make a choice: methodically solve the problem (my way), or tell me to go away because you want to solve this your way.

Sorry for bad explanation on what I was doing. Actually I made a mistake when said that there was only one file in SD card. In third experiment there was two files (BOOT.BIN and softpack.bin). And I tested this experiment by removing SD card. Then only one line shows up in terminal "RomBOOT", which means that BOOT.BIN was read from SD card. On first two experiments (when bootstrap was written in NAND) bootstrap was loaded even without SD card.

Now I have file sama5d4_xplained-sdcardboot-softpack-3.8.9.bin and execute command:cp binaries/sama5d4_xplained-sdcardboot-softpack-3.8.9.bin /mnt/fat/BOOT.BIN
Then "cd" to folder where is my getting-started-ddram.bin.cp getting-started-ddram.bin /mnt/fat/softpack.bin
Looked at SD Card directory (files BOOT.BIN and softpack.bin are there)umount /dev/mmcblk0p1

4.2.7.2 HSMCI Card Connector
A standard MMC/SD card (push and click type) connector, connected to MCI1, is mounted on the top side of the board. It features a push-lock / push-eject mechanism and a card detection switch.
A micro SD card (push and click type) connector, connected to MCI0, is mountable as an option on the bottom side of the board.

I always thought that top side is the side on which the MPU is soldered , but that doesn't matter...
In my bootstrap Memory selection ---> SD Card Configuration ---> MultiMedia Card Interface Select() was set to "On Atmel MCI 0" , which means micro SD card connector. So I changed the value to "On Atmel MCI 1" (MMC/SD Card connector as written in datasheet).
But with this setting I can't make binaries - error appears:

Tried compile as Administrator too, obviously without any success
I think I should find more info about this error line: /home/lukas/Documents/at91bootstrap-master/driver/sdcard.c:126: undefined reference to `at91_mci1_hw_init'
Am I right that I have to use MCI1 ? Maybe someone who made bootstrap work knows the exact value?

BlackMesa wrote:It was a nice try, I didn't know anything about dirty bit since now, so I'm happy to learn something new

The sole reason I mention the fs dirty bit is because that was the only way I have been able to replicate your problem. I'm giving you credit that you haven't messed up the SDcard in some other way.
Maybe you could try using a USB adapter for SDcard (like I do), which exposes a /dev/sdX device node.

BlackMesa wrote:But with this setting I can't make binaries - error appears:

I already mentioned to you that building as superuser is bad practice.
What is misconfigured in your build environment (which you haven't described) that compels this bad practice?

BlackMesa wrote:Am I right that I have to use MCI1 ? Maybe someone who made bootstrap work knows the exact value?

No, you are not right. AT91Bootstrap should be configured for the default "MCI0", but use the full-size SDcard socket.
If you look at the source code, logical "MCI0" accesses hardware MCI1 in board/sama5d4_xplained/sama5d4_xplained.c:at91_mci0_hw_init().
And I do have AT91Bootstrap loading a softpack.bin from SDcard on a SAMA5D4 XULT.

I already mentioned to you that building as superuser is bad practice.
What is misconfigured in your build environment (which you haven't described) that compels this bad practice?

My fault, I didn't know that user with sudo is superuser, I thought that only root is superuser. And another reason was that previously I build bootstrap as superuser, so as user I didn't have permissions to clean (mrproper) that files, so I used sudo. In order to not leave any mistakes I downloaded a fresh copy from GitHub and unziped it.

If you look at the source code, logical "MCI0" accesses hardware MCI1 in board/sama5d4_xplained/sama5d4_xplained.c:at91_mci0_hw_init().

Yeah, now I see. It would take much time to find this by myself. Thanks again, blue_z

Now that you've posted logs of what you did, you've finally revealed the gcc version that you're using. That is the next thing to replace, because I'm running out of ideas. Back in the day these boot programs used to be sensitive to the compiler version, which is why you'll see a list of tested toolchains in the AT91Bootstrap's README.txt.

So instead of using gcc v6.3.0, try using the Linaro v4.9 toolchain, as mentioned in Setup ARM Cross Compiler .
However keep CROSS_COMPILE simple as

So instead of using gcc v6.3.0, try using the Linaro v4.9 toolchain, as mentioned in Setup ARM Cross Compiler .

You was right, blue_z, there was the problem. Now board boots from SD card and NAND flash also. Thank you very much for your help, it was a difficult time for me to run this board, I tried for about 2 month

BlackMesa wrote:I was unable to run Linaro 4.9.4 using command as mentioned here linux4sam/bin/view/Linux4SAM/Sama5d4Xpl ... s_Compiler, because I use 32-bit linux, so I had to download x86 (i686) Linaro version. gcc-linaro-5.4.1-2017.05-i686_arm-linux-gnueabi.tar.xz works fine:

If you had read my post carefully, then you might have noticed that I had already provided the commands to download a 32-bit toolchain as an alternate to the 64-bit version of the web page.