How to enable GPIO header J10 (GPIOEVT[1:5]) on the LX2160A-RDB-B ?

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

How to enable GPIO header J10 (GPIOEVT[1:5]) on the LX2160A-RDB-B ?

2,961 Views
ajedgar
Contributor II

We want to enable the GPIO header J10 on the LX2160A-RDB-B board.

It looks like the GPIO pins at J10 (GPIO/EVT[1:5]) are disabled by default.


So far it seems the only way to enable them is by re-flashing the RCW.

A couple of questions, is this true? Is there no other way to enable GPIO at J10 at run time? With DIP switches?

If I don't have Code Warrior what is the simplest way to create a new RCW and flash it?

It looks like there is a way to set the RCW using the Lauterbach debugger, does anyone have an example script for this?

Many thanks in advance for any and all pointers!

Andrew
System Software Engineer -- Wind River

0 Kudos
Reply
18 Replies

2,709 Views
June_Lu
NXP TechSupport
NXP TechSupport

Command $ flex-builder -i repo-fetch

Didn't mention in this case.

Maybe it's from other case support.

I could use the commands above, please follow the my suggestion and try it.

0 Kudos
Reply

2,667 Views
ajedgar
Contributor II

Hi June Lu,

Which suggestion did I miss?

As I have said I have redownloaded from scratch and followed your instructions with the same result each time.

There is nothing new since you replied with,
"All commands you used workswell in my Host system, maybe will need try some times because of the network. I think you need to check your Host system, I am sorry I could not help for that"

I need a new suggestion.


Thank you.

Andrew

0 Kudos
Reply

2,727 Views
June_Lu
NXP TechSupport
NXP TechSupport

I have done a new download from the link and try a clean test build of lx2160ardb_rev2. it works well.

When I failed to create the ATF, I will input the command again(flex-builder -c atf -m lx2160ardb_rev2 -b xspi), the command will start to continue, until get a ATF.

When you get ATF successful, you could get the next step(e.g. flex-builder -i mkfw lx2160ardb_rev2 -b xspi).

When build the firmware, the command(flex-builder -i mkfw lx2160ardb_rev2 -b xspi) also need to input sometimes. I think it would be network link error.

Hope this will help you.

Anyway, the commands work well in my host system.

 

If you get an image, you could program it.

You could refer Layerscape Linux Distribution POC User Guide, Rev. L5.15.71-2.2.0  page 100 for XSFPI image program.

For the SD card and eMMC, you could refer page 103.

0 Kudos
Reply

2,716 Views
ajedgar
Contributor II

Hi June Lu,

After updating configs/sdk.yml and with the correct xserver URL and gitlab URL as below:

"""
wayland:
# url: https://github.com/wayland-project/wayland.git
url: https://gitlab.freedesktop.org/wayland/wayland.git
tag: 1.18.0

xserver:
# url: https://github.com/freedesktop/xorg-xserver.git
url: https://gitlab.freedesktop.org/xorg/xserver.git
tag: xorg-server-1.20.9
"""

I was able to get this step to complete successfully:

$ flex-builder -i repo-fetch

Then (as mentioned before) the below step still fails in exactly the same way:

$ flex-builder -c atf -m lx2160ardb_rev2 -b xspi

make[2]: Entering directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf'
REALCLEAN
make[2]: Leaving directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf'
make -s -j4 fip pbl PLAT=lx2160ardb BOOT_MODE=flexspi_nor RCW=/home/ajedgar/Git/flexbuild_lsdk2108_github/build/firmware/rcw/lx2160ardb_rev2/XGGFF_PP_HHHH_RR_19_5_2/rcw_2200_750_3200_19_5_2.bin BL33=/home/ajedgar/Git/flexbuild_lsdk2108_github/build/firmware/u-boot/lx2160ardb/uboot_lx2160ardb_tfa.bin BL32=/home/ajedgar/Git/flexbuild_lsdk2108_github/components/apps/security/optee_os/out/arm-plat-ls/core/tee_lx2160ardb.bin SPD=opteed
make[2]: Entering directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf'
Including services/spd/opteed/opteed.mk
setting chssis
make[2]: *** No rule to make target 'plat/nxp/soc-lx2160a/LX2160A_RDB/ddr_init.c', needed by '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf/build/lx2160ardb/release/bl2/ddr_init.o'. Stop.
make[2]: *** Waiting for unfinished jobs....

Building tools/fiptool/fiptool
HOSTCC fiptool.c
HOSTCC tbbr_config.c
HOSTLD fiptool

Built fiptool successfully


make[2]: Leaving directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf'
cp: cannot stat 'build/lx2160ardb/release/bl2_flexspi_nor*.pbl': No such file or directory
make[1]: *** [atf.mk:11: atf] Error 1
make[1]: Leaving directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/packages/firmware'
make: *** [Makefile:19: atf] Error 2
make: Leaving directory '/home/ajedgar/Git/flexbuild_lsdk2108_github'
"""

A quick inspection shows there is no directory 'build/lx2160ardb/release/bl2_flexspi'.

$ ls build
apps firmware images linux rfs

As mentioned before, this is from a new, clean download of flex-builder on Ubuntu LTS 20.04 and it is always failing at this step in the same way. I also have a clean and solid internet connection, that is not an issue.

I need a new suggestion on how to progress past this point.

Thank you for your help.

-Andrew

0 Kudos
Reply

2,863 Views
June_Lu
NXP TechSupport
NXP TechSupport

Before changing the RCW, you should make your Host system can compile the image successfully(using the default source files). Please refer to LSDK21.08 4.1.1 Host system requirements, make sure your system can access server.

Download flexbuild_lsdk2108_github.tgz from nxp.com

tar xvzf flexbuild_lsdk2108_github.tgz

source setup.env

0 Kudos
Reply

2,850 Views
ajedgar
Contributor II

Hi June Lu,

Please see my comment below from yesterday (4/24) where I explain that I have downloaded 21.08 and followed the instructions but as soon as I try and do anything with flex-builder I get this error:

$ flex-builder -i mkfw -m lx2160ardb_rev2
MACHINE: lx2160ardb_rev2
ln: failed to create symbolic link '/home/ajedgar/shared/flexbuild_lsdk2108_github/build/linux/kernel': Operation not permitted

Am I missing something? Is there a "getting started" guide?

Thank you for your help!

-Andrew

0 Kudos
Reply

2,836 Views
June_Lu
NXP TechSupport
NXP TechSupport

 

It seems you select flexbuild_lsdk2108.tgz rather than flexbuild_lsdk2108_github.tgz.

LSDK Repositories has migrated from CodeAurora to GiTHub, please use the flexbuild_lsdk2108_github.tgz.

Of course, if you renamed the file, I think it's OK.

I have checked the command:

$ flex-builder -i mkfw -m lx2160ardb_rev2

It works well in my Host system, maybe will need try some times because of the network. I think you need to check your Host system, I am sorry I could not help for that.

0 Kudos
Reply

2,866 Views
ajedgar
Contributor II

A related question. I am trying to write directly to the FlexSIO to update the EVT20_PMUX and EVT32_PMUX bits as shown below. The 'mw' command says the bytes were written ok but when I read them back they are unchanged. This leads me to believe there must be some write-protection that needs to be disabled or I am missing a step or two. What is the best way to accomplish this?

=> sf read 0xa1000000 0x0 0x80
device 0 offset 0x0, size 0x80
SF: 128 bytes @ 0x0 Read: OK
=> md a1000000
a1000000: aa55aa55 80100000 5883833c 24580058 U.U.....<..XX.X$
a1000010: 00000000 00000000 00000000 0c010000 ................
a1000020: 00000000 00000000 036001a0 00002580 ..........`..%..
a1000030: 00000000 00000096 00000000 00000000 ................
a1000040: 00000000 00000000 00000000 00000000 ................
a1000050: 00000000 00000000 00000000 00000000 ................
a1000060: 00000000 00000000 00000000 00000000 ................
a1000070: 00027000 00000000 08b30010 00150020 .p.......... ...

=> mw.b a100003b 08
=> mw.b a100003c 01

=> md a1000000
a1000000: aa55aa55 80100000 5883833c 24580058 U.U.....<..XX.X$
a1000010: 00000000 00000000 00000000 0c010000 ................
a1000020: 00000000 00000000 036001a0 00002580 ..........`..%..
a1000030: 00000000 00000096 08000000 00000001 ................
a1000040: 00000000 00000000 00000000 00000000 ................
a1000050: 00000000 00000000 00000000 00000000 ................
a1000060: 00000000 00000000 00000000 00000000 ................
a1000070: 00027000 00000000 08b30010 00150020 .p.......... ...

=> sf write 0xa1000000 0x0 0x80
device 0 offset 0x0, size 0x80
SF: 128 bytes @ 0x0 Written: OK

=> sf read 0xa2000000 0x0 0x80
device 0 offset 0x0, size 0x80
SF: 128 bytes @ 0x0 Read: OK

=> md a2000000
a2000000: aa55aa55 80100000 5883833c 24580058 U.U.....<..XX.X$
a2000010: 00000000 00000000 00000000 0c010000 ................
a2000020: 00000000 00000000 036001a0 00002580 ..........`..%..
a2000030: 00000000 00000096 00000000 00000000 ................
a2000040: 00000000 00000000 00000000 00000000 ................
a2000050: 00000000 00000000 00000000 00000000 ................
a2000060: 00000000 00000000 00000000 00000000 ................
a2000070: 00027000 00000000 08b30010 00150020 .p.......... ...

Thanks for any pointers!

Best,
Andrew

0 Kudos
Reply

2,944 Views
rweiss
Contributor V

The Lauterbach TRACE32 offers two methods to change the RCW.

A temporary change of the RCW is possible using the RCW override feature. This is also helpful to connect to the processor there is not RCW programmed to flash yet. The script lx2160-spi-rcwovr.cmm shows how to do this.

For a permanent change, the RCW needs to be programmed to the flash selected as boot source. Above script also sets up the FLEXSPI for programming. If booting from other boot source, a different script will be required.

Regards,
Reinhard

2,891 Views
ajedgar
Contributor II

Thank you Reinhard. I'll give that a try.

0 Kudos
Reply

2,947 Views
June_Lu
NXP TechSupport
NXP TechSupport

You could refer the board reference manual for the details information.

If you use LSDK, you could try to use commands below to generate RCW binary file:

  1. $ git clone https://github.com/nxp-qoriq/rcw
  2. $ cd rcw
  3. $ git checkout -b LSDK-21.08 LSDK-21.08
  4.  $ cd LX2160axxx
  5.  If required, make changes to the rcw files.
  6.  $ make

 

You could use the generated binary, confirm the */flexbuild_lsdk2108xxx/configs/board/lx2160axxx/manifest select rcw_xspi, rcw_xspi="path/*.bin"(make sure the path is the required bin file)

 

  1. $ cd ~flexbuild_lsdk2108xxx/
  2. $ source setup.env
  3. $ flex-builder -i clean-firmware
  4. $ flex-builder -c atf -m lx2160axxx -b xspi
  5. $ flex-builder -i mkfw -m lx2160axxx -b xspi

Now the required xxx image is available in*/flexbuild_lsdk2108xxx/build/images

2,813 Views
ajedgar
Contributor II

 

Hi June Lu,

I am still unable to have the flexbuild complete cleanly. I am on Ubuntu 20.04 LTS.

Here are the commands:

$ flex-builder -i clean-firmware

$ flex-builder -c atf -m lx2160ardb_rev2 -b xspi

It bails out with:

make[2]: Leaving directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf'
make -s -j4 fip pbl PLAT=lx2160ardb BOOT_MODE=flexspi_nor RCW=/home/ajedgar/Git/flexbuild_lsdk2108_github/build/firmware/rcw/lx2160ardb_rev2/XGGFF_PP_HHHH_RR_19_5_2/rcw_2200_750_3200_19_5_2.bin BL33=/home/ajedgar/Git/flexbuild_lsdk2108_github/build/firmware/u-boot/lx2160ardb/uboot_lx2160ardb_tfa.bin BL32=/home/ajedgar/Git/flexbuild_lsdk2108_github/components/apps/security/optee_os/out/arm-plat-ls/core/tee_lx2160ardb.bin SPD=opteed
make[2]: Entering directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf'
Including services/spd/opteed/opteed.mk
setting chssis
make[2]: *** No rule to make target 'plat/nxp/soc-lx2160a/LX2160A_RDB/ddr_init.c', needed by '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf/build/lx2160ardb/release/bl2/ddr_init.o'. Stop.
make[2]: *** Waiting for unfinished jobs....

Building tools/fiptool/fiptool
HOSTCC tbbr_config.c
HOSTCC fiptool.c
HOSTLD fiptool

Built fiptool successfully


make[2]: Leaving directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf'
cp: cannot stat 'build/lx2160ardb/release/bl2_flexspi_nor*.pbl': No such file or directory
atf.mk:11: recipe for target 'atf' failed
make[1]: *** [atf] Error 1
make[1]: Leaving directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/packages/firmware'
Makefile:19: recipe for target 'atf' failed
make: *** [atf] Error 2
make: Leaving directory '/home/ajedgar/Git/flexbuild_lsdk2108_github'

And if I try the next step:
$ flex-builder -i mkfw -m lx2160ardb_rev2 -b xspi

It bails out with the very similar:

make[2]: Leaving directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf'
make -s -j4 fip pbl PLAT=lx2160ardb BOOT_MODE=flexspi_nor RCW=/home/ajedgar/Git/flexbuild_lsdk2108_github/build/firmware/rcw/lx2160ardb_rev2/XGGFF_PP_HHHH_RR_19_5_2/rcw_2200_750_3200_19_5_2.bin BL33=/home/ajedgar/Git/flexbuild_lsdk2108_github/build/firmware/u-boot/lx2160ardb/uboot_lx2160ardb_tfa.bin BL32=/home/ajedgar/Git/flexbuild_lsdk2108_github/components/apps/security/optee_os/out/arm-plat-ls/core/tee_lx2160ardb.bin SPD=opteed
make[2]: Entering directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf'
Including services/spd/opteed/opteed.mk
setting chssis
make[2]: *** No rule to make target 'plat/nxp/soc-lx2160a/LX2160A_RDB/ddr_init.c', needed by '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf/build/lx2160ardb/release/bl2/ddr_init.o'. Stop.
make[2]: *** Waiting for unfinished jobs....

Building tools/fiptool/fiptool
HOSTCC fiptool.c
HOSTCC tbbr_config.c
HOSTLD fiptool

Built fiptool successfully


make[2]: Leaving directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/components/firmware/atf'
cp: cannot stat 'build/lx2160ardb/release/bl2_flexspi_nor*.pbl': No such file or directory
atf.mk:11: recipe for target 'atf' failed
make[1]: *** [atf] Error 1
make[1]: Leaving directory '/home/ajedgar/Git/flexbuild_lsdk2108_github/packages/firmware'
Makefile:19: recipe for target 'atf' failed
make: *** [atf] Error 2
make: Leaving directory '/home/ajedgar/Git/flexbuild_lsdk2108_github'

Thoughts? Suggestions?

Thanks for your help!

-Andrew

 

0 Kudos
Reply

2,806 Views
June_Lu
NXP TechSupport
NXP TechSupport

All commands you used workswell in my Host system, maybe will need try some times because of the network. I think you need to check your Host system, I am sorry I could not help for that.

0 Kudos
Reply

2,787 Views
ajedgar
Contributor II

Hi June Lu,

I'm sorry but this is not a very helpful answer.

I am on Ubuntu 20.04 LTS. I have ensured that I have all the required packages installed per page 2 of this doc:
  https://www.nxp.com/docs/en/user-guide/LLDPUG_RevL5.15.71-2.2.0.pdf

The packages that were not already installed that I had to install were: socat, python3-git, python3-jinja2, libegl1-mesa, libsdl1.2-dev, pylint3, xterm, python3-subunit, mesa-common-dev, zstd, and liblz4-tool.

Installing these packages made no difference in the behavior of the flex-builder. It failed in the same way described above.

I have re-downloaded and re-installed from the link you provided here: https://lsdk.github.io/components.html

And I still cannot get a clean build.

Can you do a new download from that link and try a clean test build of lx2160ardb_rev2 and let me know if that works for you?

Is there someone else at NXP you can talk to that can help? I really need to get this working.

In the mean time I will dig into it and see if I can figure out what is broken.

Thank you for your assistance.

best,
Andrew

 

 

0 Kudos
Reply

2,786 Views
ajedgar
Contributor II

Hi June Lu,

Also please keep in mind that all I am trying to do is update the RCW on the LX2160A-RDB-B rev2 board.

I have already figured out how to build a new RCW manually. Now all I need to do is update the FlexSIO flash with the new RCW.

I have tried writing directly to the FlexSIO using u-boot 'sf' command but it does not work. Is there some write protection that needs to be disabled?

Can you please point me to some detailed step-by-step instructions on how to update the RCW? And also how to write directly to the FlexSIO from u-boot using the 'sf' command?

Thank you for your assistance!

best,

Andrew

 

0 Kudos
Reply

2,889 Views
ajedgar
Contributor II

Thank you June Lu.

The manifest file for the lx2160ardb_rev2 the exists:

$ pwd

$ /home/ajedgar/shared/flexbuild_lsdk2108_github

$ ls -l configs/board//lx2160ardb_rev2/manifest
-rwxrwx--- 1 root vboxsf 8998 Aug 29 2021 configs/board//lx2160ardb_rev2/manifest

And looking inside we see the path to the RCW file I'm looking for:
$grep rcw_xspi configs/board//lx2160ardb_rev2/manifest
rcw_xspi="firmware/rcw/lx2160ardb_rev2/XGGFF_PP_HHHH_RR_19_5_2/rcw_2200_750_3200_19_5_2.bin"

But it doesn't yet exist (also looked under 'build' and 'packages' so presumably it has to be built:

$ ls firmware/rcw/lx2160ardb_rev2/XGGFF_PP_HHHH_RR_19_5_2
ls: cannot access 'firmware/rcw/lx2160ardb_rev2/XGGFF_PP_HHHH_RR_19_5_2': No such file or directory

When I try to do anything with flex-builder I get this:

$ flex-builder -i clean-firmware
ln: failed to create symbolic link '/home/ajedgar/shared/flexbuild_lsdk2108_github/build/linux/kernel': Operation not permitted

I added a couple of 'echo's to the flex-builder script and see:
FBOUTDIR: /home/ajedgar/shared/flexbuild_lsdk2108_github/build
KERNEL_TREE: linux

And here is how I created my setup (with the same result):

On Ubuntu 20:
$ sudo apt update
$ sudo apt -y upgrade
$ sudo apt-get install git

$ tar xvzf flexbuild_lsdk2108.tgz

$ source setup.env
$ flex-builder -i mkrfs -a arm64

$ flex-builder -i mkrfs -a arm64
ln: failed to create symbolic link '/home/ajedgar/shared/flexbuild_lsdk2108_github/build/linux/kernel': Operation not permitted

So presumably the KERNEL_TREE var in the flex-builder script is incorrect or I am missing a step.

Thoughts?

Many thanks in advance for your help!

--Andrew

0 Kudos
Reply

2,849 Views
ajedgar
Contributor II

p.s.

 Once I have successfully built an rcw.bin file how do I flash it to FlexSIO? Is there some documentation on this?

Thank you.

 

- Andrew

0 Kudos
Reply

2,832 Views
June_Lu
NXP TechSupport
NXP TechSupport

If you get a bin, you need to generate the image to program.

You could refer Layerscape Linux Distribution POC User Guide, Rev. L5.15.71-2.2.0  page 100 for XSFPI image program.

For the SD card and eMMC, you could refer page 103.

0 Kudos
Reply