你好呀,
我使用Winbond W25X10(2-Mbit)SPI闪存模块(USON8占地面积)进行了定制板。我的SPI引脚引脚与基本开发套件(SCLK = P0.0,CS = P0.3,MISO = P0.5,MOSI = P0.6)相同。当我用SPI _FLASH示例项目读取Flash模块(在SDK5.0.2.1文件夹中提供)时,我可以读取闪光灯唯一ID和制造商ID,并且SPI Flash模块通过测试,以便无保护和受保护的W / R。但是,当我尝试用智能赛段v3.9阅读它时,我得到的只是垃圾(我有正确的spi设置),我无法删除扇区(err:验证在地址0x00时失败)。任何想法可能导致这个问题是什么?谢谢!
The test result from the SPI_flash project.
************
*SPI TEST *
************
阅读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 FFff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff FFff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff FFff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff FFff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff FFff 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
执行程序页...页面编程。(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)
读取SPI闪光首先512字节... 00 01 02 03 04 05 02 0D 0D 0EF 10 11 12 1a 1b 1c 1d 1e 1f 20 21 22 21 22 21 22 21 22 21 22 21 22 22 21 22 21 22 21 22 21 22 21 22 21 2 21 2 2 21 22 21 22 21 2 2 21 2 2 21 2 2 21 2 2 21 22 21 22 21 22 21 22 21 22 21 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 FD FE FF 00 01 02 03 04 05 0C 0D 0D 0B 0C 0D 0D 0F 10 11 12 1A 1B 1C 1D 1D 1F 20 21 21223 24 25 26 28 29 28 2B 2C 2D 2E 2F 30 3 32 33 34 36 37 38 39 3A 3B 3C 3D 3E 3F 40 411 42 43 44 45 46 47 48 49 4F 50 51 52 53 54 55 5C 50 52 5F 60 61 62 63 64 65 66 61 6D 6E 6F 70 6F 70 71 72 60 72 71 7273 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 89 8a 8b 8c 80 8d 8e 8e 8e 8e 8e 8e 8e 80 94 94 99999999999999999999999999999995 9C 94 9C 94 9C 9C 94 9C 9S 9C 9S 9C 9S 9S 9C 9S 9F A0 A1 A2 A3 A4A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BC BC BD是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
读取[0x00000] = 0xFF和[0x20000] = 0xFF
(必须是[0x00000] = 0xFF和[0x20000] = 0xFF,因为内存已被清除)
3)将[0x00000] < - 0xe0和[0x20000] < - 0x0E写入未受保护的内存
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
读取[0x00000] = 0xe0和[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)写入[0x00000] < - 0x70和[0x20000] < - 0x07至“仅限仅受保护”的内存
Reading [0x00000] = 0x60 and [0x20000] = 0x0A
(必须是[0x00000] = 0x60和[0x20000] = 0x0a,只有下半部分是可写的)
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
测试结束
嗨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
Hi MT_dialog,
我正在使用JTAG模式,因为我通过Segger J-Link Ultra +调试我的电路板。DA14580通过SW_CLK和SWDIO引脚连接到调试器,具有3.3V的REF电压。在我以前的版本上,我使用了更大的足迹版本(WSON8,也是基本Dev Kit上的相同占用脚印),我可以通过Smartsnipppet读取内存。当我使用USON8足迹时,我再也看不到了。如果我与uson8 flash的连接是错误的,我不应该能够执行spi_flash测试代码吗?
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.
嗨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
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-
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.
嗨Kenneth.er,
谢谢您的指示,如果您想要更改默认引导引脚,可以使用辅助引导程序并从那里设置自定义引脚。
Thanks MT_dialog
Hi MT_dialog,
我已经更改了辅助启动加载器并从那里设置了自定义引脚。谢谢你的推荐。