• AVR Freaks

Build Error "Cannot CD to nbproject (Name is nonexistent or not a directory)"

Author
travisn
New Member
  • Total Posts : 12
  • Reward points : 0
  • Joined: 2016/08/24 11:15:12
  • Location: 0
  • Status: offline
2016/10/21 16:13:00 (permalink)
0

Build Error "Cannot CD to nbproject (Name is nonexistent or not a directory)"

During build I get this error and cannot proceed. 'nbproject' might be related to NetBeans. (I am running Windows 10 with 2016a with Embedded Coder.)
 
### Build procedure for model: 'BidetWaterHeater_PIC33FJ256GP710A' aborted due to an error.
Cannot propose to program chip from Matlab: Either file model_PIC33FJ256GP710A.elf does not exist or MPLAB X API is not available on this system.
* Visit the Microchip Blockset Forum for any questions, issues, share tricks.
* Visit the Microchip Wiki for further informations and examples.
-----------------------------------------------------------------------------------------
* MPLAB X project: model_PIC33FJ256GP710A.X then select the project folder
-----------------------------------------------------------------------------------------

***** Error detected. Links above are provided for debug purpose only (.elf file might not be current).
The call to MCHP_dsPIC_stf_make_rtw_hook, during the before_make hook generated the following error:
Cannot CD to nbproject (Name is nonexistent or not a directory).
The build process will terminate as a result.
Caused by:
Cannot CD to nbproject (Name is nonexistent or not a directory).
 
Any help would be appreciated. 
 
Travis
#1
Lubin
Moderator
  • Total Posts : 353
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Build Error "Cannot CD to nbproject (Name is nonexistent or not a directory)" 2016/10/22 06:30:40 (permalink)
0
Hi Travis,
 
This is an unexpected error. Could you post the complete compilation report? Do you see this behavior with example models provided with the blockset ?
 
I try posting an experimental patch in Private Message (PM)
 
In the meantime, you should find a .bat file within the .X folder created. Starting that batch file will compile your project. Trick: You can start a .bat file directly from Matlab by typing its name preceded with ! :
>>!myBatchFile
 
You could then program it using the picflash utility (Alternativley, you might use IPE or MPLAB X).
 
Lubin
#2
travisn
New Member
  • Total Posts : 12
  • Reward points : 0
  • Joined: 2016/08/24 11:15:12
  • Location: 0
  • Status: offline
Re: Build Error "Cannot CD to nbproject (Name is nonexistent or not a directory)" 2016/10/24 08:14:45 (permalink)
0
Lubin,
 
Here is the complete compilation report. 
 
Microchip Model Check before compilation
This model is not using the most recent compiler version available on this system. Please considere adding the Compiler Option block to the model an update the compiler selection.
TIMERS:
1 timers used. Remaining timers: 8
Timer 1
- Resolution : 49.5049504950495(ns)
- Period : 1(ms)
- Used for : Time Step (TS)
- - - - - - - - - -
[Pin] Port - Desc (With link to block)
- - - - - - - - - -
[49] RF4 - U2RX
[50] RF5 - U2TX
[51] RF3 - U1TX
[52] RF2 - U1RX

33FJ256GP710A, 4 pins used.
- - - - - - - - - -
Code Generation 3
Elapsed: 51 sec
Warning: Removed 'C:\path\model_PIC33FJ256GP710A.X\html\css' from the MATLAB path for this MATLAB session.
See 'doc path' for more information.
Warning: Removed 'C:\path\model_PIC33FJ256GP710A.X\html\js' from the MATLAB path for this MATLAB session.
See 'doc path' for more information.
Warning: Removed 'C:\path\model_PIC33FJ256GP710A.X\html' from the MATLAB path for this MATLAB session.
See 'doc path' for more information.
### Build procedure for model: 'model_PIC33FJ256GP710A' aborted due to an error.
Cannot propose to program chip from Matlab: Either file model_PIC33FJ256GP710A.elf does not exist or MPLAB X API is not available on this system.
* Visit the Microchip Blockset Forum for any questions, issues, share tricks.
* Visit the Microchip Wiki for further informations and examples.
-----------------------------------------------------------------------------------------
* MPLAB X project: model_PIC33FJ256GP710A.X then select the project folder
-----------------------------------------------------------------------------------------

***** Error detected. Links above are provided for debug purpose only (.elf file might not be current).
The call to MCHP_dsPIC_stf_make_rtw_hook, during the before_make hook generated the following error:
Cannot CD to nbproject (Name is nonexistent or not a directory).
The build process will terminate as a result.
Caused by:
Cannot CD to nbproject (Name is nonexistent or not a directory).
 
#3
travisn
New Member
  • Total Posts : 12
  • Reward points : 0
  • Joined: 2016/08/24 11:15:12
  • Location: 0
  • Status: offline
Compilation of example model gives the same error 2016/10/24 08:51:45 (permalink)
0
Hi Lubin,
 
I tried to compile "Microstick_II_33FJ128MC802_bare" but got the same error that I saw with my model. Below is the complete compilation report. 
 
 
 
Microstick_II_33FJ128MC802_bare
Build 3 1 Clear
09:43 AM Elapsed: 19 sec
Target definition is different from that in the model. Updating target according to the new definition. The following parameters were updated:
ProdLargestAtomicInteger
Microchip Model Check before compilation
This model is not using the most recent compiler version available on this system. Please considere adding the Compiler Option block to the model an update the compiler selection.
TIMERS:
1 timers used. Remaining timers: 4
Timer 1
- Resolution : 271.370420624152(ns)
- Period : 1(ms)
- Used for : Time Step (TS)
- - - - - - - - - -
[Pin] Port - Desc (With link to block)
- - - - - - - - - -
[2] RA0 - DOU

33FJ128MC802, 1 pins used.
- - - - - - - - - -
Code Generation 1
Elapsed: 10 sec
### Generating code into build folder: C:\Users\TNiederhauser\Documents\SimulinkMicrochipExamples\Microstick_II_33FJ128MC802_bare.X
### Invoking Target Language Compiler on Microstick_II_33FJ128MC802_bare.rtw
### Using System Target File: C:\Program Files (x86)\Microchip\MatlabTools\blocks\MCHP_dsPIC_stf.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
.
### Caching model source code
### Writing main
--- Multi Tasking implementation ---
.
### Writing header file Microstick_II_33FJ128MC802_bare.h
### Writing header file Microstick_II_33FJ128MC802_bare_types.h
### Writing header file rtwtypes.h
.
### Writing source file Microstick_II_33FJ128MC802_bare.c
### Writing header file Microstick_II_33FJ128MC802_bare_private.h
### Writing header file rtmodel.h
### Writing source file Microstick_II_33FJ128MC802_bare_main.c
### TLC code generation complete.
### Creating project marker file: rtw_proj.tmw
.
### Processing Template Makefile: C:\Program Files (x86)\Microchip\MatlabTools\mchp\MCHP_dsPIC.tmf
### Creating Microstick_II_33FJ128MC802_bare.mk from C:\Program Files (x86)\Microchip\MatlabTools\mchp\MCHP_dsPIC.tmf
### Building Microstick_II_33FJ128MC802_bare: "C:\Users\TNiederhauser\Documents\SimulinkMicrochipExamples\Microstick_II_33FJ128MC802_bare.X\Microstick_II_33FJ128MC802_bare.bat"

C:\Users\TNiederhauser\Documents\SimulinkMicrochipExamples\Microstick_II_33FJ128MC802_bare.X>"C:\Program Files\MATLAB\R2016a\bin\win64\gmake" -f Microstick_II_33FJ128MC802_bare.mk GENERATE_ASAP2=0 MCHP_AUTO_FLASH=0 MCHP_MULTITHREAD_COMPILATION=0 ISPROTECTINGMODEL=NOTPROTECTING
Compiling: Microstick_II_33FJ128MC802_bare_main.c
"C:/PROGRA~2/MICROC~1/xc16/v1.26/bin/xc16-gcc.exe" -c -mcpu=33FJ128MC802 -omf=elf -g -O3 -I. -I.. -IC:/PROGRA~1/MATLAB/R2016a/rtw/c/ert -IC:/PROGRA~1/MATLAB/R2016a/extern/include -IC:/PROGRA~1/MATLAB/R2016a/simulink/include -IC:/PROGRA~1/MATLAB/R2016a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2016a/rtw/c/src/ext_mode/common -IC:/Users/TNiederhauser/Documents/SimulinkMicrochipExamples/Microstick_II_33FJ128MC802_bare.X -IC:/Users/TNiederhauser/Documents/SimulinkMicrochipExamples -IC:/PROGRA~2/MICROC~1/xc16/v1.26/include -IC:/PROGRA~2/MICROC~1/xc16/v1.26/support/dsPIC33F/h -IC:/PROGRA~2/MICROC~1/xc16/v1.26/support/generic/h Microstick_II_33FJ128MC802_bare_main.c -o Microstick_II_33FJ128MC802_bare_main.o
Options have been disabled due to restricted license
Visit http://www.microchip.com/ to purchase a new key.
Microstick_II_33FJ128MC802_bare_main.c:128:1: warning: '_FOSCSEL' definition has been deprecated: consider migrating to #pragma config
Microstick_II_33FJ128MC802_bare_main.c:128:1: warning: '_FOSC' definition has been deprecated: consider migrating to #pragma config
Microstick_II_33FJ128MC802_bare_main.c:128:1: warning: '_FWDT' definition has been deprecated: consider migrating to #pragma config
Microstick_II_33FJ128MC802_bare_main.c:128:1: warning: '_FICD' definition has been deprecated: consider migrating to #pragma config
Compiling: Microstick_II_33FJ128MC802_bare.c
"C:/PROGRA~2/MICROC~1/xc16/v1.26/bin/xc16-gcc.exe" -c -mcpu=33FJ128MC802 -omf=elf -g -O3 -I. -I.. -IC:/PROGRA~1/MATLAB/R2016a/rtw/c/ert -IC:/PROGRA~1/MATLAB/R2016a/extern/include -IC:/PROGRA~1/MATLAB/R2016a/simulink/include -IC:/PROGRA~1/MATLAB/R2016a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2016a/rtw/c/src/ext_mode/common -IC:/Users/TNiederhauser/Documents/SimulinkMicrochipExamples/Microstick_II_33FJ128MC802_bare.X -IC:/Users/TNiederhauser/Documents/SimulinkMicrochipExamples -IC:/PROGRA~2/MICROC~1/xc16/v1.26/include -IC:/PROGRA~2/MICROC~1/xc16/v1.26/support/dsPIC33F/h -IC:/PROGRA~2/MICROC~1/xc16/v1.26/support/generic/h Microstick_II_33FJ128MC802_bare.c -o Microstick_II_33FJ128MC802_bare.o
Options have been disabled due to restricted license
Visit http://www.microchip.com/ to purchase a new key.
### BUILD_MODE real_time
"C:/PROGRA~2/MICROC~1/xc16/v1.26/bin/xc16-gcc.exe" -mcpu=33FJ128MC802 Microstick_II_33FJ128MC802_bare_main.o Microstick_II_33FJ128MC802_bare.o C:/PROGRA~2/MICROC~1/xc16/v1.26/lib/libpic30-elf.a C:/PROGRA~2/MICROC~1/xc16/v1.26/lib/libm-elf.a C:/PROGRA~2/MICROC~1/xc16/v1.26/lib/libc-elf.a C:/PROGRA~2/MICROC~1/xc16/v1.26/lib/libq-elf.a C:/PROGRA~2/MICROC~1/xc16/v1.26/lib/libq-dsp-elf.a -o Microstick_II_33FJ128MC802_bare.elf -omf=elf -Wl,--script="C:/PROGRA~2/MICROC~1/xc16/v1.26/support/dsPIC33F/gld/P3D789~1.GLD",-t,--report-mem,-Map=info.map,-cref,--memorysummary,memoryfile.xml
c:\progra~2\microc~1\xc16\v1.26\bin\bin\..\bin/elf-ld.exe: mode pic30_elf32
Microstick_II_33FJ128MC802_bare_main.o
Microstick_II_33FJ128MC802_bare.o
(C:/PROGRA~2/MICROC~1/xc16/v1.26/lib/libpic30-elf.a)crt0_standard.o
(C:/PROGRA~2/MICROC~1/xc16/v1.26/lib/libpic30-elf.a)data_init_standard.o


xc16-ld 1.26 (A)

Program Memory [Origin = 0x200, Length = 0x15600]

section address length (PC units) length (bytes) (dec)
------- ------- ----------------- --------------------
.text 0x200 0x130 0x1c8 (456)
.const 0x330 0x2 0x3 (3)
.text 0x332 0x18 0x24 (36)
.dinit 0x34a 0x14 0x1e (30)
.shared.dinit 0x35e 0x2 0x3 (3)

Total program memory used (bytes): 0x210 (528) <1%


Ivt Memory [Origin = 0x4, Length = 0xfc]

section address length (PC units) length (bytes) (dec)
------- ------- ----------------- --------------------
.ivt._T1Interrupt 0x1a 0x2 0x3 (3)


Aivt Memory [Origin = 0x104, Length = 0xfc]

section address length (PC units) length (bytes) (dec)
------- ------- ----------------- --------------------


Data Memory [Origin = 0x800, Length = 0x4000]

section address alignment gaps total length (dec)
------- ------- -------------- -------------------
.nbss 0x800 0 0xa (10)
.bss 0x80a 0 0x4 (4)

Total data memory used (bytes): 0xe (14) <1%


Dynamic Memory Usage

region address maximum length (dec)
------ ------- ---------------------
heap 0 0 (0)
stack 0x80e 0x3ff2 (16370)

Maximum dynamic memory (bytes): 0x3ff2 (16370)
+++ Created executable: Microstick_II_33FJ128MC802_bare.elf
### Created Microstick_II_33FJ128MC802_bare.elf successfully (or it was already up to date)
### Build procedure for model: 'Microstick_II_33FJ128MC802_bare' aborted due to an error.
Cannot propose to program chip from Matlab: Either file Microstick_II_33FJ128MC802_bare.elf does not exist or MPLAB X API is not available on this system.
* Visit the Microchip Blockset Forum for any questions, issues, share tricks.
* Visit the Microchip Wiki for further informations and examples.
-----------------------------------------------------------------------------------------
* MPLAB X project: Microstick_II_33FJ128MC802_bare.X then select the project folder
-----------------------------------------------------------------------------------------

***** Error detected. Links above are provided for debug purpose only (.elf file might not be current).
The call to MCHP_dsPIC_stf_make_rtw_hook, during the after_make hook generated the following error:
Cannot CD to nbproject (Name is nonexistent or not a directory).
The build process will terminate as a result.
Caused by:
Cannot CD to nbproject (Name is nonexistent or not a directory).
Component: Simulink | Category: Model error
 
 
#4
travisn
New Member
  • Total Posts : 12
  • Reward points : 0
  • Joined: 2016/08/24 11:15:12
  • Location: 0
  • Status: offline
Reinstalling the block set and the latest patch did not help 2016/10/25 08:21:59 (permalink)
0
-- Reinstalling the block set and the latest patch did not help. The same error came up. 
--Deleting the *.X folder so it could be recreated with new Build did not help.
--MPLAB X and MPLAB IPE are **not usable** with high resolution 4K monitors.
--MPLAB Xpress is very awkward to use when trying to copy c and h files generated by Simulink. Also, it doesn't support many devices. 
 
I have not yet tried the Microelektronika picflash utility.
 
 
post edited by travisn - 2016/10/25 08:23:21
#5
travisn
New Member
  • Total Posts : 12
  • Reward points : 0
  • Joined: 2016/08/24 11:15:12
  • Location: 0
  • Status: offline
Can't find it 2016/10/25 08:29:18 (permalink)
0
I can't find picflash...don't know what it is or how to get it. 
#6
travisn
New Member
  • Total Posts : 12
  • Reward points : 0
  • Joined: 2016/08/24 11:15:12
  • Location: 0
  • Status: offline
Interfering? 2016/10/25 08:31:53 (permalink)
0
I recently installed for STM and TI. Maybe they are interfering. 
 
--Update--
 
I uninstalled: 
Embedded Coder Support Package for Texas Instruments C2000 Processors version 16.1.2 
Embedded Coder Support Package for STMicroelectronics STM32F4-Discovery Board version 16.1.4 
Embedded Coder Support Package for ARM Cortex-M Processors version 16.1.2 
 
Restarted MATLAB and tried to compile something. It didn't work. I still go the same error.
 
post edited by travisn - 2016/10/25 09:42:49
#7
Lubin
Moderator
  • Total Posts : 353
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Interfering? 2016/10/25 12:11:34 (permalink)
0
Hi Travis,
 
I sent you a Private Message (PM) with my contact you might find in the forum menu on top.
I would like to ask you testing a patch on your setup which will not solve the issue, but will resume the compilation process on an MPLAB X project creation failure. MPLAB X project is not required, except if you need to tweak code but this is hardly the case.
 
We did not get such issue in the past. I would need further input to understand what cause the issue. I would be interested to know
1) which toolbox you have on your matlab setup (type ver at matlab prompt)
2) what result you get if you type which('nbproject') at matlab prompt
3) did you added the .X folder created to the matlab path ? I do not understand message from your report like: "Warning: Removed 'C:\path\model_PIC33FJ256GP710A.X\html\css' from the MATLAB path for this MATLAB session."
4) could you try compiling model from another path (the path word in the path might cause issue ???
 
I noticed that when you compiled the example project you sucessfully obtained the binary file:
"+++ Created executable: Microstick_II_33FJ128MC802_bare.elf "
 
picflash is an utility distributed with the blockset to flash binary from matlab. Just type picflash at matlab prompt and you will be prompted to select programmer (if more than one is connected on your setup), and the binary file to program. 
 
Thanks,
Lubin
#8
travisn
New Member
  • Total Posts : 12
  • Reward points : 0
  • Joined: 2016/08/24 11:15:12
  • Location: 0
  • Status: offline
Re: Interfering? 2016/10/25 13:17:23 (permalink)
0
Hi Lubin,
 
For the past 2 hours I have been running. An electrical engineer I work with suggested that I create a folder in the '*.X' folder called 'nbproject'. I did not put anything in the folder. That is all it took. For some reason, Simulink could not create the folder, 'nbproject'. I think I understand the error message now.   
 
1) which toolbox you have on your matlab setup (type ver at matlab prompt)
>> ver
----------------------------------------------------------------------------------------------------
MATLAB Version: 9.0.0.341360 (R2016a)
MATLAB License Number: 40472586
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 14393)
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
MATLAB                                                Version 9.0         (R2016a)
Simulink                                              Version 8.7         (R2016a)
Embedded Coder                                        Version 6.10        (R2016a)
Embedded Target for Microchip                         Version 3.38        (R20xx)
MATLAB Coder                                          Version 3.1         (R2016a)
Simulink Coder                                        Version 8.10        (R2016a)
Stateflow                                             Version 8.7         (R2016a)
 
2) what result you get if you type which('nbproject') at matlab prompt
I can see the 'nbproject' folder in the *.X folder but it is not currently on the path.
>> which('nbproject')
'nbproject' not found.
 
3) did you added the .X folder created to the matlab path ? I do not understand message from your report like: "Warning: Removed 'C:\path\model_PIC33FJ256GP710A.X\html\css' from the MATLAB path for this MATLAB session."
The '*.X' folder is in the path
--Update-- 
I removed the '*.X' folder from the path and built and I did not get that warning. 
I added the '*.X' folder to the path and built and the following message appeared.
Warning: Removed 'C:\repos\MedicToiletControl\BidetWaterHeater\BidetWaterHeater_PIC33FJ256GP710A.X\dist\default\production' from the MATLAB path for this MATLAB session.
See 'doc path' for more information.
One message I wonder about is
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
 
4) could you try compiling model from another path (the path work in the path might cause issue ???
--I build the model from a different location. I got the same error as before. The new '*.X' folder does not contain the folder called 'nbproject'. This is consistent with the error message.
--I created a folder called 'nbproject' in the new '*.X' folder and I left the folder empty. I built the model again. This time the build proceeded with no problems and the code was flashed to the device! The warning you mentioned in 3) did not appear.
 
post edited by travisn - 2016/10/25 13:27:15
#9
Lubin
Moderator
  • Total Posts : 353
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Interfering? 2016/10/25 14:54:55 (permalink)
3 (1)
Hi Travis,
 
Thanks for detailed inputs.  Could not provide any input about
"WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5."
 
Do you have any versioning system which might interfere ? (git/svn/hg...)
Could you go in the .X folder, remove the nbproject if any and type
  • "exist('nbproject','dir')". What result do you get ? Then, type:
  • "mkdir('nbproject');" Is the folder created ?
Thanks,
Lubin
 
 
#10
travisn
New Member
  • Total Posts : 12
  • Reward points : 0
  • Joined: 2016/08/24 11:15:12
  • Location: 0
  • Status: offline
Re: Interfering? 2016/10/26 09:26:48 (permalink)
0
Do you have any versioning system which might interfere ? (git/svn/hg...)
I do use git.
 
Could you go in the .X folder, remove the nbproject if any and type
I added a .X folder to the path and navigated to it. It does not contain nbproject. I removed other folders from the path.
  • "exist('nbproject','dir')". What result do you get ? Then, type:
  • "mkdir('nbproject');" Is the folder created ?
>> exist('nbproject','dir')
ans =
0
 
>> mkdir('nbproject')
>>
>> exist('nbproject','dir')
ans =
7
 
Yes, the nbproject folder does now exist in the .X folder. 
 
 
 
 
 
#11
Lubin
Moderator
  • Total Posts : 353
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Interfering? 2016/10/26 11:31:08 (permalink)
0
Hi Travis,
 
Thanks for theses tests. Theses are instructions we used to check for nbproject and to create that folder if it does not already exist. Thus I am missing something as the commands output seems ok when you test them from the command line.
 
Please contact me back after 2nd of november to have a closer look.
Does the experimental patch provides any better behavior with that error making the tool easier to use ? 
 
Lubin
#12
Jump to:
© 2019 APG vNext Commercial Version 4.5