You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/10/25 18:06:59 UTC

[GitHub] [mynewt-core] rafacouto opened a new pull request #2403: Feat detect connected programmer

rafacouto opened a new pull request #2403:
URL: https://github.com/apache/mynewt-core/pull/2403


   Here is a new bash funtion in _hw/scripts/common.sh_ to detect connected programmers. I've added detection by USB vendor:product IDs, but other methods could be implemented. At the moment I've tested with Segger's **jlink** nrf5x on-board, **cmsis-dap** on STM32 and **stlink-v2** and **stlink-v2.1**.
   
   Detected programmer is put on **DETECTED_PROGRAMMER variable** so download or debug script for some board. For example, scripts for pinetime BSP are using this feature.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] kasjer merged pull request #2403: Detect connected programmer to download and debug firmware

Posted by GitBox <gi...@apache.org>.
kasjer merged pull request #2403:
URL: https://github.com/apache/mynewt-core/pull/2403


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2403: Detect connected programmer to download and debug firmware

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on pull request #2403:
URL: https://github.com/apache/mynewt-core/pull/2403#issuecomment-716187783


   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2403: Detect connected programmer to download and debug firmware

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on pull request #2403:
URL: https://github.com/apache/mynewt-core/pull/2403#issuecomment-716187783


   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] rafacouto commented on a change in pull request #2403: Detect connected programmer to download and debug firmware

Posted by GitBox <gi...@apache.org>.
rafacouto commented on a change in pull request #2403:
URL: https://github.com/apache/mynewt-core/pull/2403#discussion_r516974935



##########
File path: hw/scripts/common.sh
##########
@@ -76,3 +76,27 @@ parse_extra_jtag_cmd() {
     echo $NEW_EXTRA_JTAG_CMD
     EXTRA_JTAG_CMD=$NEW_EXTRA_JTAG_CMD
 }
+
+# Try to detect connnected programmers
+detect_programmer() {
+
+    # scan USB for well-known VID:PID
+    USB_DEV=$(ls /sys/bus/hid/devices)

Review comment:
       I've trusted on sysfs too much :angel: _lsusb_ command is the right way. Reviewing now... Thanks for your comments :+1: 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2403: Detect connected programmer to download and debug firmware

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on pull request #2403:
URL: https://github.com/apache/mynewt-core/pull/2403#issuecomment-717258790


   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2403: Detect connected programmer to download and debug firmware

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on pull request #2403:
URL: https://github.com/apache/mynewt-core/pull/2403#issuecomment-717258790


   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2403: Detect connected programmer to download and debug firmware

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on pull request #2403:
URL: https://github.com/apache/mynewt-core/pull/2403#issuecomment-721410087


   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] rafacouto commented on pull request #2403: Detect connected programmer to download and debug firmware

Posted by GitBox <gi...@apache.org>.
rafacouto commented on pull request #2403:
URL: https://github.com/apache/mynewt-core/pull/2403#issuecomment-717220009


   > Would it make sense for some of the code to move to `openocd.sh`? This way more BSPs can benefit from this change.
   
   You are right: moved openocd code to openocd.sh script 
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] caspermeijn commented on pull request #2403: Detect connected programmer to download and debug firmware

Posted by GitBox <gi...@apache.org>.
caspermeijn commented on pull request #2403:
URL: https://github.com/apache/mynewt-core/pull/2403#issuecomment-716753911


   I like this idea. I have a ST-link V2 myself, so I will not benefit directly. This patch work on my machine.
   
   Would it make sense for some of the code to move to `openocd.sh`? This way more BSPs can benefit from this change.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] kasjer commented on a change in pull request #2403: Detect connected programmer to download and debug firmware

Posted by GitBox <gi...@apache.org>.
kasjer commented on a change in pull request #2403:
URL: https://github.com/apache/mynewt-core/pull/2403#discussion_r516953393



##########
File path: hw/scripts/common.sh
##########
@@ -76,3 +76,27 @@ parse_extra_jtag_cmd() {
     echo $NEW_EXTRA_JTAG_CMD
     EXTRA_JTAG_CMD=$NEW_EXTRA_JTAG_CMD
 }
+
+# Try to detect connnected programmers
+detect_programmer() {
+
+    # scan USB for well-known VID:PID
+    USB_DEV=$(ls /sys/bus/hid/devices)

Review comment:
       Are you sure that _stlink_ and _jlink_ are **HID** devices.
   It does not show up on my Linux (for Windows there is no such folder but we can leave it for now).
   `lsusb` on the other hand does show instances of stlink, jlink and dap.
   Maybe command is valid for Mac?

##########
File path: hw/scripts/common.sh
##########
@@ -76,3 +76,27 @@ parse_extra_jtag_cmd() {
     echo $NEW_EXTRA_JTAG_CMD
     EXTRA_JTAG_CMD=$NEW_EXTRA_JTAG_CMD
 }
+
+# Try to detect connnected programmers

Review comment:
       typo in `connnected`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org