How to create and flash the boot image for baremetal application in code warrior for T2081?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to create and flash the boot image for baremetal application in code warrior for T2081?

975 次查看
Vimalprasad
Contributor I

I have created a bareboard hello world application in the CodeWarrior for T2081 processor.

I can able to debug the application and i want to flash the application.

 

Is this RCW needed for the bareboard application to flash and boot?

Could you please provide the procedure for creating boot image(boot.bin) and flashing the bareboard application on the T2081 processor?

0 项奖励
回复
9 回复数

937 次查看
yipingwang
NXP TechSupport
NXP TechSupport

1. Configure the CodeWarrior as ROM version and build this project.

2. Please use the following command to convert the ELF file to bin file.

C:\Users\nxa22585>C:\Freescale\CW_PA_v10.5.1\Cross_Tools\gcc-4.9.2-Ee6500-aeabi\bin\powerpc-aeabi-objcopy.exe -O binary -S C:\Users\nxa22585\Downloads\t2080rdb\t2081-core00\ROM\t2081-core00.elf C:\Users\nxa22585\Downloads\t2080rdb\t2081-core00\ROM\test.bin 

3. Please refer to T2081QDS_gcc-aeabi_ROM.lcf to deploy the test.bin file at 0xEFF00000  on NOR flash.

You need to program RCW on the target board first.

For flash programming, please refer to https://community.nxp.com/t5/CodeWarrior-Development-Tools/Flash-Programmer-for-CodeWarrior-Power-Ar...

 

0 项奖励
回复

882 次查看
Vimalprasad
Contributor I

Hi @yipingwang ,

Currently I'm working on the T2080RDB,I have created the ROM version of the project and created the boot.bin file with using the mentioned command.

I have flashed the PBL.bin at the starting address 0xE0000000 and the boot.bin file in the 0xE7F00000 where my unprotected region of my NOR flash is 0xE0000000 to 0xE7FFFFFF and the protected region is 0xE8000000 to 0xEFFFFFFF.

After that I can able to flash but the booting is not happening.

I have created the ROM version of the project in the codewarrior , while debugging the project it not stopping in the main function.
Can you tell me how to debug the ROM version for the codewarrior?

I have done the modification in the T2080RDB-PCIe_gcc-aeabi_ROM.lcf . I have attached the lcf file with the modification have some errors mentioned in the screenshot.

Can you tell me any other configuration have to do for the booting have happen?

lcf_error.png

0 项奖励
回复

769 次查看
Vimalprasad
Contributor I
Can you please provide the solution for the above queries?
0 项奖励
回复

759 次查看
yipingwang
NXP TechSupport
NXP TechSupport

What is the size of your binary file?

What address did your program it at?

0 项奖励
回复

749 次查看
Vimalprasad
Contributor I
I'm programming PBL (PBL.bin) at 0xE0000000 having size of 1KB.
I'm programming the binary file(boot.bin) at 0xE7F0000 having size of 1024KB
0 项奖励
回复

708 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please define lcf file as the following, and program the bin file at 0xEFF00000.

/* Default linker script, for normal executables */
OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
      "elf32-powerpc")
OUTPUT_ARCH(powerpc:common)
ENTRY(__start)
MEMORY {
ram    : org = 0x00002000, l = 0x7FFFFFFF
rom   : org = 0xEFF10000, l = 0x000EEFFF
}
 
SECTIONS
{
 
  _stack_addr = 0x003dfff0;
  _stack_end  = 0x003d7ff0;
  
  _heap_addr  = 0x3cfff0;
  _heap_end   = 0x3d7ff0;
 
  .intvec 0xEFF00000 :
  {
    *(.intvec)
  } = 0xffff
  
  .reset 0xEFFFFFFC :
  {
    *(.reset)
  } = 0x4
 
  .init 0xEFFFF000 :
  {
    *(.init)
    *(.init_data)
  } = 0xFFC
  
0 项奖励
回复

909 次查看
Vimalprasad
Contributor I

Hi @yipingwang , thanks for your response.

In my nor flash the address start from the 0xE0000000 to 0xE7FFFFFF is in unprotected and the address from 0xE8000000 to 0xEFFFFFFF is in protected mode.

I have tried to flash in 0xEFF00000 , it showing write protected error, flash not happened.

So, I flashed at 0xE7F00000 but the booting is not happening. 

Where I have to flash my boot.bin file so that it can boot?

In this T2081QDS_gcc-aeabi_ROM.lcf file any modification have to do , can you tell the modifications?

 

0 项奖励
回复

795 次查看
yipingwang
NXP TechSupport
NXP TechSupport

bootloader image should be deployed at the end of the NOR flash.

0 项奖励
回复

767 次查看
Vimalprasad
Contributor I
Thanks for your response,
I had flashed the boot image at the end of the NOR flash, then also I cannot see the boot prints.
0 项奖励
回复