Tool/software: Code Composer Studio
Hi,
I am starting with sitara and TI-RTOS.
Using rtos pdk 1.0.6, I have developed a simple project which uses uart to control on board leds. It works fine when I load it throught USB using ccs 6, but I am having some problems to flash it on SPI memory.
Steps I have followed:
- Enable GNU Objcopy Utility to generate a .bin output of my project
- Convert this .bin to _ti.bin file using tiimage.exe from {PDK_PATH}\packages\ti\starterware\tools\ti_image. Based on ti_image wiki.
Running: tiimage.exe 0x80000000 NONE path_to_my_project\debug\MyProject.bin path_to_my_project\debug\MyProject_ti.bin
- Using CCS, load {PDK_PATH}\packages\ti\starterware\tools\flash_writer\spi_flash_writer_AM335X.out on the board. As said in SDK RTOS boot wiki
- Flash "bootloader_boot_mcspi_a8host_release_ti.bin" in offset 0x0 from {PDK_PATH}\packages\ti\starterware\binary\bootloader\bin\am335x-evm\gcc
- Flash "MyProject_ti.bin " in offset 0x20000
After this proces uart output is:
StarterWare Boot Loader
BOARDInit status [0x0]
SoC : [AM335X]
Core : [A8]
Board Detected : [ICE Ver 2]
Base Board Revision : [UNKNOWN]
Daughter Card Revision: [UNKNOWN]
GPIO Instance number: 0
Pin number: 18
MCSPI Instance number: 0
Channel/Chip Select number: 0
The instance address is 48030000
Copying Header of the image
Copying image from flash to DDR
Jumping to StarterWare Application...
But my program never starts running...
I have succesfully flashed a binary file from {PDK_PATH}\packages\ti\starterware\binary using spi_flash_writer_AM335X.out so I guess something is going wrong with "MyProject_ti.bin".
Could you please tell me if the process I am following is correct?
I have read that sometimes is necessary to include gel file code to initialize board. Is that what I am missing? If so, how can I add this to my project?
How can I modify bootloader to print more info thought the uart?
I have also tried using "bootloader_boot_mmcsd_a8host_release_ti.bin" and again "MyProject_ti.bin " to boot it from SD card and serial output is:
*** StarterWare Boot Loader. Build - 1.0.4-NOR BOOT Copying application image from MMCSD to RAM Unable to open application file from MMCSD
The same ouput appears when I try with an example .bin instead of my project. Is it an error meaning the MLO file is correct and again the app is the problem??
Thanks.
Flashing process:
[CortxA8] AM335X part detected.
SF: Got idcode ef 40 17
Checking if Winbond flash writer can be used..
SF: Detected W25Q64 with page size 256, total 8388608 bytes
Flash page size: 256 bytes
Flash sector size: 4096 bytes
Starting SPIWriter.
Choose Operation:
Enter 1 ----> To FLASH an Image
Enter 2 ----> To ERASE Flash
Enter 3 ----> To EXIT
1
Enter the File Name
C:\ti\pdk_am335x_1_0_6\packages\ti\starterware\binary\bootloader\bin\am335x-evm\gcc\bootloader_boot_mcspi_a8host_release_ti.bin
Enter the Offset in bytes (in HEX)
0x0
Erasing flash at byte offset: 0, byte length: 36864
SE: cmd = { 0x20 0x000000 }
SE: cmd = { 0x20 0x001000 }
SE: cmd = { 0x20 0x002000 }
SE: cmd = { 0x20 0x003000 }
SE: cmd = { 0x20 0x004000 }
SE: cmd = { 0x20 0x005000 }
SE: cmd = { 0x20 0x006000 }
SE: cmd = { 0x20 0x007000 }
SE: cmd = { 0x20 0x008000 }
SF: Successfully erased 36864 bytes @ 0x9000
Writing flash at page offset: 0, number of pages: 134
Flashing is in progress...
Verifying... Success.
AM335X part detected.
SF: Got idcode ef 40 17
Checking if Winbond flash writer can be used..
SF: Detected W25Q64 with page size 256, total 8388608 bytes
Flash page size: 256 bytes
Flash sector size: 4096 bytes
Starting SPIWriter.
Choose Operation:
Enter 1 ----> To FLASH an Image
Enter 2 ----> To ERASE Flash
Enter 3 ----> To EXIT
1
Enter the File Name
C:\ti\blink_ICE_test\Uart_Output_Test\Debug\Uart_Output_Test_ti.bin
Enter the Offset in bytes (in HEX)
0x20000
Erasing flash at byte offset: 131072, byte length: 274432
SE: cmd = { 0x20 0x020000 }
SE: cmd = { 0x20 0x021000 }
SE: cmd = { 0x20 0x022000 }
SE: cmd = { 0x20 0x023000 }
SE: cmd = { 0x20 0x024000 }
SE: cmd = { 0x20 0x025000 }
SE: cmd = { 0x20 0x026000 }
SE: cmd = { 0x20 0x027000 }
SE: cmd = { 0x20 0x028000 }
SE: cmd = { 0x20 0x029000 }
SE: cmd = { 0x20 0x02a000 }
SE: cmd = { 0x20 0x02b000 }
SE: cmd = { 0x20 0x02c000 }
SE: cmd = { 0x20 0x02d000 }
SE: cmd = { 0x20 0x02e000 }
SE: cmd = { 0x20 0x02f000 }
SE: cmd = { 0x20 0x030000 }
SE: cmd = { 0x20 0x031000 }
SE: cmd = { 0x20 0x032000 }
SE: cmd = { 0x20 0x033000 }
SE: cmd = { 0x20 0x034000 }
SE: cmd = { 0x20 0x035000 }
SE: cmd = { 0x20 0x036000 }
SE: cmd = { 0x20 0x037000 }
SE: cmd = { 0x20 0x038000 }
SE: cmd = { 0x20 0x039000 }
SE: cmd = { 0x20 0x03a000 }
SE: cmd = { 0x20 0x03b000 }
SE: cmd = { 0x20 0x03c000 }
SE: cmd = { 0x20 0x03d000 }
SE: cmd = { 0x20 0x03e000 }
SE: cmd = { 0x20 0x03f000 }
SE: cmd = { 0x20 0x040000 }
SE: cmd = { 0x20 0x041000 }
SE: cmd = { 0x20 0x042000 }
SE: cmd = { 0x20 0x043000 }
SE: cmd = { 0x20 0x044000 }
SE: cmd = { 0x20 0x045000 }
SE: cmd = { 0x20 0x046000 }
SE: cmd = { 0x20 0x047000 }
SE: cmd = { 0x20 0x048000 }
SE: cmd = { 0x20 0x049000 }
SE: cmd = { 0x20 0x04a000 }
SE: cmd = { 0x20 0x04b000 }
SE: cmd = { 0x20 0x04c000 }
SE: cmd = { 0x20 0x04d000 }
SE: cmd = { 0x20 0x04e000 }
SE: cmd = { 0x20 0x04f000 }
SE: cmd = { 0x20 0x050000 }
SE: cmd = { 0x20 0x051000 }
SE: cmd = { 0x20 0x052000 }
SE: cmd = { 0x20 0x053000 }
SE: cmd = { 0x20 0x054000 }
SE: cmd = { 0x20 0x055000 }
SE: cmd = { 0x20 0x056000 }
SE: cmd = { 0x20 0x057000 }
SE: cmd = { 0x20 0x058000 }
SE: cmd = { 0x20 0x059000 }
SE: cmd = { 0x20 0x05a000 }
SE: cmd = { 0x20 0x05b000 }
SE: cmd = { 0x20 0x05c000 }
SE: cmd = { 0x20 0x05d000 }
SE: cmd = { 0x20 0x05e000 }
SE: cmd = { 0x20 0x05f000 }
SE: cmd = { 0x20 0x060000 }
SE: cmd = { 0x20 0x061000 }
SE: cmd = { 0x20 0x062000 }
SF: Successfully erased 274432 bytes @ 0x63000
Writing flash at page offset: 512, number of pages: 1065
Flashing is in progress...
Verifying... Success.