We are using Cortex-M0 DesignStart Pro to design MCU. When we use SWD to download grogram to flash in FPGA(Cortex_m0 mcu inside), we cannot to connect keil with FPGA, and Keil shows:" Could not stop Cortex-M device!Please check the JTAG cable. "
Attached are keil display error messages, simulation waveforms, and data analysis captured by the logic analyzer.
SWD_signals.docx
Yes, I have seen these, and I don't change these code, but still failed! And I see it must define CORTEX_M0DESIGNSTART in RTL, and in cmsdk_mcu_defs.v , it shows:
The system level RTL has a number condition compile codes like
`ifdef CORTEX_M0DESIGNSTART
...
`endif
This is needed as designstart eval possibly has different top level pins compared to full RTL.
If you are using DesignStart pro (full RTL) you don't need to set this macro.
I think you should set CORTEX_M0 in your synthesis.
Another thing to check is whether you have setup clock constraints for SWCLKTCK (missing clock contraints can also cause problem.).
Yes, I am using DesignStart pro (full RTL) , so I don't need to set DesignStart pro (full RTL) , but must set CORTEX_M0 in my synthesis, and no need to set for simulation , is it?
I have setup clock constraints for SWCLKTCK in my synthesis constraints.
If I set this macro in simulation and synthesis , is ok, right?
Yes, you need to set CORTEX_M0 in your synthesis.
You can set it in both simulation and synthesis environment.
Could you also check your Keil MDK project debug option - in debug probe setting, there might be choices of reset types: It should be SYSRESETREQ
I have set these macro , and re-synthesis.
And then choice of reset types: SYSRESETREQ.
But it failed again, and the info as follows:
This is not a failure message - this is expected because the flash programming option is removed in the debug option (you don't have flash memory in your FPGA).
regards,
Joseph
I see, but I use RAM to equate FLASH memory. Can I download hex into RAM? Can I debug the gpogram used SWD? What should we do with KEIL in order to download programs to RAM? What should we do with SOC in order to download programs to Flash memory(RAM in FPGA)?
Yes, you can download program image to an SRAM location and execute and debug it using SWD.
By the way, which FPGA board are you using? And which debug probe? (ULINK? I-Jet?)
My FPGA borad is Xilinx's XC7Z020, debug probe is ST-LINK V2.
I am not sure if you can use ST-LINK to program non ST devices. In the past I saw some forum posts said that the probe is locked down to ST device only
You might need to get a different debug adapter for your FPGA project.
OK, I see, which debug probe that you recommend?
It depends on your budget. If you want something really low cost, you can get a CMSIS-DAP from Adafruit
https://www.adafruit.com/product/2764
For educational use, J-LINK EDU is also affordable
https://www.adafruit.com/product/1369
For professional software development, I use ULINK Pro (http://www2.keil.com/mdk5/ulink) , but there are also others with many features:
J-Trace : https://www.segger.com/products/debug-probes/j-trace/models/j-trace/
I-Jet Trace : https://www.iar.com/iar-embedded-workbench/add-ons-and-integrations/in-circuit-debugging-probes/
Lauterbach u-Trace for Cortex-M : https://www.lauterbach.com/microtrace.html
Thank you very much! If we use one of these probe, can we directly access FLASH, to debug the SOC system?For our SOC FLASH access system, do we need to do anything with probe? Do we need to design for SWD in SOC?
We use ULINK to download program image to FPGA, but fail again, the Error Info and setup as follow :
You need to remove the STM32 flash option from your project. Otherwise the IDE will try to use the STM32 flash algorithm to to program verification which won't work on your FPGA.
And yes, you can use 3rd party debug probes for flash programming. If you are a SoC designer, and creating your own MCU, you need to create your flash algorithm. There is a template in
C:\Keil_v5\ARM\Flash\_Template