microsoft / devkit-sdk

Arduino library and package for the MXChip IoT DevKit
https://aka.ms/devkit
MIT License
69 stars 52 forks source link

Document multi-device and no-button configuration #1084

Open CIPop opened 3 years ago

CIPop commented 3 years ago

1. Multi-device scenarios

In an environment where multiple STLink devices are attached to a PC, it is still possible to use the DevKit-SDK toolset to connect and program MXChip. The following change to the toolset is required:

Edit the stlink script in C:\Users\<youruser>\AppData\Local\Arduino15\packages\AZ3166\tools\openocd\0.10.0/scripts/interface/stlink-v2-1.cfg and add the correct hla_serial number:

 #
# STMicroelectronics ST-LINK/V2-1 in-circuit debugger/programmer
#

interface hla
hla_layout stlink
hla_device_desc "ST-LINK/V2-1"
hla_vid_pid 0x0483 0x374b
hla_serial 0674DEADB33F8972DEADBEEF

2. No-touch (remote) configuration

To bypass the requirement of an (unlocked/dev) MXChip button press for flashing, create and run the following mxchip_config.ino. UART connectivity is required to configure the device:

#include "AZ3166WiFi.h"
#include "cli/console_cli.h"
#include "config.h"
#include "utility.h"
#include "SystemTickCounter.h"

//////////////////////////////////////////////////////////////////////////////////////////////////////////
// Arduino sketch
void setup()
{
  Screen.init();
  Screen.print(0, "IoT DevKit");
  Screen.print(2, "Initializing...");

  Screen.print(3, " > Serial");
  Serial.begin(115200);

  Screen.print(3, " > CLI SETUP");
  cli_main();
}

void loop()
{ 
  delay(1000);
}