good day,
I am currently using AM17x Evaluation Module.
I want to load UBL and u-boot in serial flash.
I do the following:
1. edit UBL source code.
file: spi_memboot.c
function: SPI_MEM_BOOT_copy()
Uint32 SPI_MEM_BOOT_copy()
{
SPI_MEM_InfoHandle hSpiMemInfo;
Uint32 currMemAddr = 0;
DEBUG_printString("Starting SPI Memory Copy...\r\n");
// Do device specific init for SPI
DEVICE_SPIInit(DEVICE_SPIBOOT_PERIPHNUM);
// SPI Memory Initialization
hSpiMemInfo = SPI_MEM_open(DEVICE_SPIBOOT_PERIPHNUM, DEVICE_SPIBOOT_CSNUM, hDEVICE_SPI_config);
if (hSpiMemInfo == NULL)
return E_FAIL;
// Read data about Application starting at start of memory and searching
// at the start of each memory block
DEBUG_printString("UBL_MAGIC_BINARY_BOOT: ");
DEBUG_printHexInt(UBL_MAGIC_BINARY_BOOT);
DEBUG_printString("\r\n");
while (currMemAddr < hSpiMemInfo->hMemParams->memorySize)
currMemAddr += hSpiMemInfo->hMemParams->blockSize;
SPI_MEM_readBytes(hSpiMemInfo, currMemAddr, sizeof(SPI_MEM_BOOT_HeaderObj), (Uint8 *) &gSpiMemBoot);
DEBUG_printString("gSpiMemBoot.magicNum = ");
DEBUG_printHexInt(gSpiMemBoot.magicNum);
if (gSpiMemBoot.magicNum == UBL_MAGIC_BINARY_BOOT)
// Valid magic number found
DEBUG_printString("Valid magicnum, ");
DEBUG_printString(", found at offset ");
DEBUG_printHexInt(currMemAddr);
DEBUG_printString(".\r\n");
break;
}
if (currMemAddr >= hSpiMemInfo->hMemParams->memorySize)
DEBUG_printString("No magic number found.\r\n");
if (SPI_MEM_readBytes(hSpiMemInfo, gSpiMemBoot.memAddress, gSpiMemBoot.appSize, (Uint8 *)gSpiMemBoot.ldAddress) != E_PASS)
DEBUG_printString("Application image reading failed.\r\n");
// Application was read correctly, so set entrypoint
gEntryPoint = gSpiMemBoot.entryPoint;
return E_PASS;
2. Build UML and generate from UBL_SPI_MEM.bin the UBL_SPI_MEM.bin with the "AISgen for D800K003" utility
3. Build u-boot.bin for da830evm_config configuration
4. Set AM17x Evaluation Module on UART2 BOOT MODE
5. Erase
denis@ubuntu:~/Desktop/sdk_1_10_00_01/OMAP-L137_FlashAndBootUtils_2_20/OMAP-L137/GNU$ ./sfh_OMAP-L137.exe -targetType AM1707 -erase
log:
./sfh_OMAP-L137.exe -targetType AM1707 -flashType SPI_MEM -erase
-----------------------------------------------------
TI Serial Flasher Host Program for OMAP-L137
(C) 2011, Texas Instruments, Inc.
Ver. 1.67
Platform is Unix/Linux.
[TYPE] Global erase
[TARGET] AM1707
[DEVICE] SPI_MEM
Attempting to connect to device /dev/ttyS0...
Press any key to end this program at any time.
(AIS Parse): Read magic word 0x41504954.
(AIS Parse): Waiting for BOOTME... (power on or reset target now)
(AIS Parse): BOOTME received!
(AIS Parse): Performing Start-Word Sync...
(AIS Parse): Performing Ping Opcode Sync...
(AIS Parse): Processing command 0: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 7984-Byte section to address 0x80000000.
(AIS Parse): Processing command 1: 0x58535901.
(AIS Parse): Loaded 808-Byte section to address 0x80001F30.
(AIS Parse): Processing command 2: 0x58535906.
(AIS Parse): Performing jump and close...
(AIS Parse): AIS complete. Jump to address 0x80000000.
(AIS Parse): Waiting for DONE...
(AIS Parse): Boot completed successfully.
Waiting for SFT on the OMAP-L137...
Erasing flash
100% [ ████████████████████████████████████████████████████████████ ]
Erase complete
Operation completed successfully.
6. Flash UBL and u-boot.bin
./sfh_OMAP-L137.exe -targetType AM1707 -flashType SPI_MEM -flash 1 u-boot.bin
[TYPE] UBL and application image
[UBL] 1
[APP IMAGE] u-boot.bin
(Serial Port): Read error! (The operation has timed-out.)
Flashing UBL 1 (7652 bytes) at 0x00000000
Image data transmitted over UART.
UBL programming complete
Flashing application u-boot.bin (156376 bytes)
Application programming complete
7. Set AM17x Evaluation Module on SPI0 BOOT MODE
8. run minicom and reset AM17x Evaluation Module
9. startup log:
AM1707 initialization passed!
Booting TI User Boot Loader
UBL Version: 1.65
UBL Flashtype: SPI
Starting SPI Memory Copy...
UBL_MAGIC_BINARY_BOOT: 0x55424CBB
gSpiMemBoot.magicNum = 0xE3500000
gSpiMemBoot.magicNum = 0xE59F303C
gSpiMemBoot.magicNum = 0xFFFFFFFF
No magic number found.
SPI Memory Boot failed.
Aborting...
please help me solve the problems:
1. correcting start UBL and u-boot
2. why and what it means for the constants UBL_MAGIC_BINARY_BOOT and UBL_MAGIC_FINISHED from ubl.h ?
3. everything is right I do to flash UBL and u-boot?
Thanks,
Denis
sorry:
2. Build UML and generate from UBL_SPI_MEM.out the UBL_SPI_MEM.bin with the "AISgen for D800K003" utility
Was the code working before you modified, or did you just add additional debug statements?
I would recommend using the UBL that comes from the PSP package as opposed to the one on the /UBL directory and see if that helps.
If that still doesn't work, add some additional debug lines to show what SPI block it is reading the gSpiMemBoot.magicNum from. The flashing tool should flash the UBL at block 0 and U-boot at block 1 with the header prepended.
Jeff
----------------------------------------------------------------------------------------------------------
Please click the Verify Answer button on this post if it answers your question.----------------------------------------------------------------------------------------------------------
Useful Links:OMAP-L1x/C674x/AM18x Debug GEL File