Jump to content

Build project in ChibiStudio problem


electrotehnik

Recommended Posts

Hi

I try to build the project, but there is an error:


22:25:27 **** Build of configuration Default for project HY-miniSTM32V_Chibios_uGFX ****
make -j2 all
0 [main] sh 8212 sync_with_child: child 6808(0x168) died before initialization with status code 0xC0000142
28 [main] sh 8212 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
Compiler Options
arm-none-eabi-gcc -c -mcpu=cortex-m3 -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -ffunction-sections -fdata-sections -fno-common -Wall -Wextra -Wstrict-prototypes -Wa,-alms=build/lst/ -DCORTEX_USE_FPU=FALSE -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -MD -MP -MF .dep/build.d -I. -I../../chibios/os/ports/common/ARMCMx/CMSIS/include -I../../chibios/os/ports/common/ARMCMx -I../../chibios/os/ports/GCC/ARMCMx -I../../chibios/os/ports/GCC/ARMCMx/STM32F1xx -I../../chibios/os/kernel/include -I../../chibios/os/hal/include -I../../chibios/os/hal/platforms/STM32F1xx -I../../chibios/os/hal/platforms/STM32 -I../../chibios/os/hal/platforms/STM32/GPIOv1 -I../../chibios/os/hal/platforms/STM32/I2Cv1 -I../../chibios/os/hal/platforms/STM32/RTCv1 -I../../chibios/os/hal/platforms/STM32/SPIv1 -I../../chibios/os/hal/platforms/STM32/TIMv1 -I../../chibios/os/hal/platforms/STM32/USARTv1 -I../../chibios/os/hal/platforms/STM32/USBv1 -I../../chibios/ext/ugfx/boards/base/MiniSTM32-LCD/chibios_board -I../../chibios/os/various -I../../chibios/ext/ugfx/boards/base/MiniSTM32-LCD -I../../chibios/ext/ugfx/drivers/gdisp/SSD1289 -I../../chibios/ext/ugfx -I../../chibios/ext/ugfx/src/gdisp/mcufont main.c -o main.o

mkdir -p build/obj
mkdir -p build/lst
Compiling crt0.c
Compiling vectors.c
../../chibios/os/ports/GCC/ARMCMx/STM32F1xx/vectors.c:324:1: fatal error: opening dependency file .dep/vectors.o.d: No such file or directory
compilation terminated.
../../chibios/os/ports/GCC/ARMCMx/crt0.c:359:1: fatal error: opening dependency file .dep/crt0.o.d: No such file or directory
compilation terminated.
make: *** [build/obj/vectors.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [build/obj/crt0.o] Error 1

22:25:32 Build Finished (took 5s.263ms)

I think a bug in the makefile. but where? Please, help

ChibiStudio.rar

Link to comment
Share on other sites

Hi,

Can you please specify which version of ChibiOS/RT you are using?

I don't think that this is an uGFX related problem. I just compiled a project with ChibiOS/RT 2.6.6 and an STM32F103 as well. It worked without any problems.

Please make sure that you always use the ChibiOS/RT provided Makefile and just modify it as described in the wiki as they change sometimes.

~ Tectu

Link to comment
Share on other sites

These lines:

      0 [main] sh 8212 sync_with_child: child 6808(0x168) died before initialization with status code 0xC0000142
28 [main] sh 8212 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable

suggest to me some sort of installation/setup error with ChibiStudio, or possibly a problem with the PC itself. Never seen that type of error myself, but have had problems sometimes when Windows decides to 'lock' a directory so that make can't access or delete it.

Link to comment
Share on other sites

These are problems I have experienced.

This is a problem when compiling in Win32 using the cygwin make program. If you are using UNIX you can ignore the discussion below and your problem must lie elsewhere.

Cygwin make gets confused with DOS style paths and drive letters and it seems to affect it worst when including dependencies.

Firstly update your cygwin installation to the latest version. I expect that will get rid of the "sync_with_child" issues but not the dependency issue.

If you update to our latest master in the git repository and use one of our example makefiles (eg. boards/base/Win32/example/makefile) we have put special code in to handle these cygwin nasties. If you are cross compiling for another platform (eg ARM) just use another example makefile in the board area as your base makefile. All our example makefiles now contain the fixes that allow them to compile properly on Win32.

The makefiles provided as part of the ChibiOS project do not have those fixes and often have issues when compiling on Win32.

Whilst the GNU make is very powerful (which is why we use it) it has a number of very bad limitations (on all platforms - Windows and Unix). The cygwin version has even more limitations. We have put a number of fixes into our makefiles to overcome many of these limitations. The current rules when using our makefiles are:

  • With our makefiles you can handle absolute paths (eg c:\mydir) or relative pathnames (eg ..\mydir) using dos or unix directory separaters (eg "\" or "/").
  • You CANNOT currently use drive relative pathnames (eg e:mydir).
  • I think we can handle directories that have spaces in them provided that the makefiles do not reference any part of the directory that contains the space eg. If the project directory is "c:\my dir with spaces\project1" you can use paths such as "../otherdir" in the makefile but not anything that contains a space. (I have not fully tested this). It is generally better to not use directories with spaces in them at all with GNU make.
  • Filenames cannot contain spaces at all.

On our Wiki we have a very nice article on getting your first compile to work on Win32. Follow those instructions first and see how you go.

Link to comment
Share on other sites

As he uses ChibiStudio, he's quite certainly using Windowsindeed. However, I think that ChibiStudio comes with its own tool. There should not be a make related issue unless he installed a custom toolchain.

@electrotehnik: Can you please try to compile an unmodified ChibiOS/RT demo project? (like the /demos/ARMCM3-STM32F103)

~ Tectu

Link to comment
Share on other sites

It does. I think its from here: https://launchpad.net/gcc-arm-embedded

That is "just" the compiler (and linker) and so on. Make is not part of that package.

Certainly my experience of using ChibiStudio is that it 'just works' - just need to modify the path to ChibiOS in the make file if you copy a demo project into the workspace.

I agree - I've had the very same experience.

Let's see if he can successfully build the unmodified ChibiOS/RT demo first.

~ Tectu

Link to comment
Share on other sites

This is definitely the cygwin make issue. The chibios chibistudio uses the cygwin make to execute it's makefiles and so is subject to these problems. It is exactly this scenario where I came across this problem -chibios being my primary platform at the time.

Because it is environment based I got no answers from the chibios forums etc. I eventually found the problem. I switched to using the mingw make which has less problems than the cygwin make.

When I was doing the make system rebuild for ugfx I added the fixes into our scripts for these problems. As chibios has never acknowledged the problem it continues to be a problem with the chibios make scripts on the Win32 platform - but only in certain circumstances eg using absolute paths containing a drive letter. It is the colon in the path that causes cygwin make to die when handling dependancy file inclusion.

Link to comment
Share on other sites

ChibiStudio actually ships with gnu mingw-32 make.

There's a batch file start.bat that also ships with ChibiStudio which should be used to start eclipse:

@echo off
set PATH=C:\ChibiStudio\tools\gnutools\bin;%PATH%
set PATH=C:\ChibiStudio\tools\openocd\bin;%PATH%
set PATH=C:\ChibiStudio\tools\GNU Tools ARM Embedded\4.7 2014q2\arm-none-eabi\bin;%PATH%
set PATH=C:\ChibiStudio\tools\GNU Tools ARM Embedded\4.7 2014q2\bin;%PATH%
cd eclipse
start eclipse.exe

mingw-32 make is in the C:\ChibiStudio\tools\gnutools\bin directory.

Possibly starting eclipse directly, rather than using the batch file?

Link to comment
Share on other sites

By the way - proof that it is using the cygwin tools comes from looking at the fork problem line. Notice that sh comes from /usr/bin/sh. This path shows that it is cygwin based as the mingw version would show a Dos style path.

The fork problem is likely caused by having mismatching versions of the cygwin.dll file. Perhaps there is an instalation of cygwin on your system where the version conflicts with the version included with chibistudio. This is why I suggested to upgrade your cygwin instalation on your machine. If that doesn't fix it go looking for errant cygwin dll's on your path.

Link to comment
Share on other sites

A simple test to verify the problem...

Manually delete the .dep directory. The first make after that will succeed (subject to any other compile problems). Try compiling again and it will fail. It is the format of the paths in the dependancy files that is killing the compile.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...