MPLAB X freeze building using printf - build

My setup is:
MPLAB X IDE v3.40
C30 compiler v3.31
PIC24FJ128GA306
Mi problem comes when I try to use printf. I can print a string but not a variable.
This line is correctly bompiled:
printf("HI");
This line is not correctly builded:
unsigned int var;
var = 1;
printf("%u", var);
The same code works perfectly with other PIC (PIC24FJ512GA606) and compiler (XC16).
In both project we are using printf from the same library stdio.h
The problem comes when I try to build the project. If i use "printf("%u", var);" and build it, the IDE hangs and I have to cancel the building process. After it I can't clean the project, the IDE shows me the next text:
rm: no se puede borrar build/SF_Utility_v31_RS485/production/interrupts_remapped.o: Permission denied
rm: no se puede borrar build/SF_Utility_v31_RS485/production/mult.o: Permission denied
rm: no se puede borrar build/SF_Utility_v31_RS485/production/SF_debug.o: Permission denied
rm: no se puede borrar build/SF_Utility_v31_RS485/production/SF_formatter.o: Permission denied
rm: no se puede borrar build/SF_Utility_v31_RS485/production/SF_HAL_axis_references.o: Permission denied
rm: no se puede borrar build/SF_Utility_v31_RS485/production/SF_internal_comms.o: Permission denied
CLEAN FAILED (exit value 1, total time: 123ms)
If I go to the folder and try to delete manually, a message appears saying that I cant delete it because "pic30-elf-gcc.exe" is using it. I have to close the process and then y can clean and rebuild the project with "printf("Hi");"...
EDIT1: I can observe when I build the project that every files are compiled correctly. The problem comes with the linker... When I try to build the project it get hangs with the next line:
"C:\Program Files (x86)\Microchip\MPLAB C30\bin\pic30-gcc.exe" -omf=elf -mcpu=24FJ128GA306 -o dist/SF_Utility_v31_RS485/production/sf-device.production.elf build/SF_Utility_v31_RS485/production/DEE_Emulation/DEE_Emulation_16-bit_v2.2/DEE_Emulation_16-bit/DEE_Emulation_16-bit.o build/SF_Utility_v31_RS485/production/DEE_Emulation/DEE_Emulation_16-bit_v2.2/DEE_Emulation_16-bit/Flash_Operations.o build/SF_Utility_v31_RS485/production/RS485/SF_RS485.o build/SF_Utility_v31_RS485/production/src/ADC_Handler/ADC_Handler.o build/SF_Utility_v31_RS485/production/src/Event_Timer/osal_timers.o build/SF_Utility_v31_RS485/production/src/PWM/PWM_Core_Handler.o build/SF_Utility_v31_RS485/production/src/PWM/PWM_Func_Layer.o build/SF_Utility_v31_RS485/production/src/PWM/PWM_Hal_Layer.o build/SF_Utility_v31_RS485/production/HTS221.o build/SF_Utility_v31_RS485/production/LISXDH.o build/SF_Utility_v31_RS485/production/src/Tasks/LED_Status_Task.o build/SF_Utility_v31_RS485/production/src/Tasks/System_Task_Handler.o build/SF_Utility_v31_RS485/production/src/Tasks/Hum_Temp_Task.o build/SF_Utility_v31_RS485/production/configuration_bits.o build/SF_Utility_v31_RS485/production/main.o build/SF_Utility_v31_RS485/production/system.o build/SF_Utility_v31_RS485/production/traps.o build/SF_Utility_v31_RS485/production/user.o build/SF_Utility_v31_RS485/production/SF_controller.o build/SF_Utility_v31_RS485/production/SF_solar_calculations.o build/SF_Utility_v31_RS485/production/SF_solar_calculations_utils.o build/SF_Utility_v31_RS485/production/SF_time.o build/SF_Utility_v31_RS485/production/SF_tracker.o build/SF_Utility_v31_RS485/production/SF_settings.o build/SF_Utility_v31_RS485/production/SF_protocol.o build/SF_Utility_v31_RS485/production/SF_io_manager.o build/SF_Utility_v31_RS485/production/SF_inverter.o build/SF_Utility_v31_RS485/production/utils.o build/SF_Utility_v31_RS485/production/SF_main_loop.o build/SF_Utility_v31_RS485/production/SF_persistence.o build/SF_Utility_v31_RS485/production/SF_formatter_binary.o build/SF_Utility_v31_RS485/production/SF_GW_Common.o build/SF_Utility_v31_RS485/production/SF_tick.o build/SF_Utility_v31_RS485/production/mult.o build/SF_Utility_v31_RS485/production/SF_internal_comms.o build/SF_Utility_v31_RS485/production/interrupts_remapped.o build/SF_Utility_v31_RS485/production/SF_formatter.o build/SF_Utility_v31_RS485/production/SF_HAL_axis_references.o build/SF_Utility_v31_RS485/production/SF_debug.o -legacy-libc -Wl,--defsym=__MPLAB_BUILD=1,--heap=1024,-Map="prueba.map",-Tp24FJ128GA306.gld

I have the solution. The problem was that my project had the legacy libraries actives... Uncheking that option in the project configuration it is running correctly now.

Related

mingw32-make access denied when building wxWidgets

I get an error when I execute mingw32-make in cmd with the makefile.gcc found in the build\msw folder of the wxWidget decompressed zip. I followed the steps shown in this tutorial video.
The error is:
make (e=5): Acceso denegado.
mingw32-make: [makefile.gcc:5354: clean] Error 5 (ignored)
I tried adding "Everyone" with total control to the security tab in the properties option of the folder in which I had decompressed wxWidgets.
I changed the same option for make.exe file in C:\msys64\mingw64\bin
I read that it could be the antivirus, I'm using Windows Defender, I switched off the real time protection but it didn't change anything.
First of all, this is not a fatal error, as indicated by "(ignored)" at the end, so it's not clear what your actual problem is -- does the library get compiled or not?
Second, to debug problems such as this one, you could use the Process Monitor tool where you can find out accessing which file exactly triggers this error -- this could give you at least some idea. Without knowing it, it's really impossible to know what goes wrong on your machine.

hit roadblock while trying to compile lua for emscripten usage, using windows, "unable to find ar rcu"

i've been stuck on this problem for hours, without finding any solutions. I'm currently trying to compile lua 5.3.4 for Emscripten for use in my project. ive hit a roadblock thought, I need to compile it to a liblua.a file which ill later use when doing the emcc command line. but theres problems. heres the console output and what i do. ive gotten it to output .o files already. how do i put these in the .a (since i assume thats what its doing)
E:\code\liblua>make generic CC="emcc -s WASM=1"
cd src && make generic
make[1]: se ingresa al directorio `E:/code/liblua/src'
ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o 1lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
process_begin: CreateProcess(NULL, ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o, ...) failed.
make (e=2): El sistema no puede encontrar el archivo especificado. (system cannot find the specified file)
make[1]: *** [liblua.a] Error 2
make[1]: se sale del directorio `E:/code/liblua/src'
make: *** [generic] Error 2
what it says is that it cant find ar rcu, how do i use it on my system?
for reference, the system im trying to use can be found here https://github.com/vvanders/wasm_lua if its required
It looks like the makefile requires Un*x tools so I suggest:
Install Windows Subsystem for Linux 2 (WSL2).
Install the Ubuntu 20.04 distribution in WSL2.
Start a bash shell by double clicking the Ubuntu 20.04 LTS icon.
From the bash shell, install the tools needed. A minimal set for this whould be:
sudo apt install g++ binutils make libc-bin
... or for a more complete set of packages:
sudo apt install build-essential
Unpack the lua distribution (as yourself, not the root user) somewhere in your home directory and try building.

Permission denied to create temporary file in Visual Studio Code

When I try to 'Run Build Task' in VS Code using C/C++ plugin, I get the following error:
Assembler messages:
Fatal error: can't create C:\Users\UserName\AppData\Local\Temp\cc2Ad432.o: Permission denied
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command & 'C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\g++.exe' -g c:\Users\UserName\projects\helloworld\helloworld.cpp -o c:\Users\UserName\projects\helloworld\helloworld.exe" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
When I try to build a code in 'Code::Blocks' it displays the same error - Can't create temporary file. Permission Denied
I tried changing the value of TEMP and TMP user variables in 'Environment variables'. That solved the problem for me but it doesn't allow 'Windows Word' to create temporary files.

*** internal error: unable to open jobserver semaphore '3,4': (Error 2: The system cannot find the file specified. ). Stop

I am trying to compile an existing qt application's code using mingw compiler.
During compilation I am getting an error "*** internal error: unable to open jobserver semaphore '3,4': (Error 2: The system cannot find the file specified. ). Stop".
My current project is a makefile based project. Here I have one make file (parent.mk) that compiles all primary modules and then
parent.mk
compilation steps
.
.
.
make $QT_CODE_DIR
Here in this QT code directory I have another makefile (child.mk) which has following content:
child.mk
cd "qtcode_compilation_out_dir"
qmake.exe "product.pro" -r -spec win32-g++
CONFIG+=release
mingw32-make -w
If I try to run the make command manually for QT code then it works fine.
#Alexander: Thanks for the suggestion.
Please suggest if anyone has any idea about it.
Thanks.
Finally, I found out the exact reason of the problem and solution as well.
Reason for failure:
The compilation command that I am using is "make" which is been aliased to "make -j2"and along with "mingw32-make -w" it was producing the error because mingw32-make is an obsolete make command and it doesn't support multi threaded compilation.
Solution:
I just replaced the mingw32-make with make.

jenkins while creating folder access denied using base clear case

I am trying to build make file using xshell plugin in jenkins.
Manually, I am able to build, but when I trigger from jenkins I get bellow error please suggest why access is denied:
element * CHECKEDOUT
element * /main/LATEST
[workspace] $ cmd.exe /C '""V:\dpush_view\CCAD_REPO\CC Training\my\one.bat" && exit %%ERRORLEVEL%%"'
D:\Program Files\Jenkins\jobs\nmake\workspace>v:
V:\>cd "dpush_view\CCAD_REPO\CC Training\my"
V:\dpush_view\CCAD_REPO\CC Training\my>nmake vivek1.mk
Microsoft (R) Program Maintenance Utility Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
mkdir "V:\dpush_view\CCAD_REPO\CC Training\ball\sree"
Access is denied.
NMAKE : fatal error U1077: 'mkdir' : return code '0x1'
Stop.
V:\dpush_view\CCAD_REPO\CC Training\my>pause
Press any key to continue . . .
Build step 'Invoke XShell command' marked build as failure
Finished: FAILURE
You need to make sure of the account used by Jenkins to use that ClearCase view.
If Jenkins runs with the system account, chances are that CLEARCASE_PRIMARY_GROUP isn't properly set, and it wouldn't have the right to fully access CCAD_REPO vobs elements.
So make sure it is running with your account (which, when used manually, can successfully build in that view).
The other aspect is in the rights associated with the parent folder where you try to create ball\sree:
Make sure (by doing a cleartool descr -l "V:\dpush_view\CCAD_REPO\CC Training##") that the folder is "executable" (755).
If not, a simple:
cleartool protect -chmod 755 "V:\dpush_view\CCAD_REPO\CC Training##"
If "V:\dpush_view\CCAD_REPO\CC Training\ball##" already exists (and Jenkins is trying to create sre within ball folder, repeat the checks (cleartool describe and, if need be, cleartool protect -chmod)
Note in both instances the presence of '##': it is to reference the element folder 'CC Training' (instead of the version).
start the Jenkins service as respective users
by using services.msc in run command