This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

https://nordicsemiconductor.github.io/asset-tracker-cloud-docs/v1.5.x/docs/aws/GettingStarted/Flashing.html

Hello, the directions indicate that it is possible to use Windows Subsystem for Linux, and you instruct us to use version 2 of WSL, but I have no access to the COM ports so I cannot flash from WSL -- a severe inconvenience. I read somewhere that only WSL 1 allows access to COM ports. What gives here?

Parents
  • Holy Crap! -- I was able to get that nasty "node cli flash" to work in the msys2 bash environment I start from ToolChain manager. One stumbling block was JLinkExe. They really mean JLinkExe.exe and not JLink.exe. Apparently the SEGGER folks never heard of Java and the JLink command in the Java JDK, etc. I copied SEGGER's JLink.exe to JLinkEXE.exe in directory ~/bin after creating ~/bin as I noticed that directory was in my PATH. Then I just needed to export my correct AWS credentials and I was ready to run the command. I put the certificates into slot 43 and verified afterwards with an AT_Client+LTE Link Monitor that they got there.

    However, nothing doing when I try this from a Windows console, can you tell me what is wrong?

    C:\Users\Burt\cat-tracker-aws>node cli flash --dk -p COM10 -s 44 --debug -f "/c/ncs/v1.5.0/nrf/applications/asset_tracker_v2/build/zephyr/merged.hex" 352656100392227
    An unhandled exception occured!
    Exception origin: "uncaughtException"
    TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:329:5)
    at validateString (node:internal/validators:129:11)
    at Object.resolve (node:path:147:9)
    at Object.<anonymous> (C:\Users\Burt\cat-tracker-aws\dist\cli\commands\flash.js:17:28)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (C:\Users\Burt\cat-tracker-aws\dist\cli\cli.js:24:17)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:996:19) {
    code: 'ERR_INVALID_ARG_TYPE'
    }

    It is really good that the bash shell works. If someone builds using WSL 2, they can then set up cat-tracker-aws in their bash environment, copy the certificate directory from their WSL and their AWS key/secret key also, and make progress. Assuming they have a complete set of directions in the documentation. Well, I guess not really, it was a fun experiment, but it would be quicker to do the old fashioned annoying process with Programmer and LTE Link Monitor.

    And then there is always GitHub - inductivekickback/cred: A command line tool for writing credentials to nRF91 devices via the SWD interface which is what I was trying to think of earlier.

  • Nice digging into this, I will keep an eye on the issue reports around the flash command ... and eventually provide an alternative using nrfjprog.

    The issue you ran into was caused a poor home directory detection, and is fixed here: https://github.com/NordicSemiconductor/asset-tracker-cloud-aws-js/commit/0924c0f0220fcd7d7dca7fc0ec9b16dbebd4381c

    A fix release will be available shortly.

  • Nice Windows fix -- that error disappeared after I updated. I guess I will close this ticket now. Thanks again, Markus.

Reply Children
No Data
Related