Skip to content

niexuzhong/imxRT106xpyOCD

Repository files navigation

Flash algorithm for pyOCD run with i.mxRT106x QSPI flash

Introduction

when you want to debug ARM MCU by pyOCD,you have to burn the firmware to the flash. So certain flash algorithm should be used for different MCU and flash. The MDK have integrated flash algorithm for MCU supported by them. such algorithm can be found in the DFP pack provided by MCU manufactor or ARM.The convenient method is use 'FlashAlgo'_ to generate the python blob . Then pyOCD can burn the flash. but when I try to do it. it is always failure, The pyOCD only provide blob python for the i.mxRT105x for QSPI flash. but it couldn't run on my boards. So I make this project and verified on my hardware platform,The MCU is i.mxRT1061CV5.The flash is winbond w25q32,4MB quad spi flash. the website is http://www.forlinx.net/products_detail/productId=94.html ,you also can utilize pyOCD to debug gnu arm program on i.mxRT0161 platform. BTW. NXP use Freelink as emulator for their developement kit.but it is not popluar for most engineers.The DAP debugger may be good choice for us.

GetStarted

  • Debugger: DAPLink Debugger Dap firmware generated by this project. because my DAP debugger is base on stm32 MCU so i use the firmware stm32f103xb_if to generate the firmware for debugger
  • FlashAlgo: Flash algorithm use this tool to generate python blob file for pyOCD
  • PyOCD: pyOCD python debug dameon. you can use gdb server to connect with pyOCD to debug

procedure

  • 1 operation guide to generate firmware for your hardware for DAP debugger.if your DAP debugger is ready. you can ignore this setp
  • 2 download MDK project for imxrt1060 to generate FLM file.
  • 3 download Flash algorithm ,enter the folder scripts. use command "python generate_blobs.py + FLM(generate in last step) file to generate file.
  • 4 download pyOCD ,create new python file in the pyocd/target/builtub in pyOCD project. the file format can be referenced to the other target file . then you should create class for i.mxrt1060 MCU you can copy from other target file with similar .then rename it(for example target_MIMXRT1052xxxxB.py).
  • 5 modify all the function address as generated file in setp 3 ,but please attention .the 'begin_data' should not use same address as generated file. because the generated script used address is too small. I modify it as 0x20004000 ,the page_buffers is aslo same.
  • 6 modfiy the __init__.py to add board .
  • 7 connect with hardware. use command "python setup.py install --user" to install new version pyocd
  • 8 if the installation is successful. you can use comand "pyocd list -t" to verify if new board had been added in the support list
  • 9 you can use command "pyocd cmd -t xxxxx" and "pyocd gdb -t xxxxx", xxxx is the name added by you in the list

example

I create two python file in folder pyocd. one is for target.other is for init, you can use them directly. if you have any question. you can send mail to xz_nie#hotmail.com

About

pyOCD flash algorithm for imxRT106x

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published