How to flash PBL into eMMC of LS1021a via JTAG

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to flash PBL into eMMC of LS1021a via JTAG

3,464 Views
jiye
Contributor V

Hi Guys,

Current I have a stand alone ls1021a chipset and external eMMC. I want to flash my image into the eMMC. The first thing I know is to program the PBL (includes PBI and RCW) into the eMMC. Can I use CodeWarrior to achieve this? If so what would be the right version I can use. I also saw there are two different kinds of license one is 30 days trial and one is way more expensive version I wonder if I can use the 30 day free trial version to achieve my goal. If not, what is the right procedures and tools I can use to boot my system from external eMMC.

I talked to the NXP engineer and they said CodeWarrior for Armv7 can not be used to flash the eMMC. But seems like AN5184, AN12270, AN5089 these documentations indicate that we can flash the eMMC using CodeWarrior. I am really confused.

Labels (1)
0 Kudos
Reply
17 Replies

2,978 Views
Pavel
NXP Employee
NXP Employee

Usually DUART of the LS1021a is used as console.

See the Section 2.18 of the TWR-LS1021a board Reference Manual:

https://www.nxp.com/webapp/Download?colCode=TWR-LS1021ARM

 

See the Section 7.2.7 of LSDK 1909 User Guide about using LPUART on the LS1021a board:

https://docs.nxp.com/bundle/GUID-1441E561-3EAD-47FD-A50D-72E1A4E4D69E/page/GUID-38B02850-872C-4567-8...

 

See also the Section 4.4.4.11 Od SDK 2.0-1703 documentation about LPUART using as console:

https://docs.nxp.com/bundle/GUID-39A0A446-70E5-4ED7-A580-E7508B61A5F1/page/GUID-30F66DE6-BAD0-4ED6-A...

Have a great day,
Pavel Chubakov

0 Kudos
Reply

2,978 Views
Pavel
NXP Employee
NXP Employee

Is there problem if new RCW is added to u-boot code and u-boot is built again?

If this u-boot correctly started, compare this u-boot and your u-boot binary image.

Have a great day,
Pavel Chubakov

0 Kudos
Reply

2,978 Views
jiye
Contributor V

Hi Pavel,

I injected the uboot_ls1021atwr_sdcard_qspi.bin into the qcvs project and modified the RCW settings to feed my need. Then I recreate the bin file and flash into the eMMC of my board it seems like succeed. However, I want to debug from the console but my

pastedImage_1.png

are 100 as I think LPUART1_SOUT and LPUART1_SIN are the serial port by default. But I did not see anything from my console. What on my board is a direct connect of these two pins from ls1021a to my FTDI port

pastedImage_2.png

I do not know where I missed if you can give any suggestions would be super helpful.

0 Kudos
Reply

2,978 Views
Pavel
NXP Employee
NXP Employee

(1) Usually the LS1021a RCW is changed for your hardware in u-boot and u-boot is rebuilt.

CodeWarrior for u-boot burning to eMMC can use different RCW.

 

(2) The SD/MMC and eMMC are the same thing for u-boot. The LS1021a u-boot supports SD/MMC and eMMC. See the LS1021a u-boot source.

Have a great day,
Pavel Chubakov

0 Kudos
Reply

2,978 Views
jiye
Contributor V

(1) OK  can you tell me where I did wrong? I use uboot_ls1021atwr_sdcard_qspi.bin and load it into the RCW and then change the RCW settings then regenerate the PBL.bin as you can see (i thought the new .bin file is the new uboot)

pastedImage_3.png

Is this correct? If not " Usually the LS1021a RCW is changed for your hardware in u-boot and u-boot is rebuilt." can you provide me more steps to do so

(2) under my uboot/ls1021atwr

I have these only

pastedImage_4.png

But the document says

pastedImage_2.png

In my stand alone ls1021a board I apparently use the OCRAM method but I did not see any .bin under my uboot folder called u-boot-with-spl-pbl.bin any clues?

0 Kudos
Reply

2,978 Views
Pavel
NXP Employee
NXP Employee

The TWR-LS1021A uses physical switch between NOR flash or QSPI.

LSDK provides u-boot for both these configurations.

Have a great day,
Pavel Chubakov

0 Kudos
Reply

2,978 Views
jiye
Contributor V

(1)can I use this .bin file and load into codewarrior and flash into my eMMC since I upload this file into the codewarrior and did some changes for the RCW settings to reach the requirement of my stand alone ls1021a (which has external eMMC, no SD,no NOR, may be no SPI as well just a JTAG interface to flash the eMMC)

I changed the PBI_SRC for example to SD/MMC for example

pastedImage_1.png

I just also want to make sure

(2) if SD/MMC and eMMC are the same thing

0 Kudos
Reply

2,978 Views
Pavel
NXP Employee
NXP Employee

Yes, write this uboot_ls1021atwr_sdcard_qspi.bin file to eMMC on your board.

Have a great day,
Pavel Chubakov

0 Kudos
Reply

2,978 Views
jiye
Contributor V

uboot_ls1021atwr_sdcard_qspi

why this is qspi? can you explain what is qspi ?

0 Kudos
Reply

2,978 Views
Pavel
NXP Employee
NXP Employee

See the AN5184 about programming u-boot to eMMC/SD card using CodeWarrior for ARMv7 Flash programmer:

https://www.nxp.com/docs/en/application-note/AN5184.pdf

 

See also CodeWarrior for ARMv7 Release Note:

https://www.nxp.com/docs/en/release-note/CW-ARMv7-RN.pdf

Have a great day,
Pavel Chubakov

0 Kudos
Reply

2,978 Views
Pavel
NXP Employee
NXP Employee

Use the AN5184 Note for writing u-boot to eMMC.

 Have a great day,
Pavel Chubakov

0 Kudos
Reply

2,978 Views
Pavel
NXP Employee
NXP Employee

NXP offers SDK 2.0, SDK 2.7 and LSDK 1906 Linux BSP.

These BSP provides building u-boot binary file for SD/MMC.

This u-boot binary image contains RCW, PBL and u-boot.

LSDK 1906 provides building .img file. This .img file contains RCW, PBL u-boot, microcde and Linux image.

Use these BSP for building u-boot binary file or .img file.

Have a great day,
Pavel Chubakov

0 Kudos
Reply

2,978 Views
jiye
Contributor V

Hi Pavel,

so based on what you said:

(1)file for example like this uboot_ls1021atwr_sdcard_qspi.bin under flexbuild_lsdk1906/build/firmware/u-boot/ls1021atwr/ contains RCW, PBL and u-boot ? this is what you said u-boot binary image ?

If so I can directly use code warrior tool to flash this into my eMMC?

0 Kudos
Reply

2,978 Views
jiye
Contributor V

Hi Pavel,

If I dd my boot partition as an .img file is this mean this .img contains RCW, PBL and u-boot

Also if I want to change an existing RCW settings, how am I able to do it and put it back into the boot image ?

Last, as you mentioned above to create an .img which contains RCW, PBL u-boot how am I able to do it using LSDK1906.

Regards,

Jiye

0 Kudos
Reply

2,978 Views
jiye
Contributor V

But if I want to change the configuration of RCW I need to use CodeWarrior to do it right as the RCW comes from BSP is a default one. 

0 Kudos
Reply

2,978 Views
Pavel
NXP Employee
NXP Employee

NXP offers CodeWarrior for QorIQ LS Series ARMv7 ISA:

https://nxp.flexnetoperations.com/control/frse/product?child_plneID=691401&ver=CURRENT

 

See attached snapshot.

Evaluation version of this CodeWarrior provides full functionality during 15 days.

This CodeWarrior uses CodeWarrior TAP for connection to the LS1021a board.

Flash programmer of this CodeWarrior supports SD/eMMC programming. See the Section 11.1.4 in the CW_ARMv7_Targeting_Manual.pdf. this file available using the following path in CodeWarrior folder:

C:\Freescale\CW_ARMv7_v2019.01\CW_ARMv7\ARMv7\Help\PDF

Have a great day,
Pavel Chubakov

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

2,978 Views
jiye
Contributor V

Hi Pavel,

How about the PBL ( RCW and PBI) ?

what is the correct way to flash an eMMC that is what I want to know as from what I thought :

(1)

• CPLD

• RCW override

• JTAG parsing to find out Boot Core/SAP2/DAP chain position
• PBI to initialize some minimal required registers
• Configure DDR ( does this mean I need a external DDR too? )
• Load boot loader(U-boot) image to DDR
• Release the ARM core to boot

(2)

Basically, my options are to program
eMMC with RCW and bootloader directly from JTAG or first start a
DDR SDRAM-based u-Boot, also via JTAG, and then let it program eMMC

The (1) above tells me PBL should be programmed first then uboot

The (2) above tells me I go either PBL or u-boot 

which one is correct do I need both PBL and u-boot?

0 Kudos
Reply