Sorry, you need to enable JavaScript to visit this website.

Configuring Minized Petalinux Wi-Fi with custom PL

Solved
19 posts / 0 new
caheike1's picture
caheike1
Junior(2)
Configuring Minized Petalinux Wi-Fi with custom PL

I programmed my logic into the PL on a minized and using the petalinux tools configured a 4.9 version of petalinux for it.  Linux and the PL work well, except networking.  The wifi.sh script that came with the minized does a ‘modprobe bcmdhd’.   This appears to be a custom kernel module that contains the Wi-Fi drivers.  I am unable to find the source for the module so that I can build it myself  or to configure the kernel to support this Wi-Fi chip without the module.  Also,  I would also like to get a copy of the configuration files for the petalinux kernel and rootfs that matches the image.ub that comes with the board so that I can create my own image.ub using my version of the PL.   Has anyone successfully built a petalinux image.ub and gotten Wi-Fi to work?    Does anyone know where to get the stock petalinux configuration files?
 
 

stefanrousseau's picture
stefanrousseau
Junior(3)
MiniZed Wi-Fi under PetaLinux 2017.2 and later

On the MiniZed page (http://zedboard.org/product/minized) under Reference Designs you will find the PetaLinux 2017.2 BSP.
If you create a new project with
petalinux-create -t project -n minized -s MiniZed.bsp
you will be able to build this with petalinux-build and the latest image.ub will be created.  This is the image.ub that goes on the MiniZed eMMC, from where it gets loaded after booting from QSPI flash.
Under PetaLinux 2016.4 we used bcmdhd and you had to modprobe it.  If you build your project from the 2016.4 BSP, you will still have to do that.  But under PetaLinux 2017.2 (Linux version 4.9.0-xilinx-v2017.2) and later Wi-Fi support is with brcmfmac and not bcmdhd anymore and a modprobe by the user is not required anymore.
You can establish which version of Linux you are running on MiniZed (and when it was created) with:
cat /proc/version
In the 2017.2 BSP, the user scripts such as wifi.sh are in the
project-spec/meta-user/recipes-modules/custom/custom
directory inside the project.

caheike1's picture
caheike1
Junior(2)
MiniZed Wi-Fi under PetaLinux 2017.2 and later

That’s exactly what I needed.   I looked for a the correct BSP on the Xilinx website, and could not find a minized version.   I failed to look at the minized reference designs.   I am now able to install petalinux with working Wi-Fi on my minized with a customized PL.  To summarize for those that may not know, here is what I am doing
 
#on the linux host
#set up the environment
source /opt/pkg/petalinux/settings.sh
 
#create the project once
petalinux-create -t project  -n MINIZED  -s MiniZed.bsp
cd MINIZED
 
#entry of the iteration loop
#Import the .hdf file (in this case the .hdf file is in ~/Xilinx)
petalinux-config --get-hw-description=~/Xilinx
 
#build the software, the image.ub will be in the images directory
petalinux-build
 
#from the minized, I tftp the image.ub on the linux host  to the minized eMMC memory, reboot and test on the new image.
#as things are usually not quite right, I go back to Vivado and tweak the logic and export a new .hdf file and re-enter the iteration loop
 
 

jcervant's picture
jcervant
Junior(0)
This post was a huge help. 

This post was a huge help.  Works perfectly.  Now I would like to add my own peripheral in the PL.  How can I approach this?  Is there a recommended design flow I can use?  Put another way, how would I recreate the project that was used to export this BSP?  I need a Vivado design as a starting point so I can add my IP to it.  Big thanks in advance for any hints here.

stefanrousseau's picture
stefanrousseau
Junior(3)
Rebuilding the QSPI flash image

If you look at http://zedboard.org/product/minized again, under Reference Designs where you found the BSP, you will see a heading "Prebuilt Platforms Using Hardware Definition Files (HDFs)".  If you follow these instructions, you will be able to re-build the Vivado project from the script on GitHub.  Once you have done this and created your own HDF, you will be able to import it into your PetaLinux environment using :
petalinux-config --get-hw-description <location-of-your-new-HDF-file>
The BSP environment you need for re-building the QSPI flash file with the PL is not the same BSP that you will use for creating image.ub.  That one is currently under "MiniZed_QSPI.bsp (2017.1 BSP for booting from QSPI flash only)".
If you do not want to follow the script or BSP, you could also follow the posted SpeedWay tutorials on the Reference Designs page to create the QSPI flash image from scratch.
 

jcervant's picture
jcervant
Junior(0)
Thanks - everything is now

Thanks - everything is now working as I had hoped.  I had not realized that I import a new hardware definition into an existing petalinux project.

JFoster's picture
JFoster
Moderator(55)
Hello,

Hello,

Have you tried taking a look at our github? We have quite a few builds there that take advantage of the wifi peripheral on the MiniZed.
 

--Josh

acapon's picture
acapon
Junior(0)
Hi Guys,

Hi Guys,
 
 
I am having a little difficulty getting this going.
 
I have build the vivado project, created a petalinux project using the BSP and built it.
 
I transfer the bit file and then stage 1 and 2 over jtag and get the uboot up correctly:
 
 

 

[code]

U-Boot 2017.01 (Oct 19 2017 - 20:47:45 +0100)

 

Board: Xilinx Zynq

DRAM:  ECC disabled 512 MiB

MMC:   Card did not respond to voltage select!

sdhci@e0100000 - probe failed: -95

Card did not respond to voltage select!

 

SF: Detected n25q128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB

*** Warning - bad CRC, using default environment

 

In:    serial

Out:   serial

Err:   serial

U-BOOT for MiniZed

 

Hit any key to stop autoboot:  0 

Zynq> 

 

U-Boot 2017.01 (Oct 19 2017 - 20:47:45 +0100)

 

Board: Xilinx Zynq

DRAM:  ECC disabled 512 MiB

MMC:   Card did not respond to voltage select!

sdhci@e0100000 - probe failed: -95

Card did not respond to voltage select!

[/code]

 

Then I transfer stage 3 over the jtag and after it transfers I get:

 

[code]

SF: Detected n25q128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB

Uncompressing Linux... done, booting the kernel.

 

Error: unrecognized/unsupported processor variant (0x413fc090).

[/code]

 

I am new to petalinux so am a bit lost here, does anyone have any advise at what I should be looking at?

 

Many thanks

 

Andy

acapon's picture
acapon
Junior(0)
Sorry about the formatting!

Sorry about the formatting!
 
I don't seem to be able to edit the post!

acapon's picture
acapon
Junior(0)
An Update:

An Update:
 
copying the image.ub via a usb stick and I can boot ok into 4.9.0-xilinx-v2017.2 so it looks like everything is building fine, it is just the transferring over jtag that seems to cause the problem.
 
A bit stumped here!

JFoster's picture
JFoster
Moderator(55)
Hello acapon,

Hello acapon,

MiniZed does not have a SD Card interface by nature, are you using a dfferent development platform?

--Josh

acapon's picture
acapon
Junior(0)
Hi Josh,

Hi Josh,
 
Thanks very much for your reply.
 
I am using a minized.
 
I am not using a SDCard.
 
I am trying to install via JTAG which doesn't work.
 
Copying the image.ug file via a usb memory stick to the EMMC does work though.
 
Or am I misunderstanding what you are saying?
 
Cheers
 
Andy

JFoster's picture
JFoster
Moderator(55)
Hello Andy,

Hello Andy,

My apologise, for some reason I read SD Card when you actually said USB stick.

That error is coming from the kernel. Are you sure you have the processor configured correctly?

Is your MiniZed set to JTAG boot when you attempt to boot over JTAG?

--Josh

acapon's picture
acapon
Junior(0)
Hi Josh,

Hi Josh,
 
Yes it is set to jtag, I am guessing that as I can boot from the same image.ug file when it is on the EMMC then the kernel is probably ok?
 
I am at the momment just using the verson from your github with the tag "hdl-minized_petalinux_MINIZED_20170810_010906", I have not changed anything. Just built the project in Vivado and tried to install it.
 
The problem only seems to happen when I use: "petalinux-boot --jtag --prebuilt 3" to copy the kernel over jtag.
 
I just also tried with UBOOT 2016.7 to see if that made a difference but I get the same problem
 
At least I can get in installed via the USB stick, but it does require more flaffing around.
 
Cheers
 
Andy
 
 

acapon's picture
acapon
Junior(0)
If I stop at zboot and use

If I stop at zboot and use bdInfo the arch_number is 0, could this be causing the issue with the jtag:
Zynq> bdinfo

arch_number = 0x00000000

boot_params = 0x00000000

DRAM bank   = 0x00000000

-> start    = 0x00000000

-> size     = 0x20000000

baudrate    = 115200 bps

TLB addr    = 0x1FFF0000

relocaddr   = 0x1FF67000

reloc off   = 0x1FB67000

irq_sp      = 0x1F356EE0

sp start    = 0x1F356ED0

ARM frequency = 666 MHz

DSP frequency = 0 MHz

DDR frequency = 533 MHz

 

stefanrousseau's picture
stefanrousseau
Junior(3)
MiniZed JTAG

If you are having issues with the MiniZed JTAG, you could make sure you are able to program by following the steps in the "Restore QSPI and eMMC Factory Images " document under Documents on the MiniZed page.  You have to be using 2017.1 or later tools of course to support MiniZed.  The document describes how to program using the command-line tool, XSCT, so that you do not need an existing Vivado or SDK project.  Please check whether this works for you.

 

stefanrousseau's picture
stefanrousseau
Junior(3)
Copying files over to eMMC

If your JTAG works, as per the steps in the document mentioned above, you can of course use it.  The most common way for MiniZed though, is over Wi-Fi.  With a known-good version running on MiniZed, you can execute #wifi.sh (with the right credentials in wpa_supplicant.conf).  Then you can copy your image (from PetaLinux build or created with SDK) over via Wi-Fi.  That process is also described in the Getting Started guide.

acapon's picture
acapon
Junior(0)
Hi Stefan,

Hi Stefan,
 
Thanks for the info. It does indeed work using the steps outlined in the restore document, that is how I have been able to check that the petalinux build is ok.
 
I didn't know you could copy it over wifi though, that is very usefull information thanks very much. I'll get a coffee and then look at the getting started guide for how to do this.
 
Thanks
 
Andy

acapon's picture
acapon
Junior(0)
Thanks to Stefan and Josh I

Thanks to Stefan and Josh I have managed to get this going without having to use the JTAG.
 
So as Stefan says as long as you have WIFI going on the board you can do it all over WIFI (thanks very much Stefan)
 
If you are changing the u-boot or bitstream you need a boot.bin file, you can get it like this:
 
petalinux-package --boot --fsbl 'images/linux/zynq_fsbl.elf' --fpga 'images/linux/minized_petalinux_wrapper.bit' --u-boot
 
 
You need to copy these files to the minized over wifi (mine is at 192.168.1.105):
 
scp images/linux/BOOT.BIN root@192.168.1.105:/mnt/emmc/smallboot.bin
scp images/linux/image.ub  root@192.168.1.105:/mnt/emmc/image.ub
 
 
Then if you have changed the boot.bin you need to copy it to the QSPI on the minized:
 
flashcp /mnt/emmc/smallboot.bin /dev/mtd0
 
Then reboot the minized with fingers crossed.
 
Andy