OpenWrt Forum Archive

Topic: U-boot and Kernel image.

The content of this topic has been archived between 23 Apr 2018 and 6 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

pradeepsysargus wrote:

Let me know how do I see the USB pen drive data on the LUCI interface.

Start here

I suppose I need to connect the board to internet to install required packages using 'opkg' for USB storage.
Eg: opkg install kmod-usb-storage

I connected the board to a office router using ethernet cable.
I suppose some settings are left before I can actually connect the board to the internet.
I am able to login to the board using ssh.

Rgds,

I am able to see the USB pen drive data in the Samba Share drive as pointed by you. I am able to see the USB data in an android app - BubbleUPnP using miniDLNA.

Can you tell about micro SD card as well ? It has a SPI interface with RT5350 chipset.

Rgds,

We have built a board based on RT5350 chipset and taking RT5350F-OLinuXino-EVB as reference design.

We are having a problem detecting the flash chip using Jtag(Jtag connector pins to RT5350 dedicated Jtag pins) or Jtag to SPI pins(as in OLinuXino board).

When using flashrom, it is unable to detect the flash chip. It is as if there is no board connected to the Jtag connector.
I am using the below command in Ubuntu Linux:

flashrom -p ft2232_spi:type=arm-usb-ocd -c EN25Q64

I am getting the below error message:

flashrom v0.9.9-r1954 on Linux 3.16.0-33-generic (i686)
flashrom is free software, get the source code at https://flashrom.org

Calibrating delay loop... OK.
No EEPROM/flash device found.
Note: flashrom can never write if the flash chip isn't found automatically.

Let us know ur inputs in this regard if it is possible for u.

Thanks,

Can you post full autodetect output of flashrom?

We are able to program SPI-flash directly by connecting ARM-USB-OCD with SPI lines.
We are using the following commands to find and write to the flash:

flashrom -p ft2232_spi:type=arm-usb-ocd -c EN25Q64
flashrom -p ft2232_spi:type=arm-usb-ocd -w BinaryFile.bin

Is it possible to program the SPI-flash using ARM-USB-OCD using RT5350 Jtag connector with the same commands.?

Please suggest.

Thanks,

I have an issue with SD card detection.

I install the package luci-app-mmc-over-gpio
I get web interface that allows me to select the pins for DI,DO,CLK,CS.

I am using GPIO#4  for CLK.
                  GPIO#5  for  DI
                  GPIO#6   for DO.
                  GPIO#27  for CS.

The SD card is connected with an SPI interface with RT5350 chipset.
When I reboot the router after pin mapping, I am getting the below error:

gpio-mmc: Failed to request mmc_spi module.
rt2880-pinmux pinctrl: pin 4 is not set to gpio mux
rt2880-pinmux pinctrl: request() failed for pin 4
rt2880-pinmux pinctrl: pin-4 (pio:4) status -22
spi-gpio: probe of spi-gpio.0 failed with error -22
gpio-mmc: MMC-Card "default" attached to GPIO pins di=5, do=6, clk=4, cs=27
rt305x-esw 10110000.esw: link changed 0x00

Just in case, I installed the additional packages kmod-nls-cp850 and kmod-nls-iso8859-15.

I am still getting the same error as I described.
One thing is the same SPI interface(MISO,MOSI,CLK) are common pins between flash memory and SD card.

I followed the instructions at http://warrantyvoidifremoved.blogspot.i … onera.html

pradeepsysargus wrote:

flashrom -p ft2232_spi:type=arm-usb-ocd -c EN25Q64
flashrom -p ft2232_spi:type=arm-usb-ocd -w BinaryFile.bin

Is it possible to program the SPI-flash using ARM-USB-OCD using RT5350 Jtag connector with the same commands.?

I think no. flashrom use SPI-protocol only.

I install the package luci-app-mmc-over-gpio
I get web interface that allows me to select the pins for DI,DO,CLK,CS.

mmc-over-gpio may use any free gpio. gpio 4,5,6  are occupied by SPI-controller already. rt5350 have second SPI-controller on the same bus and additional cs1 but openwrt don't support this config.

We have connected SD card with 4 free gpios (GPIO#7,#9,#11,#13).
These GPIOs are of UARTF port. They are DTR_N,RTS_N,DSR_N,CTS_N.
UARTF is in GPIO mode as I dumped the register GPIOMODE (0x1000_0060). It is defined as gpio in HT-TM02.dts file as below:

pinctrl {
        state_default: pinctrl0 {
            gpio {
                ralink,group = "i2c", "jtag", "uartf";
                ralink,function = "gpio";
            };
        };
    };

Currently, getting the below error in dmesg:

gpiommc gpiommc.0: no of_node; not parsing pinctrl DT
gpio-mmc: Failed to request mmc_spi module.
spi-gpio spi-gpio.0: no of_node; not parsing pinctrl DT
rt2880-pinmux pinctrl: request pin 13 (io13) for pio:13
spi-gpio: probe of spi-gpio.0 failed with error -16
gpio-mmc: MMC-Card "default1" attached to GPIO pins di=7, do=9, clk=13, cs=11

Any clues about this error?

Thanks,

I am using HT-TM02.dts file as it is without modification so far.

Should I add any SD card related code in this file ?

The default HT-TM02.dts file is:

/dts-v1/;

/include/ "rt5350.dtsi"

/ {
    compatible = "HT-TM02", "ralink,rt5350-soc";
    model = "HooToo HT-TM02";

    palmbus@10000000 {
        gpio0: gpio@600 {
            status = "okay";
        };
        spi@b00 {
            status = "okay";
            m25p80@0 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "mx25l6405d";
                reg = <0 0>;
                linux,modalias = "m25p80", "mx25l6405d";
                spi-max-frequency = <10000000>;
                partition@0 {
                    label = "u-boot";
                    reg = <0x0 0x30000>;
                    read-only;
                };
                partition@30000 {
                    label = "u-boot-env";
                    reg = <0x30000 0x10000>;
                    read-only;
                };
                factory: partition@40000 {
                    label = "factory";
                    reg = <0x40000 0x10000>;
                    read-only;
                };
                partition@50000 {
                    label = "firmware";
                    reg = <0x50000 0x7b0000>;
                };
            };
        };
    };

    pinctrl {
        state_default: pinctrl0 {
            gpio {
                ralink,group = "i2c", "jtag", "uartf";
                ralink,function = "gpio";
            };
        };
    };

    ethernet@10100000 {
        mtd-mac-address = <&factory 0x28>;
    };

    esw@10110000 {
        ralink,portmap = <0x10>;
        ralink,portdisable = <0x2f>;
    };

    wmac@10180000 {
        ralink,mtd-eeprom = <&factory 0>;
    };

    ehci@101c0000 {
        status = "okay";
    };

    ohci@101c1000 {
        status = "okay";
    };

    gpio-leds {
        compatible = "gpio-leds";
        wlan {
            label = "ht-tm02:blue:wlan";
            gpios = <&gpio0 7 1>;
        };
        lan {
            label = "ht-tm02:green:lan";
            gpios = <&gpio0 12 1>;
        };

    };

    gpio-keys-polled {
        compatible = "gpio-keys-polled";
        #address-cells = <1>;
        #size-cells = <0>;
        poll-interval = <20>;
        reset {
            label = "reset";
            gpios = <&gpio0 10 1>;
            linux,code = <0x198>;
        };
        modeswitch {
            label = "modeswitch";
            gpios = <&gpio0 14 1>;
            linux,code = <0x100>;
            linux,input-type = <5>;
        };
    };
};

Rgds,

When we use the jtag pins which are defined as gpio in the .dts file, we are able to detect the SD card.

Rgds,

During initial boot up, the micro-SD card is being detected, If I remove the card, mmcblk0p1 is not de-allocated  - I mean there are no kernel messages.
If I insert the card again, I dont see any kernel messages either ....

There is a problem with card insertion and removal detection.

We connected the CD, CD1 (Card Detect,Card Detect1) pins to the GPIO pins of RT5350 chipset.

I suppose, I need to connect CD to the input GPIO pin of the processor, but then how do I read the state of the pin etc..

Thanks,

(Last edited by pradeepsysargus on 14 Oct 2016, 09:31)

For any free gpio N you can

echo N >/sys/class/gpio/export
echo in >/sys/class/gpio/gpioN/direction
cat /sys/class/gpio/gpioN/value

to see current state of the gpo-pin (change N to your number).
Or define pseudo button "carddetect" in dts-file and put your action into /etc/rc.button/carddetect. It will be started by system at any changed state of your pseudo button.

I can now read the CD(Card Detect) pin value as '1' or '0' based on the insertion or removal of SD card.

If I remove the SD card, I will read the pin value and stop the mmc_over_gpio service. (/etc/init.d/mmc_over_gpio stop)
If I plug-in the SD card, I will read the pin value and start the mmc_over_gpio service  (/etc/init.d/mmc_over_gpio start)

Assuming I wrote this script or the set of commands of the above process, where do I put these commands on a live board?

I guess the processor has to poll the gpio pin (CD) to see if it is high or low.

Please suggest.

Thanks,

I added the label 'carddetect' in the dts file as below:

    gpio-keys-polled {
        compatible = "gpio-keys-polled";
        #address-cells = <1>;
        #size-cells = <0>;
        poll-interval = <20>;
        reset {
            label = "reset";
            gpios = <&gpio0 10 1>;
            linux,code = <0x198>;
        };
        carddetect {
             label = "carddetect";
             gpios = <&gpio0 9 0>;
             linux,code = <0x198>;
        };
        modeswitch {
            label = "modeswitch";
            gpios = <&gpio0 14 1>;
            linux,code = <0x100>;
            linux,input-type = <5>;
        };
    };

I am using GPIO#9 as input for card detection.

What should be the action script, can you sort of show an example for me ?

Thanks,

(Last edited by pradeepsysargus on 15 Oct 2016, 11:48)

I am streaming content from USB pen drive with Samba Server over wifi to mobile phone.

I am getting an outbound data rate of 10 Mbps (Average) in Real time Graphs section in Openwrt Luci web interface for RT5350F-OLinuXino-EVB. This is a good rate as I can stream videos at a time in 3 mobile phones using a Samba client Android app.

I am getting an outbound data rate of 500 Kbps(Average) in Real time Graphs section in Openwrt Luci web interface for our own hardware design.

Our antenna section design is same as the Olimex board, with an exception that we are using a paper antenna while Olimex is using an on-board antenna.

Is it a hardware or software problem?

The other issues: a) It takes some time for establishing connection to mobiles. b) The wifi network donot connect to the laptops (only to mobiles).

Please suggest.

The discussion might have continued from here.