adafruit / Adafruit_nRF52_Bootloader

USB-enabled bootloaders for the nRF52 BLE SoC chips
MIT License
445 stars 401 forks source link

Add pyocd flash targets. #158

Closed nitz closed 4 years ago

nitz commented 4 years ago

They are used when make is invoked with FLASHER=pyocd. Still defaults to using NRFUTIL.

nitz commented 4 years ago

Okay, I think I got them all!

I'm definitely not super familiar with Makefile functions (but enjoy learning!), and ran into issues trying to do conditionals inside them, passing a 'mode' for FLASHCMD. I think I might have gotten it to work, but it would have been about 45 parenthesis deep. Is the way I've done there with 3 FLASH* functions like that something along the lines of what you imagined, or did you have a different idea?

hathach commented 4 years ago

Okay, I think I got them all!

I'm definitely not super familiar with Makefile functions (but enjoy learning!), and ran into issues trying to do conditionals inside them, passing a 'mode' for FLASHCMD. I think I might have gotten it to work, but it would have been about 45 parenthesis deep. Is the way I've done there with 3 FLASH* functions like that something along the lines of what you imagined, or did you have a different idea?

No worries, That is OK to have 3 flash functions, we could refactor it later on when there are more FLAHSER, the code is good enough since it is more centric to look at, and more importantly we don't have to duplicate target for each new FLASHER. It is perfect now :)