Code Monkey home page Code Monkey logo

Comments (28)

windowsair avatar windowsair commented on July 2, 2024

core dump问题比较严重。用的是哪个版本的固件?如果方便的话,能不能上传编译之后的elf文件,路径应该是build/esp8266_dap.elf

看到问题了,我找找是什么原因

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

相当严重的问题,我之前顾着搞其他功能去了,这里正经的dap全崩了。。。

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

找到原因了,栈太大炸了。。。

8266的内存实在有限,现在加了一堆功能,调小可能还会有暗病= =

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

试试看最新的开发分支,大概是没问题的

c13366d

https://github.com/windowsair/wireless-esp8266-dap/actions/runs/1902137412

from wireless-esp8266-dap.

ZhuYanzhen1 avatar ZhuYanzhen1 commented on July 2, 2024

试试看最新的开发分支,大概是没问题的

c13366d

https://github.com/windowsair/wireless-esp8266-dap/actions/runs/1902137412

新的没有出现core panic的问题了。但是在连接目标MCU的时候还是会报错:

Open On-Chip Debugger 0.11.0+dev-00571-g254883597-dirty (2022-02-15-15:05)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use '
transport select <transport>'.
Info : Using CMSIS-DAPv2 interface with VID:PID=0xc251:0xf00a, serial=1234
Info : CMSIS-DAP: SWD  supported
Info : CMSIS-DAP: JTAG supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Serial# = 1234
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x2ba01477
Info : stm32f4x.cpu: Cortex-M4 r0p1 processor detected
Info : SWD DPIDR 0x2ba01477
Error: Failed to write memory and, additionally, failed to find out where
Warn : target stm32f4x.cpu examination failed
Info : gdb port disabled
Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477
Error: Could not find MEM-AP to control the core
Error: Target not examined, reset NOT asserted!
embedded:startup.tcl:1136: Error: ** Unable to reset target **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1173
at file "embedded:startup.tcl", line 1136

我看看要怎么用命令行复现
我是在CLion环境下开发STM32

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

我手头没有M4的设备,但是M3测试是可以的

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

可以用telnet连上,然后看看下面的指令能不能复现:

init 
reset init
halt
flash write_image erase E:/TEST.bin 0x08000000

from wireless-esp8266-dap.

ZhuYanzhen1 avatar ZhuYanzhen1 commented on July 2, 2024

指令的返回依次是:

> init

> reset init
SWD DPIDR 0x2ba01477
SWD DPIDR 0x2ba01477
Could not find MEM-AP to control the core
Target not examined, reset NOT asserted!

> halt
Target not examined yet

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

openocd的连接命令是啥样的?

from wireless-esp8266-dap.

ZhuYanzhen1 avatar ZhuYanzhen1 commented on July 2, 2024

openocd的连接命令是啥样的?

指令是.\openocd.exe -f .\cmsis-dap.cfg
cmsis-dap.cfg的内容是:

source [find interface/cmsis-dap.cfg]
source [find target/stm32f4x.cfg]

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

我感觉是板子没有选择对,因为这个MEM-AP是要和芯片匹配的。

我再找找看是什么原因

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

你这个0x2ba01477 我看着好像不是F4?像是国产的兼容板子?
然后网上说是CKS32,那你可能需要用F1的CFG试试

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

你看看这个:
https://blog.csdn.net/nick_young_qu/article/details/108217987

用他的方案一试试看

from wireless-esp8266-dap.

ZhuYanzhen1 avatar ZhuYanzhen1 commented on July 2, 2024

你这个0x2ba01477 我看着好像不是F4?像是国产的兼容板子? 然后网上说是CKS32,那你可能需要用F1的CFG试试

是F4,通过ST-Link+STM32CubeProgrammer可以看得到。我怀疑前面是线没有接牢固的原因,所以我把线直接焊到排针上了。
现在报错是清一色的:

Open On-Chip Debugger 0.11.0+dev-00571-g254883597-dirty (2022-02-15-15:05)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use '
transport select <transport>'.
Info : Using CMSIS-DAPv2 interface with VID:PID=0xc251:0xf00a, serial=1234
Info : CMSIS-DAP: SWD  supported
Info : CMSIS-DAP: JTAG supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Serial# = 1234
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 1 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 2000 kHz
Error: Error connecting DP: cannot read IDR
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

这和不插入设备是一样的

from wireless-esp8266-dap.

ZhuYanzhen1 avatar ZhuYanzhen1 commented on July 2, 2024

我再检查一下其他的硬件问题,排除偶然性吧。真是辛苦你了

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

对,确实是F4,但是现在的问题属于是没有读到数据,比刚才要糟糕一些

from wireless-esp8266-dap.

ZhuYanzhen1 avatar ZhuYanzhen1 commented on July 2, 2024

我换了一个STM32H750的开发板,似乎可以正常工作。所以有可能是那个F4的原因。

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

我后面有时间找块f4试试看

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

@ZhuYanzhen1 我刚才试了块F4,没啥问题

不过8266确实很容易受到干扰

from wireless-esp8266-dap.

ZhuYanzhen1 avatar ZhuYanzhen1 commented on July 2, 2024

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

from wireless-esp8266-dap.

ZhuYanzhen1 avatar ZhuYanzhen1 commented on July 2, 2024

Hi, 我再次遇到了这个问题,这次我使用的是MM32F3277G9。它是Cortex-M3内核的,而我使用ST-Link可以正常连接它。
看起来这并不是一个偶然现象。报错信息:

Open On-Chip Debugger 0.11.0+dev-00571-g254883597-dirty (2022-02-15-15:05)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use '
transport select <transport>'.
Info : DEPRECATED target event trace-config; use TPIU events {pre,post}-{enable,
disable}
Info : Using CMSIS-DAPv2 interface with VID:PID=0xc251:0xf00a, serial=1234
�[0mInfo : CMSIS-DAP: SWD  supported
Info : CMSIS-DAP: JTAG supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Serial# = 1234
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 1 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 10000 kHz
Error: Error connecting DP: cannot read IDR
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

OpenOCD配置文件:

adapter driver cmsis-dap

source [find target/swj-dp.tcl]
source [find mem_helper.tcl]

adapter speed 10000

if { [info exists CHIPNAME] } {
   set _CHIPNAME $CHIPNAME
} else {
   set _CHIPNAME stm32f1x
}

set _ENDIAN little

if { [info exists WORKAREASIZE] } {
   set _WORKAREASIZE $WORKAREASIZE
} else {
   set _WORKAREASIZE 0x1000
}

set _FLASH_SIZE 0x80000

if { [using_jtag] } {
   # See STM Document RM0008 Section 26.6.3
   set _CPUTAPID 0x3ba00477
} {
   # this is the SW-DP tap id not the jtag tap id
   set _CPUTAPID 0x2ba01477
}

swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu

if {[using_jtag]} {
   jtag newtap $_CHIPNAME bs -irlen 5
}

set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME cortex_m -endian $_ENDIAN -dap $_CHIPNAME.dap

$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0

set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME mm32f3x 0x08000000 $_FLASH_SIZE 0 0 $_TARGETNAME

adapter srst delay 100
if {[using_jtag]} {
 jtag_ntrst_delay 100
}

reset_config none

if {![using_hla]} {
    cortex_m reset_config sysresetreq
}

$_TARGETNAME configure -event examine-end {
	mmw 0xE0042004 0x00000307 0
}

$_TARGETNAME configure -event trace-config {
	mmw 0xE0042004 0x00000020 0
}

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

这个比较麻烦,我建议刚开始连接的时候不要用太高的速率,先用1MHz左右的,等连接上了再切换到10Mhz以上

from wireless-esp8266-dap.

ZhuYanzhen1 avatar ZhuYanzhen1 commented on July 2, 2024

我将速率修改成了adapter speed 1000,但是问题依旧。我看看能否拿到它的报错信息

from wireless-esp8266-dap.

ZhuYanzhen1 avatar ZhuYanzhen1 commented on July 2, 2024

我怀疑是不是某一些openocd的配置使得它无法连接芯片?

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

这个比较玄学了。。因为第一步就发生了cannot read IDR错误,这是不能接受的。

实际上,第一步做的是读芯片的ID,这个基本上和openocd配置没有关系,因为Cortex M0、M1、M3、M7都是这样读的,调试器软件都是按这个规范来做的。如果说是高速下的时序问题,那改用低速方式就是原始的IO翻转,这里也不太可能出问题。

我还是觉得和硬件连接关系比较大;或者是usbip的问题,这个玩意在丢包条件下很不稳定

from wireless-esp8266-dap.

ZhuYanzhen1 avatar ZhuYanzhen1 commented on July 2, 2024

这个比较玄学了。。因为第一步就发生了cannot read IDR错误,这是不能接受的。

实际上,第一步做的是读芯片的ID,这个基本上和openocd配置没有关系,因为Cortex M0、M1、M3、M7都是这样读的,调试器软件都是按这个规范来做的。如果说是高速下的时序问题,那改用低速方式就是原始的IO翻转,这里也不太可能出问题。

我还是觉得和硬件连接关系比较大;或者是usbip的问题,这个玩意在丢包条件下很不稳定

我实在无法在硬件中找到什么问题。请问有没有办法不使用SP而I改用IO进行操作?

from wireless-esp8266-dap.

windowsair avatar windowsair commented on July 2, 2024

速度设置成小于10Mhz就是纯io翻转。

后续我具体测试下是哪里出现问题了

from wireless-esp8266-dap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.