Programm SPI Flash: UART works, JTAG error ... address 81FE8

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
10 posts / 0 new
Last post
gme_johannes
Offline
Last seen:2 weeks 4 days ago
加入:2017-12-22 10:09
Programm SPI Flash: UART works, JTAG error ... address 81FE8

Dear dialog support,

I have a custom board with Murara ZY module (DA14580), attached is an SPI flash Winbond W25X20.
I program the DA14580 directly, or the flash via UART through Smart Snippets v4.8.3.1804 . I use the IoT Kit programmer board [edit: the CIB].
两块板都通过J4处的15厘米扁平带状电缆连接。

通过UART连接时,我可以连接,读取,擦除,刻录成功,固件将在启动时加载,我可以与设备一起工作。

通过JTAG(SWD)连接时,连接似乎已成功建立:


[INFO General@18-08-12 21:01:50]无法测量总IR长度。时差持续偏高。
[INFO General@18-08-12 21:01:50]无法测量总IR长度。时差持续偏高。
[INFO General@18-08-12 21:01:50]找到ID为0x0BB11477的SWD-DP
[INFO General @18-08-12 21:01:50] FPUnit: 4 code (BP) slots and 0 literal slots
[INFO General@18-08-12 21:01:50]发现Cortex-M0 r0p0,Little endian。
[INFO General @18-08-12 21:01:50] BTLE device selected.

加载SPI闪存固件也可以工作:


(信息SPI Flash @18-08-12 21:04:25] Found SWD-DP with ID 0x0BB11477
(信息SPI Flash @18-08-12 21:04:25] FPUnit: 4 code (BP) slots and 0 literal slots
(信息SPI Flash @18-08-12 21:04:25] Found Cortex-M0 r0p0, Little endian.
[INFO SPI Flash@18-08-12 21:04:25]固件文件C:\Program Files(x86)\Dialog\SmartSnippetsStudio\Toolbox\common\u resources\jtag\u programmer.bin已选择下载。
[INFO SPI Flash@18-08-12 21:04:25]已成功将固件文件下载到主板。
[信息SPI闪存@18-08-12 21:04:25]已成功配置SPI闪存端口和引脚。

Reading does not work (nor does flash/erase)


[INFO SPI Flash@18-08-14 22:22:06]开始从内存中读取32768字节。
[错误SPI Flash@18-08-14 22:22:06]读取地址81FE8处的内存失败。
[ERROR SPI Flash @18-08-14 22:22:06] Failed reading memory.

两种情况下的配置都是相同的(SPI Flash pin配置、SPI Flash选项、SPI Flash内存大小(十六进制,以字节为单位),请参阅随附的pdf。

你知道会出什么问题吗?

Best regards
Johannes

附件:
设备:
PM_Dialog
Offline
Last seen:3天7小时前
工作人员
加入:2018-02-08 11:03
Hi gme_johannes,

Hi gme_johannes,

I am not able to understand what you want to do. Do you want to program your custom board or the murata module through JTAG and using SmartSnippets tool? What do you mean with the “IoT Kit programmer board” ? Do you mean the Communication Interface Board (CIB)? Please, provide more specific information abaut the connection diagram in order to give you the proper answer.

Thanks, PM_Dialog

gme_johannes
Offline
Last seen:2 weeks 4 days ago
加入:2017-12-22 10:09
I have acquired the IoT

我已经购买了CIB附带的物联网传感器开发套件,是的。
使用这个CIB,我试图用Murata ZY和附带的Winbond W25X20编程一个定制板。

有了UART,它可以工作->内存可以编程,Murata ZY将从闪存加载固件。
With SWD it does not work.
What confuses me is that SWD does seem to work and it does establish a connection to the module, yet programming the flash fails.
见以上日志。

Which other information do you require?

gme_johannes
Offline
Last seen:2 weeks 4 days ago
加入:2017-12-22 10:09
有可能是闪光灯吗

有可能是闪光灯吗_programmer.bin (which is used for UART) supports the W25X20, whereas jtag_programmer.bin does not?
我应该修改和重建这个固件吗?
编辑:我已经调查了DA1458x\usdk\5.0.4\utilities\flash\u程序员,对于我(作为一个外行)来说,W25X20支持似乎没有区别UART/JTAG。
此外,gpio似乎被拉了起来,这是很好的,因为我有其他传感器共享SPI总线(无论如何,它与UART工作良好,所以我没有想到这将是罪魁祸首)。

Also I see a possible relation to this thread:
https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...
Do you have the document available which is mentioned there? Can it be helpful?

PS: I realize I should have posted this in the "Tools" forum? Maybe you can move it.

gme_johannes
Offline
Last seen:2 weeks 4 days ago
加入:2017-12-22 10:09
我现在注意到

我现在注意到reading and programm the flash via SWD works fine, as long as the W25X20 is empty.

1.闪存已编程,设备从闪存引导,工作正常
2.用SWD->打开SS工具箱,其行为如初始post中所述
3. Open SS Toolbox with UART -> delete flash
4.用SWD打开SS工具箱->可以成功读取flash(all empty=FF)[见下面的第一个日志]
5.尝试写入flash->成功,但立即(自动)回读失败[参见下面的第二个日志]
6.成功的flash编程确认,因为设备再次从flash引导并正常工作

First log

[INFO General @18-08-19 11:01:22] Could not measure total IR len. TDO is constant high.
[INFO General @18-08-19 11:01:22] Could not measure total IR len. TDO is constant high.
[INFO General @18-08-19 11:01:22] Found SWD-DP with ID 0x0BB11477
[INFO General @18-08-19 11:01:22] FPUnit: 4 code (BP) slots and 0 literal slots
[INFO General@18-08-19 11:01:22]发现Cortex-M0 r0p0,Little endian。
[INFO General@18-08-19 11:01:22]已选择BTLE设备。
(信息SPI Flash @18-08-19 11:03:16] Header records have been removed from hex file wrbl_sfl_580.hex.
[INFO SPI Flash@18-08-19 11:03:16]从wrbl\u sfl\u 580.hex文件读取30776字节。
(信息SPI Flash @18-08-19 11:03:18] Found SWD-DP with ID 0x0BB11477
[INFO SPI Flash@18-08-19 11:03:18]FPUnit:4个代码(BP)插槽和0个文本插槽
[信息SPI Flash@18-08-19 11:03:18]发现Cortex-M0 r0p0,Little endian。
(信息SPI Flash @18-08-19 11:03:19] Firmware File C:\Program Files (x86)\Dialog\SmartSnippetsStudio\Toolbox\common_resources\jtag_programmer.bin has been selected for downloading.
(信息SPI Flash @18-08-19 11:03:19] Successfully downloaded firmware file to the board.
[INFO SPI Flash@18-08-19 11:03:19]已成功配置SPI闪存端口和引脚。
[INFO SPI Flash@18-08-19 11:03:33]开始从内存中读取32768字节。
[INFO SPI Flash@18-08-19 11:03:34]读取已完成。读取32768字节。

Second log

(信息SPI Flash @18-08-19 11:05:01] Started burning memory with 31096 bytes of data at address 0x00000.
(信息SPI Flash @18-08-19 11:05:01] Memory burning completed successfully.
[INFO SPI Flash@18-08-19 11:05:01]读取内存以刷新内存内容。。。。
[错误SPI Flash@18-08-19 11:05:01]读取地址81FE8处的内存失败。
(错误SPI Flash @18-08-19 11:05:01)失败ed reading memory.

PM_Dialog
Offline
Last seen:3天7小时前
工作人员
加入:2018-02-08 11:03
Hi gme_johannes,

Hi gme_johannes,

In case that you want to connect and the read the SPI flash while it is empty, the most possible reason is because of your firmware disable the debugger. So, could you please check if your firmware disables the debugger? Also, when the flash in not empty, can you please press the reset button and then try to connect and read the SPI flash?

Thanks, PM_Dialog

gme_johannes
Offline
Last seen:2 weeks 4 days ago
加入:2017-12-22 10:09
嗨,PM\U对话,

嗨,PM\U对话,

如日志所示

[INFO SPI Flash@18-08-12 21:04:25]固件文件C:\Program Files(x86)\Dialog\SmartSnippetsStudio\Toolbox\common\u resources\jtag\u programmer.bin已选择下载。
[INFO SPI Flash@18-08-12 21:04:25]已成功将固件文件下载到主板。
[信息SPI闪存@18-08-12 21:04:25]已成功配置SPI闪存端口和引脚。

the jtag_programmer.bin firmware is successfully loaded to the device. Hence, at this point, my firmware is not running anymore... (which I can also tell by the behavior of an LED).
Can it be that the device is not being fully reset in the process of loading jtag_programmer.bin (???) and that some registers in the DA14580 are still programmed as they were by my firmware (e.g. the disabled debugger)?

再者,在我成功编程一次后,读取闪存怎么会立即失败呢?
毕竟,新固件不会立即从flash加载,因为设备不会重置。

PM_Dialog
Offline
Last seen:3天7小时前
工作人员
加入:2018-02-08 11:03
Hi gme_johannes,

Hi gme_johannes,

在加载jtag\u programmer.bin的过程中,设备不可能没有完全复位。你检查过你的固件是否禁用了调试器吗?我试图重现你的问题,但我能够连接/读取成功的SPI闪存,而不是空的。

Thanks, PM_Dialog

gme_johannes
Offline
Last seen:2 weeks 4 days ago
加入:2017-12-22 10:09
嗨,PM\U对话,

嗨,PM\U对话,

我不理解你的论点,因为你自己说过:一旦jtagïu programmer.bin成功加载(根据日志),设备就被完全重置了-因此设备中不应该有我的固件的残余,不管我的固件做什么都不重要。

Nevertheless let me answer your question:
固件没有禁用调试器,尽管我确实为连接到相关端口的两个LED实现了此选项。
我确保没有禁用调试器,也没有使用相关的GPIO端口。我已经证实了这一点,因为我可以很容易地从指示灯是否正常工作。


#ifdef使用\u JTAG \u作为\u GPIO
SetBits16(SYS\u CTRL\u REG,DEBUGGER\u ENABLE,0);
#其他
SetBits16(SYS_CTRL_REG, DEBUGGER_ENABLE, 1);
#结束


#ifdef使用\u JTAG \u作为\u GPIO
#define LEDG_PORT GPIO_PORT_1
#定义LEDG\ U引脚GPIO\ U引脚5
#define LEDB_PORT GPIO_PORT_1
#define LEDB_PIN GPIO_PIN_4
#结束

Still I can not read the flash when it is programmed.

PM_Dialog
Offline
Last seen:3天7小时前
工作人员
加入:2018-02-08 11:03
Hi gme_johannes,

Hi gme_johannes,

Please try to program the SPI flash through JTAG and when the procedure finished press the reset button from the CIB, and then try to connect and read the SPI flash. Could you please let me know if that is working? As I am able to see from you last post, you the debugger is not disable, but in fact that is a custom board, I am not able to replicate your issue.

Thanks, PM_Dialog