sama5d4 serial flash not working.

Discussion around products based on ARM Cortex-A5 core.

Moderator: nferre

nveeramallu
Posts: 4
Joined: Fri Jun 03, 2016 11:59 am

sama5d4 serial flash not working.

Fri Jun 03, 2016 3:30 pm

Hi,

Serial flash init is failing with "unrecognized JEDEC id" where as flashchip(at25df321a) support is already available in m25p80.c and spi-nor.c

atmel_spi f8010000.spi: version: 0x221
atmel_spi f8010000.spi: Using dma0chan3 (tx) and dma0chan4 (rx) for DMA transfers
atmel_spi f8010000.spi: Atmel SPI Controller at 0xf8010000 (irq 30)
m25p80 spi32766.0: unrecognized JEDEC id bytes: 00, 0, 0
atmel_spi fc018000.spi: version: 0x221
atmel_spi fc018000.spi: Using dma0chan5 (tx) and dma0chan6 (rx) for DMA transfers
atmel_spi fc018000.spi: Atmel SPI Controller at 0xfc018000 (irq 37)


root@atmel-sama5d4-xplained:~# zcat /proc/config.gz | grep -i spi
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
# CAN SPI interfaces
CONFIG_REGMAP_SPI=y
CONFIG_MTD_SPI_NOR=y
# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
CONFIG_SPI_ATMEL_QUADSPI=y
# CONFIG_BMP085_SPI is not set
# CONFIG_SENSORS_LIS3_SPI is not set
# CONFIG_SCSI_SPI_ATTRS is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y
# SPI Master Controller Drivers
# CONFIG_SPI_ALTERA is not set
CONFIG_SPI_ATMEL=y
CONFIG_SPI_BITBANG=y
# CONFIG_SPI_CADENCE is not set
CONFIG_SPI_GPIO=y
# CONFIG_SPI_FSL_SPI is not set
# CONFIG_SPI_OC_TINY is not set
# CONFIG_SPI_PXA2XX_PCI is not set
# CONFIG_SPI_ROCKCHIP is not set
# CONFIG_SPI_SC18IS602 is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set
# SPI Protocol Masters
CONFIG_SPI_SPIDEV=m
# CONFIG_SPI_TLE62X0 is not set
# SPI GPIO expanders
# CONFIG_MFD_DA9052_SPI is not set
# CONFIG_MFD_MC13XXX_SPI is not set
# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_ARIZONA_SPI is not set
# CONFIG_MFD_WM831X_SPI is not set
CONFIG_SND_SPI=y
CONFIG_SND_SOC_I2C_AND_SPI=y
# CONFIG_SND_SOC_CS4271_SPI is not set
# CONFIG_SND_SOC_PCM512x_SPI is not set
# CONFIG_SND_SOC_RT5677_SPI is not set
# CONFIG_SND_SOC_SSM2602_SPI is not set
# CONFIG_SND_SOC_TLV320AIC23_SPI is not set
# CONFIG_SND_SOC_WM8804_SPI is not set
# CONFIG_MMC_SPI is not set
# SPI RTC drivers
# CONFIG_SENSORS_HMC5843_SPI is not set
# CONFIG_MTD_SPINAND_MT29F is not set
# CONFIG_WILC1000_SPI is not set
# Hardware Spinlock drivers
# CONFIG_AD5624R_SPI is not set
# Lock Debugging (spinlocks, mutexes, etc...)
# CONFIG_DEBUG_SPINLOCK is not set

hardware : Atmel SAMA5D4 XPLAINED target
Kernel: linux 4.1 from git://github.com/linux4sam/linux-at91.git

Anyone else faced the same issue??

Thanks in advance.

Regards,
nveeramallu
blue_z
Location: USA
Posts: 2128
Joined: Thu Apr 19, 2007 10:15 pm

Re: sama5d4 serial flash not working.

Fri Jun 03, 2016 9:03 pm

nveeramallu wrote: Serial flash init is failing with "unrecognized JEDEC id" ...

hardware : Atmel SAMA5D4 XPLAINED target
Why do you think that there's a serial flash chip on that board?

Regards
nveeramallu
Posts: 4
Joined: Fri Jun 03, 2016 11:59 am

Re: sama5d4 serial flash not working.

Mon Jun 06, 2016 10:49 am

According to sama5d4 user manual(page 16) and datasheet(page 1780), serial flash is supported and flash chip AT25DF321A has been used. AT25DF321 is a serial interface Flash memory device and same verified on
arch/arm/boot/dts/at91-sama5d4_xplained.dts

Is there any other way i can verify the same.

user manual
http://www.atmel.com/images/atmel-44005 ... -guide.pdf
datasheet:
http://www.atmel.com/images/Atmel-11238 ... asheet.pdf


Thanks.
blue_z
Location: USA
Posts: 2128
Joined: Thu Apr 19, 2007 10:15 pm

Re: sama5d4 serial flash not working.

Mon Jun 06, 2016 8:38 pm

nveeramallu wrote:According to sama5d4 user manual(page 16) and datasheet(page 1780), serial flash is supported and flash chip AT25DF321A has been used.
Yes, serial flash is supported by the embedded RomBOOT of the SAMA5D4.
Yes, the SAMA5D4-XULT user manual does mention serial flash, but as far as I can tell, the salient word optional is alway used.
The board schematic indicates that the serial flash IC is "DNP", for "do not populate".
nveeramallu wrote:Is there any other way i can verify the same.
Have you performed a visual inspection of the board?
IOW expect to find a Dataflash chip only if you/someone has soldered one onto your board. The board as shipped by Atmel doesn't come with one.

Regards
nveeramallu
Posts: 4
Joined: Fri Jun 03, 2016 11:59 am

Re: sama5d4 serial flash not working.

Tue Jun 07, 2016 2:34 pm

Thanks for the info, Looks like my board doesn't have serial flash.

Is it same with TWI EEPROM as well ?

In the userguide its mentioned as board have AT24MAC402/602 EEPROM using a TWI0 interface. But i am unable to get the at24 device on linux-at91 SDK.

Thanks.
blue_z
Location: USA
Posts: 2128
Joined: Thu Apr 19, 2007 10:15 pm

Re: sama5d4 serial flash not working.

Wed Jun 08, 2016 1:10 am

nveeramallu wrote:Is it same with TWI EEPROM as well ?
Check the board schematic and/or perform a visual inspection.
nveeramallu wrote:But i am unable to get the at24 device on linux-at91 SDK.
You're not clear as to what you're trying to do.
The simplest way to check HW functionality is to use U-Boot.
For I2C start with the `i2c probe` command (since the board documentation neglects to provide an address map).

Code: Select all

=> i2c dev  
Current bus is 0
=> i2c probe                                                                    
Valid chip addresses: 34 54 5C                                                  
=> i2c md 34 0 10
0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
=> i2c md 54 2 12
0002: 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11    ................
0012: 12 13    ..
=> i2c md 5c 0 10
Error reading the chip: 1
=> 
Regards
nveeramallu
Posts: 4
Joined: Fri Jun 03, 2016 11:59 am

Re: sama5d4 serial flash not working.

Thu Jun 09, 2016 3:36 pm

blue_z wrote:
nveeramallu wrote:---> According to sama5d4 user manual(page 16) and datasheet(page 1780), serial flash is supported and flash chip AT25DF321A has been used.

Yes, serial flash is supported by the embedded RomBOOT of the SAMA5D4.
Yes, the SAMA5D4-XULT user manual does mention serial flash, but as far as I can tell, the salient word optional is alway used.
The board schematic indicates that the serial flash IC is "DNP", for "do not populate".

---> Is there any other way i can verify the same.

Have you performed a visual inspection of the board?
IOW expect to find a Dataflash chip only if you/someone has soldered one onto your board. The board as shipped by Atmel doesn't come with one.
I think board have serial flash, when i boot the target with linux-3.10-at91 kernel able to detect the flash but facing issue while erasing the same.

Code: Select all

root@atmel-sama5d4-xplained:/opt# dmesg | grep -i spi
[    0.720000] atmel_spi f8010000.spi: version: 0x221
[    0.720000] atmel_spi f8010000.spi: Using dma0chan1 (tx) and dma0chan2 (rx) for DMA transfers
[    0.730000] atmel_spi f8010000.spi: Atmel SPI Controller at 0xf8010000 (irq 20)
[    0.730000] atmel_spi f8010000.spi: master is unqueued, this is deprecated
[    0.740000] m25p80 spi32766.0: found mr25h256, expected at25df321a
[    0.750000] m25p80 spi32766.0: mr25h256 (32 Kbytes)
root@atmel-sama5d4-xplained:/opt# flash_erase /dev/mtd6 0 0
Erasing 32 Kibyte @ 0 --  0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 0 (mtd6)
        error 5 (Input/output error)
flash_erase: error!: /dev/mtd6: MTD Erase failure
             error 5 (Input/output error)
Erasing 32 Kibyte @ 0 -- 100 % complete 
root@atmel-sama5d4-xplained:/opt# mount -t jffs2 /dev/mtdblock6 /mnt/disk/
jffs2: Too few erase blocks (1)
mount: wrong fs type, bad option, bad superblock on /dev/mtdblock6,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
tsvoipio
Posts: 56
Joined: Wed Aug 19, 2015 9:44 pm

Re: sama5d4 serial flash not working.

Thu Jun 09, 2016 8:32 pm

nveeramallu wrote:
blue_z wrote:
nveeramallu wrote:---> According to sama5d4 user manual(page 16) and datasheet(page 1780), serial flash is supported and flash chip AT25DF321A has been used.

code]root@atmel-sama5d4-xplained:/opt# dmesg | grep -i spi
[ 0.720000] atmel_spi f8010000.spi: version: 0x221
[ 0.720000] atmel_spi f8010000.spi: Using dma0chan1 (tx) and dma0chan2 (rx) for DMA transfers
[ 0.730000] atmel_spi f8010000.spi: Atmel SPI Controller at 0xf8010000 (irq 20)
[ 0.730000] atmel_spi f8010000.spi: master is unqueued, this is deprecated
[ 0.740000] m25p80 spi32766.0: found mr25h256, expected at25df321a
[ 0.750000] m25p80 spi32766.0: mr25h256 (32 Kbytes)
root@atmel-sama5d4-xplained:/opt# flash_erase /dev/mtd6 0 0
[/code]
Your system is prepared to handle an at25df321a Flash chip, but there is a mr25h256 magnetoresistive NVRAM. Have you checked from the data sheets that they can be handled in a similar way?

--

-TV
blue_z
Location: USA
Posts: 2128
Joined: Thu Apr 19, 2007 10:15 pm

Re: sama5d4 serial flash not working.

Fri Jun 10, 2016 1:23 am

nveeramallu wrote:I think board have serial flash, when i boot the target with linux-3.10-at91 kernel able to detect the flash ...
Garbage in, garbage out.

Obviously you haven't performed a visual inspection of your board.

The board user guide conveniently has the salient part of the schematic isolated for you:
Image


From this you get the component ID of U5 for the serial flash chip.
So then look for that U5 component using the silkscreen on your board.

Image

Regards
Last edited by blue_z on Mon Jun 13, 2016 8:07 pm, edited 1 time in total.
nferre
Site Admin
Posts: 223
Joined: Wed Feb 14, 2007 11:17 am

Re: sama5d4 serial flash not working.

Mon Jun 13, 2016 1:37 pm

Hi,

Try accessing the AT24MAC i2c eeprom with MAC address with this command under Linux (5.3 demo works great with this):
i2cget -y 0 0x5c 0x9a

You'll get 0xfc which is the censored byte of the unique MAC address stored in this i2c component.

The eeprom part of the flash is at another location but at lease it will give you the proof that the component is present.

Bye,

Return to “SAMA5D Cortex-A5 MPU”

Who is online

Users browsing this forum: No registered users and 1 guest