How to program EMW3165 using command line interface?


(1) Erase and update bootloader.


  1. Execute the control program from Command Prompt Window.

    You need to be able to be execute the command of "ST-LINK Utility". For standard installation, PATH should include following path:

    "\Program Files\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility"
    

    Then, invoke following command line:

    > ST-LINK_CLI -c SWD UR LPM -ME -P Desktop\hacker-emblem.hex 0x80000000 -V after_programming -HardRst
    

    which does:

    • specify SWD UR LPM (SWD, Under Reset, Low Power Mode)
    • Erase flash memory (-ME option)
    • Program flash memory (-P option with filename)
    • Verify flash memory (-V option)
    • Assert hardware reset signal of target board

Note that -ME option is not required for the initial programming of the MCU.

And you can download several bin files at one time.


(2)Download application code and RF driver code using UART 1.

Use python library Pyserial to download the code to board following yModem protocol. I finished it . Great!

bv

The code will be pasted here.


追加: 实际上我在这里做了个用串口终端下载程序到3165的东西,代码是用Python实现的,协议用了yModem。因为3165的sdk就是这么做的。效果不错。20170530







你可能感兴趣的:(C,EMW3165)