When using GCC 4.4.2 in windows 7 i get heap errors (solved)

May 11, 2008
21,787
1,310
126
Hello everybody,

I use a GCC toolchain set to program my arm chips.
Since i went over to windows 7, i could not get GCC to run anymore.

I get messages that make does not has permission or that my editor does not have permissions to execute programs.

I also get error messages that the files cannot be found.
My Editor invokes the programs but fails to do so.

I modified the path variable but to no prevail.
I disabled AUC to see if that is the crux.
That did help. :thumbsup:

But now i get these errors when i want to clean my project :

arm-elf-gcc (GCC) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



AllocationBase 0x0, BaseAddress 0x71590000, RegionSize 0x3B0000, State 0x10000
E: \ARM\W-ARM\utils\bin\rm.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0
make: [deletefiles] Error 1 (ignored)



Does anybody know why and how to solve this ?
 
Last edited:
May 11, 2008
21,787
1,310
126
After doing some research, i found the program sh.exe in the utils/bin folder to be the problem.
If i start this program from the commandline tool , i get the same error message :

AllocationBase 0x0, BaseAddress 0x71590000, RegionSize 0x3B0000, State 0x10000
E: \ARM\W-ARM\utils\bin\sh.exe: *** Couldn't reserve space for cygwin's heap, Win
32 error 0
 
May 11, 2008
21,787
1,310
126
GCC bin seems to work.

It seems to be sh.exe only.
Is there a sh.exe bourneshell utility that works under windows 7 ?
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,582
4,493
75
Couldn't reserve space for cygwin's heap, Win
Aha! This tells me you need files from Cygwin >= V1.7.

I'd suggest you go here, install the a basic Cygwin setup, and then copy over the latest versions of all the exes and dlls that match what you have in your current setup. Probably exclude all the compiler binaries, (gcc, ld, possibly others) as they appear to be ARM-specific.
 
May 11, 2008
21,787
1,310
126
After disabling UAC and a restart, i get the gcc tool set to run from the makefile again.

I run form a makefile using make.
Make invokes sh and sh invokes cp.exe and rm.exe if i am correct.


I traced the error back to cp.exe en rm.exe
ush invoking cp.exe en ush invoking rm.exe

This section no longer works :

Code:
#copy files to new destination.
move_files:
	@cp ./src/*.lst ./list/
	@cp ./src/*.o  ./object/
	@-rm -f ./src/*.lst
	@-rm -f ./src/*.o

And this also no longer works and produces the heap error :

Code:
deletefiles:
	@-rm -f $(OBJS)
	@-rm -f $(SRC:.c=.c.bak)
	@-rm -f $(SRC:.c=.lst)
	@-rm -f $(ASRC:.s=.s.bak)
	@-rm -f $(ASRC:.s=.lst)
	@-rm -fR .dep
	@-rm -f ./output/Usb_cdc_1.elf 
	@-rm -f ./output/Usb_cdc_1.map 
	@-rm -f ./output/Usb_cdc_1.bin 
	@-rm -f ./list/*.lst
	@-rm -f ./object/*.o
 
May 11, 2008
21,787
1,310
126
This is my entire make file.
I sort of reversed engineered it 2 years ago when i made a program that generates the makefile with proper settings .
Now it seems magic to me again.
Is there an error in it ?
Why does it function under windows xp and not under windows 7 ?

Code:
# Automatically generated by W-ARM !
# Do not edit this file with an editor that replaces tabs with spaces !
################################################################################

CC = arm-elf-gcc
AS = arm-elf-gcc -x assembler-with-cpp
CREATE_OUTPUT_FILE = arm-elf-objcopy -O binary

SRC = ./src/commandcontrol.c ./src/fastexec.c ./src/inithardware.c ./src/isr.c ./src/isr_ctrl.c ./src/low_level_init.c ./src/main.c ./src/os_functions.c ./src/sam7s_hardware.c ./src/semi_stdio.c ./src/usb_cdc_requests.c ./src/usb_descriptors.c ./src/usb_functions.c ./src/usb_std_requests.c
ASRC = ./src/isr_asm.s ./src/startup.s

USR_INC_DIR = ./inc
USR_LIB_DIR = 
################################################################################

INC_DIR  = $(patsubst %,-I%, $(USR_INC_DIR))
LIB_DIR  = $(patsubst %,-L%, $(USR_LIB_DIR))

OBJS = $(ASRC:.s=.o) $(SRC:.c=.o)

MCU_FLAGS = -mcpu=arm7tdmi

# optimisation level
OPT = -O2 

#Assemble assembly source files to object code   *.s to *.o  .
AS_FLAGS = $(MCU_FLAGS) -g -gdwarf-2 -Wa,-amhls=$(<:.s=.lst)

#compile and assemble C source files to object code   *.c to *.o  .
CP_FLAGS = $(MCU_FLAGS) $(OPT) -gdwarf-2 -Wextra -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=$(<:.c=.lst)

# link all objects to elf file   *.o to *.elf .
LD_FLAGS = $(MCU_FLAGS) -nostartfiles -T./prj/warm_ld.ld -Wl,-Map=./output/Usb_cdc_1.map,--cref,--no-warn-mismatch $(LIB_DIR)

# Generate dependency information
CPFLAGS += -MD -MP -MF .dep/$(@F).d

# Eye candy.
begin:
	@echo
	@echo ---------------- begin ----------------
	@echo

finished:
	@echo
	@echo Errors none. 
	@echo
	@echo Output format = binary
	@echo
	@echo Project name = Usb_cdc_1
	@echo

end:
	@echo
	@echo ---------------- end ----------------
	@echo

clean_message:
	@echo
	@echo Cleaning directories of current project : Usb_cdc_1
	@echo

# Display compiler version information.
gccversion:
	@$(CC) --version

#Excute from here.
all: begin gccversion ROM finished move_files end

#copy files to new destination.
move_files:
	@cp ./src/*.lst ./list/
	@cp ./src/*.o  ./object/
	@-rm -f ./src/*.lst
	@-rm -f ./src/*.o

# create output files.
ROM: $(OBJS) ./output/Usb_cdc_1.elf ./output/Usb_cdc_1.bin

%o : %c
	$(CC) -c $(CP_FLAGS) -I . $(INC_DIR) $< -o $@
	
%o : %s
	$(AS) -c $(AS_FLAGS) $< -o $@

%elf: $(OBJS)
	$(CC) $(OBJS) $(LD_FLAGS) $(LIBS) -o $@

%bin: %elf
	$(CREATE_OUTPUT_FILE) $< $@



clean: begin gccversion deletefiles clean_message end

deletefiles:
	@-rm -f $(OBJS)
	@-rm -f $(SRC:.c=.c.bak)
	@-rm -f $(SRC:.c=.lst)
	@-rm -f $(ASRC:.s=.s.bak)
	@-rm -f $(ASRC:.s=.lst)
	@-rm -fR .dep
	@-rm -f ./output/Usb_cdc_1.elf 
	@-rm -f ./output/Usb_cdc_1.map 
	@-rm -f ./output/Usb_cdc_1.bin 
	@-rm -f ./list/*.lst
	@-rm -f ./object/*.o

#
# Include the dependency files, should be the last of the makefile
#
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)

# Listing of phony targets.
.PHONY : all begin finish end sizebefore sizeafter gccversion build elf hex lss sym clean clean_list program

# *** EOF ***
 
May 11, 2008
21,787
1,310
126
This is the output error :

Code:
ush: cp file1 file2
make: *** [move_files] Error -1
make: Leaving directory `e:/arm/projecten/usb_cdc_1'
 
May 11, 2008
21,787
1,310
126
I copied the latest files and dll's from cygwin after installing it.

Good news is :
I no longer get the error.

Bad news is :
There is no file copying and file removing any more.

That is very bad news because now my source directory is filled with list files and object files that should have been moved to a separate list directory and a separate object directory.

I think i have to make my own utility that can be invoked from within my PN2 editor or just a bat file for that.

Or i jump ship and had for the emIDE from the yagharto tool chain.

I have to decide.

Anyway, thank you for the help.
 
May 11, 2008
21,787
1,310
126
Yahoooo. I was forgotten one thin'.

When i restarted PN2, it works again.

Thank you very much for the help.
 
Last edited: