element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Software Application Development Steps to get WLINK using Petalinux on MicroZed
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 4 replies
  • Subscribers 329 subscribers
  • Views 439 views
  • Users 0 members are here
Related

Steps to get WLINK using Petalinux on MicroZed

Former Member
Former Member over 10 years ago

Greetings all,

I have seen snippets of getting the TI WLINK working with the microzed board but I was wondering if anyone had more detailed instructions. I am new to petalinux and am a bit confused on how to go.

Here is what I have done so far.

I tested the Wireless link on the microzed using the standard files with changes to support the wireless. I was able to connect to a WPA network using iw and wpa_supplicant.

I now have a petalinux build on the SD card. This uses the pre-build BOOT.bin and my own image.ub based upon the microzed BSP.

I have modified the setup-env script to point to the xilinx build tools, the rootfs in the petalinux project and to point to the petalinux kernel.

I have run the init scipts successfully but when I try to build I get the following errors...

Verifying filesystem skeleton...
ERROR  /home/woody/Embedded/software/linux/projects/mz-7z020/build/linux/rootfs/lib/modules/20144317..*/updates/drivers/net/wireless/ti/wl18xx/wl18xx.ko  Not found !
md5sum: /home/woody/Embedded/software/linux/projects/mz-7z020/build/linux/rootfs/lib/modules/20144317..*/updates/drivers/net/wireless/ti/wl18xx/wl18xx.ko: No such file or directory
./_build_with_sudo.sh: line 729: [: !=: unary operator expected
ERROR  /home/woody/Embedded/software/linux/projects/mz-7z020/build/linux/rootfs/lib/modules/20144317..*/updates/drivers/net/wireless/ti/wlcore/wlcore.ko  Not found !

I think the problem is in my .config file.

Also will need to update the dts file, can someone advise on how to properly do that.

Thanks,
John




Thanks for any help.
John

  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 9 years ago in reply to Former Member +1
    I have it working, here are the detailed stepss to build Petalinux 2014.4, release 8.6 of the TI drivers for microzed. Here is a summary of the steps I had to implement to get Petalinux 2014.4 and Wilink…
  • Former Member
    0 Former Member over 10 years ago

    Ok I think I have teh device tree modified, I did not realize that new items needed to be in the first set of curly braces.

    I am having trouble setting the necessary configuration items for the kernel.  If I use the TI script, the items get written but then get overwritten if I do a petalinux-build.  I assume I want to modify the configs, build the kernel with the new configs and then build the TI drivers but I am having trouble matching config items with petalinux config.  If I manually modify the config file in the petalinux subsystem tree I get build errors

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago in reply to Former Member

    I have it working, here are the detailed stepss to build Petalinux 2014.4, release 8.6 of the TI drivers for microzed.

    Here is a summary of the steps I had to implement to get Petalinux 2014.4 and Wilink adapter working on the Microzed.

    Step 1. Download the TI driver using the build utilities script.

    git://git.ti.com/wilink8-wlan/build-utilites.git

    Step 2. Apply patch to kernel

    Allow subnodes for wlcore to be used with SDIO, this patch is included in the above build utilities, note that it will not be applied automatically since the xlnx-3.17 kernel does not have patches associated with it.

    Step 3. Reconfigure the kernel

    Enable the necessary settings, I was able to find all but one setting in the petalinux configuration this was CONFIG_
    WIRELESS_EXT.  In petalinux this appears to be private.  To make this visible I modified the Kconfig in components/linux-kernel/xlnx-3.17/net/wireless/  as shown

    config WIRELESS_EXT
        bool    "Enable Wireless Extentions"
        default n

    Then run petalinux-config -c kernel, each line shows the text menu items

    Cryptographic API

    CCM Support

    GCM Support

    EC8 Support

    Michael Mic keyed digest algorithm

    Arc4 cipher algorithm

    Library Functions

    CRC 7 Functions

    Device Drivers

    Input Device Support

    Misc...Devices

    User Level Driver Support

    Networking

    RF Switch subsystem support

    Security Options

    Enable Access Key Retention Support

    Enable Different Security Modules

    Step 4. Build Petalinux with these settings

    Step 5. Modify setup-env

    In this case I have created a petalinux app that will copy the fs directory to the TARGET ROOT, this allows me to make updates to the configuration without wiping out files I put directly into target root.  My setup-env is shown below.  I will cover the app for copying later.

                                //
    #                           -(o o)-
    #========================oOO==(_)==OOo=======================
    # This file contains the exports needed for automating the
    # build process of WLAN components.
    # Place this file in the same directory with wl18xx_build.sh
    # build scripts. No need to run 'source setup-env', the build
    # scripts will perfom it internaly.
    #===========================================================
    # User specific environment settings - use full PATH

    # if DEFAULT toolchain path is set toolchain will be downloaded to ./toolchain.
    export TOOLCHAIN_PATH=/opt/pkg/petalinux-v2014.4-final/tools/linux-i386/arm-xilinx-linux-gnueabi/bin

    # if DEFAULT path to root filesystem is set ./fs folder will be used.
    export ROOTFS=~/Embedded/wlink_test/software/wlink/components/apps/wireless/fs
    #export ROOTFS=DEFAULT

    #if DEFAULT kernel path is set - kernel will be downloaded (set branch to match kernel version)
    export KERNEL_PATH=~/Embedded/wlink_test/software/wlink/build/linux/kernel/xlnx-3.17

    # if KERNEL_VARIANT below is set the build script will look for kernel specific
    # patches under the patches directory:
    # - patches under the pathces/driver_patches/$KERNEL_VARIANT directory would be
    #   applied during "modules" build.
    # - patches under the patches/kernel_patches/$/$KERNEL_VARIANT directory would
    #   be applied to the kernel pointed by KERNEL_PATH in case the "patch_kernel"
    #   command is used.
    #   Note: the kernel is not built automatically after the patches are applied
    export KERNEL_VARIANT=xlnx-3.17

    export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
    export ARCH=arm
    [ "$TOOLCHAIN_PATH" != "DEFAULT" ] && export PATH=$TOOLCHAIN_PATH:$PATH

    Step 6. Create Petalinux App

    a. I created a petalinux app called wireless, deleted the C file and modified the make file as shown

    b. create fs subdriectory for copying files in

    ifndef PETALINUX
    $(error "Error: PETALINUX environment variable not set.  Change to the root of your PetaLinux install, and source the settings.sh file")
    endif

    include apps.common.mk

    APP = settings

    all: build install

    .PHONY: build
    build:

    install:
        # Copy settings files to the rootfs.
        cp -r ./fs/* $(TARGETDIR)


    clean:

    Step 7.  Add startup of modules to /etc/modules in fs directory

    # /etc/modules: kernel modules to load at boot time.
    #
    # This file contains the names of kernel modules that should be loaded
    # at boot time, one per line. Lines beginning with "#" are ignored.
    # Parameters can be specified after the module name.

    wlcore_sdio
    wl18xx


    Step 8. Add wl18xx-conf.bin to fs directory (need to generate this)

    /fs/lib/firmware/ti-connectivity/wl18xx-conf.bin

    Step 9. Run the build script using update R8.6

    Step 9. Fix issue with Precistion Timing GPIO

    When going to 8.6 there is a new requirement for a GPIO which is not on the microzed for a precision timing output.  This will preclude the driver from loading.  Comment out the request for this line in the following file.

    src/driver//drivers/net/wireless/ti/wlcore/main.c (approx line 6450)

    #if 0  <--- do this
        /* time sync */
        wl->time_sync.gpio = 66;
        ret = gpio_request_one(wl->time_sync.gpio, GPIOF_DIR_OUT, "time_sync");
        if (ret < 0) {
            wl1271_error("error requesting time_sync gpio");
            goto err_buffer_32;
        }
        wl1271_info("Time Sync: gpio requested");
    #endif <--- and this

    Step 10. Rebuild the TI drivers,

    Do not use update or your change will be lost

    Step 11. Update device tree.

    All the info I found was for flat trees, this is the latest format assuming using the petalinux structure for a microzed, you should only need to change which SDIO you are using and which gpio pin is used for enable and which is used for the interrupt for a custom board...

    /dts-v1/;
    /include/ "system-conf.dtsi"
    / {
        wlan_en: fixedregulator@2 {
            compatible = "regulator-fixed";
            regulator-name = "wlan-en-regulator";
            regulator-min-microvolt = <0x325aa0>;
            regulator-max-microvolt = <0x325aa0>;
            gpio = <&gpio0 0x9 0x4>;              <<<<<<<<< gpio 9
            startup-delay-us = <0x11170>;
            enable-active-high;
        };
    };

    &gem0 {
        phy-handle = <&phy0>;
        phy-mode = "rgmii-id";
           
        mdio {
            #address-cells = <1>;
            #size-cells = <0>;
            phy0: phy@0 {
                compatible = "marvell,88e1510";
                device_type = "ethernet-phy";
                reg = <0x0>;
                marvell,reg-init = <3 16 0xff00 0x1e 3 17 0xfff0 0x00>;
            };
        };
    };

    &qspi {
        flash0: flash@0 {
                      compatible = "micron,n25q128a13";
        };
    };

    &gpio0 {                               <<<<< make gpio an int controller for gpio ints
    interrupt-controller;
        #interrupt-cells = <2>;
    };

    &sdhci1{                                         <<<<<<< SDIO 1
        vmmc-supply = <&wlan_en>;
        bus-width = <4>;
        ti,non-removable;
        ti,needs-special-hs-handling;
        cap-power-off-card;
        keep-power-in-suspend;

        #address-cells = <1>;
        #size-cells = <0>;

        wlcore: wlcore@0 {
            compatible = "ti,wl1835";
            interrupt-parent = <&gpio0>;
            interrupts = <0 4>;                        <<<<<<GPIO pin 0, note GPIO is used as int parent
            reg = <2>;
            platform-quirks = <0x1>;
            board-ref-clock = <0x4>;
        };
    };

    &uart0 {
        current-speed = <115200>;
        device_type = "serial";
        port-number = <1>;
        status = "disabled";
    };

    Step 12. Image will be too big

    If using the default settings for memory, I wont go into alot of detail since this is well documented but loadaddr and netstart will need to be modified to allow copying the image, this is accomplished through petalinux config.

    You will need to regenerate BOOT.BIN to load the new kernel.

    You will also need to modify the MACRO CONFIG_SYS_BOOT_LEN which is not accessible is petalinux config, it can be changed bu editing the platform-top in the u-boot files.  All other files are generated so this can not be done where it is initially defined by petalinux.  Modify it as such

    ./subsystems/linux/configs/u-boot/platform-top.h ---

    #include <configs/platform-auto.h>

    #undef CONFIG_SYS_BOOTM_LEN

    /* Make the BOOTM LEN big enough for the compressed image */
    #define CONFIG_SYS_BOOTM_LEN 0x4000000

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • hai.bi
    0 hai.bi over 9 years ago in reply to Former Member

    I used git but the build utilities I got has no folder called build-utilities.  It only has patches in some sub folders.  Is it supposed to get you the source code instead of just patches?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • hai.bi
    0 hai.bi over 9 years ago in reply to Former Member

    I finally can get to the git, which is simple using web.  But my question is, in step 2, which patch file did you use to apply?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube