I generally ignore those problems with the C/C++ Extension. There may be a way to fix it but I haven’t had time to dig in. Everything compiles ok though right jhox616?
VSC include errors
- Edited
Here is the output I get in the terminal:
https://pasteboard.co/HSIK6dztFNsU.png
So it doesn’t appear as if it flashed correctly.
- In bootmode.
- Computer made the da-da when USB was connected.
Looking at the driver:
- Says working properly.
- 9600 Baud.
Terminal: - [1/30] Performing build step for ‘tfm’
ninja: no work to do. - [⅕] Performing build step for ‘mcuboot_subimage’
ninga: now work to do.
…
Device found but failed to open: Operation not supported or unimplemented on this platform.
Could not open device 10c4:ea60
Executing task: newtmgr -c vscode-zephyr-tools image upload c:\Users\jerra\Zephyr\nfed\samples\gps\build\zephyr\app_update.bin -r 3 -t 0.25
*Error: NMP timeout
Tried a different USB cable.
Then I got “Load error, did you init your project”
Yes I believe it did. Now it would appear I have an issue flashing to device.
- Edited
Hey jhox616
A few things to try:
When you plug your board in, does it initialize as a COM port? (check device manager) Take note of that COM port info if it does. If it doesn’t make sure you have the drivers installed.
Make sure that you’re targeting the correct COM port for bootloadiing. You can run the
Zephyr Tools: Setup Newtmgr
command. Make sure you target the COM port from step 1.Make sure the board goes into bootloader mode. If you’re on Windows this won’t happen automatically. You’ll have to manually do it. (While that video is old, it still works for ALL variants of the nRF9160 Feather)
Then attempt to load using
Zephyr Tools: Load via Bootloader
Hope that helps!
- It initializes as COM3.
- COM3 and 115200 baud set in Zephyr Tools + Device Manager.
- It is in Bootloader Mode (Solid blue light is on)
x - Device found but doesn’t connect.
x -“Load error! Did you init your project?”
What version of the extension are you using?
- Edited
jhox616 I played around with the include directories and reduced/removed most of the errors:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/zephyr/include",
"${workspaceFolder}/<path to your>/include",
"${workspaceFolder}/<path to your>/app/build/zephyr/include/generated"
],
"defines": [],
"compilerPath": "/<path to>/<the toolchain>/.zephyrtools/toolchain/zephyr-sdk-0.15.1/arm-zephyr-eabi/bin//arm-zephyr-eabi-gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-arm"
}
],
"version": 4
}
That’s my .vscode/c_cpp_properties.json
file.
- Edited
Still doesn’t find the autoconf.h
with the CONFIG variables since it’s imported via ninja
. I added a forced include to it:
I’ll keep playing with it and update you if I find any other tips/tricks.
- Edited
I’m on Windows. I’m not sure what the path to the compiler is so you will notice I didn’t include it yet.
Also mine had “configurationProvider”: “nrf-connect” line not sure if I should leave that in.
So now this is what mine looks like:
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/zephyr/include",
],
"defines": [],
"compilerPath": "",
"configurationProvider": "nrf-connect",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-arm"
}
],
"version": 4
}
- Edited
I don’t know where the “/app/build/zephyr/include/generated/autoconf.h” file is located.
That is of less concern. I wonder if not having the compilerPath specified is messsing it up.
It is still saying “Load Error did you init?” and “Load Complete” and the build got a “Build Complete” popup as well. So, I’m not sure what to do now.
Still getting could not open device “<Device-ID>” even though it is detected and device manager says it is working properly.
*If I take the Feather out of bootloader-mode and go to Serial Monitor then it says “Connected to COM3!”
- In trying to send AT-Commands to the firmware I just get an error response.
- Edited
I don’t know where the “/app/build/zephyr/include/generated/autoconf.h” file is located.
Are you using the NFED repo? The build folder is where you need to look. That will be located in whichever application you’re trying to build. Or if you copied and modified an already existing sample, it should be in that folder if you’re building with Zephyr Tools: Build
It would be helpful if you can send a log. If you’re using the Zephyr Tools: Serial Monitor
command it will automatically save a .txt file to your application folder. Otherwise it’s very hard to debug your problem.
- Edited
I inited the repo from the link that was in the documentation.
NFED on my machine doesn’t have an application folder.
I’m not sure how to get a log through VSC I’m pretty sure I have it turned on though.
- There is a main log and others for various purposes but to get the log for your extension I’m not sure how to do that.
If you can tell me how to get a log I will be glad to get one to you.
*Just a reminder the build does say complete and the usb is set up and connecting. It is just failing to flash.
Here I think is the log you wanted for my extensions:
2023-02-24 10:35:38.294 [info] Extension host with pid 8700 started
2023-02-24 10:35:38.294 [info] Skipping acquiring lock for c:\Users\jerra\AppData\Roaming\Code\User\workspaceStorage\35576f6160afbeb3e25baabc7b9b635f.
2023-02-24 10:35:38.337 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
2023-02-24 10:35:38.360 [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
2023-02-24 10:35:38.442 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.git
2023-02-24 10:35:38.452 [info] ExtensionService#_doActivateExtension nordic-semiconductor.nrf-connect, startup: true, activationEvent: '*'
2023-02-24 10:35:38.686 [info] ExtensionService#_doActivateExtension nordic-semiconductor.nrf-kconfig, startup: true, activationEvent: '*'
2023-02-24 10:35:38.757 [info] ExtensionService#_doActivateExtension nordic-semiconductor.nrf-terminal, startup: true, activationEvent: '*'
2023-02-24 10:35:39.089 [info] ExtensionService#_doActivateExtension ms-vscode.cpptools, startup: true, activationEvent: 'workspaceContains:/.vscode/c_cpp_properties.json'
2023-02-24 10:35:41.625 [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*'
2023-02-24 10:35:42.629 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
2023-02-24 10:35:42.651 [info] ExtensionService#_doActivateExtension nordic-semiconductor.nrf-devicetree, startup: false, activationEvent: 'api', root cause: nordic-semiconductor.nrf-connect
2023-02-24 10:35:42.799 [warning] DiagnosticCollection with name 'kconfig' does already exist.
2023-02-24 10:35:42.885 [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
2023-02-24 10:35:43.697 [info] ExtensionService#_doActivateExtension vscode.configuration-editing, startup: false, activationEvent: 'onLanguage:json'
2023-02-24 10:35:43.721 [info] ExtensionService#_doActivateExtension vscode.extension-editing, startup: false, activationEvent: 'onLanguage:json'
2023-02-24 10:35:43.748 [info] ExtensionService#_doActivateExtension vscode.json-language-features, startup: false, activationEvent: 'onLanguage:json'
2023-02-24 10:35:43.847 [info] ExtensionService#_doActivateExtension vscode.npm, startup: false, activationEvent: 'onLanguage:json'
2023-02-24 10:35:43.908 [info] ExtensionService#_doActivateExtension ms-python.python, startup: false, activationEvent: 'onLanguage:json'
2023-02-24 10:35:44.291 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
2023-02-24 10:35:48.348 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2023-02-24 10:35:48.362 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2023-02-24 10:35:48.423 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender, startup: false, activationEvent: 'onStartupFinished'
2023-02-24 10:35:48.457 [info] ExtensionService#_doActivateExtension circuitdojo.zephyr-tools, startup: false, activationEvent: 'onStartupFinished'
2023-02-24 10:35:48.972 [info] ExtensionService#_doActivateExtension mcu-debug.debug-tracker-vscode, startup: false, activationEvent: 'onStartupFinished', root cause: marus25.cortex-debug
2023-02-24 10:35:49.009 [info] ExtensionService#_doActivateExtension mcu-debug.memory-view, startup: false, activationEvent: 'onStartupFinished', root cause: marus25.cortex-debug
2023-02-24 10:35:49.065 [info] ExtensionService#_doActivateExtension mcu-debug.rtos-views, startup: false, activationEvent: 'onStartupFinished', root cause: marus25.cortex-debug
2023-02-24 10:35:49.095 [info] ExtensionService#_doActivateExtension marus25.cortex-debug, startup: false, activationEvent: 'onStartupFinished'
2023-02-24 10:37:46.614 [info] Eager extensions activated
2023-02-24 11:24:08.878 [warning] DiagnosticCollection with name 'C/C++' does already exist.
2023-02-24 11:25:04.722 [error] CodeExpectedError: Task to terminate not found
at vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1566:56530
**Here is the log for Window:**
2023-02-24 10:35:37.216 [warning] Via 'product.json#extensionEnabledApiProposals' extension 'github.vscode-pull-request-github' wants API proposal 'commentsResolvedState' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
2023-02-24 10:35:39.585 [error] [Extension Host] ERROR: The system was unable to find the specified registry key or value.
2023-02-24 10:35:40.248 [info] [perf] Render performance baseline is 28ms
2023-02-24 10:35:40.864 [error] [Extension Host] ERROR: The system was unable to find the specified registry key or value.
2023-02-24 10:35:41.125 [error] [Extension Host] ERROR: The system was unable to find the specified registry key or value.
2023-02-24 10:35:43.114 [error] [Extension Host] ERROR: The system was unable to find the specified registry key or value.
2023-02-24 10:35:43.359 [error] [Extension Host] ERROR: The system was unable to find the specified registry key or value.
2023-02-24 10:35:43.673 [error] [Extension Host] ERROR: The system was unable to find the specified registry key or value.
2023-02-24 10:35:44.458 [error] [Extension Host] (node:8700) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
2023-02-24 10:35:46.188 [error] [Extension Host] ERROR: The system was unable to find the specified registry key or value.
2023-02-24 10:35:46.276 [error] [Extension Host] ERROR: The system was unable to find the specified registry key or value.
2023-02-24 11:12:56.344 [warning] Settings pattern "application.*" doesn't match any settings
2023-02-24 11:15:48.301 [warning] Settings pattern "application.*" doesn't match any settings
2023-02-24 11:25:04.722 [error] Task to terminate not found: CodeExpectedError: Task to terminate not found
at vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1566:56530
The log file is saved in the application folder you’re building/using.
See that log-2022.. file? That’s the one I’m interested in. When you open a serial connection using Zephyr Tools: Serial Monitor
it will automatically generate this file. I’d like to see the output of what’s running on your board right now. There should be output since you haven’t been able to load new firmware yet.
The log file is saved in the application folder you’re building/using.
See that log-2022.. file? That’s the one I’m interested in. When you open a serial connection using Zephyr Tools: Serial Monitor
it will automatically generate this file. I’d like to see the output of what’s running on your board right now. There should be output since you haven’t been able to load new firmware yet.
The output from the factory test firmware should look something like this:
*** Booting Zephyr OS build v3.2.99-ncs1 ***
[00:00:00.501,190] <inf> battery: Setup AIN7 got 0
[00:00:00.506,439] <inf> battery: Battery setup: 0 1
[00:00:00.512,145] <inf> app: Test start!
[00:00:00.516,632] <inf> app: device is 0x314ec, name is pcf85063a@51
[00:00:00.525,451] <inf> littlefs: LittleFS version 2.5, disk version 2.0
[00:00:00.533,660] <inf> littlefs: FS at w25q32jv@0:0x0 is 1024 0x1000-byte blocks with 512 cycle
[00:00:00.543,121] <inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[00:00:00.550,964] <inf> littlefs: /lfs mounted
[00:00:00.555,938] <inf> app: /lfs mount: 0
[00:00:00.561,218] <inf> app: /lfs: bsize = 16 ; frsize = 4096 ; blocks = 1024 ; bfree = 1022
[00:00:00.570,312] <inf> app: Set up button at sw0 pin 12
[00:00:00.582,031] <inf> battery: raw 9504 ~ 2088 mV => 4176 mV
[00:00:00.588,409] <inf> app: Battery: 4176 mV
[00:00:00.594,482] <inf> app: Accel reading: #1 @ 594 ms
[00:00:00.601,654] <inf> pcf85063a: mode 0x16
[00:00:02.030,670] <inf> app: Timer event valid! Uptime: 1430
- Edited
jhox616 NFED on my machine doesn’t have an application folder.
The app
folder that I’m referring to is the application you chose when running Zephyr Tools: Change Project
Ok this weekend I’ll see if I can generate a log file and post it here. Thanks for all your help!
You’re welcome. We’ll figure this out!
- Edited
When I am connected via terminal to COM3 it just says it is connected but then I get no output from the device. (It has been flashed before, but not sure why I am getting any output)
I changed my project folder to the GPS example folder but after build and opening serial monitor it doesn’t seem to add a log file or the other files that your screenshot showed.
Here is a screenshot of the file-tree:
https://pasteboard.co/w5RXO4wDxcFq.png
UPDATE:
- I was able to get AT commands working so our connection is definitely good. Something to do with the extension and flashing still the issue…
- Edited
So I went back to the beginning and ran setup, init repo, etc. The build time seemed to take much longer which I took as a good sign.
Still getting(on flash via boot-loader)
"Device found but failed to open: Operation not supported or unimplemented on this platform
Could not open device 10c4:ea60″
Then a “NMP timeout” Error…
One thing I noticed is that while it was building it would not complete all of the pieces (x/x) on each load line. I found that odd…
I also got this notification: “Load error! Did you init your project?”