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!
SPI_FLASH项目的测试结果。
************
* SPI测试*
************
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
字节阅读:0x0100
SPI Flash JEDEC ID为EF3012
您使用的是W25X10(2 Mbit)SPI闪存设备。
SPI闪光制造商/设备ID是EF11
SPI闪存唯一ID号是D5657440C39A8A36
Performing Program Page...Page programmed. (00)
读取SPI闪光首先256字节... 00 01 02 03 04 05 01 0D 0D 02 0A 0B 0C 0D 0E 0F 10 11 12 1A 1B 1C 1D 1E 1F 20 21 22 21 22 21 22 22 22 22 21 22 22 22 22 23 22 2229 2a 2b 2c 2d 2e 2f 30f 30 3 32 33 36 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 44 45 4b 47 42 53 55 50 51 52 53 59 59 59 59图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 8C8D 8E 8F 90 91 92 93 94 94 9A 9C 9C 9D 9E 9C 9C 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 B2 B9 BB BC BD BDBF C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 DF E0 E1 E2 E3 E4 E5 E6 E2 E2 EA EA EA ED EE EF F0F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FC FC FD FE FF
字节阅读:0x0100
执行扇区erase ...划分的扇区。(00)
执行512字节写入...写入的数据。(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
字节阅读:0x0200
W25X20 SPI内存保护功能演示。
1)不保护整个内存阵列并进行完整擦除
2)在地址0x00000和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
读取[0x00000] = 0xe0和[0x20000] = 0x0e
(必须是[0x00000] = 0xe0和[0x20000] = 0x0e)
4)为整个内存阵列启用内存保护。
5)将[0x00000] < - 0xD0和[0x20000] < - 0x0d写入完全受保护的存储器
读取[0x00000] = 0xe0和[0x10000] = 0x0e
(必须是[0x00000] = 0xe0和[0x20000] = 0x0e),旧值)
6)仅对存储器阵列的下半部分(0..0x1ffff)启用内存保护
7)将[0x00000] < - 0xb0和[0x20000] < - 0x0b写入“仅限于后半部分”的内存
Reading [0x00000] = 0xE0 and [0x10000] = 0x0A
(必须是[0x00000] = 0xe0和[0x20000] = 0x0a(= 0x0e和0x0b),因为只有上半部分是可写的)
8)仅对存储器阵列的上半部分(0x20000..0x3FFFF)启用内存保护
9) Writing [0x00000]<- 0x70 and [0x20000]<- 0x07 to the 'upper-half only protected' memory
读取[0x00000] = 0x60和[0x20000] = 0x0a
(必须是[0 x00000] = 0 x60和[0 x20000] =0x0A, as only the lower half is writable)
重要说明:API还支持该设备的内存阵列的季度。
10)彻底保护整个内存阵列并进行完整擦除
End of test
Hi kenneth.er,
您正在使用的Flash设备由Flash程序员(Smart Scompets使用的.hex文件)支持。您在智能代码段中使用的界面是什么,以便阅读SPI,如果不使用JTAG,并且您使用UART,您是否有适当的连接到您的SPI内存和您的UART?另请确保智能代码段中的电路板设置上的配置对应于您正在使用的SPI引脚。
谢谢mt_dialog.
嗨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?
如果我不能使用闪存程序员的一些奇怪原因,但我可以通过SPI_FLASH项目读取SPI闪存,你会推荐我在我的“Multi_Part”Bin文件中复制到闪存中的例程,或者我应该尝试纠正这个?
谢谢。
Hi kenneth.er,
我是正确的,你不应该能够执行SPI_FLASH测试代码,但在我上一篇文章中我不谈论连接的电线,但对于电路板设置选项上的智能片段工具中的设置,请确保选择正确的复选框。我建议尝试使用智能片段将图像刻录到闪光灯,如果可能的话,可以通过UART接口尝试使用Smart Sc片段,因为您使用的JLink您使用的jlink未与智能片段测试。
谢谢mt_dialog.
嗨mt_dialog,
我一直在查看您提到的UART设置,但意识到UART引脚已固定配对。我的UART_TX设置为P0.2,UART_RX设置为P0.4。无论如何我可以定义自己的PIN连接进行测试?谢谢你。
-
嗨mt_dialog,
只是更新。我已经解决了这个问题。拒绝我的同事在同一个总线上添加了额外的SPI设备,因此我刚刚修改了Flash_Programmer实用程序代码,以确保附加设备的CS引脚设置为高。解决了我的问题。谢谢你到目前为止的输入。
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.
谢谢mt_dialog.
嗨mt_dialog,
I have changed the secondary boot-loader and set the custom pins from there as well. Thanks for the recommendation.