From: <jia...@by...> - 2018-11-02 02:36:54
|
Thanks again Paul. I finally find why my first script didn't work. "reset" command just make "targets" to default. So if "targets" before a "reset", it may be useless to switch the current target. So this won't work correctly: targets stm32f217.cpu init reset init flash write_image erase unlock "mcu1_pb6_slow.hex" targets stm32f302.cpu flash write_image erase unlock "mcu2_pb11_slow.hex" reset shutdown On Thu, Nov 01, 2018 at 08:27:15PM +0800, <mailto:jia...@by...> jia...@by... wrote: > I figured it out myself, by using this command. It seems "reset" > command reset all defined target as said in user manual. However, > "halt" just halt current target. Indeed, sorry, haven't noticed that. I would expect "flash write_image" to complain when it tries to flash a non-halted target though. The usual scenario is using "reset init" just before flashing, so I would expect your script to be something like this: init reset init targets stm32f217.cpu flash write_image erase unlock "mcu1_pb6_slow.hex" targets stm32f302.cpu flash write_image erase unlock "mcu2_pb11_slow.hex" reset shutdown |