How to load an image in spinor with default settings, and without uboot, on imx6

cancel
Showing results for 
Search instead for 
Did you mean: 

How to load an image in spinor with default settings, and without uboot, on imx6

874 Views
faizankhan
Contributor II

I am using a custom imx6 board where I dont have access to the dip switches used for boot mode selection, so its set to the default state which is boot from spi nor, I believe. Now I ultimately want it to boot from sd for which I ll force the resister settings to boot from sd, but for now I want to test the image that I ve prepared by flashing it in spi nor (assuming the default settings are spi nor) and then power cycling the board. The only problem I am facing is that all the flashing mechanisms that I have read so far assumes that there already is a uboot installed on the board and then uses the uboot to load the image on spi nor, the manufacturing tool assumes that the dip switches are set to boot from serial (which I cant). Is there any tool that I can flash the image in spi nor with....

cheers,
Faizan

Labels (4)
10 Replies

172 Views
faizankhan
Contributor II

So i shifted to booting from sd card, and the boot rom works fine, loads the 1st 4k into on chip ram and then initializes the dram, but it wont jump to the start address of the image, I used jlink to set the program counter to that start address of the image and it worked. Now how can I make the bootrom jump to the start of the image, from all the documents that I ve read it says that the BootRom should jump by itself to the address given in the IVT...

Attached is my bin file, the image is placed at 0x27800780...

0 Kudos

172 Views
faizankhan
Contributor II

Whenever I try to flash my modified uboot bin file it gets an error or gets stuck, I also used the default list for spi nor which gets flashed but when I reset the board nothing happens, which I thing is obvious cause my target uses different mux settings for serial 0, I also took the dump of memory at 0x907400 (IMX6 eMMC boot described here) via jlink but I dont see an IVT just some values...Here is what I did to modify the bin file, I copied my nucleus image that I want to eventually run on the target and replaced it with the image on u-boot-imx6-sabrelite.bin (firmware file) then i modified the IVT to adjust the size and addresses, but whenever I do this the manufacturing tool would get stuck in loading uboot. when i use the default firmware file but replace the uboot file in the files folder with my custom uboot then it gets flashed but nothing happens when I reboot the target. Now is my way of creating the uboot.bin correct (i.e. just copying my image, and editing the ivt in the hex editor correct)?? furthur there is a uImage.imx file which loads the kernel and an initramfs file, do I need to modify these files as well. Can you please tell me the correct way in which I can create a binary image and test it, remember I am just doing this step to test my image, I ultimately want to boot from an sd card.

0 Kudos

172 Views
faizankhan
Contributor II

Oh I should tell you my understanding so far, so I thing if I add an IVT in front of my desired image it will make the the image bootable and thus load the image on the desired location specified in the IVT, so I think if I flash this raw image with an IVT on spi nor, and since the default boot setting is to nor, the boot rom will read the raw IVT values and load the image to the desired location and start running the image.... let me know if there is anything wrong with my thought process.

thanks for the help,

Faizan

0 Kudos

172 Views
BiyongSUN
NXP Employee
NXP Employee


IVT is the information for ROM code to locate the image to me memory, which is like jlink use the elf format image.

That make all the segments such as .TEXT as our wish.

That is why called IVT(Image Vector Table). That is what Vector's meaning.

Untitled.png

ROM need read that IVT(aslo the boot data) from a special offset.

That is why need put image with a offset.

The reference manual has very very detialed description.

0 Kudos

172 Views
faizankhan
Contributor II

Yes I ve read about that, this means my understanding is correct, now does this mean that if I just prepend an ivt to a binary image (irrespective which image, i have a nucleus application), and flash it with the manufacturing tool to spi nor then it should work...(if yes then it would simplify things, I only hv to place the correct ivt with the correct offset now)...

0 Kudos

172 Views
faizankhan
Contributor II

Thank you guys for the reply, so I used the mfg tool and it appears that it detects the device in the default settings, so I can flash my image with it, now I only have one confusion, I used the sample uboot bins provided with the mfg tool and uboot-spi-nor.bin and uboot-sabresd.bin have the same offset (1kb), the ref manual says that for nor the IVT (image vector table) should be at 4kb offset and sd should be at 1kb offset and that the offset of the IVT is the only requirement by the ROM, I ve checked all uboot bins provided and all of them are at 1kb offset. Now I can try with both and see which works, but wanted to know if there is any thing that I am missing....

please reply asap...

cheers,
Faizan

0 Kudos

172 Views
BiyongSUN
NXP Employee
NXP Employee

1. WEIM NOR offset 4K.

2. SPI     NOR offset 1K.

Untitled.png

0 Kudos

172 Views
ozu
Contributor III

Hi faizankhan,

I think you should check cfg.ini file in the MfgTool folder. In this file you can change the offset, at which you want to flash your uboot, by changing the 'seek' variable. This variable is used in ucl2.xml, which you can also find with the MfgTool folder. ucl2 uses a dd command to flash and for a 4kB offset u can set following things,

bs=1K (in ucl2.xml)
seek=4 (in cfg.ini)

Hope it helps!

0 Kudos

172 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi faizan

I am afraid uboot or mfg tools are only possible options.

In general uboot can be run with jtag.

Best regards

igor

0 Kudos

172 Views
ozu
Contributor III

Have you tried using manufacturing tool? You can download it from Freescale website, it can be used to flash all devices. Documentation about it can be found with the tool itself or to start with in the i.MX_Linux_User's_Guide.pdf from the fsl-yocto documentation.