External SPI Flash issue

8 posts / 0 new
Last post
kenneth.er
Offline
Last seen:4 years 9 months ago
加入:2015-09-03 15:31
External SPI Flash issue

Hi there,

I have made a custom board with the Winbond W25X10 (2-MBit) SPI flash module (USON8 footprint). My SPI pinout is the same as the Basic Dev kit (SCLK = P0.0, CS = P0.3, MISO = P0.5, MOSI = P0.6). When I read the flash module with the SPI _flash example project (provided within the SDK5.0.2.1 folder), I can read the flash unique ID and manufacturer ID, and the SPI flash module pass the test for unprotected and protected w/r. However, when I try to read it with the smart snippet v3.9, all I get is rubbish (I have the correct SPI setting) and I can't erase the sector (err: Verification failed at address 0x00). Any idea what could be causing this problem? Thank you!

The test result from the SPI_flash project.
************

* SPI TEST *

************

Reading SPI Flash first 256 bytes...FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

Bytes Read: 0x0100

SPI flash JEDEC ID is EF3012

You are using W25X10 (2-MBit) SPI flash device.

SPI flash Manufacturer/Device ID is EF11

SPI flash Unique ID Number is D5657440C39A8A36

Performing Program Page...Page programmed. (00)

Reading SPI Flash first 256 bytes...00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF

Bytes Read: 0x0100

Performing Sector Erase...Sector erased. (00)

Performing 512 byte write...Data written. (00)

Reading SPI Flash first 512 bytes...00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF

Bytes Read: 0x0200

W25X20 SPI memory protection features demo.

1) Unprotecting the whole memory array and doing a full erase

2) Retrieving the two bytes at addresses 0x00000 and 0x20000

Reading [0x00000] = 0xFF and [0x20000] = 0xFF

(must be [0x00000] = 0xFF and [0x20000] = 0xFF, as the memory has been cleared)

3) Writing [0x00000]<- 0xE0 and [0x20000]<- 0x0E to the unprotected memory

Reading [0x00000] = 0xE0 and [0x20000] = 0x0E

(must be [0x00000] = 0xE0 and [0x20000] = 0x0E)

4) Enabling memory protection for the whole memory array.

5) Writing [0x00000]<- 0xD0 and [0x20000]<- 0x0D to the fully protected memory

Reading [0x00000] = 0xE0 and [0x10000] = 0x0E

(must be [0x00000] = 0xE0 and [0x20000] = 0x0E), the old values)

6) Enabling memory protection ONLY for the lower half (0..0x1FFFF) of the memory array

7) Writing [0x00000]<- 0xB0 and [0x20000]<- 0x0B to the 'lower-half only protected' memory

Reading [0x00000] = 0xE0 and [0x10000] = 0x0A

(must be [0x00000] = 0xE0 and [0x20000] = 0x0A (= 0x0E AND 0x0B), as only the upper half is writable)

8) Enabling memory protection ONLY for the upper half (0x20000..0x3FFFF) of the memory array

9) Writing [0x00000]<- 0x70 and [0x20000]<- 0x07 to the 'upper-half only protected' memory

Reading [0x00000] = 0x60 and [0x20000] = 0x0A

(必须是[0 x00000] = 0 x60和[0 x20000] =0x0A, as only the lower half is writable)

IMPORTANT NOTE: The API supports the protection also in quarters of the memory array for this device.

10) Unprotecting the whole memory array and doing a full erase

End of test

Device:
MT_dialog
Offline
Last seen:2 months 1 day ago
Staff
加入:2015-06-08 11:34
Hi kenneth.er,

Hi kenneth.er,

您正在使用的闪存设备是支持的flash programmer (the .hex file that Smart Snippets use). What is the interface that you use in smart snippets in order to read the SPI, if not using JTAG and you use UART, do you have the appropriate connections to your SPI memory and your UART? Also please make sure that the configuration on the board setup in the Smart Snippets option corresponds to the SPI pins that you are using.

Thanks MT_dialog

kenneth.er
Offline
Last seen:4 years 9 months ago
加入:2015-09-03 15:31
Hi MT_dialog,

Hi MT_dialog,

I am using the JTAG mode because I am debugging my board via a Segger J-link Ultra+. The DA14580 is connected to the debugger via the SW_CLK and SWDIO pins with ref voltage of 3.3V. The interesting thing was I used the bigger footprint version (WSON8, also the same footprint found on the basic dev kit) on my previous version and I could read w/r the memory via the smartsnipppet. When I used the USON8 footprint, I can't read it anymore. If my connection to the USON8 flash is wrong, I shouldn't be able to perform the SPI_flash test code right?

If for some strange reason that I couldn't use the flash programmer but I could read the spi flash via the SPI_flash project, would you recommend that I write a routine to copy in my "multi_part" bin file into flash memory or should I try to rectify this?

Thanks.

MT_dialog
Offline
Last seen:2 months 1 day ago
Staff
加入:2015-06-08 11:34
Hi kenneth.er,

Hi kenneth.er,

I you are correct, you shouldn't be able to perform the SPI_flash test code, but in my previous post i am not talking about the connected wires, but for the settings in the Smart Snippets tool on the board setup option, please make sure that the correct check boxes are selected. I would recommend to try and use Smart Snippets for burning your image to your flash and if possible try to use smart snippets via the UART interface for a test since the Jlink you are using isn't tested with smart snippets.

Thanks MT_dialog

kenneth.er
Offline
Last seen:4 years 9 months ago
加入:2015-09-03 15:31
Hi MT_dialog,

Hi MT_dialog,

I have been checking out on the UART setting that you have mentioned but realized that the UART pins comes in fixed pairing. My UART_TX is set to P0.2 and UART_RX is set to P0.4. Is there anyway I can defined my own pin connection for testing? Thank you.

-edited-

kenneth.er
Offline
Last seen:4 years 9 months ago
加入:2015-09-03 15:31
Hi MT_dialog,

Hi MT_dialog,

Just an update. I have resolved the problem. Turns out my colleague has added additional SPI device on the same bus, so I just modified the flash_programmer utility code to ensure the CS pin of the additional device is set high. That solved my problem. Thanks for your input so far.

MT_dialog
Offline
Last seen:2 months 1 day ago
Staff
加入:2015-06-08 11:34
Hi kenneth.er,

Hi kenneth.er,

Thank you for indicating, in case you ever want to change the default booting pins you can use the secondary bootloader and set the custom pins from there.

Thanks MT_dialog

kenneth.er
Offline
Last seen:4 years 9 months ago
加入:2015-09-03 15:31
Hi MT_dialog,

Hi MT_dialog,

I have changed the secondary boot-loader and set the custom pins from there as well. Thanks for the recommendation.