BBB emmc booting and SPI0 nor flash

Hi,

I connected SPI-nor flash with BBB. The SPI-nor flash is SST25VF080B. When I boot the BBB with SDCard mode, the communication with spi0-nor flash is OK. But, when I boot the BBB with eMMC mode with same kernel, the commuincation with spi0-nor flash is NOT ok. (BBB cannot read the chip ID of the flash).

This is log of SD card mode booting:

[ 2.419205] spi-nor spi0.0: sst25vf080b (1024 Kbytes) [ 2.424333] 2 fixed-partitions partitions found on MTD device spi0.0 [ 2.430748] Creating 2 MTD partitions on “spi0.0”: [ 2.435601] 0x000000000000-0x000000010000 : “partition1” [ 2.447042] 0x000000010000-0x000000020000 : “partition2”

This is log of eMMC mode booting:

[ 2.423553] spi-nor spi0.0: unrecognized JEDEC id bytes: 00 00 00 00 00 00 [ 2.430502] spi-nor: probe of spi0.0 failed with error -2

How can I resolve this problem? Can you give me an inforamtion on this case?

J.Hwan Kim

I found the pinmux state is differnet between the emmc boot and sd card boot.
I set the spi0 pins (/ce, sclk, d1, d0) with MODE0 in am335x-bone-common.dtsi.

When the board runs in sd card boot, the spi0 pins mode is MODE 0.
but in emmc boot, the spi0 pins mode is MODE 7.
So, in emmc boot mode, I cannot access to spi-nor flash.

I set the pin mux state in am335x0-bone-common.dtsi like this:

spi0_pins: spi0_pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_SPI0_SCLK, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_SPI0_D0, PIN_INPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_SPI0_D1, PIN_OUTPUT_PULLUP, MUX_MODE0)
AM33XX_PADCONF(AM335X_PIN_SPI0_CS0, PIN_OUTPUT_PULLUP, MUX_MODE0)

;
};

&spi0 {
pinctrl-name = “default”;
pinctrl-0 = <&spi0_pins>;
status = “okay”;

spi-flash@0 {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = “jedec,spi-nor”;
reg = <0x0>;
spi-max-frequency = <500000>;
partition@0 {
label = “partition1”;
reg = <0x0 0x10000>;
};
partition@200000 {
label = “partition2”;
reg = <0x10000 0x10000>;
};
};
};

I don’t know why the pin mode state is different between the emmc and sd card boot mode.
Is there any factor to effect for the spi0 pins mode to differ beween emmc and sd card boot?

Thanks in advance.
J.Hwan Kim

2021년 2월 2일 화요일 오전 10시 16분 35초 UTC+9에 JeongHwan Kim님이 작성:

I'm betting your version of u-boot on the eMMC and microsd are different..

Regards,

Thanks for reply.

The version of u-boot on the eMMC and SD card is same.

On the u-boot log, two versions all print as follows:

U-Boot SPL 2019.04-dirty (Jun 22 2020 - 19:46:08 +0900)
U-Boot 2019.04-dirty (Jun 22 2020 - 19:46:08 +0900)

I fused emmc with the scrypt of "bbb-eMMC-flasher-eewiki-ext4.sh".

Best Regards,

J.Hwan Kim

I found the reason.

There was typo in device tree.

pinctrl-name = “default”; → typo of pinctrl-names
The problem is fixed.
Thanks

2021년 2월 8일 월요일 오전 11시 45분 6초 UTC+9에 JeongHwan Kim님이 작성: